diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.html.ftl new file mode 100644 index 0000000000..6d48b83dcf --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.html.ftl @@ -0,0 +1,4 @@ +{ + "statusString":"${resultString}", + "statusCode":${resultCode?string} +} \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js index 5eabe57c59..faec54c1ca 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js +++ b/config/alfresco/templates/webscripts/org/alfresco/office/docActions.get.js @@ -1,40 +1,79 @@ -// Generate a PDF transform of the current object +// Client has requested certain actions on the current document -if (document.isDocument) +/* Inputs */ +var docId = args["d"], + runAction = args["a"]; + +/* Outputs */ +var resultString = "Action failed.", + resultCode = false; + +var doc = search.findNode("workspace://SpacesStore/" + docId); + +if (doc != null && doc.isDocument) { - var runAction = args['action']; - var result = "Action failed."; - - if (runAction == "makepdf") + try { - var trans = document.transformDocument("application/pdf"); - result = "Action completed."; + if (runAction == "makepdf") + { + resultString = "Could not convert document"; + var nodeTrans = doc.transformDocument("application/pdf"); + if (nodeTrans != null) + { + resultString = "Document converted"; + resultCode = true; + } + } + else if (runAction == "delete") + { + resultString = "Could not delete document"; + if (doc.remove()) + { + resultString = "Document deleted"; + resultCode = true; + } + } + else if (runAction == "checkout") + { + var workingCopy = doc.checkout(); + if (workingCopy != null) + { + resultString = "Document checked out"; + resultCode = true; + } + } + else if (runAction == "checkin") + { + var originalDoc = doc.checkin(); + if (originalDoc != null) + { + resultString = "Document checked in"; + resultCode = true; + } + } + else if (runAction == "makeversion") + { + resultString = "Could not version document"; + if (doc.addAspect("cm:versionable")) + { + resultString = "Document versioned"; + resultCode = true; + } + } + else if (runAction == "test") + { + resultString = "Test complete."; + resultCode = true; + } + else + { + resultString = "Unknown action."; + } } - else if (runAction == "delete") + catch(e) { - var rc = document.remove(); - result = "Action completed."; + resultString = "Action failed due to exception"; } - else if (runAction == "checkout") - { - var wc = null; - wc = document.checkout(); - result = "Action completed."; - } - else if (runAction == "checkin") - { - var wc = document.checkin(); - result = "Action completed."; - } - else if (runAction == "makeversion") - { - var wc = document.addAspect("cm:versionable"); - result = "Action completed."; - } - else - { - result = "Unknown action."; - } - - result; -} \ No newline at end of file +} +model.resultString = resultString; +model.resultCode = resultCode; \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl index b264df59c3..09bc4a09fa 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.html.ftl @@ -1,8 +1,10 @@ -<#assign doc_actions="${url.context}/scripts/office/docActions.js"> +<#assign doc_actions="${url.context}/service/office/docActions"> <#if args.p?exists><#assign path=args.p><#else><#assign path=""> <#-- resolve the path (from Company Home) into a node --> <#if path?starts_with("/Company Home")> - <#if companyhome.childByNamePath[args.p[14..]]?exists> + <#if path?length=13> + <#assign d=companyhome> + <#elseif companyhome.childByNamePath[args.p[14..]]?exists> <#assign d=companyhome.childByNamePath[args.p[14..]]> <#else> <#assign d=companyhome> @@ -10,32 +12,29 @@ <#else> <#assign d=companyhome> - - - - Document Details - - + + +
-
Details
+
Current Document Details
-
+
@@ -43,22 +42,23 @@ <#if d.isDocument> ${d.name} - -
- ${d.name} + + ${d.name} <#if d.isLocked > - Locked + Locked -
- + +
+
<#if d.properties.title?exists> <#else> - + <#if d.properties.description?exists> - + <#else> - + @@ -69,44 +69,98 @@
Title:${d.properties.title}
Title:
Title: 
Description:${d.properties.description}
Description:${d.properties.description}
Description:
Description: 
Creator:${d.properties.creator}
Created:${d.properties.created?datetime}
<#if d.hasAspect("cm:generalclassifiable")> <#list d.properties.categories as category> - ${companyhome.nodeByReference[category].name}; + ${companyhome.nodeByReference[category].name}; <#else> - None. + None.
<#else> - The current document is not managed by Alfresco. + The current document is not managed by Alfresco.
-
-Document Actions
+
Version History <#if d.isDocument> - - -<#else> - No actions available. + for ${d.name}
-
  +
