Skip to content

Commit

Permalink
Merge branch 'release/5.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-kropilnicki committed Dec 7, 2018
2 parents b9dbc25 + e8a5567 commit c34789f
Show file tree
Hide file tree
Showing 90 changed files with 1,829 additions and 266 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,6 @@ cs_commons-dev/
## Plugin-specific files:
*.dir
# IntelliJ
/out/
/out/

/current/prepareRelease.sh
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Coresecure, Inc.
Copyright (c) 2018 Coresecure, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion License.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Adobe CQ5 Brightcove Connector

Copyright (C) 2011 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.

Authors: Alessandro Bonfatti
Yan Kisen
Pablo Kropilnicki

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
3 changes: 0 additions & 3 deletions README

This file was deleted.

5 changes: 2 additions & 3 deletions current/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ The project comes with the auto-public repository configured. To setup the repos

##License

Copyright (C) 2017 **[Coresecure Inc.](https://www.coresecure.com)**

Copyright (C) 2018 **[Coresecure Inc.](https://www.coresecure.com)**
#####Authors:
- Alessandro Bonfatti
- Yan Kisen
Expand All @@ -72,4 +72,3 @@ squeakysand-commons and squeakysand-osgi (or a modified version of those
libraries), containing parts covered by the terms of APACHE LICENSE 2.0
or MIT License, the licensors of this Program grant you additional
permission to convey the resulting work.

6 changes: 3 additions & 3 deletions current/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors:
Alessandro Bonfatti
Expand Down Expand Up @@ -51,7 +51,7 @@
<parent>
<groupId>com.coresecure.brightcove.cq5</groupId>
<artifactId>brightcove_connector</artifactId>
<version>5.5.0</version>
<version>5.5.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>brightcove-services</artifactId>
Expand Down Expand Up @@ -383,4 +383,4 @@
<scope>test</scope>
</dependency>
</dependencies>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down Expand Up @@ -47,9 +47,10 @@ public class BrightcoveAPI {
public final CmsAPI cms;
private static final Logger LOGGER = LoggerFactory.getLogger(BrightcoveAPI.class);

public BrightcoveAPI(String aClientId, String aClientSecret, String aAccountId) {
public BrightcoveAPI(String aClientId, String aClientSecret, String aAccountId, String proxy) {
LOGGER.debug("BrightcoveAPI Init aAccount_id {}", aAccountId);
platform = new Platform();
platform.setProxy(proxy);
account = new Account(platform, aClientId, aClientSecret, aAccountId);
cms = new CmsAPI(account);
}
Expand All @@ -60,14 +61,10 @@ public BrightcoveAPI(String key) {
ConfigurationGrabber cg = ServiceUtil.getConfigurationGrabber();
ConfigurationService brcService = cg.getConfigurationService(key);

if (brcService.getProxy()!=null && brcService.getProxy().length()>0) {
setProxy(brcService.getProxy());
}
platform.setProxy(brcService.getProxy());

account = new Account(platform, brcService.getClientID(), brcService.getClientSecret(), brcService.getAccountID());
cms = new CmsAPI(account);
}

public void setProxy(String proxy) {
platform.setProxy(proxy);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public JSONArray getVideos(String q, int limit, int offset, String sort, boolean
if (!response.isEmpty()) {
json = JsonReader.readJsonArrayFromString(response);
LOGGER.debug(Constants.RESPONSE, response);
LOGGER.debug("json {}", json);
// LOGGER.trace("json {}", json);
} else if (!q.isEmpty() && NumberUtils.isNumber(q)) {
json.put(getVideo(q));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down Expand Up @@ -54,6 +54,7 @@ public class Account {
public final Platform platform;
private static final Logger LOGGER = LoggerFactory.getLogger(Account.class);


public Account(Platform aPlatform, String aClient_id, String aClient_secret, String aAccount_id) {
client_id = aClient_id;
client_secret = aClient_secret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down Expand Up @@ -50,12 +50,10 @@ public class Platform {
private final String PLAYERS_API_Url;
private final String API_Url;
private final String DI_API_Url;
private Proxy PROXY = Proxy.NO_PROXY;
private static final Logger LOGGER = LoggerFactory.getLogger(Platform.class);

public Platform()
{
this(null,null,null,null);
public Platform() {
this(null, null, null, null);
}

public Platform(String aOAUTH_Url, String aAPI_Url, String aDI_API_Url, String aPLAYERS_API_Url) {
Expand Down Expand Up @@ -83,6 +81,7 @@ public String getDI_API_Url() {

public String getAPI(String targetURL, String urlParameters, Map<String, String> headers) {
String URL = getAPI_Url() + targetURL;
LOGGER.info("getAPI: " + URL);
String response = HttpServices.executeGet(URL, urlParameters, headers);
return response;
}
Expand All @@ -95,7 +94,7 @@ public String getPLAYERS_API(String targetURL, String urlParameters, Map<String,

public String postAPI(String targetURL, String payload, Map<String, String> headers) {
String URL = getAPI_Url() + targetURL;
LOGGER.trace("POST URL: "+URL);
LOGGER.trace("POST URL: " + URL);

String response = HttpServices.executePost(URL, payload, headers);
LOGGER.trace(response);
Expand All @@ -112,47 +111,48 @@ public String patchAPI(String targetURL, String payload, Map<String, String> hea

public String postDI_API(String targetURL, String payload, Map<String, String> headers) {
String URL = getDI_API_Url() + targetURL;
LOGGER.trace("postDI_API: "+URL);
LOGGER.trace("postDI_API: " + URL);
String response = HttpServices.executePost(URL, payload, headers);
LOGGER.trace(response);
return response;
}

public String getDI_API(String targetURL, String payload, Map<String, String> headers) {
String URL = getDI_API_Url() + targetURL;
LOGGER.trace("getDI_API: "+URL);
LOGGER.trace("getDI_API: " + URL);
String response = HttpServices.executeGet(URL, payload, headers);
LOGGER.trace(response);
return response;
}

public String postDIRequest_API(String targetURL, String payload, Map<String, String> headers) {
String URL = getDI_API_Url() + targetURL;
LOGGER.trace("postDI_API: "+URL);
LOGGER.trace("postDI_API: " + URL);
String response = HttpServices.executePost(URL, payload, headers, JSONResponse.RESPONSE_CONTENT_TYPE);
LOGGER.trace(response);
return response;
}

public String deleteAPI(String targetURL, String videoID, Map<String, String> headers) {
String URL = getAPI_Url() + targetURL;
LOGGER.trace("deleteAPI: "+URL);
LOGGER.trace("deleteAPI: " + URL);
String response = HttpServices.executeDelete(URL, headers);
LOGGER.trace(response);
return response;
}


public void setProxy(String proxy) {
Proxy newProxy = Proxy.NO_PROXY;

if(proxy!=null) {
String[] parts = proxy.split(":");
if (parts.length==2) {
PROXY = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(parts[0], Integer.parseInt(parts[1])));
LOGGER.info("setProxy: " + proxy);
Proxy newProxy = Proxy.NO_PROXY;

if (proxy != null) {
String[] parts = proxy.split(":");
if (parts.length == 2) {
newProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(parts[0], Integer.parseInt(parts[1])));
}
}
}

HttpServices.setProxy(PROXY);
HttpServices.setProxy(newProxy);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Adobe AEM Brightcove Connector
Copyright (C) 2017 Coresecure Inc.
Copyright (C) 2018 Coresecure Inc.
Authors: Alessandro Bonfatti
Yan Kisen
Expand Down
Loading

0 comments on commit c34789f

Please sign in to comment.