diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/event.put.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/event.put.json.ftl index 93319da033..ab90defd06 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/event.put.json.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/calendar/event.put.json.ftl @@ -24,7 +24,7 @@ }, "uri" : "${result.uri}", "allday" : "${result.allday?string}", - "tags" : "${result.tags}", + "tags" : [<#list result.tags as tag>"${tag}"<#if tag_has_next>,, "docfolder": "${result.docfolder}" } diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js index a9774fcd5c..54e672a9f0 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/doclist.lib.js @@ -266,26 +266,15 @@ function doclist_main() // Resolved location item.location = location; - // Check: thumbnail type is registered && node is a cm:content subtype && valid inputStream for content property - var is = item.node.properties.content.inputStream; - try + // Check: thumbnail type is registered && node is a cm:content subtype + if (isThumbnailNameRegistered && item.node.isSubType("cm:content")) { - if (isThumbnailNameRegistered && item.node.isSubType("cm:content") && (null != is)) + // Make sure we have a thumbnail. + thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); + if (thumbnail === null) { - // Make sure we have a thumbnail. - thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); - if (thumbnail === null) - { - // No thumbnail, so queue creation - item.node.createThumbnail(THUMBNAIL_NAME, true); - } - } - } - finally - { - if (null != is) - { - is.close(); + // No thumbnail, so queue creation + item.node.createThumbnail(THUMBNAIL_NAME, true); } } diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/node.get.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/node.get.js index 8205143da7..eb79d4c72e 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/node.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2/node.get.js @@ -50,26 +50,15 @@ function getDoclist() item.location.file = ""; } - // Check: thumbnail type is registered && node is a cm:content subtype && valid inputStream for content property - var is = item.node.properties.content.inputStream; - try + // Check: thumbnail type is registered && node is a cm:content subtype + if (isThumbnailNameRegistered && item.node.isSubType("cm:content")) { - if (isThumbnailNameRegistered && item.node.isSubType("cm:content") && (null != is)) + // Make sure we have a thumbnail. + thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); + if (thumbnail === null) { - // Make sure we have a thumbnail. - thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); - if (thumbnail === null) - { - // No thumbnail, so queue creation - item.node.createThumbnail(THUMBNAIL_NAME, true); - } - } - } - finally - { - if (null != is) - { - is.close(); + // No thumbnail, so queue creation + item.node.createThumbnail(THUMBNAIL_NAME, true); } } diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js index 419bca14da..a317c0fc60 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js @@ -225,26 +225,15 @@ function getDoclist() // Resolved location item.location = location; - // Is our thumbnail type registered? - var is = item.node.properties.content.inputStream; - try + // Check: thumbnail type is registered && node is a cm:content subtype + if (isThumbnailNameRegistered && item.node.isSubType("cm:content")) { - if (isThumbnailNameRegistered && item.node.isSubType("cm:content") && (null != is)) + // Make sure we have a thumbnail. + thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); + if (thumbnail === null) { - // Make sure we have a thumbnail. - thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); - if (thumbnail === null) - { - // No thumbnail, so queue creation - item.node.createThumbnail(THUMBNAIL_NAME, true); - } - } - } - finally - { - if (null != is) - { - is.close(); + // No thumbnail, so queue creation + item.node.createThumbnail(THUMBNAIL_NAME, true); } } diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/node.get.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/node.get.js index 12415de19c..3e46d70ed7 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/node.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/node.get.js @@ -60,29 +60,18 @@ function getDoclist() item.location.file = ""; } - // Is our thumbnail type registered? - var is = item.node.properties.content.inputStream; - try + // Check: thumbnail type is registered && node is a cm:content subtype + if (isThumbnailNameRegistered && item.node.isSubType("cm:content")) { - if (isThumbnailNameRegistered && item.node.isSubType("cm:content") && (null != is)) + // Make sure we have a thumbnail. + thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); + if (thumbnail === null) { - // Make sure we have a thumbnail. - thumbnail = item.node.getThumbnail(THUMBNAIL_NAME); - if (thumbnail === null) - { - // No thumbnail, so queue creation - item.node.createThumbnail(THUMBNAIL_NAME, true); - } + // No thumbnail, so queue creation + item.node.createThumbnail(THUMBNAIL_NAME, true); } } - finally - { - if (null != is) - { - is.close(); - } - } - + return ( { parent: parent, diff --git a/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPost.java b/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPost.java index bc5bea34fa..2712d6e828 100644 --- a/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPost.java +++ b/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPost.java @@ -65,7 +65,7 @@ public class CalendarEntryPost extends AbstractCalendarWebScript // Handle tags if (json.containsKey("tags")) { - StringTokenizer st = new StringTokenizer((String)json.get("tags"), " "); + StringTokenizer st = new StringTokenizer((String)json.get("tags"), ","); while (st.hasMoreTokens()) { entry.getTags().add(st.nextToken()); diff --git a/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPut.java b/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPut.java index eb99d7004b..3752c40542 100644 --- a/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPut.java +++ b/source/java/org/alfresco/repo/web/scripts/calendar/CalendarEntryPut.java @@ -133,7 +133,7 @@ public class CalendarEntryPut extends AbstractCalendarWebScript { entry.getTags().clear(); - StringTokenizer st = new StringTokenizer((String)json.get("tags"), " "); + StringTokenizer st = new StringTokenizer((String)json.get("tags"), ","); while (st.hasMoreTokens()) { entry.getTags().add(st.nextToken()); @@ -173,7 +173,7 @@ public class CalendarEntryPut extends AbstractCalendarWebScript result.put("uri", "calendar/event/" + site.getShortName() + "/" + entry.getSystemName() + dateOpt); - result.put("tags", generateTagString(entry)); + result.put("tags", entry.getTags()); result.put("allday", isAllDay); result.put("docfolder", entry.getSharePointDocFolder()); @@ -191,23 +191,4 @@ public class CalendarEntryPut extends AbstractCalendarWebScript model.put("result", result); return model; } - - /** - * We use lists for tags internally, and the other webscripts - * return arrays too. This one is different, and it needs to - * a single space separated string. This does the conversion - */ - protected String generateTagString(CalendarEntry entry) - { - StringBuffer sb = new StringBuffer(); - if (entry.getTags() != null) - { - for (String tag : entry.getTags()) - { - if (sb.length() > 0) sb.append(' '); - sb.append(tag); - } - } - return sb.toString(); - } }