Skip to content

Commit

Permalink
Updating Brightcove Metadata and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dcolvin committed Nov 22, 2024
1 parent 48b94cc commit bb0462d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion current/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<parent>
<groupId>com.coresecure.brightcove.cq5</groupId>
<artifactId>brightcove_connector</artifactId>
<version>6.0.9</version>
<version>6.0.10</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>brightcove-services</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,18 +905,22 @@ private void setSchedule(JSONObject objObject, ModifiableValueMap assetmap){

private void setLink(JSONObject objObject, ModifiableValueMap map) {
try {
String link_url = objObject.getString(Constants.URL);
if (link_url != null && !link_url.toString().equals(Constants.NULLSTRING)) {
map.put(Constants.BRC_LINK_URL, link_url);
} else {
if (map.containsKey(Constants.BRC_LINK_URL)) map.remove(Constants.BRC_LINK_URL);
}
String link_text = objObject.getString(Constants.TEXT);
if (link_text != null && !link_text.toString().equals(Constants.NULLSTRING)) {
map.put(Constants.BRC_LINK_TEXT, link_text);
} else {
if (map.containsKey(Constants.BRC_LINK_TEXT)) map.remove(Constants.BRC_LINK_TEXT);
}
if (objObject.has(Constants.URL)) {
String link_url = objObject.getString(Constants.URL);
if (link_url != null && !link_url.toString().equals(Constants.NULLSTRING)) {
map.put(Constants.BRC_LINK_URL, link_url);
} else {
if (map.containsKey(Constants.BRC_LINK_URL)) map.remove(Constants.BRC_LINK_URL);
}
if (objObject.has(Constants.TEXT)) {
String link_text = objObject.getString(Constants.TEXT);
if (link_text != null && !link_text.toString().equals(Constants.NULLSTRING)) {
map.put(Constants.BRC_LINK_TEXT, link_text);
} else {
if (map.containsKey(Constants.BRC_LINK_TEXT)) map.remove(Constants.BRC_LINK_TEXT);
}
}
}
} catch (JSONException e) {
LOGGER.error(e.getClass().getName(), e);
}
Expand Down
2 changes: 1 addition & 1 deletion current/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Copyright (C) 2019 3|SHARE Inc.
<groupId>com.coresecure.brightcove.cq5</groupId>
<artifactId>brightcove_connector</artifactId>
<packaging>pom</packaging>
<version>6.0.9</version>
<version>6.0.10</version>
<description>
Parent Maven POM for the 'Adobe CQ5 Brightcove Connector API' project.
</description>
Expand Down
4 changes: 2 additions & 2 deletions current/ui.apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<parent>
<groupId>com.coresecure.brightcove.cq5</groupId>
<artifactId>brightcove_connector</artifactId>
<version>6.0.9</version>
<version>6.0.10</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -227,7 +227,7 @@
<dependency>
<groupId>com.coresecure.brightcove.cq5</groupId>
<artifactId>brightcove-services</artifactId>
<version>6.0.9</version>
<version>6.0.10</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@
<%@ page import="org.apache.sling.commons.json.JSONObject" %>
<%@ page import="com.coresecure.brightcove.wrapper.sling.ServiceUtil" %>
<%@ page import="org.apache.sling.commons.json.JSONArray" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%@include file="/libs/foundation/global.jsp" %>
<%
Resource asset_res = slingRequest.getParameter("item") != null ? resourceResolver.resolve(slingRequest.getParameter("item")) : resourceResolver.resolve(slingRequest.getRequestPathInfo().getSuffix());
ValueMap parentProps = asset_res.getParent().getValueMap();
Resource metadataRes = asset_res.getChild("jcr:content/metadata");
ValueMap map = metadataRes.adaptTo(ValueMap.class);
String brcid = map.get("brc_id","");
if ( parentProps != null && parentProps.get("jcr:createdBy").equals("brightcove_admin") ) {
if ( StringUtils.isNotBlank("brc_id")) {
String requestedAccount;
Node parentNode = asset_res.getParent().adaptTo(Node.class);
Expand All @@ -54,8 +57,7 @@
requestedAccount = parentNode.getName();
}
Resource metadataRes = asset_res.getChild("jcr:content/metadata");
ValueMap map = metadataRes.adaptTo(ValueMap.class);
ServiceUtil serviceUtil = new ServiceUtil(requestedAccount);
Expand Down

0 comments on commit bb0462d

Please sign in to comment.