From a3010dc7cc78371a94b2161b2888d2c0c9d5f5b4 Mon Sep 17 00:00:00 2001 From: Paul Legan Date: Thu, 11 Aug 2022 13:24:54 -0400 Subject: [PATCH 01/13] initial UI for labels --- .../brightcove/wrapper/objects/Video.java | 2 +- .../brightcove/wrapper/sling/ServiceUtil.java | 7 ++++ .../shared/autoDialog/autoDialog.jsp | 21 ++++++---- .../brightcoveadmin/brightcoveadmin.html | 6 ++- .../brightcoveadmin/clientlibs/css/style.css | 7 +++- .../brightcoveadmin/clientlibs/js/brcUI.js | 38 ++++++++++++++++++- 6 files changed, 69 insertions(+), 12 deletions(-) diff --git a/current/core/src/main/java/com/coresecure/brightcove/wrapper/objects/Video.java b/current/core/src/main/java/com/coresecure/brightcove/wrapper/objects/Video.java index 353b998..5c2e2e3 100644 --- a/current/core/src/main/java/com/coresecure/brightcove/wrapper/objects/Video.java +++ b/current/core/src/main/java/com/coresecure/brightcove/wrapper/objects/Video.java @@ -106,7 +106,6 @@ private Video(String aId, String aName, String aReference_id, String aDescriptio long_description = aLong_description; state = aState; tags = aTags; - labels = aLabels; geo = aGeo; schedule = aSchedule; link = aLink; @@ -116,6 +115,7 @@ private Video(String aId, String aName, String aReference_id, String aDescriptio projection = new Projection(aProjection); text_tracks = aText_tracks; images = aImages; + labels = aLabels; } private Object getNotNull(JSONObject video, String key) throws JSONException{ diff --git a/current/core/src/main/java/com/coresecure/brightcove/wrapper/sling/ServiceUtil.java b/current/core/src/main/java/com/coresecure/brightcove/wrapper/sling/ServiceUtil.java index af90480..325939f 100644 --- a/current/core/src/main/java/com/coresecure/brightcove/wrapper/sling/ServiceUtil.java +++ b/current/core/src/main/java/com/coresecure/brightcove/wrapper/sling/ServiceUtil.java @@ -1256,6 +1256,13 @@ public Video createVideo(String request, Asset asset, String aState) Collection tags = JcrUtil.tagsToCollection(tagsList); list = null; + String[] rawList = metadataRes.getValueMap().get(getKey(Constants.LABELS),new String[]{}); + List labelList = new ArrayList(Arrays.asList(rawList)); + rawList = labelList.toArray(new String[0]); + //REMOVE BRIGHTCOVE TAG BEFORE PUSH + Collection labels = JcrUtil.tagsToCollection(rawList); + labelList = null; + //STO FROM LOCAL VIDEOS INITIALIZE THESE SO THAT YOU CAN SEND -- COULD COME FROM PROPERTIES VALUE MAP String name = map.get(DamConstants.DC_TITLE, asset.getName()); diff --git a/current/ui.apps/src/main/content/jcr_root/apps/brightcove/components/shared/autoDialog/autoDialog.jsp b/current/ui.apps/src/main/content/jcr_root/apps/brightcove/components/shared/autoDialog/autoDialog.jsp index 0905a44..fa91335 100644 --- a/current/ui.apps/src/main/content/jcr_root/apps/brightcove/components/shared/autoDialog/autoDialog.jsp +++ b/current/ui.apps/src/main/content/jcr_root/apps/brightcove/components/shared/autoDialog/autoDialog.jsp @@ -97,16 +97,20 @@ + <% + String[] labels = map.get("brc_labels", String[].class); + if (labels != null) { + for (int i = 0; i < labels.length; i++) { + if (labels[i].length() > 0) { + %> - <% - String[] labels = map.get("brc_labels", String[].class); - if (labels != null) { - for (int i = 0; i < labels.length; i++) { - %> - + + " data-foundation-validation="" data-validation="" is="coral-textfield" - class="coral3-Textfield" aria-invalid="false">