+ +<#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> + + + + + + <#else> + + + + +<#else> + + + + +
+ Open ${record.versionLabel} + + ${record.versionLabel}
+ Author: ${record.creator}
+ Date: ${record.createdDate?datetime}
+ <#if record.description?exists> + Notes: ${record.description}
+ + +
+ The current document is not versioned.
+
+ +
+ The current document is not managed by Alfresco. +
+
+ +
Document Actions
+ +
+
+<#if d.isDocument> + + +<#else> + No actions available. + +
+ +
+
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/documentDetails.get.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl index e1490eb018..85630a2065 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl @@ -1,92 +1,112 @@ - +<#assign doc_actions="${url.context}/service/office/docActions"> +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> +<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome> +<#-- resolve the path (from Company Home) into a node --> +<#if path?starts_with("/Company Home")> + <#if path?length=13> + <#assign d=companyhome> + <#elseif companyhome.childByNamePath[args.p[14..]]?exists> + <#assign d=companyhome.childByNamePath[args.p[14..]]> + <#else> + <#assign d=companyhome> + +<#else> + <#assign d=companyhome> + + My Alfresco - - + + +
    -
  • My Alfresco
  • -
  • Browse Spaces and Documents
  • -
  • Search Alfresco
  • -
  • View Details
  • -
  • View Version History
  • +
  • My Alfresco
  • +
  • Browse Spaces and Documents
  • +
  • Search Alfresco
  • +
  • View Details
  • +
  • My Tasks
-
My checked out documents
+
My Checked Out Documents
-
- - +
+
+<#assign rowNum=0> <#assign query="@cm\\:workingCopyOwner:${person.properties.userName}"> <#list companyhome.childrenByLuceneSearch[query] as child> <#if child.isDocument> - - - - - - + <#assign rowNum=rowNum+1> + + + + - - -
- Open ${child.name} - - ${child.name}
-<#if child.properties.description?exists> - ${child.properties.description}
- - Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb
- Check In -Make PDF... -
+ ${child.name} + + ${child.name}
+ <#if child.properties.description?exists> + ${child.properties.description}
+ + Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)
+ Check In + Make PDF... +
-
-
My Communities +
-
- - -<#list companyhome.childrenByXPath["*[@cm:name='Communities']/*"] as child> - - - - - - +
My Tasksoverdue=overdue, due today=due today
+ +
+
- Open ${child.name} - - ${child.name}
-<#if child.properties.description?exists> - ${child.properties.description} - -
+<#assign taskNum=0> +<#list workflow.assignedTasks?sort_by('startDate') as t> + <#assign taskNum=taskNum+1> + + + + -
+ <#assign hasDue=t.properties["bpm:dueDate"]?exists> + <#if hasDue> + <#assign due=t.properties["bpm:dueDate"]> + <#-- items due today? --> + <#if (dateCompare(date?date, due?date, 0, "==") == 1)> + + <#-- items overdue? --> + <#elseif (dateCompare(date?date, due?date) == 1)> + + + <#else> +   + + + ${t.description?html} (${t.type?html}) + <#if hasDue> +
Due date: ${due?date} + +
+
+
Other Actions
+
-Other Actions
-
- -
-
- -
  +
+
\ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.desc.xml new file mode 100644 index 0000000000..b1ae5ea0e5 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.desc.xml @@ -0,0 +1,7 @@ + + My Tasks (Office Add-In) + Generate the Office Add-In My Tasks page + + user + required + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.html.ftl new file mode 100644 index 0000000000..cca4ae7ca3 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.html.ftl @@ -0,0 +1,73 @@ +<#assign doc_actions="${url.context}/service/office/docActions"> +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> +<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome> + + + + My Tasks + + + + + + + +
+
    +
  • My Alfresco
  • +
  • Browse Spaces and Documents
  • +
  • Search Alfresco
  • +
  • View Details
  • +
  • My Tasks
  • +
