Office add-in collaboration updates

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7512 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-12-03 21:27:46 +00:00
parent 7219be39f2
commit 661f9fb4ec
33 changed files with 1169 additions and 233 deletions

View File

@@ -0,0 +1,9 @@
##
## Microsoft Office Add-In Messages
##
office.title.my_alfresco=My Alfresco
office.title.navigation=Browse Spaces and Documents
office.title.search=Search Alfresco
office.title.document_details=Document Details
office.title.my_tasks=My Tasks
office.title.document_tags=Document Tags

View File

@@ -0,0 +1,16 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!-- I18N -->
<bean id="officeResourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
<property name="resourceBundles">
<list>
<value>alfresco.messages.office-addin</value>
</list>
</property>
</bean>
</beans>

View File

@@ -0,0 +1,8 @@
<webscript>
<shortname>Tagging Actions</shortname>
<description>Add and remove tags to nodes</description>
<url>/collaboration/tagActions</url>
<format default="html"/>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,52 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Tagging Test UI</title>
<style>
body {
font-family: Verdana, Helvetica, sans-serif;
font-size: 10pt;
}
.label {
float: left;
width: 10em;
}
.data {
float: left;
}
.field {
clear: left;
float: left;
padding: 8px;
}
.action {
color: green;
font-weight: bold;
float: left;
clear: both;
}
</style>
</head>
<body>
<h3>Tagging Test UI</h3>
<form action="${url.serviceContext}${url.match}" method="post">
<div class="field">
<span class="label">Space nodeRef:</span>
<span class="data"><input type="text" name="n" size="64" /><br />e.g. &quot;e3741425-35cf-11dc-9762-4b73d0280543&quot;</span>
</div>
<div class="field">
<span class="label">Tag:</span>
<span class="data"><input type="text" name="t" size="64" value="" /></span>
</div>
<div class="field">
<span><input type="submit" value="Add" name="add" /></span>
<span><input type="submit" value="Remove" name="remove" /></span>
</div>
</form>
</body>
</html>

View File

@@ -0,0 +1,8 @@
<webscript>
<shortname>Tagging Actions</shortname>
<description>Add and remove tags to nodes</description>
<url>/collaboration/tagActions</url>
<format default="html"/>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,4 @@
{
"statusString":"${tagActions.resultString}",
"statusCode":${tagActions.resultCode?string}
}

View File

@@ -0,0 +1,146 @@
var action = args.a;
/* Debug Inputs */
if (args["add"] != null) {action = "add";}
else if (args["remove"] != null) {action = "remove";}
model.tagActions = tagActions(action, args.n, args.t);
function tagActions(action, nodeId, tagName)
{
var resultString = "Action failed";
var resultCode = false;
if ((nodeId != "") && (nodeId != null) &&
(tagName != "") && (tagName != null))
{
var node = search.findNode("workspace://SpacesStore/" + nodeId);
tagName = tagName.toLowerCase();
if (node != null)
{
try
{
var tags, newTag;
if (action == "add")
{
resultString = "Already tagged with '" + tagName + "'";
tags = node.properties["cm:taggable"];
if (tags == null)
{
tags = new Array();
}
// Check node doesn't already have this tag
var hasTag = false;
for each (tag in tags)
{
if (tag != null)
{
if (tag.name == tagName)
{
hasTag = true;
break;
}
}
}
if (!hasTag)
{
// Make sure the tag is in the repo
newTag = createTag(tagName);
if (newTag != null)
{
// Add it to our node
tags.push(newTag);
tagsArray = new Array();
tagsArray["cm:taggable"] = tags;
node.addAspect("cm:taggable", tagsArray);
resultString = "Tag added";
resultCode = true;
}
else
{
resultString = "Tag '" + tagName + "' not indexed";
}
}
}
else if (action == "remove")
{
resultString = "Could not remove tag";
var oldTags = node.properties["cm:taggable"];
if (oldTags == null)
{
oldTags = new Array();
}
tags = new Array();
// Find this tag
for each (tag in oldTags)
{
if (tag != null)
{
if (tag.name != tagName)
{
tags.push(tag);
}
}
}
// Removed tag?
if (oldTags.length > tags.length)
{
if (tags.length == 0)
{
node.addAspect("cm:taggable");
}
else
{
tagsArray = new Array();
tagsArray["cm:taggable"] = tags;
node.addAspect("cm:taggable", tagsArray);
}
resultString = "Tag removed";
resultCode = true;
}
else
{
resultString = "Not tagged with '" + tagName + "'";
}
}
else
{
resultString = "Unknown action";
}
}
catch(e)
{
resultString = "Action failed due to exception [" + e.toString() + "]";
}
}
}
var result =
{
"resultString": resultString,
"resultCode": resultCode
};
return result;
}
/*
* Create a new tag if the passed-in one doesn't exist
*/
function createTag(tagName)
{
var existingTags = classification.getRootCategories("cm:taggable");
for each (existingTag in existingTags)
{
if (existingTag.name == tagName)
{
return existingTag;
}
}
var tagNode = classification.createRootCategory("cm:taggable", tagName);
return tagNode;
}

View File

@@ -0,0 +1,8 @@
<webscript>
<shortname>Tagging Query</shortname>
<description>Query tag usage</description>
<url>/collaboration/tagQuery</url>
<format default="html"/>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,12 @@
{
"countMin": "${tagQuery.countMin}",
"countMax": "${tagQuery.countMax}",
"tags":
<#assign n=0>
<#list tagQuery.tags as tag>
<#if (n > 0)>,<#else>[</#if>
{"name": "${tag.name}", "count": "${tag.count}"}
<#assign n=n+1>
</#list>
]
}

View File

