mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged V3.2E to HEAD
17635: Complete fix for ETHREEOH-2879 - user with missing first/last name able to use Discussions, Blogs, Links etc. in Share. 17637: Fix regression from r17601: Favourite sites in header menu. 17638: Fix ETHREEOH-3610 - upgrade Enterprise 2.x -> 3.2 (personUsagePatch) 17641: ETHREEOH-3612 Security Issue : DeploymentTarget uses String to represent passwords 17642: Fix for ETHREEOH-3482 - Impossible to delete content from its details page. - regression due to the "AbortProcessingException" changes added a while back. 17660: Minor functional fixes for mobile app and cleanup 17663: Fixed ETHREEOH-3664 "'My Tasks' dashlet could not load task list if a user was invited to a private site" - When webscript accessed a private site undefined was returned so the title and description couldn't be displayed, now the values are store on the invite task instead. 17665: Fix up compile errors from r17663 - also clean up old code to coding standards in related invite classes. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18162 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -3,107 +3,105 @@
|
|||||||
<#-- Renders a person object. -->
|
<#-- Renders a person object. -->
|
||||||
<#macro renderPerson person fieldName>
|
<#macro renderPerson person fieldName>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
"${fieldName}":
|
"${fieldName}":
|
||||||
{
|
{
|
||||||
<#if person.assocs["cm:avatar"]??>
|
<#if person.assocs["cm:avatar"]??>
|
||||||
"avatarRef": "${person.assocs["cm:avatar"][0].nodeRef?string}",
|
"avatarRef": "${person.assocs["cm:avatar"][0].nodeRef?string}",
|
||||||
</#if>
|
</#if>
|
||||||
"username": "${person.properties["cm:userName"]}",
|
"username": "${person.properties["cm:userName"]}",
|
||||||
"firstName": "${person.properties["cm:firstName"]}",
|
"firstName": "${person.properties["cm:firstName"]!""}",
|
||||||
"lastName": "${person.properties["cm:lastName"]}"
|
"lastName": "${person.properties["cm:lastName"]!""}"
|
||||||
},
|
},
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
<#macro addContent item>
|
<#macro addContent item>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
<#if (contentLength?? && contentLength > -1 && (item.node.content?length > contentLength))>
|
<#if (contentLength?? && contentLength > -1 && (item.node.content?length > contentLength))>
|
||||||
"content": "${stringUtils.stripUnsafeHTML(item.node.content)?substring(0, contentLength)}",
|
"content": "${stringUtils.stripUnsafeHTML(item.node.content)?substring(0, contentLength)}",
|
||||||
<#else>
|
<#else>
|
||||||
"content": "${stringUtils.stripUnsafeHTML(item.node.content)}",
|
"content": "${stringUtils.stripUnsafeHTML(item.node.content)}",
|
||||||
</#if>
|
</#if>
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#--
|
<#--
|
||||||
|
This template renders a blog post.
|
||||||
This template renders a blog post.
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<#macro blogpostJSON item>
|
<#macro blogpostJSON item>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
{
|
{
|
||||||
"url": "blog/post/node/${item.node.nodeRef?replace('://','/')}",
|
"url": "blog/post/node/${item.node.nodeRef?replace('://','/')}",
|
||||||
"commentsUrl": "/node/${item.node.nodeRef?replace('://','/')}/comments",
|
"commentsUrl": "/node/${item.node.nodeRef?replace('://','/')}/comments",
|
||||||
"nodeRef": "${item.node.nodeRef}",
|
"nodeRef": "${item.node.nodeRef}",
|
||||||
"name": "${item.node.properties.name!''}",
|
"name": "${item.node.properties.name!''}",
|
||||||
"title": "${item.node.properties.title!''}",
|
"title": "${item.node.properties.title!''}",
|
||||||
<@addContent item=item />
|
<@addContent item=item />
|
||||||
<#if item.author??>
|
<#if item.author??>
|
||||||
<@renderPerson person=item.author fieldName="author" />
|
<@renderPerson person=item.author fieldName="author" />
|
||||||
<#else>
|
<#else>
|
||||||
"author":
|
"author":
|
||||||
{
|
{
|
||||||
"username": "${item.node.properties.creator}"
|
"username": "${item.node.properties.creator}"
|
||||||
},
|
},
|
||||||
</#if>
|
</#if>
|
||||||
"createdOn": "${item.createdDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"createdOn": "${item.createdDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
"modifiedOn": "${item.modifiedDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"modifiedOn": "${item.modifiedDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
"permissions":
|
"permissions":
|
||||||
{
|
{
|
||||||
"edit": ${item.node.hasPermission("Write")?string},
|
"edit": ${item.node.hasPermission("Write")?string},
|
||||||
"delete": ${item.node.hasPermission("Delete")?string}
|
"delete": ${item.node.hasPermission("Delete")?string}
|
||||||
},
|
},
|
||||||
"commentCount": ${item.commentCount?c},
|
"commentCount": ${item.commentCount?c},
|
||||||
"tags": [<#list item.tags as x>"${x}"<#if x_has_next>, </#if></#list>],
|
"tags": [<#list item.tags as x>"${x}"<#if x_has_next>, </#if></#list>],
|
||||||
<#-- draft vs internal published -->
|
<#-- draft vs internal published -->
|
||||||
"isDraft": ${item.isDraft?string},
|
"isDraft": ${item.isDraft?string},
|
||||||
<#if (! item.isDraft)>
|
<#if (! item.isDraft)>
|
||||||
"releasedOn": "${item.releasedDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"releasedOn": "${item.releasedDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
</#if>
|
</#if>
|
||||||
<#-- true if the post has been updated -->
|
<#-- true if the post has been updated -->
|
||||||
"isUpdated": ${item.isUpdated?string},
|
"isUpdated": ${item.isUpdated?string},
|
||||||
<#if (item.isUpdated)>
|
<#if (item.isUpdated)>
|
||||||
"updatedOn": "${item.updatedDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"updatedOn": "${item.updatedDate?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
</#if>
|
</#if>
|
||||||
<#if (item.node.properties["blg:published"]?? && item.node.properties["blg:published"] == true)>
|
<#if (item.node.properties["blg:published"]?? && item.node.properties["blg:published"] == true)>
|
||||||
"publishedOn": "${item.node.properties["blg:posted"]?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"publishedOn": "${item.node.properties["blg:posted"]?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
"updatedOn": "${item.node.properties["blg:lastUpdate"]?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"updatedOn": "${item.node.properties["blg:lastUpdate"]?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
"postId": "${item.node.properties["blg:postId"]!''}",
|
"postId": "${item.node.properties["blg:postId"]!''}",
|
||||||
"postLink": "${item.node.properties["blg:link"]!''}",
|
"postLink": "${item.node.properties["blg:link"]!''}",
|
||||||
"outOfDate": ${item.outOfDate?string},
|
"outOfDate": ${item.outOfDate?string},
|
||||||
</#if>
|
</#if>
|
||||||
<#-- external publishing - last to make sure that we correctly end the response without a comma -->
|
<#-- external publishing - last to make sure that we correctly end the response without a comma -->
|
||||||
"isPublished": ${(item.node.properties["blg:published"]!'false')?string}
|
"isPublished": ${(item.node.properties["blg:published"]!'false')?string}
|
||||||
}
|
}
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro renderPostList>
|
<#macro renderPostList>
|
||||||
{
|
{
|
||||||
"metadata":
|
"metadata":
|
||||||
{
|
{
|
||||||
"blogPermissions":
|
"blogPermissions":
|
||||||
{
|
{
|
||||||
"create": ${blog.hasPermission("CreateChildren")?string},
|
"create": ${blog.hasPermission("CreateChildren")?string},
|
||||||
"edit": ${blog.hasPermission("Write")?string},
|
"edit": ${blog.hasPermission("Write")?string},
|
||||||
"delete": ${blog.hasPermission("Delete")?string}
|
"delete": ${blog.hasPermission("Delete")?string}
|
||||||
},
|
},
|
||||||
"externalBlogConfig": ${externalBlogConfig?string}
|
"externalBlogConfig": ${externalBlogConfig?string}
|
||||||
},
|
},
|
||||||
<@gen.pagedResults data=data ; item>
|
<@gen.pagedResults data=data ; item>
|
||||||
<@blogpostJSON item=item />
|
<@blogpostJSON item=item />
|
||||||
</@gen.pagedResults>
|
</@gen.pagedResults>
|
||||||
}
|
}
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro renderPost>
|
<#macro renderPost>
|
||||||
{
|
{
|
||||||
"metadata":
|
"metadata":
|
||||||
{
|
{
|
||||||
"externalBlogConfig": ${externalBlogConfig?string}
|
"externalBlogConfig": ${externalBlogConfig?string}
|
||||||
},
|
},
|
||||||
"item": <@blogpostJSON item=item />
|
"item": <@blogpostJSON item=item />
|
||||||
}
|
}
|
||||||
</#macro>
|
</#macro>
|
@@ -1,111 +1,111 @@
|
|||||||
<#-- Renders a person object. -->
|
<#-- Renders a person object. -->
|
||||||
<#macro renderPerson person fieldName>
|
<#macro renderPerson person fieldName>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
"${fieldName}":
|
"${fieldName}":
|
||||||
{
|
{
|
||||||
<#if person.assocs["cm:avatar"]??>
|
<#if person.assocs["cm:avatar"]??>
|
||||||
"avatarRef": "${person.assocs["cm:avatar"][0].nodeRef?string}",
|
"avatarRef": "${person.assocs["cm:avatar"][0].nodeRef?string}",
|
||||||
</#if>
|
</#if>
|
||||||
"username": "${person.properties["cm:userName"]}",
|
"username": "${person.properties["cm:userName"]}",
|
||||||
"firstName": "${person.properties["cm:firstName"]}",
|
"firstName": "${person.properties["cm:firstName"]!""}",
|
||||||
"lastName": "${person.properties["cm:lastName"]}"
|
"lastName": "${person.properties["cm:lastName"]!""}"
|
||||||
},
|
},
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
<#macro addContent post>
|
<#macro addContent post>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
<#if (contentLength?? && contentLength > -1 && (post.content?length > contentLength))>
|
<#if (contentLength?? && contentLength > -1 && (post.content?length > contentLength))>
|
||||||
"content": "${stringUtils.stripUnsafeHTML(post.content)?substring(0, contentLength)}",
|
"content": "${stringUtils.stripUnsafeHTML(post.content)?substring(0, contentLength)}",
|
||||||
<#else>
|
<#else>
|
||||||
"content": "${stringUtils.stripUnsafeHTML(post.content)}",
|
"content": "${stringUtils.stripUnsafeHTML(post.content)}",
|
||||||
</#if>
|
</#if>
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
<#macro postJSON postData>
|
<#macro postJSON postData>
|
||||||
{
|
{
|
||||||
<@postDataJSON postData=postData />
|
<@postDataJSON postData=postData />
|
||||||
}
|
}
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro postDataJSON postData>
|
<#macro postDataJSON postData>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
<#-- which node should be used for urls? which for the post data? -->
|
<#-- which node should be used for urls? which for the post data? -->
|
||||||
<#if postData.isTopicPost>
|
<#if postData.isTopicPost>
|
||||||
<#assign refNode=postData.topic />
|
<#assign refNode=postData.topic />
|
||||||
<#else>
|
<#else>
|
||||||
<#assign refNode=postData.post />
|
<#assign refNode=postData.post />
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<#assign post=postData.post />
|
<#assign post=postData.post />
|
||||||
|
|
||||||
<#-- render topic post only data first -->
|
<#-- render topic post only data first -->
|
||||||
<#if postData.isTopicPost>
|
<#if postData.isTopicPost>
|
||||||
"name": "${postData.topic.name}",
|
"name": "${postData.topic.name}",
|
||||||
"totalReplyCount": ${postData.totalReplyCount?c},
|
"totalReplyCount": ${postData.totalReplyCount?c},
|
||||||
<#if postData.lastReply??>
|
<#if postData.lastReply??>
|
||||||
"lastReplyOn": "${postData.lastReply.properties.created?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"lastReplyOn": "${postData.lastReply.properties.created?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
<@renderPerson person=postData.lastReplyBy fieldName="lastReplyBy" />
|
<@renderPerson person=postData.lastReplyBy fieldName="lastReplyBy" />
|
||||||
</#if>
|
</#if>
|
||||||
"tags": [<#list postData.tags as x>"${x}"<#if x_has_next>, </#if></#list>],
|
"tags": [<#list postData.tags as x>"${x}"<#if x_has_next>, </#if></#list>],
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<#-- data using refNode which might be the topic or the post node -->
|
<#-- data using refNode which might be the topic or the post node -->
|
||||||
"url": "/forum/post/node/${refNode.nodeRef.storeRef.protocol}/${refNode.nodeRef.storeRef.identifier}/${refNode.nodeRef.id}",
|
"url": "/forum/post/node/${refNode.nodeRef.storeRef.protocol}/${refNode.nodeRef.storeRef.identifier}/${refNode.nodeRef.id}",
|
||||||
"repliesUrl": "/forum/post/node/${refNode.nodeRef.storeRef.protocol}/${refNode.nodeRef.storeRef.identifier}/${refNode.nodeRef.id}/replies",
|
"repliesUrl": "/forum/post/node/${refNode.nodeRef.storeRef.protocol}/${refNode.nodeRef.storeRef.identifier}/${refNode.nodeRef.id}/replies",
|
||||||
"nodeRef": "${refNode.nodeRef}",
|
"nodeRef": "${refNode.nodeRef}",
|
||||||
|
|
||||||
<#-- data coming from the post node -->
|
<#-- data coming from the post node -->
|
||||||
"title": "${(post.properties.title!"")}",
|
"title": "${(post.properties.title!"")}",
|
||||||
"createdOn": "${post.properties.created?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"createdOn": "${post.properties.created?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
"modifiedOn": "${post.properties.modified?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"modifiedOn": "${post.properties.modified?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
<#if (post.properties["cm:updated"]??)>
|
<#if (post.properties["cm:updated"]??)>
|
||||||
"isUpdated": true,
|
"isUpdated": true,
|
||||||
"updatedOn": "${post.properties["cm:updated"]?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"updatedOn": "${post.properties["cm:updated"]?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
<#else>
|
<#else>
|
||||||
"isUpdated": false,
|
"isUpdated": false,
|
||||||
</#if>
|
</#if>
|
||||||
<#if postData.author??>
|
<#if postData.author??>
|
||||||
<@renderPerson person=postData.author fieldName="author" />
|
<@renderPerson person=postData.author fieldName="author" />
|
||||||
<#else>
|
<#else>
|
||||||
"author":
|
"author":
|
||||||
{
|
{
|
||||||
"username": "${post.properties["cm:creator"]}"
|
"username": "${post.properties["cm:creator"]}"
|
||||||
},
|
},
|
||||||
</#if>
|
</#if>
|
||||||
<@addContent post=post />
|
<@addContent post=post />
|
||||||
"replyCount": <#if post.sourceAssocs["cm:references"]??>${post.sourceAssocs["cm:references"]?size?c}<#else>0</#if>,
|
"replyCount": <#if post.sourceAssocs["cm:references"]??>${post.sourceAssocs["cm:references"]?size?c}<#else>0</#if>,
|
||||||
"permissions":
|
"permissions":
|
||||||
{
|
{
|
||||||
"edit": ${post.hasPermission("Write")?string},
|
"edit": ${post.hasPermission("Write")?string},
|
||||||
"reply": ${post.parent.hasPermission("CreateChildren")?string},
|
"reply": ${post.parent.hasPermission("CreateChildren")?string},
|
||||||
"delete": ${post.hasPermission("Delete")?string}
|
"delete": ${post.hasPermission("Delete")?string}
|
||||||
}
|
}
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
<#-- Renders replies.
|
<#-- Renders replies.
|
||||||
The difference is to a normal post is that the children might be
|
The difference is to a normal post is that the children might be
|
||||||
added inline in the returned JSON.
|
added inline in the returned JSON.
|
||||||
-->
|
-->
|
||||||
<#macro repliesJSON data>
|
<#macro repliesJSON data>
|
||||||
{
|
{
|
||||||
<@postDataJSON postData=data />
|
<@postDataJSON postData=data />
|
||||||
<#if data.children?exists>
|
<#if data.children?exists>
|
||||||
, "children": <@repliesRootJSON children=data.children />
|
, "children": <@repliesRootJSON children=data.children />
|
||||||
</#if>
|
</#if>
|
||||||
}
|
}
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro repliesRootJSON children>
|
<#macro repliesRootJSON children>
|
||||||
[
|
[
|
||||||
<#list children as child>
|
<#list children as child>
|
||||||
<@repliesJSON data=child/>
|
<@repliesJSON data=child/>
|
||||||
<#if child_has_next>,</#if>
|
<#if child_has_next>,</#if>
|
||||||
</#list>
|
</#list>
|
||||||
]
|
]
|
||||||
</#macro>
|
</#macro>
|
@@ -1,66 +1,66 @@
|
|||||||
<#import "../generic-paged-results.lib.ftl" as gen>
|
<#import "../generic-paged-results.lib.ftl" as gen>
|
||||||
|
|
||||||
<#macro renderPerson person fieldName>
|
<#macro renderPerson person fieldName>
|
||||||
"${fieldName}":
|
"${fieldName}":
|
||||||
{
|
{
|
||||||
<#if person.assocs["cm:avatar"]??>
|
<#if person.assocs["cm:avatar"]??>
|
||||||
"avatarRef": "${person.assocs["cm:avatar"][0].nodeRef?string}",
|
"avatarRef": "${person.assocs["cm:avatar"][0].nodeRef?string}",
|
||||||
</#if>
|
</#if>
|
||||||
"username": "${person.properties["cm:userName"]}",
|
"username": "${person.properties["cm:userName"]}",
|
||||||
"firstName": "${person.properties["cm:firstName"]}",
|
"firstName": "${person.properties["cm:firstName"]!""}",
|
||||||
"lastName": "${person.properties["cm:lastName"]}"
|
"lastName": "${person.properties["cm:lastName"]!""}"
|
||||||
},
|
},
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#--
|
<#--
|
||||||
This template renders a link.
|
This template renders a link.
|
||||||
-->
|
-->
|
||||||
<#macro linkJSON item>
|
<#macro linkJSON item>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
{
|
{
|
||||||
"url": "${item.url!''}",
|
"url": "${item.url!''}",
|
||||||
"commentsUrl": "/node/${item.node.nodeRef?replace('://','/')}/comments",
|
"commentsUrl": "/node/${item.node.nodeRef?replace('://','/')}/comments",
|
||||||
"description": "${item.description!''}",
|
"description": "${item.description!''}",
|
||||||
"nodeRef": "${item.node.nodeRef}",
|
"nodeRef": "${item.node.nodeRef}",
|
||||||
"name": "${item.name!''}",
|
"name": "${item.name!''}",
|
||||||
"title": "${item.title!''}",
|
"title": "${item.title!''}",
|
||||||
"internal": ${(item.internal!false)?string},
|
"internal": ${(item.internal!false)?string},
|
||||||
"createdOn": "${item.createdOn?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"createdOn": "${item.createdOn?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
<#if item.creator??>
|
<#if item.creator??>
|
||||||
<@renderPerson person=item.creator fieldName="author" />
|
<@renderPerson person=item.creator fieldName="author" />
|
||||||
<#else>
|
<#else>
|
||||||
"author":
|
"author":
|
||||||
{
|
{
|
||||||
"username": "${item.node.properties.creator}"
|
"username": "${item.node.properties.creator}"
|
||||||
},
|
},
|
||||||
</#if>
|
</#if>
|
||||||
"permissions":
|
"permissions":
|
||||||
{
|
{
|
||||||
"edit": ${item.node.hasPermission("Write")?string},
|
"edit": ${item.node.hasPermission("Write")?string},
|
||||||
"delete": ${item.node.hasPermission("Delete")?string}
|
"delete": ${item.node.hasPermission("Delete")?string}
|
||||||
},
|
},
|
||||||
"tags": [<#list item.tags as x>"${x}"<#if x_has_next>, </#if></#list>]
|
"tags": [<#list item.tags as x>"${x}"<#if x_has_next>, </#if></#list>]
|
||||||
}
|
}
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro renderLinkList>
|
<#macro renderLinkList>
|
||||||
{
|
{
|
||||||
"metadata":
|
"metadata":
|
||||||
{
|
{
|
||||||
"linkPermissions":
|
"linkPermissions":
|
||||||
{
|
{
|
||||||
"create": "${links.hasPermission("CreateChildren")?string}"
|
"create": "${links.hasPermission("CreateChildren")?string}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
<@gen.pagedResults data=data ; item>
|
<@gen.pagedResults data=data ; item>
|
||||||
<@linkJSON item=item />
|
<@linkJSON item=item />
|
||||||
</@gen.pagedResults>
|
</@gen.pagedResults>
|
||||||
}
|
}
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro renderLink>
|
<#macro renderLink>
|
||||||
{
|
{
|
||||||
"item": <@linkJSON item=item />
|
"item": <@linkJSON item=item />
|
||||||
}
|
}
|
||||||
</#macro>
|
</#macro>
|
@@ -10,11 +10,11 @@
|
|||||||
{
|
{
|
||||||
"authorityType" : "${authority.authorityType}",
|
"authorityType" : "${authority.authorityType}",
|
||||||
"shortName" : "${authority.shortName}",
|
"shortName" : "${authority.shortName}",
|
||||||
"fullName" : "${authority.fullName}",
|
"fullName" : "${authority.fullName!""}",
|
||||||
"displayName" : "${authority.displayName}",
|
"displayName" : "${authority.displayName}",
|
||||||
"url" : "${url.serviceContext + "/api/groups/" + authority.shortName }"
|
"url" : "${url.serviceContext + "/api/groups/" + authority.shortName }"
|
||||||
},
|
},
|
||||||
"url" : "${url.serviceContext + "/api/sites/" + site.shortName + "/memberships/" + authority.fullName}"
|
"url" : "${url.serviceContext + "/api/sites/" + site.shortName + "/memberships/" + authority.fullName!""}"
|
||||||
|
|
||||||
<#else>
|
<#else>
|
||||||
<#-- this is a person authority type -->
|
<#-- this is a person authority type -->
|
||||||
@@ -23,8 +23,8 @@
|
|||||||
"authorityType" : "USER",
|
"authorityType" : "USER",
|
||||||
"fullName" : "${authority.properties.userName}",
|
"fullName" : "${authority.properties.userName}",
|
||||||
"userName" : "${authority.properties.userName}",
|
"userName" : "${authority.properties.userName}",
|
||||||
"firstName" : "${authority.properties.firstName}",
|
"firstName" : "${authority.properties.firstName!""}",
|
||||||
"lastName" : "${authority.properties.lastName}",
|
"lastName" : "${authority.properties.lastName!""}",
|
||||||
<#if authority.assocs["cm:avatar"]??>
|
<#if authority.assocs["cm:avatar"]??>
|
||||||
"avatar" : "${"api/node/" + authority.assocs["cm:avatar"][0].nodeRef?string?replace('://','/') + "/content/thumbnails/avatar"}",
|
"avatar" : "${"api/node/" + authority.assocs["cm:avatar"][0].nodeRef?string?replace('://','/') + "/content/thumbnails/avatar"}",
|
||||||
</#if>
|
</#if>
|
||||||
@@ -41,4 +41,4 @@
|
|||||||
</#if>
|
</#if>
|
||||||
}
|
}
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
@@ -1,17 +1,17 @@
|
|||||||
[
|
[
|
||||||
<#list versions as v>
|
<#list versions as v>
|
||||||
{
|
{
|
||||||
nodeRef: "${v.nodeRef}",
|
nodeRef: "${v.nodeRef}",
|
||||||
name: "${jsonUtils.encodeJSONString(v.name)}",
|
name: "${jsonUtils.encodeJSONString(v.name)}",
|
||||||
label: "${v.label}",
|
label: "${v.label}",
|
||||||
description: "${jsonUtils.encodeJSONString(v.description)}",
|
description: "${jsonUtils.encodeJSONString(v.description)}",
|
||||||
createdDate: "${v.createdDate?string("dd MMM yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
createdDate: "${v.createdDate?string("dd MMM yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
creator:
|
creator:
|
||||||
{
|
{
|
||||||
userName: "${v.creator.userName}",
|
userName: "${v.creator.userName}",
|
||||||
firstName: "${jsonUtils.encodeJSONString(v.creator.firstName)}",
|
firstName: "${jsonUtils.encodeJSONString(v.creator.firstName!"")}",
|
||||||
lastName: "${jsonUtils.encodeJSONString(v.creator.lastName)}"
|
lastName: "${jsonUtils.encodeJSONString(v.creator.lastName!"")}"
|
||||||
}
|
}
|
||||||
}<#if (v_has_next)>,</#if>
|
}<#if (v_has_next)>,</#if>
|
||||||
</#list>
|
</#list>
|
||||||
]
|
]
|
@@ -108,16 +108,15 @@
|
|||||||
"type": "${task.type}",
|
"type": "${task.type}",
|
||||||
"completeness": "${task.properties["bpm:percentComplete"]}",
|
"completeness": "${task.properties["bpm:percentComplete"]}",
|
||||||
<#if task.properties["inwf:resourceName"]?exists>
|
<#if task.properties["inwf:resourceName"]?exists>
|
||||||
<#assign theSite = site.getSiteInfo(task.properties["inwf:resourceName"])>
|
|
||||||
<#assign theInviter = people.getPerson(task.properties["inwf:inviterUserName"])>
|
<#assign theInviter = people.getPerson(task.properties["inwf:inviterUserName"])>
|
||||||
"invitation":
|
"invitation":
|
||||||
{
|
{
|
||||||
"type": "nominated",
|
"type": "nominated",
|
||||||
"site":
|
"site":
|
||||||
{
|
{
|
||||||
"id": "${theSite.shortName}",
|
"id": "${task.properties["inwf:resourceName"]!""}",
|
||||||
"title": "${theSite.title!""}",
|
"title": "${jsonUtils.encodeJSONString(task.properties["inwf:resourceTitle"]!"")}",
|
||||||
"description": "${theSite.description!""}"
|
"description": "${jsonUtils.encodeJSONString(task.properties["inwf:resourceDescription"]!"")}"
|
||||||
},
|
},
|
||||||
"inviter":
|
"inviter":
|
||||||
{
|
{
|
||||||
|
@@ -41,19 +41,19 @@
|
|||||||
<#assign version = "1.0">
|
<#assign version = "1.0">
|
||||||
<#if d.hasAspect("cm:versionable") && d.versionHistory?size != 0><#assign version = d.versionHistory[0].versionLabel></#if>
|
<#if d.hasAspect("cm:versionable") && d.versionHistory?size != 0><#assign version = d.versionHistory[0].versionLabel></#if>
|
||||||
<#if item.createdBy??>
|
<#if item.createdBy??>
|
||||||
<#assign createdBy = (item.createdBy.properties.firstName + " " + item.createdBy.properties.lastName)?trim>
|
<#assign createdBy = (item.createdBy.properties.firstName!"" + " " + item.createdBy.properties.lastName!"")?trim>
|
||||||
<#assign createdByUser = item.createdBy.properties.userName>
|
<#assign createdByUser = item.createdBy.properties.userName>
|
||||||
<#else>
|
<#else>
|
||||||
<#assign createdBy="" createdByUser="">
|
<#assign createdBy="" createdByUser="">
|
||||||
</#if>
|
</#if>
|
||||||
<#if item.modifiedBy??>
|
<#if item.modifiedBy??>
|
||||||
<#assign modifiedBy = (item.modifiedBy.properties.firstName + " " + item.modifiedBy.properties.lastName)?trim>
|
<#assign modifiedBy = (item.modifiedBy.properties.firstName!"" + " " + item.modifiedBy.properties.lastName!"")?trim>
|
||||||
<#assign modifiedByUser = item.modifiedBy.properties.userName>
|
<#assign modifiedByUser = item.modifiedBy.properties.userName>
|
||||||
<#else>
|
<#else>
|
||||||
<#assign modifiedBy="" modifiedByUser="">
|
<#assign modifiedBy="" modifiedByUser="">
|
||||||
</#if>
|
</#if>
|
||||||
<#if item.lockedBy??>
|
<#if item.lockedBy??>
|
||||||
<#assign lockedBy = (item.lockedBy.properties.firstName + " " + item.lockedBy.properties.lastName)?trim>
|
<#assign lockedBy = (item.lockedBy.properties.firstName!"" + " " + item.lockedBy.properties.lastName!"")?trim>
|
||||||
<#assign lockedByUser = item.lockedBy.properties.userName>
|
<#assign lockedByUser = item.lockedBy.properties.userName>
|
||||||
<#else>
|
<#else>
|
||||||
<#assign lockedBy="" lockedByUser="">
|
<#assign lockedBy="" lockedByUser="">
|
||||||
|
@@ -64,7 +64,7 @@ public class RepositoryTemplateProcessor extends FreeMarkerProcessor
|
|||||||
protected String defaultEncoding;
|
protected String defaultEncoding;
|
||||||
protected Configuration templateConfig;
|
protected Configuration templateConfig;
|
||||||
protected FreeMarkerProcessor freeMarkerProcessor;
|
protected FreeMarkerProcessor freeMarkerProcessor;
|
||||||
private int updateDelay = 0;
|
private int updateDelay = 1;
|
||||||
private int cacheSize = 512;
|
private int cacheSize = 512;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user