+
+ +
My Tasksoverdue=overdue, due today=due today
+ +
+ +<#assign taskNum=0> +<#list workflow.assignedTasks?sort_by('startDate') as t> + <#assign taskNum=taskNum+1> + + + + + +
+ <#assign hasDue=t.properties["bpm:dueDate"]?exists> + <#if hasDue> + <#assign due=t.properties["bpm:dueDate"]> + <#-- items due today? --> + <#if (dateCompare(date?date, due?date, 0, "==") == 1)> + + <#-- items overdue? --> + <#elseif (dateCompare(date?date, due?date) == 1)> + + + <#else> +   + + + ${t.description?html} (${t.type?html}) + <#if hasDue> +
Due date: ${due?date} + <#else> +
(No due date) + +
+
+ +
Workflow
+ +
+
+
+
+ +
+ +
+ + + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.desc.xml new file mode 100644 index 0000000000..709eb59b4f --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.desc.xml @@ -0,0 +1,7 @@ + + My Tasks Detail (Office Add-In) + Generate the Office Add-In Task Detail page + + user + required + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.html.ftl new file mode 100644 index 0000000000..50ba6824c9 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.html.ftl @@ -0,0 +1,70 @@ +<#if args.t?exists> + <#assign taskid = args.t> + <#if taskid != ""> + <#assign task = workflow.getTaskById(taskid)> + + + +<#if task?exists> + + + + + +
Task item + ${task.description?html} +
+ + + + + + + + + + + + + + + + + + + + + +
Status:${task.properties["bpm:status"]}
Priority:${task.properties["bpm:priority"]}
Start Date:${task.startDate?date}
Type:${task.type?html}
Complete:${task.properties["bpm:percentComplete"]}%
+
+ +
${task.name?html}:
+
+ + <#list task.packageResources as res> + + + + + +
${res.name} + <#if res.isDocument> + ${res.name} + <#else> + ${res.name} + +
+
+ +
+ + + <#list task.transitions as wt> + + + +
+ ${wt.label?html} +
+
+ diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl index 10bc53e85f..c8f942b5a0 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.html.ftl @@ -1,161 +1,154 @@ - -<#list template.parent.children as child> - <#if child.name = "my_alfresco.ftl"><#assign office_home = child.id> - <#elseif child.name = "navigation.ftl"><#assign office_browse = child.id> - <#elseif child.name = "search.ftl"><#assign office_search = child.id> - <#elseif child.name = "document_details.ftl"><#assign office_details = child.id> - <#elseif child.name = "version_history.ftl"><#assign office_history = child.id> - <#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id> - <#elseif child.name = "navigation.js"><#assign nav_script = child> - - -<#if document.isDocument> - <#assign thisSpace = document.parent> +<#assign doc_actions="${url.context}/service/office/docActions"> +<#if node.isDocument> + <#assign thisSpace = node.parent> <#else> - <#assign thisSpace = document> + <#assign thisSpace = node> + -Basic Navigation - - - - - + Browse Spaces and Documents + + +
-
    -
  • My Alfresco
  • -
  • Browse Spaces and Documents
  • -
  • Search Alfresco
  • -
  • View Details
  • -
  • View Version History
  • -
-
- +
    +
  • My Alfresco
  • +
  • Browse Spaces and Documents
  • +
  • Search Alfresco
  • +
  • View Details
  • +
  • My Tasks
  • +
+
- - - - - - - + +
- In: - - ${thisSpace.name} -
+ + + + + - + - -
In:${thisSpace.name} + ${thisSpace.name} <#if thisSpace.properties.description?exists> - ${thisSpace.properties.description} +
${thisSpace.properties.description} -
-      -<#if thisSpace = companyhome> + +<#if thisSpace=companyhome> <#else> -go up to parent spaceUp + + Up to Parent Space + Up + -
+
-
Spaces in ${thisSpace.name}
+
Spaces in ${thisSpace.name}
-
- - +
+
+<#assign spacesFound = 0> <#list thisSpace.children as child> <#if child.isContainer> - - - - - + <#assign spacesFound = spacesFound + 1> + + + + - - -
- Open ${child.name} - - ${child.name}
-<#if child.properties.description?exists> - ${child.properties.description} - -
+ Open ${child.name} + + + ${child.name} + + <#if child.properties.description?exists> +
${child.properties.description} + +
+<#if spacesFound = 0> + + (No subspaces) + + +
-
Documents in ${thisSpace.name} -
+
Documents in ${thisSpace.name}
-
- - +
+
+<#assign documentsFound = 0> <#list thisSpace.children as child> <#if child.isDocument> - -<#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') /> - - - - - + <#assign documentsFound = documentsFound + 1> + <#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') /> + + + + - -
-<#if child.name?ends_with(".doc")> - Open ${child.name} -<#else> - Open ${child.name} - - -<#if child.name?ends_with(".doc")> - ${child.name}
-<#else> - ${child.name}
- -<#if child.properties.description?exists> - ${child.properties.description}
- - Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb
-<#if child.isLocked > - Locked -<#elseif hasAspect(child, "cm:workingcopy") == 1> - Check In -<#else> - Check Out - -Make PDF... -<#if !child.isLocked > -Delete... - -
+ <#if child.name?ends_with(".doc")> + Open ${child.name} + <#else> + Open ${child.name} + + + <#if child.name?ends_with(".doc")> + + ${child.name} +
+ <#else> + + ${child.name} +
+ + <#if child.properties.description?exists> + ${child.properties.description}
+ + Modified: ${child.properties.modified?datetime}, Size: ${(child.size / 1024)?int}Kb
+ <#if child.isLocked > + Locked + <#elseif hasAspect(child, "cm:workingcopy") == 1> + Check In + <#else> + Check Out + + Make PDF... + <#if !child.isLocked > + Delete... + +
+<#if documentsFound = 0> + + (No documents) + + +
-
-Document Actions
- +
+ +
-
  -
