Merged V3.2E to HEAD

17411: Fix for ETHREEOH-3209 - Share Admin Console edit/delete user buttons now respect account mutability.
      - Cleanup to incorrect and overly verbose FreeMarker for slingshot user metadata webscript.
   17412: Updated batch log output value for running on large repos (which is where you would actually care about the output anyway).
   17414: Fix for ETHREEOH-3071 - Unable to remove a group from user profile.
   17416: *RECORD ONLY* Removed mobile.war from WAR bundles

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18121 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2010-01-19 11:17:32 +00:00
parent 4613bf3bf7
commit 3f788bc205
4 changed files with 81 additions and 62 deletions

View File

@@ -11,6 +11,7 @@ function main()
if (person != null)
{
model.person = person;
model.capabilities = people.getCapabilities(person);
model.groups = groups ? people.getContainerGroups(person) : null;
}
else

View File

@@ -1,6 +1,6 @@
<#import "person.lib.ftl" as personLib/>
<#if groups??>
<@personLib.personGroupsJSON person=person groups=groups />
<@personLib.personGroupsJSON person=person groups=groups capabilities=capabilities />
<#else>
<@personLib.personJSON person=person />
<@personLib.personCapJSON person=person capabilities=capabilities />
</#if>

View File

@@ -35,10 +35,24 @@
}
</#macro>
<#macro personGroupsJSON person groups>
<#macro personCapJSON person capabilities>
{
<@personJSONinner person=person/>,
"capabilities":
{
<@serializeHash hash=capabilities/>
}
}
</#macro>
<#macro personGroupsJSON person groups capabilities>
<#escape x as jsonUtils.encodeJSONString(x)>
{
<@personJSONinner person=person/>,
"capabilities":
{
<@serializeHash hash=capabilities/>
},
"groups": [
<#list groups as g>
<#assign authName = g.properties["cm:authorityName"]>
@@ -60,4 +74,22 @@
"lastName": "${person.properties.lastName}"
}
</#escape>
</#macro>
<#macro serializeHash hash>
<#escape x as jsonUtils.encodeJSONString(x)>
<#local first = true>
<#list hash?keys as key>
<#if hash[key]??>
<#local val = hash[key]>
<#if !first>,<#else><#local first = false></#if>"${key}":
<#if person.isTemplateContent(val)>"${val.content}"
<#elseif person.isTemplateNodeRef(val)>"${val.nodeRef}"
<#elseif val?is_date>"${val?datetime}"
<#elseif val?is_boolean>${val?string}
<#else>"${val}"
</#if>
</#if>
</#list>
</#escape>
</#macro>

View File

@@ -1,52 +1,52 @@
{
"code" : "${code}"
"code": "${code}"
<#if object?exists>
,
"data" : {
"data": {
<@serialize object=object includeChildren=includeChildren includeContent=includeContent/>
}
</#if>
}
<#macro serialize object includeChildren includeContent>
"isContainer" : ${object.isContainer?string}
<#escape x as jsonUtils.encodeJSONString(x)>
"isContainer": ${object.isContainer?string}
,
"isDocument" : ${object.isDocument?string}
"isDocument": ${object.isDocument?string}
,
"url" : "${object.url}"
"url": "${object.url}"
,
"downloadUrl" : "${object.downloadUrl}"
"downloadUrl": "${object.downloadUrl}"
<#if object.mimetype?exists>
,
"mimetype" : "${object.mimetype}"
"mimetype": "${object.mimetype}"
</#if>
,
"size" : "${object.size}"
"size": "${object.size}"
,
"displayPath" : "${object.displayPath}"
"displayPath": "${object.displayPath}"
,
"qnamePath" : "${object.qnamePath}"
"qnamePath": "${object.qnamePath}"
,
"icon16" : "${object.icon16}"
"icon16": "${object.icon16}"
,
"icon32" : "${object.icon32}"
"icon32": "${object.icon32}"
,
"isLocked" : ${object.isLocked?string}
"isLocked": ${object.isLocked?string}
,
"id" : "${object.id}"
"id": "${object.id}"
,
"nodeRef" : "${object.nodeRef}"
"nodeRef": "${object.nodeRef}"
,
"name" : "${object.name}"
"name": "${object.name}"
,
"type" : "${object.type}"
"type": "${object.type}"
,
"isCategory" : ${object.isCategory?string}
"isCategory": ${object.isCategory?string}
<#if object.properties?exists>
,
"properties" :
"properties":
{
<@serializeHash hash=object.properties/>
}
@@ -54,70 +54,56 @@
<#if includeChildren && object.children?exists>
,
"children" :
"children":
[
<#assign first = true>
<#list object.children as child>
<#if first == false>
<#if first == false>
,
</#if>
</#if>
{
<@serialize object=child includeChildren=false includeContent=includeContent/>
}
<#assign first = false>
<#assign first = false>
</#list>
]
<#else>
,
"children" : []
"children": []
</#if>
<#if isUser && object.associations["cm:avatar"]?exists>
,
"associations" :
"associations":
{
"{http://www.alfresco.org/model/content/1.0}avatar" : ["${object.associations["cm:avatar"][0].nodeRef}"]
"{http://www.alfresco.org/model/content/1.0}avatar": ["${object.associations["cm:avatar"][0].nodeRef}"]
}
</#if>
<#if isUser>
,
"capabilities" :
{
<@serializeHash hash=capabilities/>
}
,
"capabilities":
{
<@serializeHash hash=capabilities/>
}
</#if>
</#escape>
</#macro>
<#macro serializeHash hash>
<#escape x as jsonUtils.encodeJSONString(x)>
<#local first = true>
<#list hash?keys as key>
<#if hash[key]?exists>
<#local val = hash[key]>
<#if isUser && object.isTemplateContent(val)>
<#if first == false>,</#if>
"${key}" : "${jsonUtils.encodeJSONString(val.content)}"
<#local first = false>
<#elseif object.isTemplateNodeRef(val)>
<#if first == false>,</#if>
"${key}" : "${val.nodeRef}"
<#local first = false>
<#elseif val?is_string == true>
<#if first == false>,</#if>
"${key}" : "${jsonUtils.encodeJSONString(val)}"
<#local first = false>
<#elseif val?is_date == true>
<#if first == false>,</#if>
"${key}" : "${val?datetime}"
<#local first = false>
<#elseif val?is_boolean == true>
<#if first == false>,</#if>
"${key}" : "${val?string}"
<#local first = false>
</#if>
</#if>
<#if hash[key]??>
<#local val = hash[key]>
<#if !first>,<#else><#local first = false></#if>"${key}":
<#if isUser && object.isTemplateContent(val)>"${val.content}"
<#elseif object.isTemplateNodeRef(val)>"${val.nodeRef}"
<#elseif val?is_date>"${val?datetime}"
<#elseif val?is_boolean>${val?string}
<#else>"${val}"
</#if>
</#if>
</#list>
</#escape>
</#macro>