@@ -0,0 +1,104 @@
model.tagQuery = tagQuery(args["n"], args["m"]);
function tagQuery(nodeRef, maxResults)
{
var tags = new Array();
var countMin = Number.MAX_VALUE,
countMax = 0;
/* nodeRef input */
var node = null;
if ((nodeRef != null) && (nodeRef != ""))
{
node = search.findNode(nodeRef);
}
if (node == null)
{
node = companyhome;
}
/* maxResults input */
if ((maxResults == null) || (maxResults == ""))
{
maxResults = -1;
}
/* Query for tagged node(s) */
var query = "PATH:\"" + node.qnamePath;
if (node.isContainer)
{
query += "//*";
}
query += "\" AND ASPECT:\"{http://www.alfresco.org/model/content/1.0}taggable\"";
var taggedNodes = search.luceneSearch(query);
if (taggedNodes.length == 0)
{
countMin = 0;
}
else
{
/* Build a hashtable of tags and tag count */
var tagHash = {};
var count;
for each (taggedNode in taggedNodes)
{
for each(tag in taggedNode.properties["cm:taggable"])
{
if (tag != null)
{
count = tagHash[tag.name];
tagHash[tag.name] = count ? count+1 : 1;
}
}
}
/* Convert the hashtable into an array of objects */
for (key in tagHash)
{
tag =
{
name: key,
count: tagHash[key],
toString: function()
{
return this.name;
}
};
tags.push(tag);
}
/* Sort the results by count (descending) */
tags.sort(sortByCountDesc);
/* Trim the results to maxResults if specified */
if (maxResults > -1)
{
tags = tags.slice(0, maxResults);
}
/* Calculate the min and max tag count values */
for each(tag in tags)
{
countMin = Math.min(countMin, tag.count);
countMax = Math.max(countMax, tag.count);
}
/* Sort the results by tag name (ascending) */
tags.sort();
}
var results =
{
"countMin": countMin,
"countMax": countMax,
"tags": tags
};
return results;
}
function sortByCountDesc(a, b)
{
return (b.count - a.count);
}

View File