- - \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.js new file mode 100644 index 0000000000..9e0cbf99dd --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/navigation.get.js @@ -0,0 +1,10 @@ + +if ((args.n) && (args.n != "")) +{ + model.node = search.findNode("workspace://SpacesStore/" + args.n); +} +else +{ + model.node = companyhome; +} +model.path = args.p; diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl index d79c5b3d08..a415bef94a 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl @@ -1,150 +1,62 @@ -<#list template.parent.children as child> - <#if child.name = "my_alfresco.ftl"><#assign office_home = child.id> - <#elseif child.name = "navigation.ftl"><#assign office_browse = child.id> - <#elseif child.name = "search.ftl"><#assign office_search = child.id> - <#elseif child.name = "document_details.ftl"><#assign office_details = child.id> - <#elseif child.name = "version_history.ftl"><#assign office_history = child.id> - <#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id> - <#elseif child.name = "search.js"><#assign srch_script = child> - - - -<#if args.search?exists> - <#assign searchString = args.search> - <#if searchString != ""> - <#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}"> - -<#else> - <#assign searchString = ""> - <#assign queryString = ""> - - -<#if searchString != ""> - <#if args.maxresults?exists> - <#assign maxresults=args.maxresults?number> - <#else> - <#assign maxresults=10> - - - <#assign rescount=1> - - - - - - <#assign results = companyhome.childrenByLuceneSearch[queryString] > - <#if results?size = 0> - - <#else> - <#list results as child> - - <#if child.isDocument> - <#if child.name?ends_with(".pdf")> - <#assign openURL = "/alfresco${child.url}"> - <#assign hrefExtra = " target=\"_blank\""> - <#else> - <#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') /> - <#assign openURL = "#"> - <#assign hrefExtra = " onClick=\"window.external.openDocument('${webdavPath}')\""> - - <#else> - <#assign openURL = "/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${office_browse}?search=${searchString}&maxresults=${maxresults}"> - <#assign hrefExtra = ""> - - - - - - - <#if rescount = maxresults> - <#break> - - <#assign rescount=rescount + 1> - - - -
No results found.
- Open ${child.name} - - ${child.name}
- <#if child.properties.description?exists> - ${child.properties.description}
- - <#if child.isDocument> - Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb
- -
- - - - - - -<#if !args.search?exists> - - +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> +<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome> +<#assign searchCommand="OfficeAddin.runSearch('${url.context}/service/office/searchResults', '${path}')" > +<#if (args.searchagain?exists)><#assign searchText=args.searchagain><#else><#assign searchText=""> +<#if (args.maxresults?exists)><#assign maxResults=args.maxresults><#else><#assign maxResults="5"> + -Search - - - - - + Browse Spaces and Documents + + + - <#if args.searchagain?exists> - <#assign onLoad = "onLoad = \"doSearch('${args.searchagain}', '${args.maxresults}');\""> - <#else> - <#assign onLoad = ""> - - - - +
- +
+
Search
+ - -
Items Found
- -
- - - +
+ + +
+ Search for + +
+
+ Return a maximum of  items +
+
-
  +
