mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Open Office integration office webscripts - contributed by Juergen Schmidt from Sun Microsystems
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11578 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,122 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--****************************************************************************
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. *
|
||||||
|
* *
|
||||||
|
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* The contents of this file are subject to the terms of either the GNU General*
|
||||||
|
* Public License Version 2 only ("GPL") or the Common Development and *
|
||||||
|
* Distribution License("CDDL") (collectively, the "License"). *
|
||||||
|
* You may not use this file except in compliance with the License. *
|
||||||
|
* You can obtain a copy of the License at AlfrescoAddon/licenses/license.txt. *
|
||||||
|
* See the License for the specific language governing permissions and *
|
||||||
|
* limitations under the License. When distributing the software, include this*
|
||||||
|
* License Header Notice in each file and include the License file at *
|
||||||
|
* AlfrescoAddon/licenses/license.txt. If applicable, add the following below *
|
||||||
|
* the License Header, with the fields enclosed by brackets [] replaced by your*
|
||||||
|
* own identifying information: *
|
||||||
|
* "Portions Copyrighted [year] [name of copyright owner]" *
|
||||||
|
* *
|
||||||
|
* Contributor(s): *
|
||||||
|
* If you wish your version of this file to be governed by only the CDDL or *
|
||||||
|
* only the GPL Version 2, indicate your decision by adding "[Contributor] *
|
||||||
|
* elects to include this software in this distribution under the *
|
||||||
|
* [CDDL or GPL Version 2] license." If you don't indicate a single choice of *
|
||||||
|
* license, a recipient has the option to distribute your version of this file *
|
||||||
|
* under either the CDDL, the GPL Version 2 or to extend the choice of *
|
||||||
|
* license to its licensees as provided above. However, if you add *
|
||||||
|
* GPL Version 2 code and therefore, elected the GPL Version 2 license, then *
|
||||||
|
* the option applies only if the new code is made subject to such option by *
|
||||||
|
* the copyright holder. *
|
||||||
|
****************************************************************************-->
|
||||||
|
|
||||||
|
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||||
|
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||||
|
<#assign extn="doc" extn1="odt" extn2="sxw">
|
||||||
|
<#assign extnx=extn+"x">
|
||||||
|
<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if>
|
||||||
|
<#-- resolve the path (from Company Home) into a node -->
|
||||||
|
<#if companyhome.childByNamePath[path]?exists>
|
||||||
|
<#assign d=companyhome.childByNamePath[path]>
|
||||||
|
<#else>
|
||||||
|
<#assign d=companyhome>
|
||||||
|
</#if>
|
||||||
|
<documentDetails>
|
||||||
|
<#if d.isDocument>
|
||||||
|
<img>${url.context}${d.icon32}</img>
|
||||||
|
<#if d.isLocked >
|
||||||
|
<locked>YES</locked>
|
||||||
|
</#if>
|
||||||
|
<name>${d.name}</name>
|
||||||
|
<#if d.properties.title?exists>
|
||||||
|
<title>${d.properties.title}</title>
|
||||||
|
<#else>
|
||||||
|
<title>""</title>
|
||||||
|
</#if>
|
||||||
|
<#if d.properties.description?exists>
|
||||||
|
<description>${d.properties.description}</description>
|
||||||
|
<#else>
|
||||||
|
<description>""</description>
|
||||||
|
</#if>
|
||||||
|
<creator>${d.properties.creator}</creator>
|
||||||
|
<created>${d.properties.created?datetime}</created>
|
||||||
|
<modifier>${d.properties.modifier}</modifier>
|
||||||
|
<modified>${d.properties.modified?datetime}</modified>
|
||||||
|
<size>${d.size / 1024} Kb</size>
|
||||||
|
|
||||||
|
<#if d.hasAspect("cm:generalclassifiable")>
|
||||||
|
<#list d.properties.categories as category>
|
||||||
|
<categories> ${companyhome.nodeByReference[category].name};</categories>
|
||||||
|
</#list>
|
||||||
|
<#else>
|
||||||
|
<categories>None.</categories>
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<nonAlfrescoDoc>The current document is not managed by Alfresco.</nonAlfrescoDoc>
|
||||||
|
</#if>
|
||||||
|
<versionHistory>
|
||||||
|
<#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>
|
||||||
|
<version>
|
||||||
|
<title>${record.versionLabel}</title>
|
||||||
|
<url>${url.context}${record.url}?ticket=${session.ticket}</url>
|
||||||
|
<author>${record.creator}</author>
|
||||||
|
<date>${record.createdDate?datetime}</date>
|
||||||
|
<#if record.description?exists>
|
||||||
|
<notes>${record.description}</notes>
|
||||||
|
</#if>
|
||||||
|
<#-- Only Word supports document compare -->
|
||||||
|
<#if extn = "doc">
|
||||||
|
<compareDocument>${record.url}</compareDocument>
|
||||||
|
</version>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
<#else>
|
||||||
|
<notVersioned>The current document is not versioned.</notVersioned>
|
||||||
|
<makeVersionURL>${doc_actions}?a=makeversion&n=${d.id}</makeVersionURL>
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<nonAlfresco>The current document is not managed by Alfresco.</nonAlfresco>
|
||||||
|
</#if>
|
||||||
|
</versionHistory>
|
||||||
|
<documentActions>
|
||||||
|
<#if d.isDocument>
|
||||||
|
<#if d.isLocked >
|
||||||
|
<#elseif hasAspect(d, "cm:workingcopy") == 1>
|
||||||
|
<checkin>${doc_actions}?a=checkin&n=${d.id}</checkin>
|
||||||
|
<#else>
|
||||||
|
<checkout>${doc_actions}?a=checkout&n=${d.id}</checkout>
|
||||||
|
</#if>
|
||||||
|
<workflow>${url.serviceContext}/office/docActions?a=workflow&n=${d.id}</workflow>
|
||||||
|
<#if d.name?ends_with(extn) || d.name?ends_with(extnx) || d.name?ends_with(extn1) || d.name?ends_with(extn2)>
|
||||||
|
<makePDF>${doc_actions}?a=makepdf&n=${d.id}</makePDF>
|
||||||
|
</#if>
|
||||||
|
<openFullDetails>${url.context}/navigate/showDocDetails/workspace/SpacesStore/${d.id}?ticket=${session.ticket}</openFullDetails>
|
||||||
|
<#else>
|
||||||
|
<save>Save to Alfresco</save>
|
||||||
|
</#if>
|
||||||
|
</documentActions>
|
||||||
|
</documentDetails>
|
@@ -0,0 +1,111 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--****************************************************************************
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. *
|
||||||
|
* *
|
||||||
|
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* The contents of this file are subject to the terms of either the GNU General*
|
||||||
|
* Public License Version 2 only ("GPL") or the Common Development and *
|
||||||
|
* Distribution License("CDDL") (collectively, the "License"). *
|
||||||
|
* You may not use this file except in compliance with the License. *
|
||||||
|
* You can obtain a copy of the License at AlfrescoAddon/licenses/license.txt. *
|
||||||
|
* See the License for the specific language governing permissions and *
|
||||||
|
* limitations under the License. When distributing the software, include this*
|
||||||
|
* License Header Notice in each file and include the License file at *
|
||||||
|
* AlfrescoAddon/licenses/license.txt. If applicable, add the following below *
|
||||||
|
* the License Header, with the fields enclosed by brackets [] replaced by your*
|
||||||
|
* own identifying information: *
|
||||||
|
* "Portions Copyrighted [year] [name of copyright owner]" *
|
||||||
|
* *
|
||||||
|
* Contributor(s): *
|
||||||
|
* If you wish your version of this file to be governed by only the CDDL or *
|
||||||
|
* only the GPL Version 2, indicate your decision by adding "[Contributor] *
|
||||||
|
* elects to include this software in this distribution under the *
|
||||||
|
* [CDDL or GPL Version 2] license." If you don't indicate a single choice of *
|
||||||
|
* license, a recipient has the option to distribute your version of this file *
|
||||||
|
* under either the CDDL, the GPL Version 2 or to extend the choice of *
|
||||||
|
* license to its licensees as provided above. However, if you add *
|
||||||
|
* GPL Version 2 code and therefore, elected the GPL Version 2 license, then *
|
||||||
|
* the option applies only if the new code is made subject to such option by *
|
||||||
|
* the copyright holder. *
|
||||||
|
****************************************************************************-->
|
||||||
|
|
||||||
|
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||||
|
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||||
|
<#if args.e?exists><#assign extn=args.e><#assign extn="doc" extn1="odt" extn2="sxw"></#if>
|
||||||
|
<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if>
|
||||||
|
<#-- resolve the path (from Company Home) into a node -->
|
||||||
|
<#if companyhome.childByNamePath[path]?exists>
|
||||||
|
<#assign d=companyhome.childByNamePath[path]>
|
||||||
|
<#else>
|
||||||
|
<#assign d=companyhome>
|
||||||
|
</#if>
|
||||||
|
<myAlfresco>
|
||||||
|
<title>My Alfresco</title>
|
||||||
|
<links>
|
||||||
|
<link title="Browse Spaces and Documents">${url.serviceContext}/office/navigation?p=${path?url}&e=${extn}&n=${nav}</link>
|
||||||
|
<link title="Search Alfresco">${url.serviceContext}/office/search?p=${path?url}&e=${extn}&n=${nav}</link>
|
||||||
|
<documentDetails>${url.serviceContext}/office/documentDetails?p=${path?url}&e=${extn}&n=${nav}</documentDetails>
|
||||||
|
<link title="My Tasks">${url.serviceContext}/office/myTasks?p=${path?url}&e=${extn}&n=${nav}</link>
|
||||||
|
</links>
|
||||||
|
<myDocs title="My Checked Out Documents">
|
||||||
|
<#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('\'', '\\\'') />
|
||||||
|
<saveDir>${child.displayPath?substring(companyhome.name?length+1) + '/'}</saveDir>
|
||||||
|
<document type="<#if child.name?ends_with(extn) || child.name?ends_with(extn1) || child.name?ends_with(extn2)>office<#else>general</#if>">
|
||||||
|
<icon>${url.context}${child.icon32}</icon>
|
||||||
|
<title>${child.name}</title>
|
||||||
|
<url>
|
||||||
|
<#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>
|
||||||
|
<#if child.properties.description?exists>
|
||||||
|
<#if (child.properties.description?length > 0)>
|
||||||
|
<description>${child.properties.description}</description>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</url>
|
||||||
|
<lastModified>${child.properties.modified?datetime}</lastModified>
|
||||||
|
<fileSize>${(child.size / 1024)?int}Kb</fileSize>
|
||||||
|
<checkin>${doc_actions}?a=checkin&n=${child.id}</checkin>
|
||||||
|
<workflow>${url.serviceContext}/office/docActions?a=workflow&n=${child.id}</workflow>
|
||||||
|
<insertDoc>${url.context}${child.url}?ticket=${session.ticket}</insertDoc>
|
||||||
|
<#if !child.name?ends_with(".pdf")>
|
||||||
|
<makePDF>${doc_actions}?a=makepdf&n=${child.id}</makePDF>
|
||||||
|
</#if>
|
||||||
|
</document>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
</myDocs>
|
||||||
|
<myTasks title="My Tasks">
|
||||||
|
<#list workflow.assignedTasks as t>
|
||||||
|
<task>
|
||||||
|
<#assign hasDue=t.properties["bpm:dueDate"]?exists>
|
||||||
|
<#if hasDue>
|
||||||
|
<#assign due=t.properties["bpm:dueDate"]>
|
||||||
|
</#if>
|
||||||
|
<#if hasDue>
|
||||||
|
<#-- items due today? -->
|
||||||
|
<#if (dateCompare(date?date, due?date, 0, "==") == 1)>
|
||||||
|
<dueToday/>
|
||||||
|
<#-- items overdue? -->
|
||||||
|
<#elseif (dateCompare(date?date, due?date) == 1)>
|
||||||
|
<overdue/>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
<id>${t.id}</id>
|
||||||
|
<url>${url.context}/service/office/myTasksDetail.xml?t=${t.id}&e=doc</url>
|
||||||
|
<description>${t.description!""?html}</description>
|
||||||
|
<type>${t.type?html}</type>
|
||||||
|
<#if hasDue>
|
||||||
|
<dueDate>${due?date}</dueDate>
|
||||||
|
</#if>
|
||||||
|
</task>
|
||||||
|
</#list>
|
||||||
|
</myTasks>
|
||||||
|
<launchAlfresco>${url.context}/navigate/browse?ticket=${session.ticket}</launchAlfresco>
|
||||||
|
</myAlfresco>
|
@@ -0,0 +1,94 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--****************************************************************************
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. *
|
||||||
|
* *
|
||||||
|
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* The contents of this file are subject to the terms of either the GNU General*
|
||||||
|
* Public License Version 2 only ("GPL") or the Common Development and *
|
||||||
|
* Distribution License("CDDL") (collectively, the "License"). *
|
||||||
|
* You may not use this file except in compliance with the License. *
|
||||||
|
* You can obtain a copy of the License at AlfrescoAddon/licenses/license.txt. *
|
||||||
|
* See the License for the specific language governing permissions and *
|
||||||
|
* limitations under the License. When distributing the software, include this*
|
||||||
|
* License Header Notice in each file and include the License file at *
|
||||||
|
* AlfrescoAddon/licenses/license.txt. If applicable, add the following below *
|
||||||
|
* the License Header, with the fields enclosed by brackets [] replaced by your*
|
||||||
|
* own identifying information: *
|
||||||
|
* "Portions Copyrighted [year] [name of copyright owner]" *
|
||||||
|
* *
|
||||||
|
* Contributor(s): *
|
||||||
|
* If you wish your version of this file to be governed by only the CDDL or *
|
||||||
|
* only the GPL Version 2, indicate your decision by adding "[Contributor] *
|
||||||
|
* elects to include this software in this distribution under the *
|
||||||
|
* [CDDL or GPL Version 2] license." If you don't indicate a single choice of *
|
||||||
|
* license, a recipient has the option to distribute your version of this file *
|
||||||
|
* under either the CDDL, the GPL Version 2 or to extend the choice of *
|
||||||
|
* license to its licensees as provided above. However, if you add *
|
||||||
|
* GPL Version 2 code and therefore, elected the GPL Version 2 license, then *
|
||||||
|
* the option applies only if the new code is made subject to such option by *
|
||||||
|
* the copyright holder. *
|
||||||
|
****************************************************************************-->
|
||||||
|
|
||||||
|
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||||
|
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||||
|
<#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if>
|
||||||
|
<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if>
|
||||||
|
<#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>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
<myTasks>
|
||||||
|
<title>My Tasks</title>
|
||||||
|
<fileExtn>${extn}</fileExtn>
|
||||||
|
<myTasks title="My Tasks">
|
||||||
|
<task>
|
||||||
|
<#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>
|
||||||
|
<#if hasDue>${due?date?string("yyyyMMddHHmmss")}<#else>99999999999999</#if>">
|
||||||
|
</hasDue>
|
||||||
|
<#if hasDue>
|
||||||
|
<#-- items due today? -->
|
||||||
|
<#if (dateCompare(date?date, due?date, 0, "==") == 1)>
|
||||||
|
<img src="${url.context}/images/office/task_today.gif" alt="due today" />
|
||||||
|
<#-- items overdue? -->
|
||||||
|
<#elseif (dateCompare(date?date, due?date) == 1)>
|
||||||
|
<img src="${url.context}/images/office/task_overdue.gif" alt="overdue" />
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
<taskItemDetails>
|
||||||
|
${t.description?html} (${t.type?html})
|
||||||
|
</taskItemDetails>
|
||||||
|
<#if hasDue>
|
||||||
|
<dueDate> ${due?date}
|
||||||
|
<#else>
|
||||||
|
(No due date)
|
||||||
|
</#if>
|
||||||
|
</dueDate>
|
||||||
|
</#list>
|
||||||
|
<#if taskNum = 0>
|
||||||
|
<noItems>(No tasks)</noItems>
|
||||||
|
</#if>
|
||||||
|
</task>
|
||||||
|
<workflow>
|
||||||
|
<#if args.w?exists && d.isDocument>
|
||||||
|
<taskDetails>
|
||||||
|
<taskAction>${url.serviceContext}/office/docActions, ${d.id}</taskAction>
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
</myTasks>
|
@@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--****************************************************************************
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. *
|
||||||
|
* *
|
||||||
|
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* The contents of this file are subject to the terms of either the GNU General*
|
||||||
|
* Public License Version 2 only ("GPL") or the Common Development and *
|
||||||
|
* Distribution License("CDDL") (collectively, the "License"). *
|
||||||
|
* You may not use this file except in compliance with the License. *
|
||||||
|
* You can obtain a copy of the License at AlfrescoAddon/licenses/license.txt. *
|
||||||
|
* See the License for the specific language governing permissions and *
|
||||||
|
* limitations under the License. When distributing the software, include this*
|
||||||
|
* License Header Notice in each file and include the License file at *
|
||||||
|
* AlfrescoAddon/licenses/license.txt. If applicable, add the following below *
|
||||||
|
* the License Header, with the fields enclosed by brackets [] replaced by your*
|
||||||
|
* own identifying information: *
|
||||||
|
* "Portions Copyrighted [year] [name of copyright owner]" *
|
||||||
|
* *
|
||||||
|
* Contributor(s): *
|
||||||
|
* If you wish your version of this file to be governed by only the CDDL or *
|
||||||
|
* only the GPL Version 2, indicate your decision by adding "[Contributor] *
|
||||||
|
* elects to include this software in this distribution under the *
|
||||||
|
* [CDDL or GPL Version 2] license." If you don't indicate a single choice of *
|
||||||
|
* license, a recipient has the option to distribute your version of this file *
|
||||||
|
* under either the CDDL, the GPL Version 2 or to extend the choice of *
|
||||||
|
* license to its licensees as provided above. However, if you add *
|
||||||
|
* GPL Version 2 code and therefore, elected the GPL Version 2 license, then *
|
||||||
|
* the option applies only if the new code is made subject to such option by *
|
||||||
|
* the copyright holder. *
|
||||||
|
****************************************************************************-->
|
||||||
|
|
||||||
|
<#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if>
|
||||||
|
<#if args.t?exists>
|
||||||
|
<#assign taskid = args.t>
|
||||||
|
<#if taskid != "">
|
||||||
|
<#assign task = workflow.getTaskById(taskid)>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
<taskDetails>
|
||||||
|
<#if task?exists>
|
||||||
|
<description>${task.description?html}</description>
|
||||||
|
<status>${task.properties["bpm:status"]}</status>
|
||||||
|
<priority>${task.properties["bpm:priority"]}</priority>
|
||||||
|
<startDate>${task.startDate?date}</startDate>
|
||||||
|
<type>${task.type?html}</type>
|
||||||
|
<complete>${task.properties["bpm:percentComplete"]}%</complete>
|
||||||
|
<label>${task.name?html}:</label>
|
||||||
|
<#list task.packageResources as res>
|
||||||
|
|
||||||
|
<url>${url.context}${res.url}?ticket=${session.ticket}</url>
|
||||||
|
<resName>${res.name}</resName>
|
||||||
|
</#list>
|
||||||
|
<#list task.transitions as wt>
|
||||||
|
<taskAction>${url.context}/command/task/end/${task.id}<#if wt.id?exists>/${wt.id}</#if></taskAction>
|
||||||
|
</#list>
|
||||||
|
<taskManage>${url.context}/command/ui/managetask?id=${task.id}&type=${task.qnameType}&container=plain&ticket=${session.ticket}</taskManage>
|
||||||
|
</#if>
|
||||||
|
</taskDetails>
|
@@ -0,0 +1,138 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--****************************************************************************
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. *
|
||||||
|
* *
|
||||||
|
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* The contents of this file are subject to the terms of either the GNU General*
|
||||||
|
* Public License Version 2 only ("GPL") or the Common Development and *
|
||||||
|
* Distribution License("CDDL") (collectively, the "License"). *
|
||||||
|
* You may not use this file except in compliance with the License. *
|
||||||
|
* You can obtain a copy of the License at AlfrescoAddon/licenses/license.txt. *
|
||||||
|
* See the License for the specific language governing permissions and *
|
||||||
|
* limitations under the License. When distributing the software, include this*
|
||||||
|
* License Header Notice in each file and include the License file at *
|
||||||
|
* AlfrescoAddon/licenses/license.txt. If applicable, add the following below *
|
||||||
|
* the License Header, with the fields enclosed by brackets [] replaced by your*
|
||||||
|
* own identifying information: *
|
||||||
|
* "Portions Copyrighted [year] [name of copyright owner]" *
|
||||||
|
* *
|
||||||
|
* Contributor(s): *
|
||||||
|
* If you wish your version of this file to be governed by only the CDDL or *
|
||||||
|
* only the GPL Version 2, indicate your decision by adding "[Contributor] *
|
||||||
|
* elects to include this software in this distribution under the *
|
||||||
|
* [CDDL or GPL Version 2] license." If you don't indicate a single choice of *
|
||||||
|
* license, a recipient has the option to distribute your version of this file *
|
||||||
|
* under either the CDDL, the GPL Version 2 or to extend the choice of *
|
||||||
|
* license to its licensees as provided above. However, if you add *
|
||||||
|
* GPL Version 2 code and therefore, elected the GPL Version 2 license, then *
|
||||||
|
* the option applies only if the new code is made subject to such option by *
|
||||||
|
* the copyright holder. *
|
||||||
|
****************************************************************************-->
|
||||||
|
|
||||||
|
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||||
|
<#if args.e?exists><#assign extn=args.e>
|
||||||
|
<#else>
|
||||||
|
</#if>
|
||||||
|
<#assign extn="doc" extn1="odt" extn2="sxw">
|
||||||
|
<#assign extnx=extn+"x">
|
||||||
|
<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if>
|
||||||
|
<#assign chLen=companyhome.name?length>
|
||||||
|
<#if node.isDocument>
|
||||||
|
<#assign thisSpace = node.parent>
|
||||||
|
<#else>
|
||||||
|
<#assign thisSpace = node>
|
||||||
|
</#if>
|
||||||
|
<navigation>
|
||||||
|
<webdavSpace>${thisSpace.displayPath}/${thisSpace.name}/</webdavSpace>
|
||||||
|
<space>${thisSpace.name}</space>
|
||||||
|
<id>${thisSpace.id}</id>
|
||||||
|
<descr><#if thisSpace.properties.description?exists>${thisSpace.properties.description}</#if></descr>
|
||||||
|
<#if thisSpace=companyhome>
|
||||||
|
<#else>
|
||||||
|
<up>${url.serviceContext}/office/navigation.xml?p=${path?url}&n=${thisSpace.parent.id}</up>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<lblSpaces>Spaces in ${thisSpace.name}</lblSpaces>
|
||||||
|
<lblCreate>Create New <#if args.cc?exists>Collaboration </#if>Space...</lblCreate>
|
||||||
|
<#assign xpath="app:dictionary/app:space_templates/*">
|
||||||
|
<#assign templates = companyhome.childrenByXPath[xpath]>
|
||||||
|
<#if (templates?size > 0)>
|
||||||
|
<#list templates as template>
|
||||||
|
<template>
|
||||||
|
<name>${template.name}</name>
|
||||||
|
<value>${template.id}</value>
|
||||||
|
</template>
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
<#assign spacesFound = 0>
|
||||||
|
<childSpaces>
|
||||||
|
<#list thisSpace.children?sort_by('name') as child>
|
||||||
|
<#if child.isContainer>
|
||||||
|
<childSpace>
|
||||||
|
<#assign spacesFound = spacesFound + 1>
|
||||||
|
<name>${child.name}</name>
|
||||||
|
<url>${url.serviceContext}/office/navigation.xml?p=${path?url}&n=${child.id}</url>
|
||||||
|
|
||||||
|
<#if child.properties.description?exists>
|
||||||
|
<descr>${child.properties.description}</descr>
|
||||||
|
</#if>
|
||||||
|
</childSpace>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
</childSpaces>
|
||||||
|
<#if spacesFound = 0>
|
||||||
|
<noItems>(No subspaces)</noItems>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<docsLabel>Documents in ${thisSpace.name}</docsLabel>
|
||||||
|
<documents>
|
||||||
|
<#assign documentsFound = 0>
|
||||||
|
<#list thisSpace.children?sort_by('name') as child>
|
||||||
|
<document>
|
||||||
|
<#if child.isDocument>
|
||||||
|
<#assign documentsFound = documentsFound + 1>
|
||||||
|
<title>${child.name}</title>
|
||||||
|
<#assign relativePath = (child.displayPath?substring(chLen+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') />
|
||||||
|
<url>
|
||||||
|
<#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></url>
|
||||||
|
<#if child.properties.description?exists>
|
||||||
|
<#if (child.properties.description?length > 0)>
|
||||||
|
<descr>${child.properties.description}</descr>
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<descr>None.</descr>
|
||||||
|
</#if>
|
||||||
|
<lastModified>${child.properties.modified?datetime}</lastModified>
|
||||||
|
<fileSize>${(child.size / 1024)?int}Kb</fileSize>
|
||||||
|
<#if child.isLocked >
|
||||||
|
<locked>YES</locked>
|
||||||
|
<#elseif hasAspect(child, "cm:workingcopy") == 1>
|
||||||
|
<checkin>${doc_actions}?a=checkin&n=${child.id}</checkin>
|
||||||
|
<#else>
|
||||||
|
<checkout>${doc_actions}?a=checkout&n=${child.id}</checkout>
|
||||||
|
</#if>
|
||||||
|
<workflow>${url.serviceContext}/office/docActions?a=workflow&n=${child.id}</workflow>
|
||||||
|
|
||||||
|
<insertDoc>${url.context}${child.url}?ticket=${session.ticket}</insertDoc>
|
||||||
|
<#if !child.name?ends_with(".pdf")>
|
||||||
|
<makePDF>${doc_actions}?a=makepdf&n=${child.id}</makePDF>
|
||||||
|
</#if>
|
||||||
|
<#if !child.isLocked>
|
||||||
|
<delete>${doc_actions}?a=delete&n=${child.id}</delete>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</document>
|
||||||
|
</#list>
|
||||||
|
</documents>
|
||||||
|
<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name />
|
||||||
|
<#assign currentPath = currentPath?substring(chLen+1)?url?replace('%2F', '/')?replace('\'', '\\\'') />
|
||||||
|
<currentPath>${currentPath}</currentPath>
|
||||||
|
<#if documentsFound = 0>
|
||||||
|
<noDocs>YES</noDocs>
|
||||||
|
</#if>
|
||||||
|
</navigation>
|
@@ -0,0 +1,91 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--****************************************************************************
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. *
|
||||||
|
* *
|
||||||
|
* Copyright 2007 Sun Microsystems, Inc. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* The contents of this file are subject to the terms of either the GNU General*
|
||||||
|
* Public License Version 2 only ("GPL") or the Common Development and *
|
||||||
|
* Distribution License("CDDL") (collectively, the "License"). *
|
||||||
|
* You may not use this file except in compliance with the License. *
|
||||||
|
* You can obtain a copy of the License at AlfrescoAddon/licenses/license.txt. *
|
||||||
|
* See the License for the specific language governing permissions and *
|
||||||
|
* limitations under the License. When distributing the software, include this*
|
||||||
|
* License Header Notice in each file and include the License file at *
|
||||||
|
* AlfrescoAddon/licenses/license.txt. If applicable, add the following below *
|
||||||
|
* the License Header, with the fields enclosed by brackets [] replaced by your*
|
||||||
|
* own identifying information: *
|
||||||
|
* "Portions Copyrighted [year] [name of copyright owner]" *
|
||||||
|
* *
|
||||||
|
* Contributor(s): *
|
||||||
|
* If you wish your version of this file to be governed by only the CDDL or *
|
||||||
|
* only the GPL Version 2, indicate your decision by adding "[Contributor] *
|
||||||
|
* elects to include this software in this distribution under the *
|
||||||
|
* [CDDL or GPL Version 2] license." If you don't indicate a single choice of *
|
||||||
|
* license, a recipient has the option to distribute your version of this file *
|
||||||
|
* under either the CDDL, the GPL Version 2 or to extend the choice of *
|
||||||
|
* license to its licensees as provided above. However, if you add *
|
||||||
|
* GPL Version 2 code and therefore, elected the GPL Version 2 license, then *
|
||||||
|
* the option applies only if the new code is made subject to such option by *
|
||||||
|
* the copyright holder. *
|
||||||
|
****************************************************************************-->
|
||||||
|
|
||||||
|
<#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}*" -->
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<#assign searchString = "">
|
||||||
|
<#assign queryString = "">
|
||||||
|
</#if>
|
||||||
|
<searchResults>
|
||||||
|
<#if searchString != "">
|
||||||
|
<#if args.maxresults?exists>
|
||||||
|
<#assign maxresults=args.maxresults?number>
|
||||||
|
<#else>
|
||||||
|
<#assign maxresults=10>
|
||||||
|
</#if>
|
||||||
|
<#assign resCount=0>
|
||||||
|
<#assign totalResults=0>
|
||||||
|
<#assign results = companyhome.childrenByLuceneSearch[queryString] >
|
||||||
|
<#if results?size = 0>
|
||||||
|
<noItems>
|
||||||
|
(No results found)
|
||||||
|
</noItems>
|
||||||
|
<#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}">
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
<result>
|
||||||
|
<name>${child.name}</name>
|
||||||
|
<url>${openURL}</url>
|
||||||
|
|
||||||
|
<#if child.properties.description?exists>
|
||||||
|
<#if (child.properties.description?length > 0)>
|
||||||
|
<details> ${child.properties.description}</details>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
<#if child.isDocument>
|
||||||
|
<modified>${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)</modified>
|
||||||
|
</#if>
|
||||||
|
</result>
|
||||||
|
</#if>
|
||||||
|
<#if resCount = maxresults>
|
||||||
|
<#break>
|
||||||
|
</#if>
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
</searchResults>
|
Reference in New Issue
Block a user