@@ -8,19 +8,19 @@ var resultString = "Action failed",
resultCode = false;
// Is this action targetting a document?
var docId = args.d;
if ((docId != "") && (docId != null))
var nodeId = args.n;
if ((nodeId != "") && (nodeId != null))
{
var doc = search.findNode("workspace://SpacesStore/" + docId);
var node = search.findNode("workspace://SpacesStore/" + nodeId);
if (doc != null && doc.isDocument)
if (node != null && node.isDocument)
{
try
{
if (runAction == "makepdf")
{
resultString = "Could not convert document";
var nodeTrans = doc.transformDocument("application/pdf");
var nodeTrans = node.transformDocument("application/pdf");
if (nodeTrans != null)
{
resultString = "Document converted";
@@ -30,7 +30,7 @@ if ((docId != "") && (docId != null))
else if (runAction == "delete")
{
resultString = "Could not delete document";
if (doc.remove())
if (node.remove())
{
resultString = "Document deleted";
resultCode = true;
@@ -38,7 +38,7 @@ if ((docId != "") && (docId != null))
}
else if (runAction == "checkout")
{
var workingCopy = doc.checkout();
var workingCopy = node.checkout();
if (workingCopy != null)
{
resultString = "Document checked out";
@@ -47,7 +47,7 @@ if ((docId != "") && (docId != null))
}
else if (runAction == "checkin")
{
var originalDoc = doc.checkin();
var originalDoc = node.checkin();
if (originalDoc != null)
{
resultString = "Document checked in";
@@ -57,7 +57,7 @@ if ((docId != "") && (docId != null))
else if (runAction == "makeversion")
{
resultString = "Could not version document";
if (doc.addAspect("cm:versionable"))
if (node.addAspect("cm:versionable"))
{
resultString = "Document versioned";
resultCode = true;
@@ -78,7 +78,7 @@ if ((docId != "") && (docId != null))
{
workflow.parameters["bpm:workflowDueDate"] = dueDate;
}
workflow.execute(doc);
workflow.execute(node);
resultString = "New workflow started";
resultCode = true;
}

View File

@@ -1,4 +1,6 @@
<#assign doc_actions="${url.serviceContext}/office/docActions">
<#assign tag_actions="${url.serviceContext}/collaboration/tagActions">
<#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><#assign extnx=extn+"x">
<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if>
@@ -11,23 +13,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Document Details</title>
<title>${message("office.title.document_details")}</title>
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="${url.context}/css/office_ie6.css" />
<![endif]-->
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.11.js"></script>
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
<script type="text/javascript" src="${url.context}/scripts/office/doc_details.js"></script>
</head>
<body>
<div id="tabBar">
<div class="tabBar">
<ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li id="current"><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.my_alfresco")}" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="${message("office.title.my_alfresco")}" /></span></a></li>
<li><a title="${message("office.title.navigation")}" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="${message("office.title.navigation")}" /></span></a></li>
<li><a title="${message("office.title.search")}" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="${message("office.title.search")}" /></span></a></li>
<li id="current"><a title="${message("office.title.document_details")}" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="${message("office.title.document_details")}" /></span></a></li>
<li><a title="${message("office.title.my_tasks")}" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="${message("office.title.my_tasks")}" /></span></a></li>
<li><a title="${message("office.title.document_tags")}" href="${url.serviceContext}/office/tags?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/tag.gif" alt="${message("office.title.document_tags")}" /></span></a></li>
</ul>
</div>
@@ -86,66 +90,113 @@
</table>
</div>
<div class="header">Version History<#if d.isDocument> for ${d.name}</#if></div>
<div class="tabBarInline">
<ul>
<li class="current"><a title="Document Tags" href="#"><span><img src="${url.context}/images/office/document_tag.gif" alt="Document Tags" /></span></a></li>
<li><a title="Version History" href="#"><span><img src="${url.context}/images/office/version.gif" alt="Version History")}" /></span></a></li>
</ul>
</div>
<div id="versionList" class="containerMedium">
<table width="265">
<#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>
<tr class="${(versionRow % 2 = 0)?string("odd", "even")}">
<td valign="top">
<a title="Open ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><img src="${url.context}/images/office/document.gif" alt="Open ${record.versionLabel}" /></a>
</td>
<td>
<a title="Open ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><span style="font-weight:bold;">${record.versionLabel}</span></a><br />
Author: ${record.creator}<br />
Date: ${record.createdDate?datetime}<br />
<#if record.description?exists>
Notes: ${record.description}<br />
<div id="panelTags" class="tabPanel">
<div class="tabHeader">Tags<#if d.isDocument> for ${d.name}</#if></div>
<div id="tagList" class="containerTabMedium">
<#if d.isDocument >
<div class="addTagIcon"></div>
<div id="addTagLinkContainer">
<a href="#" onclick="OfficeDocDetails.showAddTagForm(); return false;">Add a tag</a>
</div>
<div id="addTagFormContainer">
<form id="addTagForm" name="addTagForm" method="get" action="#" onsubmit="return OfficeDocDetails.addTag('${d.id}', this.tag.value);">
<input id="addTagBox" name="tag" type="text">
<input class="addTagImage" type="image" src="${url.context}/images/office/action_successful.gif" onclick="return (document.addTagForm.tag.value.length > 0);">
<input class="addTagImage" type="image" src="${url.context}/images/office/action_failed.gif" onclick="return OfficeDocDetails.hideAddTagForm();">
</form>
</div>
<#if d.hasAspect("cm:taggable")>
<#if (d.properties["cm:taggable"]?size > 0)>
<#list d.properties["cm:taggable"]?sort_by("name") as tag>
<#if tag?exists>
<div class="tagListEntry">
<a class="tagDelete" href="#" title="Delete this tag" onclick="OfficeAddin.postAction('${tag_actions}','remove','${d.id}','', '&t=${tag.name}');">[x]</a>
<a class="tagName" href="${url.serviceContext}/office/tags?p=${path?url}&amp;e=${extn}&amp;n=${nav}">${tag.name}</a>
</div>
</#if>
</#list>
</#if>
<#-- Only Word supports document compare -->
<#if extn = "doc">
<a class="bold" href="#" onclick="window.external.compareDocument('${record.url}')" title="Compare with current">Compare with current</a><br />
</#if>
</td>
</tr>
</#list>
</#if>
<#else>
<tr>
<td valign="top">
The current document is not versioned.<br />
<br />
<ul>
<li><a title="Make Versionable" href="#" onclick="OfficeAddin.runAction('${doc_actions}','makeversion','${d.id}', '');">
<img src="${url.context}/images/office/make_versionable.gif" alt="Make Versionable" /> Make Versionable
</a></li>
</ul>
</td>
</tr>
<table width="265">
<tr>
<td valign="top">
The current document is not managed by Alfresco.
</td>
</tr>
</table>
</#if>
<#else>
<tr>
<td valign="top">
The current document is not managed by Alfresco.
</td>
</tr>
</#if>
</table>
</div>
</div>
<div id="panelVersion" class="tabPanel tabPanelHidden">
<div class="tabHeader">Version History<#if d.isDocument> for ${d.name}</#if></div>
<div id="versionList" class="containerTabMedium">
<table width="265">
<#if d.isDocument >
<#if d.hasAspect("cm:versionable")>
<#assign versionRow=0>
<#list d.versionHistory?sort_by("versionLabel")?reverse as record>
<#assign versionRow=versionRow+1>
<tr class="${(versionRow % 2 = 0)?string("odd", "even")}">
<td valign="top">
<a title="Open ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><img src="${url.context}/images/office/document.gif" alt="Open ${record.versionLabel}" /></a>
</td>
<td>
<a title="Open ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><span style="font-weight:bold;">${record.versionLabel}</span></a><br />
Author: ${record.creator}<br />
Date: ${record.createdDate?datetime}<br />
<#if record.description?exists>
Notes: ${record.description}<br />
</#if>
<#-- Only Word supports document compare -->
<#if extn = "doc">
<a class="bold" href="#" onclick="window.external.compareDocument('${record.url}')" title="Compare with current">Compare with current</a><br />
</#if>
</td>
</tr>
</#list>
<#else>
<tr>
<td valign="top">
The current document is not versioned.<br />
<br />
<ul>
<li><a title="Make Versionable" href="#" onclick="OfficeAddin.getAction('${doc_actions}','makeversion','${d.id}',null,null,'tab=v');">
<img src="${url.context}/images/office/make_versionable.gif" alt="Make Versionable" /> Make Versionable
</a></li>
</ul>
</td>
</tr>
</#if>
<#else>
<tr>
<td valign="top">
The current document is not managed by Alfresco.
</td>
</tr>
</#if>
</table>
</div>
</div>
<div class="header">Document Actions</div>
<div id="documentActions">
<div id="documentActions" class="actionsPanel">
<div id="nonStatusText">
<ul>
<#if d.isDocument>
<#if d.isLocked >
<#elseif hasAspect(d, "cm:workingcopy") == 1>
<#elseif d.hasAspect("cm:workingcopy")>
<li>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${d.id}', '');">
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','checkin','${d.id}');">
<img src="${url.context}/images/office/checkin.gif" alt="Check In">
Check In
</a>
@@ -153,7 +204,7 @@
</li>
<#else>
<li>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkout','${d.id}', '');">
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','checkout','${d.id}');">
<img src="${url.context}/images/office/checkout.gif" alt="Check Out">
Check Out
</a>
@@ -169,7 +220,7 @@
</li>
<#if d.name?ends_with(extn) || d.name?ends_with(extnx)>
<li>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');">
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','makepdf','${d.id}');">
<img src="${url.context}/images/office/makepdf.gif" alt="Transform to PDF" />
Transform to PDF
</a>
@@ -199,7 +250,5 @@
</div>
</body>
</html>

View File

@@ -22,13 +22,14 @@
</head>
<body>
<div id="tabBar">
<div class="tabBar">
<ul>
<li id="current"><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}&amp;ticket=${session.ticket}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li id="current"><a title="${message("office.title.my_alfresco")}" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="${message("office.title.navigation")}" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="${message("office.title.search")}" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}&amp;ticket=${session.ticket}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="${message("office.title.document_details")}" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="${message("office.title.my_tasks")}" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.document_tags")}" href="${url.serviceContext}/office/tags?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/tag.gif" alt="${message("office.title.document_tags")}" /></span></a></li>
</ul>
</div>
@@ -57,11 +58,11 @@
</#if>
</#if>
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br />
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;w=new&amp;wd=${child.id}"><img src="${url.context}/images/office/new_workflow.gif" style="padding:3px 6px 2px 0px;" alt="Create Workflow..." title="Create Workflow..." /></a>
<a href="#" onclick="window.external.insertDocument('${relativePath}')"><img src="${url.context}/images/office/insert_document.gif" style="padding:3px 6px 2px 0px;" alt="Insert File into Current Document" title="Insert File into Current Document" /></a>
<#if !child.name?ends_with(".pdf")>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</#if>
</span>
</div>
@@ -117,7 +118,7 @@
<div class="header">Actions</div>
<div id="documentActions">
<div id="myAlfrescoActions" class="actionsPanel">
<div id="nonStatusText">
<ul>
<#if d.isDocument>

View File

@@ -31,13 +31,14 @@
</head>
<body>
<div id="tabBar">
<div class="tabBar">
<ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li id="current"><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.my_alfresco")}" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="${message("office.title.navigation")}" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="${message("office.title.search")}" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="${message("office.title.document_details")}" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li id="current"><a title="${message("office.title.my_tasks")}" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.document_tags")}" href="${url.serviceContext}/office/tags?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/tag.gif" alt="${message("office.title.document_tags")}" /></span></a></li>
</ul>
</div>

View File

@@ -61,13 +61,13 @@
<#if res.isLocked >
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" />
<#elseif hasAspect(res, "cm:workingcopy") == 1>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','checkin','${res.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','checkin','${res.id}');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<#else>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','checkout','${res.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','checkout','${res.id}');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
</#if>
<a href="#" onclick="window.external.insertDocument('${relativePath}')"><img src="${url.context}/images/office/insert_document.gif" style="padding:3px 6px 2px 0px;" alt="Insert File into Current Document" title="Insert File into Current Document" /></a>
<#if !res.name?ends_with(".pdf")>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','makepdf','${res.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','makepdf','${res.id}');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</#if>
</td>
<#else>

View File

@@ -21,13 +21,14 @@
</head>
<body>
<div id="overlayPanel"></div>
<div id="tabBar">
<div class="tabBar">
<ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li id="current"><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.my_alfresco")}" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li id="current"><a title="${message("office.title.navigation")}" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="${message("office.title.search")}" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="${message("office.title.document_details")}" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="${message("office.title.my_tasks")}" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.document_tags")}" href="${url.serviceContext}/office/tags?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/tag.gif" alt="${message("office.title.document_tags")}" /></span></a></li>
</ul>
</div>
@@ -72,7 +73,7 @@
</div>
<div class="spaceParam">Title:</div>
<div class="spaceValue">
<input id="spacetitle" type="text" value="" />
<input id="spaceTitle" type="text" value="" />
</div>
<div class="spaceParam">Description:</div>
<div class="spaceValue">
@@ -159,17 +160,17 @@
<#if child.isLocked >
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" />
<#elseif hasAspect(child, "cm:workingcopy") == 1>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<#else>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkout','${child.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','checkout','${child.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
</#if>
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;w=new&amp;wd=${child.id}"><img src="${url.context}/images/office/new_workflow.gif" style="padding:3px 6px 2px 0px;" alt="Create Workflow..." title="Create Workflow..." /></a>
<a href="#" onclick="window.external.insertDocument('${relativePath}')"><img src="${url.context}/images/office/insert_document.gif" style="padding:3px 6px 2px 0px;" alt="Insert File into Current Document" title="Insert File into Current Document" /></a>
<#if !child.name?ends_with(".pdf")>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</#if>
<#if !child.isLocked>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete" /></a>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete" /></a>
</#if>
</span>
</div>
@@ -184,7 +185,7 @@
<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name />
<#assign currentPath = currentPath?substring(chLen+1)?url?replace('%2F', '/')?replace('\'', '\\\'') />
<div id="documentActionsNavigation">
<div id="navigationActions" class="actionsPanel">
<div id="saveDetailsPanel">
Document filename:<br />
<input class="saveDetailsItem" type="text" id="saveFilename" style="height: 18px; width: 168px;" />

View File

@@ -18,20 +18,20 @@
<script type="text/javascript" src="${url.context}/scripts/office/search.js"></script>
</head>
<body>
<!-- ${maxResults} -->
<div id="tabBar">
<div class="tabBar">
<ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li id="current"><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.my_alfresco")}" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="${message("office.title.navigation")}" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li id="current"><a title="${message("office.title.search")}" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="${message("office.title.document_details")}" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="${message("office.title.my_tasks")}" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
<li><a title="${message("office.title.document_tags")}" href="${url.serviceContext}/office/tags?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/tag.gif" alt="${message("office.title.document_tags")}" /></span></a></li>
</ul>
</div>
<div class="header">Search</div>
<div class="containerSmall">
<div class="containerSearchTerms">
<div id="nonStatusText">
<div class="searchBox">
<span class="searchParam">

View File

@@ -1,84 +1,73 @@
<#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><#assign extnx=extn+"x">
<#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>
<#if args.search?exists><#assign searchString = args.search><#else><#assign searchString=""></#if>
<#if args.maxresults?exists>
<#assign maxresults=args.maxresults?number>
<#else>
<#assign searchString = "">
<#assign queryString = "">
<#assign maxresults=10>
</#if>
<#assign resCount=0>
<#assign totalResults=0>
<#if results?size = 0>
<div class="noItems">
<span>(No results found)</span>
</div>
<#else>
<#assign totalResults = results?size>
<#list results as child>
<#assign resCount=resCount + 1>
<#if child.isDocument>
<#assign relativePath = (child.displayPath?substring(companyhome.name?length+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') />
<#if child.name?ends_with(extn) || child.name?ends_with(extnx)>
<#assign openURL = "#">
<#assign hrefExtra = " onClick=\"window.external.openDocument('${relativePath}')\"">
<#else>
<#assign openURL = "${url.context}${child.url}?ticket=${session.ticket}">
<#assign hrefExtra = " target=\"_blank\"">
</#if>
<#else>
<#assign openURL = "${url.serviceContext}/office/navigation?p=${args.p?url}&amp;e=$(extn}&amp;n=${child.id}&amp;search=${searchString?url}&amp;maxresults=${maxresults}">
<#assign hrefExtra = "">
</#if>
<div class="documentItem ${(resCount % 2 = 0)?string("odd", "even")}"">
<span class="documentItemIcon">
<a href="${openURL}" ${hrefExtra}><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
</span>
<span class="documentItemDetails">
<a class="bold" href="${openURL}" ${hrefExtra} title="Open ${child.name}">${child.name}</a><br />
<#if child.properties.description?exists>
<#if (child.properties.description?length > 0)>
${child.properties.description}<br />
</#if>
</#if>
<#if child.isDocument>
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br />
<#if child.isLocked >
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" />
<#elseif hasAspect(child, "cm:workingcopy") == 1>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<#else>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','checkout','${child.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
</#if>
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;w=new&amp;wd=${child.id}"><img src="${url.context}/images/office/new_workflow.gif" style="padding:3px 6px 2px 0px;" alt="Create Workflow..." title="Create Workflow..." /></a>
<a href="#" onclick="window.external.insertDocument('${relativePath}')"><img src="${url.context}/images/office/insert_document.gif" style="padding:3px 6px 2px 0px;" alt="Insert File into Current Document" title="Insert File into Current Document" /></a>
<#if !child.name?ends_with(".pdf")>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</#if>
<#if !child.isLocked>
<a href="#" onclick="OfficeAddin.getAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete" /></a>
</#if>
</#if>
</span>
</div>
<#if resCount = maxresults>
<#break>
</#if>
</#list>
</#if>
<#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>
<div class="noItems">
<span>(No results found)</span>
</div>
<#else>
<#assign totalResults = results?size>
<#list results as child>
<#assign resCount=resCount + 1>
<#if child.isDocument>
<#assign relativePath = (child.displayPath?substring(companyhome.name?length+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') />
<#if child.name?ends_with(extn) || child.name?ends_with(extnx)>
<#assign openURL = "#">
<#assign hrefExtra = " onClick=\"window.external.openDocument('${relativePath}')\"">
<#else>
<#assign openURL = "${url.context}${child.url}?ticket=${session.ticket}">
<#assign hrefExtra = " target=\"_blank\"">
</#if>
<#else>
<#assign openURL = "${url.serviceContext}/office/navigation?p=${args.p?url}&amp;e=$(extn}&amp;n=${child.id}&amp;search=${searchString?url}&amp;maxresults=${maxresults}">
<#assign hrefExtra = "">
</#if>
<div class="documentItem ${(resCount % 2 = 0)?string("odd", "even")}"">
<span class="documentItemIcon">
<a href="${openURL}" ${hrefExtra}><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
</span>
<span class="documentItemDetails">
<a class="bold" href="${openURL}" ${hrefExtra} title="Open ${child.name}">${child.name}</a><br />
<#if child.properties.description?exists>
<#if (child.properties.description?length > 0)>
${child.properties.description}<br />
</#if>
</#if>
<#if child.isDocument>
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br />
<#if child.isLocked >
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" />
<#elseif hasAspect(child, "cm:workingcopy") == 1>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<#else>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkout','${child.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
</#if>
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;w=new&amp;wd=${child.id}"><img src="${url.context}/images/office/new_workflow.gif" style="padding:3px 6px 2px 0px;" alt="Create Workflow..." title="Create Workflow..." /></a>
<a href="#" onclick="window.external.insertDocument('${relativePath}')"><img src="${url.context}/images/office/insert_document.gif" style="padding:3px 6px 2px 0px;" alt="Insert File into Current Document" title="Insert File into Current Document" /></a>
<#if !child.name?ends_with(".pdf")>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</#if>
<#if !child.isLocked>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete" /></a>
</#if>
</#if>
</span>
</div>
<#if resCount = maxresults>
<#break>
</#if>
</#list>
</#if>
</#if>
<script type="text/javascript">
OfficeSearch.itemsFound(${resCount}, ${totalResults});
</script>

View File

@@ -0,0 +1,23 @@
var searchString = args.search;
var searchType = args.type;
var queryString;
if ((searchString != null) && (searchString != ""))
{
if (searchType == "tag")
{
queryString = "PATH:\"/cm:categoryRoot/cm:taggable/cm:" + searchString + "/member\"";
}
else
{
queryString = "(TEXT:\"" + searchString + "\") OR (@cm\\:name:*" + searchString + "*)";
}
}
else
{
searchString = "";
queryString = "";
}
model.results = search.luceneSearch(queryString);

View File

@@ -0,0 +1,7 @@
<webscript>
<shortname>Document Tags (Office Add-In)</shortname>
<description>Generate the Office Add-In Tags page</description>
<url>/office/tags?p={path?}</url>
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,61 @@
<#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><#assign extnx=extn+"x">
<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if>
<#if args.tag?exists><#assign tag=args.tag><#else><#assign tag=""></#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>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>${message("office.title.document_tags")}</title>
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="${url.context}/css/office_ie6.css" />
<![endif]-->
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.11.js"></script>
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
<script type="text/javascript" src="${url.context}/scripts/office/tags.js"></script>
</head>
<body>
<div class="tabBar">
<ul>
<li><a title="${message("office.title.my_alfresco")}" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="${message("office.title.my_alfresco")}" /></span></a></li>
<li><a title="${message("office.title.navigation")}" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="${message("office.title.navigation")}" /></span></a></li>
<li><a title="${message("office.title.search")}" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="${message("office.title.search")}" /></span></a></li>
<li><a title="${message("office.title.document_details")}" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="${message("office.title.document_details")}" /></span></a></li>
<li><a title="${message("office.title.my_tasks")}" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="${message("office.title.my_tasks")}" /></span></a></li>
<li id="current"><a title="${message("office.title.document_tags")}" href="${url.serviceContext}/office/tags?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/tag.gif" alt="${message("office.title.document_tags")}" /></span></a></li>
</ul>
</div>
<div class="header">Tag Cloud</div>
<div class="containerMedium">
<div id="nonStatusText">
<div id="tagCloud"></div>
</div>
<div id="statusText"></div>
</div>
<div id="taggedHeader" class="header">Tagged Documents</div>
<div id="taggedContainer">
<div id="itemsFound" class="taggedFound"></div>
<div id="taggedList" class="containerBig"></div>
</div>
<script type="text/javascript">
OfficeTags.setParams("${path?url}&amp;e=${extn}");
</script>
<#if (args.tag?exists)>
<script type="text/javascript">
window.addEvent('domready', function(){OfficeTags.selectTag("${args.tag}")});
</script>
</#if>
</body>
</html>

View File

@@ -63,31 +63,31 @@ input.button {
overflow-x: hidden;
}
#tabBar {
.tabBar {
float: left;
width: 100%;
background: #efefef;
border-bottom: 1px solid #ccc;
}
#tabBar ul {
.tabBar ul {
margin: 0px;
padding: 4px 10px 0px 4px;
list-style: none;
}
#tabBar li {
.tabBar li {
display: inline;
margin: 0px;
padding: 0px;
height: 18px;
}
#tabBar a {
.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 {
.tabBar a span {
background: url("../images/office/tab_right.gif") no-repeat right top;
color: #666;
display: block;
@@ -95,23 +95,79 @@ input.button {
padding: 5px 15px 4px 6px;
}
#tabBar a:hover span {
.tabBar a:hover span {
color: #FFF;
}
#tabBar a:hover {
.tabBar a:hover {
background-position: 0% -42px;
}
#tabBar a:hover span {
.tabBar a:hover span {
background-position: 100% -42px;
}
#tabBar #current a {
.tabBar #current a {
background-position: 0% -42px;
}
#tabBar #current a span {
.tabBar #current a span {
background-position: 100% -42px;
}
.tabBarInline {
clear: left;
float: left;
margin: 0px 4px;
width: 284px;
}
.tabBarInline ul {
margin: 0px;
padding: 4px 10px 0px 4px;
list-style: none;
}
.tabBarInline li {
display: inline;
margin: 0px;
padding: 0px;
height: 18px;
}
.tabBarInline a {
background: url("../images/office/tab_left.gif") no-repeat left top;
float:left;
margin: 0px;
padding: 0px 0px 0px 4px;
text-decoration: none;
}
.tabBarInline a span {
background: url("../images/office/tab_right.gif") no-repeat right top;
color: #666;
display: block;
float: none;
padding: 5px 15px 4px 6px;
}
.tabBarInline a:hover span {
color: #FFF;
}
.tabBarInline a:hover {
background-position: 0% -42px;
}
.tabBarInline a:hover span {
background-position: 100% -42px;
}
.tabBarInline .current a {
background-position: 0% -42px;
}
.tabBarInline .current a span {
background-position: 100% -42px;
}
.tabPanel {
}
.tabPanelHidden {
display: none;
}
.header {
clear: both;
font-weight: bold;
@@ -124,6 +180,22 @@ input.button {
white-space:nowrap;
}
.tabHeader {
background: #ffffff;
border: 1px solid #cccccc;
border-bottom: none;
clear: both;
font-weight: bold;
float: left;
margin: 0px 4px;
padding: 2px;
height: 13px;
width: 278px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.headerExtra {
font-weight: normal;
float: right;
@@ -174,13 +246,23 @@ input.button {
clear: both;
float: left;
width: 282px;
height: 76px;
height: 89px;
overflow: auto;
border: 1px solid #cccccc;
margin: 0px 4px 0px 4px;
background: #fff;
}
.containerSearchTerms {
clear: both;
float: left;
width: 282px;
height: 76px;
overflow: auto;
border: 1px solid #cccccc;
margin: 0px 4px 0px 4px;
background: #fff;
}
.containerSearchResults {
clear: both;
float: left;
@@ -191,8 +273,20 @@ input.button {
margin: 0px 4px 0px 4px;
background: #fff;
}
.containerTabMedium {
clear: both;
float: left;
width: 282px;
height: 174px;
overflow: auto;
border: 1px solid #cccccc;
border-top: none;
margin: 0px 4px 0px 4px;
background: #fff;
}
#checkedoutList, #taskList, #spaceList, #documentList, #versionList, #resultsList {
#checkedoutList, #taskList, #spaceList, #documentList, #versionList, #taggedList, #resultsList {
overflow-y: scroll;
}
@@ -307,46 +401,35 @@ input.button {
width: 226px;
}
#documentActions {
.actionsPanel {
clear: both;
background-color: #ffffcc;
border: 1px solid #ccc;
float: left;
margin: 0px 4px;
height: 150px;
width: 282px;
}
#documentActions ul {
.actionsPanel ul {
padding: 2px 0px 0px 24px;
}
#documentActions li a {
.actionsPanel li a {
font-weight: bold;
margin: 0px 0px 0px -22px;
}
#documentActions li a img {
.actionsPanel li a img {
margin: 0px 0px -2px 0px;
padding: 0px 3px 0px 0px;
}
#documentActionsNavigation {
clear: both;
background-color: #ffffcc;
border: 1px solid #ccc;
float: left;
margin: 0px 4px;
#myAlfrescoActions {
height: 150px;
}
#documentActions {
height: 149px;
}
#navigationActions {
height: 89px;
width: 282px;
}
#documentActionsNavigation ul {
padding: 2px 0px 0px 24px;
}
#documentActionsNavigation li a {
font-weight: bold;
margin: 0px 0px 0px -22px;
}
#documentActionsNavigation li a img {
margin: 0px 0px -2px 0px;
padding: 0px 3px 0px 0px;
}
#saveDetailsPanel
@@ -638,3 +721,119 @@ ul.autocompleter-choices li.autocompleter-selected span.autocompleter-queried
background-color: #0073e6;
color: #fff;
}
/* Document tags */
.addTagIcon {
background: url("../images/office/new_tag.gif") no-repeat;
float: left;
height: 16px;
width: 16px;
margin: 2px 4px;
}
#addTagLinkContainer {
height: 16px;
margin: 3px 0px;
}
#addTagFormContainer {
display: none;
}
#addTagForm {
margin: 1px;
}
#addTagBox {
border: 1px solid #cccccc;
height: 14px;
margin: 0px 0px 0px;
padding: 1px;
color: #0073e6;
font-family: tahoma, sans-serif;
font-size: 11px;
}
.addTagImage {
margin: 0px 0px -2px;
outline: none;
}
.tagListEntry {
cursor: pointer;
margin: 1px 0px;
padding: 0px 4px;
}
.tagDelete {
color: #ccc;
font-size: 11px;
}
.tagName {
}
/* Tag cloud */
#tagCloud {
line-height: 2em;
padding: 4px;
}
#tagCloud .tagContainer {
float: left;
padding: 2px;
}
#tagCloud a {
cursor: pointer;
}
#tagCloud .tagName0 {
font-size: 11px;
}
#tagCloud .tagName1 {
font-size: 12px;
}
#tagCloud .tagName2 {
font-size: 13px;
}
#tagCloud .tagName3 {
font-size: 14px;
}
#tagCloud .tagName4 {
font-size: 15px;
}
#tagCloud .tagName5 {
font-size: 16px;
}
#tagCloud .tagCount {
color: #cccccc;
font-size: 11px;
padding-left: 0.1em;
}
#taggedList {
border-top: none;
float: left;
height: 356px !important;
}
.taggedFound {
background: #ffffff;
border: 1px solid #cccccc;
border-bottom: none;
clear: both;
float: left;
margin: 0px 4px;
padding: 2px;
height: 13px;
width: 278px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.taggedFound {
float: left;
}

View File

@@ -10,7 +10,7 @@
top: -2px;
}
.containerBig, .containerMedium, .containerSmall, .containerSearchResults, #currentSpaceInfo, #documentActions, #documentActionsNavigation {
.containerBig, .containerBigAlt, .containerMedium, .containerSmall, .containerSearchTerms, .containerSearchResults, .containerTabMedium, #currentSpaceInfo, #myAlfrescoActions, #navigationActions, #documentActions {
margin: 0px 4px 0px 1px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