Items Found
+ +
+
+
+<#if (args.searchagain?exists)> + + - - \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.js b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.desc.xml new file mode 100644 index 0000000000..932e5fc90f --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.desc.xml @@ -0,0 +1,7 @@ + + Search Results (Office Add-In) + Generate the Office Add-In Search Results page + + user + required + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.html.ftl new file mode 100644 index 0000000000..0be509c55b --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.html.ftl @@ -0,0 +1,62 @@ +<#if args.search?exists> + <#assign searchString = args.search> + <#if searchString != ""> + <#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}"> + +<#else> + <#assign searchString = ""> + <#assign queryString = ""> + + +<#if searchString != ""> + <#if args.maxresults?exists> + <#assign maxresults=args.maxresults?number> + <#else> + <#assign maxresults=10> + + + <#assign rescount=1> + + + <#assign results = companyhome.childrenByLuceneSearch[queryString] > + <#if results?size = 0> + + + + <#else> + <#list results as child> + <#if child.isDocument> + <#if child.name?ends_with(".pdf")> + <#assign openURL = "${url.context}${child.url}"> + <#assign hrefExtra = " target=\"_blank\""> + <#else> + <#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') /> + <#assign openURL = "#"> + <#assign hrefExtra = " onClick=\"window.external.openDocument('${webdavPath}')\""> + + <#else> + <#assign openURL = "${url.context}/service/office/navigation?p=${args.p}&n=${child.id}&search=${searchString}&maxresults=${maxresults}"> + <#assign hrefExtra = ""> + + + + + + <#if rescount = maxresults> + <#break> + + <#assign rescount=rescount + 1> + + +
(No results found)
+ Open ${child.name} + + ${child.name}
+ <#if child.properties.description?exists> + ${child.properties.description}
+ + <#if child.isDocument> + Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)
+ +
+ diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory.get.desc.xml deleted file mode 100644 index 469b35e9da..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory.get.desc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - Version History (Office Add-In) - Generate the Office Add-In Version History page - - user - required - \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory.get.html.ftl deleted file mode 100644 index 084c8eab1c..0000000000 --- a/config/alfresco/templates/webscripts/org/alfresco/office/versionHistory.get.html.ftl +++ /dev/null @@ -1,88 +0,0 @@ -<#list template.parent.children as child> - <#if child.name = "my_alfresco.ftl"><#assign office_home = child.id> - <#elseif child.name = "navigation.ftl"><#assign office_browse = child.id> - <#elseif child.name = "search.ftl"><#assign office_search = child.id> - <#elseif child.name = "document_details.ftl"><#assign office_details = child.id> - <#elseif child.name = "version_history.ftl"><#assign office_history = child.id> - <#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id> - <#elseif child.name = "version.js"><#assign ver_script = child> - - - - - -Version History - - - - - - - - - - -
-
    -
  • My Alfresco
  • -
  • Browse Spaces and Documents
  • -
  • Search Alfresco
  • -
  • View Details
  • -
  • View Version History
  • -
-
- -
Version History for ${document.name}
- -
- - -<#if document.isDocument > - <#if hasAspect(document, "cm:versionable") == 1 > - - <#list document.versionHistory?sort_by("versionLabel")?reverse as record> - - - - - - <#else> - - - - - -<#else> - - - - - -
- Open ${record.versionLabel} - - ${record.versionLabel}
- Author: ${record.creator}
- Date: ${record.createdDate?datetime}
-<#if record.description?exists> - Notes: ${record.description}
- - -
-The current document is not versioned.
-Make Versionable -
-The current document is not managed by Alfresco. -
-
- -
  -
