diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.xml.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.xml.ftl new file mode 100644 index 0000000000..9559051ce5 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.xml.ftl @@ -0,0 +1,122 @@ + + + +<#assign doc_actions="${url.serviceContext}/office/docActions"> +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> +<#assign extn="doc" extn1="odt" extn2="sxw"> +<#assign extnx=extn+"x"> +<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""> +<#-- resolve the path (from Company Home) into a node --> +<#if companyhome.childByNamePath[path]?exists> + <#assign d=companyhome.childByNamePath[path]> +<#else> + <#assign d=companyhome> + + +<#if d.isDocument> + ${url.context}${d.icon32} + <#if d.isLocked > + YES + + ${d.name} + <#if d.properties.title?exists> + ${d.properties.title} + <#else> + "" + + <#if d.properties.description?exists> + ${d.properties.description} + <#else> + "" + + ${d.properties.creator} + ${d.properties.created?datetime} + ${d.properties.modifier} + ${d.properties.modified?datetime} + ${d.size / 1024} Kb + + <#if d.hasAspect("cm:generalclassifiable")> + <#list d.properties.categories as category> + ${companyhome.nodeByReference[category].name}; + + <#else> + None. + +<#else> + The current document is not managed by Alfresco. + + +<#if d.isDocument > + <#if hasAspect(d, "cm:versionable") == 1> + <#assign versionRow=0> + <#list d.versionHistory?sort_by("versionLabel")?reverse as record> + <#assign versionRow=versionRow+1> + + ${record.versionLabel} + ${url.context}${record.url}?ticket=${session.ticket} + ${record.creator} + ${record.createdDate?datetime} + <#if record.description?exists> + ${record.description} + + <#-- Only Word supports document compare --> + <#if extn = "doc"> + ${record.url} + + + + <#else> +The current document is not versioned. +${doc_actions}?a=makeversion&n=${d.id} + +<#else> + The current document is not managed by Alfresco. + + + +<#if d.isDocument> + <#if d.isLocked > + <#elseif hasAspect(d, "cm:workingcopy") == 1> + ${doc_actions}?a=checkin&n=${d.id} + <#else> + ${doc_actions}?a=checkout&n=${d.id} + + ${url.serviceContext}/office/docActions?a=workflow&n=${d.id} + <#if d.name?ends_with(extn) || d.name?ends_with(extnx) || d.name?ends_with(extn1) || d.name?ends_with(extn2)> + ${doc_actions}?a=makepdf&n=${d.id} + + ${url.context}/navigate/showDocDetails/workspace/SpacesStore/${d.id}?ticket=${session.ticket} +<#else> + Save to Alfresco + + + diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.xml.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.xml.ftl new file mode 100644 index 0000000000..2d12a91848 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.xml.ftl @@ -0,0 +1,111 @@ + + + +<#assign doc_actions="${url.serviceContext}/office/docActions"> +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> +<#if args.e?exists><#assign extn=args.e><#assign extn="doc" extn1="odt" extn2="sxw"> +<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""> +<#-- resolve the path (from Company Home) into a node --> +<#if companyhome.childByNamePath[path]?exists> + <#assign d=companyhome.childByNamePath[path]> +<#else> + <#assign d=companyhome> + + + My Alfresco + + ${url.serviceContext}/office/navigation?p=${path?url}&e=${extn}&n=${nav} + ${url.serviceContext}/office/search?p=${path?url}&e=${extn}&n=${nav} + ${url.serviceContext}/office/documentDetails?p=${path?url}&e=${extn}&n=${nav} + ${url.serviceContext}/office/myTasks?p=${path?url}&e=${extn}&n=${nav} + + +<#assign query="@cm\\:workingCopyOwner:${person.properties.userName}"> + <#list companyhome.childrenByLuceneSearch[query] as child> + <#if child.isDocument> + <#assign relativePath = (child.displayPath?substring(companyhome.name?length+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> +${child.displayPath?substring(companyhome.name?length+1) + '/'} + + ${url.context}${child.icon32} + ${child.name} + + <#if child.name?ends_with(extn) || child.name?ends_with(extn1) || child.name?ends_with(extn2)> + ${relativePath} + <#else> + ${url.context}${child.url}?ticket=${session.ticket} + + <#if child.properties.description?exists> + <#if (child.properties.description?length > 0)> + ${child.properties.description} + + + + ${child.properties.modified?datetime} + ${(child.size / 1024)?int}Kb + ${doc_actions}?a=checkin&n=${child.id} + ${url.serviceContext}/office/docActions?a=workflow&n=${child.id} + ${url.context}${child.url}?ticket=${session.ticket} + <#if !child.name?ends_with(".pdf")> + ${doc_actions}?a=makepdf&n=${child.id} + + + + + + +<#list workflow.assignedTasks as t> + + <#assign hasDue=t.properties["bpm:dueDate"]?exists> + <#if hasDue> + <#assign due=t.properties["bpm:dueDate"]> + + <#if hasDue> + <#-- items due today? --> + <#if (dateCompare(date?date, due?date, 0, "==") == 1)> + + <#-- items overdue? --> + <#elseif (dateCompare(date?date, due?date) == 1)> + + + + ${t.id} + ${url.context}/service/office/myTasksDetail.xml?t=${t.id}&e=doc + ${t.description!""?html} + ${t.type?html} + <#if hasDue> + ${due?date} + + + + +${url.context}/navigate/browse?ticket=${session.ticket} + diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.xml.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.xml.ftl new file mode 100644 index 0000000000..d42ffbd223 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.xml.ftl @@ -0,0 +1,94 @@ + + + +<#assign doc_actions="${url.serviceContext}/office/docActions"> +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> +<#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"> +<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""> +<#if docWorkflow?exists> + <#assign d=docWorkflow> +<#else> + <#-- resolve the path (from Company Home) into a node --> + <#if companyhome.childByNamePath[path]?exists> + <#assign d=companyhome.childByNamePath[path]> + <#else> + <#assign d=companyhome> + + + +My Tasks + ${extn} + + +<#assign taskNum=0> +<#list workflow.assignedTasks as t> + <#assign taskNum=taskNum+1> + <#assign hasDue=t.properties["bpm:dueDate"]?exists> + <#if hasDue> + <#assign due=t.properties["bpm:dueDate"]> + + +<#if hasDue>${due?date?string("yyyyMMddHHmmss")}<#else>99999999999999"> + + <#if hasDue> + <#-- items due today? --> + <#if (dateCompare(date?date, due?date, 0, "==") == 1)> + due today + <#-- items overdue? --> + <#elseif (dateCompare(date?date, due?date) == 1)> + overdue + + <#else> +   + + + ${t.description?html} (${t.type?html}) + + <#if hasDue> + ${due?date} + <#else> + (No due date) + + + +<#if taskNum = 0> + (No tasks) + + + +<#if args.w?exists && d.isDocument> + + ${url.serviceContext}/office/docActions, ${d.id} +<#else> + + + diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.xml.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.xml.ftl new file mode 100644 index 0000000000..8285fa3328 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.xml.ftl @@ -0,0 +1,59 @@ + + + +<#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"> +<#if args.t?exists> + <#assign taskid = args.t> + <#if taskid != ""> + <#assign task = workflow.getTaskById(taskid)> + + + +<#if task?exists> + ${task.description?html} + ${task.properties["bpm:status"]} + ${task.properties["bpm:priority"]} + ${task.startDate?date} + ${task.type?html} + ${task.properties["bpm:percentComplete"]}% + + <#list task.packageResources as res> + + ${url.context}${res.url}?ticket=${session.ticket} + ${res.name} + + <#list task.transitions as wt> + ${url.context}/command/task/end/${task.id}<#if wt.id?exists>/${wt.id} + + ${url.context}/command/ui/managetask?id=${task.id}&type=${task.qnameType}&container=plain&ticket=${session.ticket} + + diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.xml.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.xml.ftl new file mode 100644 index 0000000000..ec5d27b6e9 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.xml.ftl @@ -0,0 +1,138 @@ + + + +<#assign doc_actions="${url.serviceContext}/office/docActions"> +<#if args.e?exists><#assign extn=args.e> +<#else> + +<#assign extn="doc" extn1="odt" extn2="sxw"> +<#assign extnx=extn+"x"> +<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""> +<#assign chLen=companyhome.name?length> +<#if node.isDocument> + <#assign thisSpace = node.parent> +<#else> + <#assign thisSpace = node> + + +${thisSpace.displayPath}/${thisSpace.name}/ +${thisSpace.name} +${thisSpace.id} +<#if thisSpace.properties.description?exists>${thisSpace.properties.description} +<#if thisSpace=companyhome> +<#else> + ${url.serviceContext}/office/navigation.xml?p=${path?url}&n=${thisSpace.parent.id} + + +Spaces in ${thisSpace.name} +Create New <#if args.cc?exists>Collaboration Space... +<#assign xpath="app:dictionary/app:space_templates/*"> +<#assign templates = companyhome.childrenByXPath[xpath]> +<#if (templates?size > 0)> + <#list templates as template> + + + +<#assign spacesFound = 0> + +<#list thisSpace.children?sort_by('name') as child> + <#if child.isContainer> + + <#assign spacesFound = spacesFound + 1> +${child.name} + ${url.serviceContext}/office/navigation.xml?p=${path?url}&n=${child.id} + + <#if child.properties.description?exists> + ${child.properties.description} + + + + + +<#if spacesFound = 0> + (No subspaces) + + +Documents in ${thisSpace.name} + +<#assign documentsFound = 0> +<#list thisSpace.children?sort_by('name') as child> + + <#if child.isDocument> + <#assign documentsFound = documentsFound + 1> + ${child.name} + <#assign relativePath = (child.displayPath?substring(chLen+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> + + <#if child.name?ends_with(extn) || child.name?ends_with(extnx) || child.name?ends_with(extn1) || child.name?ends_with(extn2)> + ${relativePath} + <#else> + ${url.context}${child.url}?ticket=${session.ticket} + + <#if child.properties.description?exists> + <#if (child.properties.description?length > 0)> + ${child.properties.description} + + <#else> + None. + + ${child.properties.modified?datetime} + ${(child.size / 1024)?int}Kb + <#if child.isLocked > + YES + <#elseif hasAspect(child, "cm:workingcopy") == 1> + ${doc_actions}?a=checkin&n=${child.id} + <#else> + ${doc_actions}?a=checkout&n=${child.id} + + ${url.serviceContext}/office/docActions?a=workflow&n=${child.id} + + ${url.context}${child.url}?ticket=${session.ticket} + <#if !child.name?ends_with(".pdf")> + ${doc_actions}?a=makepdf&n=${child.id} + + <#if !child.isLocked> + ${doc_actions}?a=delete&n=${child.id} + + + + + +<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name /> +<#assign currentPath = currentPath?substring(chLen+1)?url?replace('%2F', '/')?replace('\'', '\\\'') /> +${currentPath} +<#if documentsFound = 0> + YES + + diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.xml.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.xml.ftl new file mode 100644 index 0000000000..8d7b9887df --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.xml.ftl @@ -0,0 +1,91 @@ + + + +<#assign extn="doc" extn1="odt" extn2="sxw"> +<#if args.search?exists> + <#assign searchString = args.search> + <#if searchString != ""> + <#assign queryString = "(TEXT:\"${searchString}\") OR (@cm\\:name:*${searchString}*)" > + <#-- assign queryString = "@\\{http\\://www.alfresco.org/model/content/1.0\\}name:*${searchString}*" --> + +<#else> + <#assign searchString = ""> + <#assign queryString = ""> + + +<#if searchString != ""> + <#if args.maxresults?exists> + <#assign maxresults=args.maxresults?number> + <#else> + <#assign maxresults=10> + + <#assign resCount=0> + <#assign totalResults=0> + <#assign results = companyhome.childrenByLuceneSearch[queryString] > + <#if results?size = 0> + + (No results found) + + <#else> + <#assign totalResults = results?size> + <#list results as child> + <#if child.isDocument> +<#assign resCount=resCount + 1> + <#if child.name?ends_with(extn) || child.name?ends_with(extn1) || child.name?ends_with(extn2)> + <#assign relativePath = (child.displayPath?substring(companyhome.name?length+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> + + <#assign openURL = "${relativePath}"> + <#else> + <#assign openURL = "${url.context}${child.url}?ticket=${session.ticket}"> + + + + ${child.name} + ${openURL} + + <#if child.properties.description?exists> + <#if (child.properties.description?length > 0)> +
${child.properties.description}
+ + + <#if child.isDocument> + ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb) + +
+ + <#if resCount = maxresults> + <#break> + + + + +