View File

@@ -0,0 +1,108 @@
/*
* Prerequisites: mootools.v1.11.js
* office_addin.js
*/
var OfficeDocDetails =
{
init: function()
{
OfficeDocDetails.setupTabs();
OfficeDocDetails.setupTags();
},
setupTabs: function()
{
var tabs = $$('.tabBarInline li');
var tablinks = $$('.tabBarInline li a');
var panels = $$('.tabPanel');
tabs.each(function(tab, i)
{
// register 'click' event for each tab
tablinks[i].addEvent('click', function(e)
{
// highlight the current tab
tab.addClass('current');
// show the tab panel
panels[i].removeClass('tabPanelHidden');
// reset styles on all closed tasks
tabs.each(function(otherTab, j)
{
if (otherTab != tab)
{
// reset selected class
otherTab.removeClass('current');
// hide the tab panel
panels[j].addClass('tabPanelHidden');
}
});
});
});
},
setupTags: function()
{
var tags = $$('#panelTags .tagName');
tags.each(function(tag, i)
{
tag.addEvent('click', function(e)
{
window.location.href = window.serviceContextPath + "/office/tags?p=" + window.queryObject.p + "&tag=" + tag.innerHTML;
});
});
},
showAddTagForm: function()
{
$("addTagLinkContainer").setStyle("display", "none");
$("addTagFormContainer").setStyle("display", "block");
$("addTagBox").focus();
},
hideAddTagForm: function()
{
$("addTagFormContainer").setStyle("display", "none");
$("addTagLinkContainer").setStyle("display", "block");
return false;
},
addTag: function(nodeId, tagName)
{
OfficeAddin.postAction(window.serviceContextPath + "/collaboration/tagActions", "add", nodeId, null, "&t=" + tagName);
return false;
},
tagAction: function(action, nodeId, tagName, msg)
{
if (msg != "" && !confirm(msg))
{
return;
}
OfficeAddin.showStatusText("Processing...", "ajax_anim.gif", false);
var actionURL = window.serviceContextPath + "/collaboration/tagActions?a=" + action + "&n=" + nodeId + "&t=" + tagName;
var myAjax = new Ajax(actionURL, {
method: 'post',
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
onComplete: function(textResponse, xmlResponse)
{
// Optionally add a status string
if (textResponse != "")
{
var objResponse = Json.evaluate(textResponse);
var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif");
var colBackground = (objResponse.statusCode ? "#50ff50" : "#ff5050");
OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true, colBackground);
}
},
onFailure: function()
{
OfficeAddin.showStatusText("Action failed", "action_failed.gif", true);
}
}).request();
}
};
window.addEvent('domready', OfficeDocDetails.init);