- - - - \ No newline at end of file diff --git a/source/web/css/office.css b/source/web/css/office.css index c9a8a04d55..9b01355a32 100644 --- a/source/web/css/office.css +++ b/source/web/css/office.css @@ -1,119 +1,204 @@ html, body { - height: 100%; - overflow:hidden; - font-family: tahoma, sans-serif; - font-size: 11px; - color: #0073e6; - background: url("../images/taskpane/view_bg.gif") top; + height: 100%; + overflow: hidden; + font-family: tahoma, sans-serif; + font-size: 11px; + color: #0073e6; + background: url("../images/office/view_bg.gif") top; } -body {margin:0px;padding:0px;} +body { + margin: 0px; + padding: 0px; +} + +a { + color: #0073e6; + text-decoration: none; +} + +a img { + border: 0px; +} + +.bold { + font-weight: bold; +} #tabBar { - float:left; - width:100%; - background:#d4eaff url("../images/taskpane/bg.gif") repeat-x bottom; - font-size:93%; - line-height:normal; - } + float: left; + width: 100%; + background: #efefef; + border-bottom: 1px solid #ccc; +} #tabBar ul { - margin:0; - padding:10px 10px 0; - list-style:none; - } - #tabBar li { - float:left; - background:url("../images/taskpane/norm_left.gif") no-repeat left top; - margin:0; - padding:0 0 0 9px; - } - #tabBar a { - display:block; - background:url("../images/taskpane/norm_right.gif") no-repeat right top; - padding:5px 15px 4px 6px; - text-decoration:none; - font-weight:bold; - color:#765; - } - #tabBar a:hover { - color:#333; - } - #tabBar #current { - background-image:url("../images/taskpane/norm_left_on.gif"); - } - #tabBar #current a { - background-image:url("../images/taskpane/norm_right_on.gif"); - color:#333; - padding-bottom:5px; - } + margin: 0px; + padding: 4px 10px 0px 4px; + list-style: none; +} +#tabBar li { + display: inline; + margin: 0px; + padding: 0px; +} +#tabBar a { + background: url("../images/office/tab_left.gif") no-repeat left top; + float:left; + margin: 0px; + padding: 0px 0px 0px 4px; + text-decoration: none; +} +#tabBar a span { + background: url("../images/office/tab_right.gif") no-repeat right top; + color: #666; + display: block; + float: none; + padding: 5px 15px 4px 6px; + height: 18px; +} -#spaceListHeader {width:100%; - height:auto; - padding:6px;} +#tabBar a:hover span { + color: #FFF; +} +#tabBar a:hover { + background-position: 0% -42px; +} +#tabBar a:hover span { + background-position: 100% -42px; +} -#mycheckedoutdocsListHeader {width:100%; - height:auto; - padding:6px;} +#tabBar #current a { + background-position: 0% -42px; +} +#tabBar #current a span { + background-position: 100% -42px; +} -#mytodoListHeader {width:100%; - height:auto; - padding:6px;} +.header { + clear: both; + width: 282px; + padding: 6px 0px 2px 4px; + font-weight: bold; + float: left; +} -#contentListHeader {width:100%; - height:auto;padding:6px;} +.headerExtra { + font-weight: normal; + float: right; + margin-top: -13px; +} -#searchResultsListHeader {width:100%; - height:auto;padding:6px;} +.listBig { + clear: both; + float: left; + width: 282px; + height: 378px; + overflow: auto; + border: 1px solid #cccccc; + margin: 0px 4px 0px 4px; + background: #fff; +} +.listMedium { + clear: both; + float: left; + width: 282px; + height: 204px; + overflow: auto; + border: 1px solid #cccccc; + margin: 0px 4px 0px 4px; + background: #fff; +} -#detailsListHeader {width:100%; - height:auto;padding:6px;} +.listMediumGrow { + height: 354px !important; +} +.listMediumShrink { + height: 54px !important; +} -#versionListHeader {width:100%; - height:auto;padding:6px;} +.odd { + background-color: #f8f8f8 !important; + border-bottom: 1px solid #eee; +} +.even { + background-color: #ffffff !important; + border-bottom: 1px solid #eee; +} -#advWorkflowListHeader {width:100%; - height:auto;padding:6px;} +#currentSpaceInfo { + clear: both; + float: left; + width: 282px; + height: 34px; + overflow: none; + border: 1px solid #cccccc; + margin: 4px 4px 0px; + padding: 4px 0px 0px; + background: #fff; +} -#myTasksListHeader {width:100%; - height:auto;padding:6px;} +TABLE, TR, TD { + border: 0px; + border-collapse: collapse; + padding: 2px; +} -#simpleWorkflowHeader {width:100%; - height:auto;padding:6px;} +ul { + margin: 0px; + list-style: none; + padding: 2px 0px 0px 4px; +} -#currentSpaceInfo {width:100%; - padding: 6px} +#documentActions { + clear: both; + background-color: #ffffcc; + border: 1px solid #ccc; + float: left; + margin: 0px 4px; + height: 150px; + width: 282px; +} -#simpleWorkflowInfo {width:100%; - padding: 6px} +#documentActionsNavigation { + clear: both; + background-color: #ffffcc; + border: 1px solid #ccc; + float: left; + margin: 0px 4px; + height: 106px; + width: 282px; +} -#spaceList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#mycheckedoutdocsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#mytodoList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#contentList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#searchResultsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#detailsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#versionList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#advWorkflowList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} -#myTasksList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;} +#nonStatusText { + min-height: 100%; + position: relative; +} -TABLE {border:0px; -padding:2px;} +#searchResultsList { + min-height: 100%; + position: relative; +} -A {color:#0073e6; } +#statusText { + border: none; + float: left; + margin: -22px 0px; + padding: 2px; + position: relative; + height: 17px; + width: 278px; +} -#bottomMargin {height:6px;} +#search { + clear: both; + float: left; + width: 282px; + border: 1px solid #cccccc; + margin: 0px 4px; + background: #fff; +} -#documentActions ul { - margin:0; - padding:10px 10px 0; - list-style:none; - } - -#documentActions {width:97%;margin-left:6px;padding-top:6px;padding-bottom:6px;} - -#search {padding: 24px 0px 0px 10px;} - -input.button{ +input.button { color:#0073e6; font-size:11px; font-weight:bold; @@ -124,7 +209,22 @@ input.button{ border-right-color:#0073e6; border-bottom-color:#0073e6; filter:progid:DXImageTransform.Microsoft.Gradient - (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff'); + (GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff'); cursor:pointer; margin-left:6px; - } +} + +#taskDetails { + padding: 2px; +} + +.taskItemSelected { + background-color: #ffe500 !important; +} + +.taskResources { + border: 1px solid #ccc; + margin: 4px; + height: 128px; + overflow: auto; +} diff --git a/source/web/images/icons/make_versionable.gif b/source/web/images/icons/make_versionable.gif new file mode 100644 index 0000000000..e98712cf31 Binary files /dev/null and b/source/web/images/icons/make_versionable.gif differ diff --git a/source/web/images/office/action_failed.gif b/source/web/images/office/action_failed.gif new file mode 100644 index 0000000000..0ad5d8d068 Binary files /dev/null and b/source/web/images/office/action_failed.gif differ diff --git a/source/web/images/office/action_successful.gif b/source/web/images/office/action_successful.gif new file mode 100644 index 0000000000..90d16c18e4 Binary files /dev/null and b/source/web/images/office/action_successful.gif differ diff --git a/source/web/images/office/ajax_anim.gif b/source/web/images/office/ajax_anim.gif new file mode 100644 index 0000000000..c014d6d580 Binary files /dev/null and b/source/web/images/office/ajax_anim.gif differ diff --git a/source/web/images/office/make_versionable.gif b/source/web/images/office/make_versionable.gif new file mode 100644 index 0000000000..e98712cf31 Binary files /dev/null and b/source/web/images/office/make_versionable.gif differ diff --git a/source/web/images/office/my_tasks.gif b/source/web/images/office/my_tasks.gif new file mode 100644 index 0000000000..6cee9ec039 Binary files /dev/null and b/source/web/images/office/my_tasks.gif differ diff --git a/source/web/images/office/search_again.gif b/source/web/images/office/search_again.gif new file mode 100644 index 0000000000..f6ecf2104a Binary files /dev/null and b/source/web/images/office/search_again.gif differ diff --git a/source/web/images/office/tab_left.gif b/source/web/images/office/tab_left.gif new file mode 100644 index 0000000000..021624c09a Binary files /dev/null and b/source/web/images/office/tab_left.gif differ diff --git a/source/web/images/office/tab_right.gif b/source/web/images/office/tab_right.gif new file mode 100644 index 0000000000..7c236f3a27 Binary files /dev/null and b/source/web/images/office/tab_right.gif differ diff --git a/source/web/images/office/task_item.gif b/source/web/images/office/task_item.gif new file mode 100644 index 0000000000..bf5bd91084 Binary files /dev/null and b/source/web/images/office/task_item.gif differ diff --git a/source/web/images/office/task_overdue.gif b/source/web/images/office/task_overdue.gif new file mode 100644 index 0000000000..cad27743ad Binary files /dev/null and b/source/web/images/office/task_overdue.gif differ diff --git a/source/web/images/office/task_today.gif b/source/web/images/office/task_today.gif new file mode 100644 index 0000000000..2a96492496 Binary files /dev/null and b/source/web/images/office/task_today.gif differ diff --git a/source/web/scripts/office/my_tasks.js b/source/web/scripts/office/my_tasks.js new file mode 100644 index 0000000000..52de8127e7 --- /dev/null +++ b/source/web/scripts/office/my_tasks.js @@ -0,0 +1,98 @@ +/* + * Prerequisites: mootools.v1.1.js + */ +var OfficeMyTasks = +{ + init: function() + { + var tasks = $$('#taskList .taskItem'); + + tasks.each(function(task, i) + { + task.isOpen = false; + + // register 'mouseenter' event for each task + task.addEvent('mouseenter', function(e) + { + if (task.isOpen) + return; + + // highlight the item title + task.addClass('taskItemSelected'); + + // reset styles on all closed tasks + tasks.each(function(otherTask, j) + { + if ((otherTask != task) && (!otherTask.isOpen)) + { + // reset selected class + otherTask.removeClass('taskItemSelected'); + } + }); + }); + + // register 'mouseleave' event for each task + task.addEvent('mouseleave', function(e) + { + if (task.isOpen) + return; + + // unhighlight the item title + task.removeClass('taskItemSelected'); + }); + + // register 'click' event for each task + task.addEvent('click', function(e) + { + if (!task.isOpen) + { + // open up this task + // flag this task as open + task.isOpen = true; + + OfficeAddin.showStatusText("Loading task...", "ajax_anim.gif", false); + + // ajax call to load task details + var actionURL = "/alfresco/service/office/myTasksDetail?t=" + task.id; + var myAjax = new Ajax(actionURL, { + method: 'get', + headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'}, + onComplete: function(textResponse, xmlResponse) + { + OfficeAddin.hideStatusText(); + $("taskDetails").innerHTML = textResponse; + } + }); + myAjax.request(); + + // close other open tasks + tasks.each(function(otherTask, j) + { + if (otherTask != task) + { + // close any other open tasks + otherTask.isOpen = false; + + // unhighlight the item title + otherTask.removeClass('taskItemSelected'); + } + }); + } + }); + }); + + $('taskList').addEvent('mouseleave', function(e) + { + // handler for mouse leaving the entire task list + tasks.each(function(task, i) + { + if (!task.isOpen) + { + task.removeClass('taskItemSelected'); + } + }); + }); + } +}; + +window.addEvent('domready', OfficeMyTasks.init); \ No newline at end of file diff --git a/source/web/scripts/office/office_addin.js b/source/web/scripts/office/office_addin.js new file mode 100644 index 0000000000..f99c452328 --- /dev/null +++ b/source/web/scripts/office/office_addin.js @@ -0,0 +1,160 @@ +/* + * Prerequisites: mootools.v1.1.js + */ +var OfficeAddin = +{ + ANIM_LENGTH: 300, + STATUS_FADE: 10000, + LIST_DEF_HEIGHT: 204, + + init: function() + { + this.queryObject = OfficeAddin.toQueryObject(document.location.search); + + /* Update needed after page load? */ + if(this.queryObject.st) + { + var objResponse = Json.evaluate(this.queryObject.st); + var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif"); + OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true); + } + + /* Have search box? */ + if ($("searchText")) + { + $("searchText").addEvent("keydown", function(event) + { + event = new Event(event); + if (event.key == 'enter') + { + $("simpleSearchButton").click(); + } + }); + } + + /* Have expandos? */ + if ($("toggleSpaceList")) + { + $("toggleSpaceList").addEvent("click", function() + { + $("spaceList").removeClass("listMediumShrink"); + $("spaceList").addClass("listMediumGrow"); + $("documentList").removeClass("listMediumGrow"); + $("documentList").addClass("listMediumShrink"); + }); + $("toggleDocumentList").addEvent("click", function() + { + $("documentList").removeClass("listMediumShrink"); + $("documentList").addClass("listMediumGrow"); + $("spaceList").removeClass("listMediumGrow"); + $("spaceList").addClass("listMediumShrink"); + }); + } + }, + + toQueryObject: function(s) + { + var obj = {}; + $A(s.substring(1).split('&')).each(function(param) + { + param = decodeURIComponent(param).split("="); + obj[param[0]] = param[1]; + }); + return obj; + }, + + showStatusText: function(statusText, statusImage, fadeOut) + { + var e = $("statusText"); + if (statusImage) + { + statusText = "\"*\"" + statusText; + } + e.innerHTML = statusText; + e.setStyle("opacity", "1"); + if (statusText == "") + { + e.setStyle("border-top", ""); + } + else + { + e.setStyle("border-top", "1px dashed #808080"); + var fx = new Fx.Style(e, 'background-color', + { + duration: OfficeAddin.ANIM_LENGTH, + transition: Fx.Transitions.linear + }); + if (fadeOut) + { + fx.onComplete = new function() + { + OfficeAddin.hideStatusText.delay(OfficeAddin.STATUS_FADE); + } + } + fx.start('#ffffcc', '#ffffff'); + } + }, + + hideStatusText: function() + { + var e = $("statusText"); + e.setStyle("opacity", "1"); + var fx = new Fx.Style(e, 'opacity', + { + duration: OfficeAddin.ANIM_LENGTH + }).start('1', '0'); + }, + + /* AJAX call to perform server-side actions */ + runAction: function(useTemplate, Action, Doc, Msg) + { + if (Msg != "" && !confirm(Msg)) + { + return; + } + + OfficeAddin.showStatusText("Running action...", "ajax_anim.gif", false); + var actionURL = useTemplate + "?a=" + Action + "&d=" + Doc; + var myAjax = new Ajax(actionURL, { + method: 'get', + headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'}, + onComplete: function(textResponse, xmlResponse) + { + // Remove any trailing hash + var href = window.location.href.replace("#", "") + // Remove any previous "&st=" strings + href = href.replace(/[?&]st=([^&$]+)/g, ""); + // Optionally add a status string + if (textResponse != "") + { + href += "&st=" + encodeURI(textResponse); + } + window.location.href = href; + } + }); + myAjax.request(); + }, + + /* AJAX call to perform server-side search */ + runSearch: function(useTemplate, argPath) + { + OfficeAddin.showStatusText("Searching...", "ajax_anim.gif", false); + + var searchString = $("searchText").value; + var maxResults = $("maxResults").value; + + var actionURL = useTemplate + "?p=" + argPath + "&search=" + searchString + "&maxresults=" + maxResults; + var myAjax = new Ajax(actionURL, { + method: 'get', + headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'}, + onComplete: function(textResponse, xmlResponse) + { + OfficeAddin.hideStatusText(); + $("searchResultsList").innerHTML = textResponse; + } + }); + myAjax.request(); + } +}; + +window.addEvent('domready', OfficeAddin.init); \ No newline at end of file