View File

@@ -113,8 +113,7 @@ var OfficeMyTasks =
OfficeAddin.hideStatusText();
$("taskDetails").innerHTML = textResponse;
}
});
myAjax.request();
}).request();
// close other open tasks
tasks.each(function(otherTask, j)
@@ -180,8 +179,7 @@ var OfficeMyTasks =
{
OfficeAddin.showStatusText("Couldn't run workflow", "action_failed.gif", true);
}
});
myAjax.request();
}).request();
},
startWorkflow: function(commandURL, Doc)
@@ -229,18 +227,18 @@ var OfficeMyTasks =
},
/* AJAX call to perform server-side actions */
runAction: function(useTemplate, Action, Doc, Msg)
runAction: function(useTemplate, action, nodeId, confirmMsg)
{
// Re-select a selected task after reload
var taskSel = $E('#taskList .taskItemSelected');
var extraParams = "";
var outParams = null;
if (taskSel != null)
{
var taskId = taskSel.id;
extraParams = "t=" + encodeURI(taskId);
outParams = "t=" + encodeURI(taskId);
}
OfficeAddin.runAction(useTemplate, Action, Doc, Msg, extraParams);
return OfficeAddin.getAction(useTemplate, action, nodeId, confirmMsg, null, outParams);
},
refreshPage: function()

View File

@@ -91,17 +91,32 @@ var OfficeAddin =
},
/* AJAX call to perform server-side actions */
runAction: function(useTemplate, Action, Doc, Msg, extraParams)
getAction: function(useTemplate, action, nodeId, confirmMsg, inParams, outParams)
{
if (Msg != "" && !confirm(Msg))
return OfficeAddin.runAction("get", useTemplate, action, nodeId, confirmMsg, inParams, outParams)
},
postAction: function(useTemplate, action, nodeId, confirmMsg, inParams, outParams)
{
return OfficeAddin.runAction("post", useTemplate, action, nodeId, confirmMsg, inParams, outParams)
},
runAction: function(httpMethod, useTemplate, action, nodeId, confirmMsg, inParams, outParams)
{
if ((confirmMsg != null) && (confirmMsg != ""))
{
return;
if (!confirm(confirmMsg))
{
return;
}
}
OfficeAddin.showStatusText("Running action...", "ajax_anim.gif", false);
var actionURL = useTemplate + "?a=" + Action + "&d=" + Doc;
var actionURL = useTemplate + "?a=" + action + "&n=" + nodeId;
if ((inParams != null) && (inParams != ""))
{
actionURL += "&" + inParams;
}
var myAjax = new Ajax(actionURL, {
method: 'get',
method: httpMethod,
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
onComplete: function(textResponse, xmlResponse)
{
@@ -114,12 +129,14 @@ var OfficeAddin =
{
href += (href.indexOf("?") == -1) ? "?" : "&";
href += "st=" + encodeURI(textResponse);
href += "&" + extraParams;
if ((outParams != null) && (outParams != ""))
{
href += "&" + outParams;
}
}
window.location.href = href;
}
});
myAjax.request();
}).request();
},
/* Calculates and returns the context path for the current page */

View File

@@ -0,0 +1,115 @@
/*
* Prerequisites: mootools.v1.11.js
* office_addin.js
*/
var OfficeTags =
{
/* Scaling for tag clouds - must have supporting CSS classes defined */
SCALE_FACTOR: 5,
/* Manadatory params for searchResults component */
searchParams: "",
init: function()
{
OfficeTags.getTagCloud();
},
setParams: function(params)
{
OfficeTags.searchParams = params;
},
getTagCloud: function()
{
OfficeAddin.showStatusText("Loading tag cloud...", "ajax_anim.gif", false);
// ajax call to get repository tag data
var actionURL = window.serviceContextPath + "/collaboration/tagQuery";
var myJsonRequest = new Json.Remote(actionURL, {
method: 'get',
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
onComplete: function(tagQuery)
{
OfficeAddin.hideStatusText();
OfficeTags.populateTagCloud(tagQuery);
}
}).send();
},
populateTagCloud: function(tagQuery)
{
var tagCloud = $("tagCloud");
var range = tagQuery.countMax - tagQuery.countMin;
var scale = (range / OfficeTags.SCALE_FACTOR);
var tagContainer, tagName, tagNameClass, tagCount;
tagCloud.empty();
tagQuery.tags.each(function(tag, i)
{
tagNameClass = "tagName" + Math.round((tag.count - tagQuery.countMin) / scale);
tagName = new Element("a", {"class": tagNameClass});
tagName.appendText(tag.name);
tagName.injectInside(tagCloud);
tagName.addEvent('click', function(e)
{
OfficeTags.selectTag(tag.name);
});
tagCloud.appendText(" ");
tagCount = new Element("span", {"class": "tagCount"});
tagCount.appendText("(" + tag.count + ")");
tagCount.injectInside(tagName);
});
// $("tagCloud").innerHTML = Json.toString(tagQuery);
},
/* AJAX call to perform server-side tag search */
selectTag: function(tagName)
{
OfficeAddin.showStatusText("Searching tags...", "ajax_anim.gif", false);
// var maxResults = $('maxResults').value;
var maxResults = 100;
var args = OfficeTags.searchParams + "&type=tag";
var actionURL = window.serviceContextPath + "/office/searchResults?p=" + args + "&search=" + tagName.replace(" ", "_x0020_") + "&maxresults=" + maxResults;
var myAjax = new Ajax(actionURL, {
method: 'get',
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
evalScripts: true,
onComplete: function(textResponse, xmlResponse)
{
OfficeAddin.hideStatusText();
$('taggedList').innerHTML = textResponse;
$('taggedHeader').innerHTML = "Tagged with \"" + tagName + "\"";
}
}).request();
}
};
/* Search Results expects this class */
var OfficeSearch =
{
itemsFound: function(shownResults, totalResults)
{
var strFound;
if (totalResults == 0)
{
strFound = "No items found";
}
else if (shownResults < totalResults)
{
strFound = "Showing first " + shownResults + " of " + totalResults + " total items found";
}
else
{
strFound = "Showing all " + shownResults + " items found";
}
$('itemsFound').innerHTML = strFound;
}
};
window.addEvent('domready', OfficeTags.init);