Point check-in of the Office 2003 Add-in. Currently only Word has been developed - Excel is just a bare framework. To test, use installer provided in AlfrescoWord2003Setup\Debug and check the README in the templates folder.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5787 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-05-26 18:07:43 +00:00
parent 4596a6e268
commit 4202d686f4
51 changed files with 1673 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
// Generate a PDF transform of the current object
if (document.isDocument)
{
var runAction = args['action'];
var result = "Action failed.";
if (runAction == "makepdf")
{
var trans = document.transformDocument("application/pdf");
result = "Action completed.";
}
else if (runAction == "delete")
{
var rc = document.remove();
result = "Action completed.";
}
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;
}

View File

@@ -0,0 +1,7 @@
<webscript>
<shortname>Document Actions (Office Add-In)</shortname>
<description>Used by the Office Add-In to perform actions on managed documents</description>
<url format="html" template="/office/docActions" />
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

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

View File

@@ -0,0 +1,115 @@
<#assign doc_actions="${url.context}/scripts/office/docActions.js">
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
<#-- resolve the path (from Company Home) into a node -->
<#if path?starts_with("/Company Home")>
<#if companyhome.childByNamePath[args.p[14..]]?exists>
<#assign d=companyhome.childByNamePath[args.p[14..]]>
<#else>
<#assign d=companyhome>
</#if>
<#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">
<!-- ${args.p} -->
<!-- ${path} -->
<!-- ${d.id} -->
<html>
<head>
<title>Document Details</title>
<link rel="stylesheet" type="text/css" href="${url.context}/css/taskpane.css" />
<script type="text/javascript" src="${url.context}/scripts/office/doc_details.js"></script>
</head>
<body>
<div id="tabBar">
<ul>
<li><a href="${url.context}/scripts/office/myAlfresco?p=${path}"><img src="${url.context}/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
<li><a href="${url.context}/scripts/office/navigation?p=${path}"><img src="${url.context}/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
<li style="padding-right:6px;"><a href="${url.context}/scripts/office/search?p=${path}"><img src="${url.context}/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
<li id="current"><a href="#"><img src="${url.context}/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
<li><a href="${url.context}/scripts/office/versionHistory?p=${path}"><img src="${url.context}/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
</ul>
</div>
<div id="detailsListHeader"><span style="font-weight:bold">Details</span></div>
<div id="detailsList">
<table>
<tbody>
<tr>
<td valign="top">
<#if d.isDocument>
<img src="${url.context}${d.icon32}" border="0" alt="${d.name}" />
</td>
<td style="line-height:16px;" width="100%">
<span style="font-weight:bold;">${d.name}
<#if d.isLocked >
<img src="${url.context}/images/taskpane/lock.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Locked">
</#if>
</span><br/>
<table>
<#if d.properties.title?exists>
<tr><td>Title:</td><td>${d.properties.title}</td></tr>
<#else>
<tr><td>Title:</td><td></td></tr>
</#if>
<#if d.properties.description?exists>
<tr><td>Description:</td><td>${d.properties.description}</td></tr>
<#else>
<tr><td valign="top">Description:</td><td></td></tr>
</#if>
<tr><td>Creator:</td><td>${d.properties.creator}</td></tr>
<tr><td>Created:</td><td>${d.properties.created?datetime}</td></tr>
<tr><td>Modifier:</td><td>${d.properties.modifier}</td></tr>
<tr><td>Modified:</td><td>${d.properties.modified?datetime}</td></tr>
<tr><td>Size:</td><td>${d.size / 1024} Kb</td></tr>
<tr><td valign="top">Categories:</td>
<td>
<#if d.hasAspect("cm:generalclassifiable")>
<#list d.properties.categories as category>
${companyhome.nodeByReference[category].name};
</#list>
<#else>
None.
</#if>
</td>
</tr>
</table>
<#else>
The current document is not managed by Alfresco.
</#if>
</td>
</tr>
</tbody>
</table>
</div>
<div id="documentActions">
<span style="font-weight:bold;">Document Actions</span><br/>
<#if d.isDocument>
<ul>
<#if d.isLocked >
<#elseif hasAspect(d, "cm:workingcopy") == 1>
<li><a href="#" onClick="javascript:runAction('${doc_actions}','checkin','${d.id}', '');"><img src="${url.context}/images/taskpane/checkin.gif" border="0" style="padding-right:6px;" alt="Check In">Check In</a></li>
<#else>
<li><a href="#" onClick="javascript:runAction('${doc_actions}','checkout','${d.id}', '');"><img src="${url.context}/images/taskpane/checkout.gif" border="0" style="padding-right:6px;" alt="Check Out">Check Out</a></li>
</#if>
<li><a href="#" onClick="javascript:runAction('${doc_actions}','makepdf','${d.id}', '');"><img src="${url.context}/images/taskpane/makepdf.gif" border="0" style="padding-right:6px;" alt="Transform to PDF">Transform to PDF</a></li>
<li><a href="${url.context}/navigate/showDocDetails/workspace/SpacesStore/${d.id}?ticket=${session.ticket}" target="_blank"><img src="${url.context}/images/taskpane/document_details.gif" border="0" style="padding-right:6px;" alt="Open Full Details">Open Full Details</a></li>
</ul>
<#else>
No actions available.
</#if>
</div>
<div id="bottomMargin"><span id="statusArea">&nbsp;</span>
</div>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<webscript>
<shortname>My Alfresco (Office Add-In)</shortname>
<description>Generate the Office Add-In My Alfresco page</description>
<url format="html" template="/office/myAlfresco?p={path?}" />
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,92 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>My Alfresco</title>
<link rel="stylesheet" type="text/css" href="/alfresco/css/taskpane.css" />
<script type="text/javascript" src="/alfresco/scripts/office/my_alfresco.js"></script>
</head>
<body>
<div id="tabBar">
<ul>
<li id="current"><a href="#"><img src="/alfresco/images/office/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/office/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
<li style="padding-right:6px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/office/search.gif" border="0" alt="Search Alfresco" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/office/document_details.gif" border="0" alt="View Details" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_history}"><img src="/alfresco/images/office/version_history.gif" border="0" alt="View Version History" /></a></li>
</ul>
</div>
<div id="mycheckedoutdocsListHeader"><span style="font-weight:bold">My checked out documents</span></div>
<div id="mycheckedoutdocsList">
<table>
<tbody>
<#assign query="@cm\\:workingCopyOwner:${person.properties.userName}">
<#list companyhome.childrenByLuceneSearch[query] as child>
<#if child.isDocument>
<!-- lb: start repeat -->
<tr>
<td>
<a href="#"><img src="/alfresco/images/office/document.gif" border="0" alt="Open ${child.name}" /></a>
</td>
<td style="line-height:16px;" width="100%">
<a href="#" title="Open ${child.name}">${child.name}</a><br/>
<#if child.properties.description?exists>
${child.properties.description}<br/>
</#if>
Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb<br/>
<a href="#" onClick="javascript:runAction('checkin','${child.id}', '');"><img src="/alfresco/images/office/checkin.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In"></a>
<a href="#" onClick="javascript:runAction('makepdf','${child.id}', '');"><img src="/alfresco/images/office/makepdf.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF"></a>
</td>
</tr>
<!-- lb: end repeat -->
</#if>
</#list>
</tbody>
</table>
</div>
<div id="mytodoListHeader"><span style="font-weight:bold;">My Communities</span>
</div>
<div id="mytodoList">
<table>
<tbody>
<#list companyhome.childrenByXPath["*[@cm:name='Communities']/*"] as child>
<!-- lb: start repeat -->
<tr>
<td>
<a href="#"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
</td>
<td width="100%">
<a href="/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${office_browse}" title="Open ${child.name}">${child.name}</a><br/>
<#if child.properties.description?exists>
${child.properties.description}
</#if>
</td>
</tr>
<!-- lb: end repeat -->
</#list>
</table>
</div>
<div id="documentActions">
<span style="font-weight:bold;">Other Actions</span><br/>
<div id="yellowbox" style="background:#ffffcc;border: 1px solid #cccccc; margin-top:6px; padding-bottom:6px;">
<ul>
<li style="padding-bottom:4px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/office/save_to_alfresco.gif" border="0" style="padding-right:6px;" alt="Save to Alfresco"><b>Save to Alfresco</b></a><br> Allows you to place the current document under Alfresco management.</li>
<li style="padding-bottom:4px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/office/navigator.gif" border="0" style="padding-right:6px;" alt="Browse"><b>Browse Alfresco</b></a><br> Navigate around the Alfresco repository for documents.</li>
<li style="padding-bottom:4px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/office/search.gif" border="0" style="padding-right:6px;" alt="Search"><b>Find Documents</b></a><br> Search Alfresco for documents by name and content.</li>
<li style="padding-bottom:4px;"><a href="/alfresco/navigate/browse?ticket=${session.ticket}" target="_blank"><img src="/alfresco/images/logo/AlfrescoLogo16.gif" border="0" style="padding-right:6px;" alt="Save to Alfresco"><b>Launch Alfresco</b></a><br> Start the Alfresco Web Client.</li>
</ul>
</div>
</div>
<div id="bottomMargin" style="height:24px;"><span id="statusArea">&nbsp;</span>
</div>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<webscript>
<shortname>Navigation (Office Add-In)</shortname>
<description>Generate the Office Add-In Navigation page</description>
<url format="html" template="/office/navigation?p={path?}" />
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,161 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<#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>
</#list>
<#if document.isDocument>
<#assign thisSpace = document.parent>
<#else>
<#assign thisSpace = document>
</#if>
<html>
<head>
<title>Basic Navigation</title>
<link rel="stylesheet" type="text/css"
href="/alfresco/css/taskpane.css" />
<script type="text/javascript" src="/alfresco${nav_script.url}" >
</script>
</head>
<body>
<div id="tabBar">
<ul>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_home}"><img src="/alfresco/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
<li id="current"><a href="#"><img src="/alfresco/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
<li style="padding-right:6px;"><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_history}"><img src="/alfresco/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
</ul>
</div>
<div id="currentSpaceInfo">
<table>
<tr>
<td rowspan=2 class="valign">
In:<img src="/alfresco${thisSpace.icon32}" border="0"/>
</td>
<td>
<span style="font-weight:bold;">${thisSpace.name}</span>
</td>
</tr>
<tr>
<td>
<#if thisSpace.properties.description?exists>
${thisSpace.properties.description}
</#if>
</td>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;
<#if thisSpace = companyhome>
<#else>
<img src="/alfresco/images/taskpane/go_up.gif" border="0" width="16" height="16" alt="go up to parent space"/><a href="/alfresco/template/workspace/SpacesStore/${thisSpace.parent.id}/workspace/SpacesStore/${template.id}"><span title="Go up to parent space">Up</span></a>
</#if>
</td>
</tr>
</table>
</div>
<div id="spaceListHeader"><span style="font-weight:bold">Spaces in ${thisSpace.name}</span></div>
<div id="spaceList">
<table>
<tbody>
<#list thisSpace.children as child>
<#if child.isContainer>
<!-- lb: start repeat -->
<tr>
<td>
<a href="#"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
</td>
<td width="100%">
<a href="/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${template.id}" title="Open ${child.name}">${child.name}</a><br/>
<#if child.properties.description?exists>
${child.properties.description}
</#if>
</td>
</tr>
</#if>
</#list>
<!-- lb: end repeat -->
</tbody>
</table>
</div>
<div id="contentListHeader"><span style="font-weight:bold;">Documents in ${thisSpace.name}</span>
</div>
<div id="contentList">
<table>
<tbody>
<#list thisSpace.children as child>
<#if child.isDocument>
<!-- lb: start repeat -->
<#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
<tr>
<td>
<#if child.name?ends_with(".doc")>
<a href="#" onClick="window.external.openDocument('${webdavPath}')"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
<#else>
<a href="/alfresco${child.url}?ticket=${session.ticket}" target="_blank"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
</#if>
</td>
<td style="line-height:16px;" width="100%">
<#if child.name?ends_with(".doc")>
<a href="#" onClick="window.external.openDocument('${webdavPath}')" title="Open ${child.name}">${child.name}</a><br/>
<#else>
<a href="/alfresco${child.url}?ticket=${session.ticket}" target="_blank" title="Open ${child.name}">${child.name}</a><br/>
</#if>
<#if child.properties.description?exists>
${child.properties.description}<br/>
</#if>
Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb<br/>
<#if child.isLocked >
<img src="/alfresco/images/taskpane/lock.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Locked">
<#elseif hasAspect(child, "cm:workingcopy") == 1>
<a href="#" onClick="javascript:runAction('${doc_actions}','checkin','${child.id}', '');"><img src="/alfresco/images/taskpane/checkin.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In"></a>
<#else>
<a href="#" onClick="javascript:runAction('${doc_actions}','checkout','${child.id}', '');"><img src="/alfresco/images/taskpane/checkout.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out"></a>
</#if>
<a href="#" onClick="javascript:runAction('${doc_actions}','makepdf','${child.id}', '');"><img src="/alfresco/images/taskpane/makepdf.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF"></a>
<#if !child.isLocked >
<a href="#" onClick="javascript:runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="/alfresco/images/taskpane/delete.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete"></a>
</#if>
</td>
</tr>
<!-- lb: end repeat -->
</#if>
</#list>
</tbody>
</table>
</div>
<div id="documentActions">
<span style="font-weight:bold;">Document Actions</span><br/>
<ul>
<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name />
<#assign webdavPath = currentPath?substring(13)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
<li><a href="#" onClick="window.external.saveToAlfresco('${webdavPath}')"><img src="/alfresco/images/taskpane/save_to_alfresco.gif" border="0" style="padding-right:6px;" alt="Save to Alfresco">Save to Alfresco</a></li>
<#if args.search?exists>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_search}?searchagain=${args.search}&maxresults=${args.maxresults}"><img src="/alfresco/images/taskpane/placeholder.gif" border="0" style="padding-right:6px;" alt="Back to results">Back to search results</a></li>
</#if>
</ul>
</div>
<div id="bottomMargin" style="height:24px; padding-left:6px;"><span id="statusArea">&nbsp;</span>
</div>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<webscript>
<shortname>Search (Office Add-In)</shortname>
<description>Generate the Office Add-In Search page</description>
<url format="html" template="/office/search?p={path?}" />
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,150 @@
<#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>
</#list>
<#if args.search?exists>
<#assign searchString = args.search>
<#if searchString != "">
<#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}">
</#if>
<#else>
<#assign searchString = "">
<#assign queryString = "">
</#if>
<#if searchString != "">
<#if args.maxresults?exists>
<#assign maxresults=args.maxresults?number>
<#else>
<#assign maxresults=10>
</#if>
<#assign rescount=1>
<!-- Start output -->
<table>
<tbody style="font-family: tahoma, sans-serif; font-size: 11px;">
<#assign results = companyhome.childrenByLuceneSearch[queryString] >
<#if results?size = 0>
<tr><td>No results found.</td></tr>
<#else>
<#list results as child>
<!-- lb: start repeat -->
<#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}')\"">
</#if>
<#else>
<#assign openURL = "/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${office_browse}?search=${searchString}&maxresults=${maxresults}">
<#assign hrefExtra = "">
</#if>
<tr>
<td>
<a href="${openURL}" ${hrefExtra}><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
</td>
<td width="100%">
<a href="${openURL}" ${hrefExtra} title="Open ${child.name}">${child.name}</a><br/>
<#if child.properties.description?exists>
${child.properties.description}<br/>
</#if>
<#if child.isDocument>
Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb<br/>
</#if>
</td>
</tr>
<!-- lb: end repeat -->
<#if rescount = maxresults>
<#break>
</#if>
<#assign rescount=rescount + 1>
</#list>
</#if>
</tbody>
</table>
<!-- End output -->
</#if>
<!-- End of returning search results -->
<!-- Display Search UI -->
<#if !args.search?exists>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Search</title>
<link rel="stylesheet" type="text/css"
href="/alfresco/css/taskpane.css" />
<script type="text/javascript" src="/alfresco${srch_script.url}" >
</script>
</head>
<#if args.searchagain?exists>
<#assign onLoad = "onLoad = \"doSearch('${args.searchagain}', '${args.maxresults}');\"">
<#else>
<#assign onLoad = "">
</#if>
<body ${onLoad}>
<div id="tabBar">
<ul>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_home}"><img src="/alfresco/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
<li id="current" style="padding-right:6px;"><a href="#"><img src="/alfresco/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_history}"><img src="/alfresco/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
</ul>
</div>
<div id="search">
<table width="100%" border="0" style="font-family: tahoma, sans-serif; font-size: 11px;">
<tr valign="top">
<td align="left" valign="middle">
Search for <input type="text" id="searchText" name="searchText" value="" maxlength='1024' style='width:140px;font-size:10px' onkeyup="return handleTextEnter(event);" /><input type="button" name="simpleSearchButton" id="simpleSearchButton" class="button" onClick="javascript:runSearch('${office_search}');" value="Search"/><br/>
<label><SELECT id="maxresults" NAME="maxresults" onchange="javascript:runSearch('${office_search}');">
<option id="5" name="5" value=5>5</option>
<option id="10" name="10" value=10>10</option>
<option id="15" name="15" value=15>15</option>
<option id="20" name="20" value=20>20</option>
<option id="50" name="50" value=50>50</option>
</select>&#160;Items</label><br/>
</td>
</tr>
</table>
</div>
<div id="searchResultsListHeader"><span style="font-weight:bold">Items Found</span></div>
<div id="searchResultsList">
<table>
<tbody>
</tbody>
</table>
</div>
<div id="bottomMargin" style="height:24px;"><span id="statusArea">&nbsp;</span>
</div>
</body>
</html>
</#if>
<!-- End of Search UI -->

View File

@@ -0,0 +1,7 @@
<webscript>
<shortname>Version History (Office Add-In)</shortname>
<description>Generate the Office Add-In Version History page</description>
<url format="html" template="/office/versionHistory?p={path?}" />
<authentication>user</authentication>
<transaction>required</transaction>
</webscript>

View File

@@ -0,0 +1,88 @@
<#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>
</#if>
</#list>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Version History</title>
<link rel="stylesheet" type="text/css"
href="/alfresco/css/taskpane.css" />
<script type="text/javascript" src="/alfresco${ver_script.url}">
</script>
</head>
<body>
<div id="tabBar">
<ul>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_home}"><img src="/alfresco/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
<li style="padding-right:6px;"><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
<li id="current"><a href="#"><img src="/alfresco/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
</ul>
</div>
<div id="versionListHeader"><span style="font-weight:bold">Version History for ${document.name}</span></div>
<div id="versionList">
<table>
<tbody>
<#if document.isDocument >
<#if hasAspect(document, "cm:versionable") == 1 >
<!-- lb: start repeat row -->
<#list document.versionHistory?sort_by("versionLabel")?reverse as record>
<tr>
<td valign="top">
<a href="/alfresco${document.url}"><img src="/alfresco/images/taskpane/document.gif" border="0" alt="Open ${record.versionLabel}"/></a>
</td>
<td style="line-height:16px;" width="100%">
<a href="#" title="Open ${record.versionLabel}"><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>
<!-- <a href="#" onClick="window.external.compareDocument('/alfresco${document.url}')" title="Compare with current">Compare with current</a><br/> -->
</td>
</tr>
</#list>
<#else>
<tr>
<td valign="top">
The current document is not versioned.<br>
<a href="#" onClick="javascript:runAction('${doc_actions}','makeversion','${document.id}', '');">Make Versionable</a>
</td>
</tr>
</#if>
<!-- lb: end repeat row -->
<#else>
<tr>
<td valign="top">
The current document is not managed by Alfresco.
</td>
</tr>
</#if>
</tbody>
</table>
</div>
<div id="bottomMargin" style="height:24px; padding-left:6px;"><span id="statusArea">&nbsp;</span>
</div>
</body>
</html>

130
source/web/css/office.css Normal file
View File

@@ -0,0 +1,130 @@
html, body {
height: 100%;
overflow:hidden;
font-family: tahoma, sans-serif;
font-size: 11px;
color: #0073e6;
background: url("../images/taskpane/view_bg.gif") top;
}
body {margin:0px;padding:0px;}
#tabBar {
float:left;
width:100%;
background:#d4eaff url("../images/taskpane/bg.gif") repeat-x bottom;
font-size:93%;
line-height:normal;
}
#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;
}
#spaceListHeader {width:100%;
height:auto;
padding:6px;}
#mycheckedoutdocsListHeader {width:100%;
height:auto;
padding:6px;}
#mytodoListHeader {width:100%;
height:auto;
padding:6px;}
#contentListHeader {width:100%;
height:auto;padding:6px;}
#searchResultsListHeader {width:100%;
height:auto;padding:6px;}
#detailsListHeader {width:100%;
height:auto;padding:6px;}
#versionListHeader {width:100%;
height:auto;padding:6px;}
#advWorkflowListHeader {width:100%;
height:auto;padding:6px;}
#myTasksListHeader {width:100%;
height:auto;padding:6px;}
#simpleWorkflowHeader {width:100%;
height:auto;padding:6px;}
#currentSpaceInfo {width:100%;
padding: 6px}
#simpleWorkflowInfo {width:100%;
padding: 6px}
#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;}
TABLE {border:0px;
padding:2px;}
A {color:#0073e6; }
#bottomMargin {height:6px;}
#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{
color:#0073e6;
font-size:11px;
font-weight:bold;
background-color:#cce6ff;
border:1px solid;
border-top-color:#0073e6;
border-left-color:#0073e6;
border-right-color:#0073e6;
border-bottom-color:#0073e6;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff');
cursor:pointer;
margin-left:6px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

View File

@@ -0,0 +1,110 @@
var xmlHttp
function showStatus(url)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("statusArea").innerHTML=xmlHttp.responseText
window.location.reload();
}
}
function GetXmlHttpObject()
{
var objXMLHttp = null;
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
function runAction(useTemplate, Action, Doc, Msg)
{
if (Msg != "" && !confirm(Msg))
{
return;
}
document.getElementById("statusArea").innerHTML="Running action...";
showStatus("/alfresco/command/script/execute/workspace/SpacesStore/" + useTemplate + "/workspace/SpacesStore/" + Doc + "?action=" + Action);
}
function getWindowHeight()
{
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number')
{
windowHeight = window.innerHeight;
}
else
{
if (document.documentElement && document.documentElement.clientHeight)
{
windowHeight = document.documentElement.clientHeight;
}
else
{
if (document.body && document.body.clientHeight)
{
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function setContent()
{
if (document.getElementById)
{
var windowHeight = getWindowHeight();
if (windowHeight > 0)
{
var detailsListHeaderElement = document.getElementById('detailsListHeader');
var detailsListElement = document.getElementById('detailsList');
var tabBarElement = document.getElementById('tabBar');
var bottomMarginElement = document.getElementById('bottomMargin');
var documentActionsElement = document.getElementById('documentActions');
var detailsListHeight = detailsListElement.offsetHeight;
var detailsListHeaderHeight = detailsListHeaderElement.offsetHeight;
var tabBarHeight = tabBarElement.offsetHeight;
var bottomMarginHeight = bottomMarginElement.offsetHeight;
var documentActionsHeight = documentActionsElement.offsetHeight;
if (windowHeight > 0)
{
detailsListElement.style.height = ((windowHeight- (tabBarHeight + detailsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /3) * 2 + 'px';
documentActionsElement.style.height = (windowHeight- (tabBarHeight + detailsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /3 + 'px';
}
}
}
}
window.onload = function()
{
setContent();
}
window.onresize = function()
{
setContent();
}

View File

@@ -0,0 +1,182 @@
var xmlHttp
function GetXmlHttpObject()
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp;
}
function showStatus(url)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url+"&sid="+Math.random(),true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if (xmlHttp.responseText.indexOf("System Error") > 0)
{
var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400");
myWindow.document.write(xmlHttp.responseText);
document.getElementById("statusArea").innerHTML="";
}
else
{
document.getElementById("statusArea").innerHTML=xmlHttp.responseText;
window.location.reload();
}
}
}
function runAction(Action, Doc, Msg)
{
if (Msg != "" && !confirm(Msg))
{
return;
}
document.getElementById("statusArea").innerHTML="Running action...";
showStatus("/alfresco/command/script/execute/workspace/SpacesStore/${doc_actions}/workspace/SpacesStore/" + Doc + "?action=" + Action);
}
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function setContent() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var mycheckedoutdocsListElement = document.getElementById('mycheckedoutdocsList');
var mytodoListElement = document.getElementById('mytodoList');
var tabBarElement = document.getElementById('tabBar');
var mycheckedoutdocsListHeaderElement = document.getElementById('mycheckedoutdocsListHeader');
var mytodoListHeaderElement = document.getElementById('mytodoListHeader');
var bottomMarginElement = document.getElementById('bottomMargin');
var documentActionsElement = document.getElementById('documentActions');
var mycheckedoutdocsListHeight = mycheckedoutdocsListElement.offsetHeight;
var mytodoListHeight = mytodoListElement.offsetHeight;
var tabBarHeight = tabBarElement.offsetHeight;
var mycheckedoutdocsListHeaderHeight = mycheckedoutdocsListHeaderElement.offsetHeight;
var mytodoListHeaderHeight = mytodoListHeaderElement.offsetHeight;
var bottomMarginHeight = bottomMarginElement.offsetHeight;
var documentActionsHeight = documentActionsElement.offsetHeight;
if (windowHeight > 0) {
mycheckedoutdocsListElement.style.height = (windowHeight- (tabBarHeight + mytodoListHeaderHeight + mycheckedoutdocsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px';
mytodoListElement.style.height = (windowHeight- (tabBarHeight + mytodoListHeaderHeight + mycheckedoutdocsListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px';
}
}
}
}
window.onload = function() {
setContent();
stripe('mytodoList', '#fff', '#f6f8fa');
stripe('mycheckedoutdocsList', '#fff', '#f6f8fa');
}
window.onresize = function() {
setContent();
}
// this function is need to work around
// a bug in IE related to element attributes
function hasClass(obj) {
var result = false;
if (obj.getAttributeNode("class") != null) {
result = obj.getAttributeNode("class").value;
}
return result;
}
function stripe(id) {
// the flag we'll use to keep track of
// whether the current row is odd or even
var even = false;
// if arguments are provided to specify the colours
// of the even & odd rows, then use the them;
// otherwise use the following defaults:
var evenColor = arguments[1] ? arguments[1] : "#fff";
var oddColor = arguments[2] ? arguments[2] : "#eee";
// obtain a reference to the desired table
// if no such table exists, abort
var table = document.getElementById(id);
if (! table) { return; }
// by definition, tables can have more than one tbody
// element, so we'll have to get the list of child
// &lt;tbody&gt;s
var tbodies = table.getElementsByTagName("tbody");
// and iterate through them...
for (var h = 0; h < tbodies.length; h++) {
// find all the &lt;tr&gt; elements...
var trs = tbodies[h].getElementsByTagName("tr");
// ... and iterate through them
for (var i = 0; i < trs.length; i++) {
// avoid rows that have a class attribute
// or backgroundColor style
if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
// get all the cells in this row...
var tds = trs[i].getElementsByTagName("td");
// and iterate through them...
for (var j = 0; j < tds.length; j++) {
var mytd = tds[j];
// avoid cells that have a class attribute
// or backgroundColor style
if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
mytd.style.backgroundColor = even ? evenColor : oddColor;
}
}
}
// flip from odd to even, or vice-versa
even = ! even;
}
}
}

View File

@@ -0,0 +1,187 @@
var xmlHttp
function GetXmlHttpObject()
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp;
}
function showStatus(url)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url+"&sid="+Math.random(),true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if (xmlHttp.responseText.indexOf("System Error") > 0)
{
var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400");
myWindow.document.write(xmlHttp.responseText);
document.getElementById("statusArea").innerHTML="";
}
else
{
document.getElementById("statusArea").innerHTML=xmlHttp.responseText;
window.location.reload();
}
}
}
function runAction(useTemplate, Action, Doc, Msg)
{
if (Msg != "" && !confirm(Msg))
{
return;
}
document.getElementById("statusArea").innerHTML="Running action...";
showStatus("/alfresco/command/script/execute/workspace/SpacesStore/" + useTemplate + "/workspace/SpacesStore/" + Doc + "?action=" + Action);
}
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function setContent() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var spaceListElement = document.getElementById('spaceList');
var contentListElement = document.getElementById('contentList');
var tabBarElement = document.getElementById('tabBar');
var currentSpaceInfoElement = document.getElementById('currentSpaceInfo');
var spaceListHeaderElement = document.getElementById('spaceListHeader');
var contentListHeaderElement = document.getElementById('contentListHeader');
var bottomMarginElement = document.getElementById('bottomMargin');
var documentActionsElement = document.getElementById('documentActions');
var spaceListHeight = spaceListElement.offsetHeight;
var contentListHeight = contentListElement.offsetHeight;
var tabBarHeight = tabBarElement.offsetHeight;
var currentSpaceInfoHeight = currentSpaceInfoElement.offsetHeight;
var spaceListHeaderHeight = spaceListHeaderElement.offsetHeight;
var contentListHeaderHeight = contentListHeaderElement.offsetHeight;
var bottomMarginHeight = bottomMarginElement.offsetHeight;
var documentActionsHeight = documentActionsElement.offsetHeight;
if (windowHeight > 0) {
spaceListElement.style.height = (windowHeight- (tabBarHeight + currentSpaceInfoHeight + spaceListHeaderHeight + contentListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px';
contentListElement.style.height = (windowHeight- (tabBarHeight + currentSpaceInfoHeight + spaceListHeaderHeight + contentListHeaderHeight + documentActionsHeight + bottomMarginHeight)) /2 + 'px';
}
}
}
}
window.onload = function() {
setContent();
stripe('spaceList', '#fff', '#f6f8fa');
stripe('contentList', '#fff', '#f6f8fa');
}
window.onresize = function() {
setContent();
}
// this function is need to work around
// a bug in IE related to element attributes
function hasClass(obj) {
var result = false;
if (obj.getAttributeNode("class") != null) {
result = obj.getAttributeNode("class").value;
}
return result;
}
function stripe(id) {
// the flag we'll use to keep track of
// whether the current row is odd or even
var even = false;
// if arguments are provided to specify the colours
// of the even & odd rows, then use the them;
// otherwise use the following defaults:
var evenColor = arguments[1] ? arguments[1] : "#fff";
var oddColor = arguments[2] ? arguments[2] : "#eee";
// obtain a reference to the desired table
// if no such table exists, abort
var table = document.getElementById(id);
if (! table) { return; }
// by definition, tables can have more than one tbody
// element, so we'll have to get the list of child
// &lt;tbody&gt;s
var tbodies = table.getElementsByTagName("tbody");
// and iterate through them...
for (var h = 0; h < tbodies.length; h++) {
// find all the &lt;tr&gt; elements...
var trs = tbodies[h].getElementsByTagName("tr");
// ... and iterate through them
for (var i = 0; i < trs.length; i++) {
// avoid rows that have a class attribute
// or backgroundColor style
if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
// get all the cells in this row...
var tds = trs[i].getElementsByTagName("td");
// and iterate through them...
for (var j = 0; j < tds.length; j++) {
var mytd = tds[j];
// avoid cells that have a class attribute
// or backgroundColor style
if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
mytd.style.backgroundColor = even ? evenColor : oddColor;
}
}
}
// flip from odd to even, or vice-versa
even = ! even;
}
}
}

View File

@@ -0,0 +1,203 @@
var xmlHttp
function GetXmlHttpObject()
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp;
}
function showStatus(url)
{
// alert(url);
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url+"&sid="+Math.random(),true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if (xmlHttp.responseText.indexOf("System Error") > 0)
{
var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400");
myWindow.document.write(xmlHttp.responseText);
}
else
{
document.getElementById("searchResultsList").innerHTML=xmlHttp.responseText;
stripe('searchResultsList', '#fff', '#f6f8fa');
}
document.getElementById("statusArea").innerHTML="";
}
}
function runSearch(useTemplate)
{
document.getElementById("statusArea").innerHTML="Searching...";
searchString = document.getElementById("searchText").value;
maxcount = document.getElementById("maxresults").value;
doSearch(useTemplate, searchString, maxcount);
}
function doSearch(useTemplate, searchString, maxcount)
{
showStatus("/alfresco/template/workspace/SpacesStore/"+ useTemplate + "/workspace/SpacesStore/" + useTemplate + "?search=" + searchString + "&maxresults=" + maxcount);
}
function handleTextEnter(e) {
var keycode;
// get the keycode
if (window.event)
{
keycode = window.event.keyCode;
}
else if (e)
{
keycode = e.which;
}
// if ENTER was pressed execute the query
if (keycode == 13)
{
runSearch();
return false;
}
return true;
}
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function setContent() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var tabBarElement = document.getElementById('tabBar');
var bottomMarginElement = document.getElementById('bottomMargin');
var searchResultsListElement = document.getElementById('searchResultsList');
var searchHeightElement = document.getElementById('search');
var searchResultsListHeaderElement = document.getElementById('searchResultsListHeader');
var tabBarHeight = tabBarElement.offsetHeight;
var bottomMarginHeight = bottomMarginElement.offsetHeight;
var searchResultsListHeight = searchResultsListElement.offsetHeight;
var searchHeight = searchHeightElement.offsetHeight;
var searchResultsListHeaderHeight = searchResultsListHeaderElement.offsetHeight;
if (windowHeight > 0) {
searchResultsListElement.style.height = windowHeight- (tabBarHeight + searchHeight + searchResultsListHeaderHeight + bottomMarginHeight) + 'px';
}
}
}
}
window.onload = function() {
setContent();
stripe('searchResultsList', '#fff', '#f6f8fa');
}
window.onresize = function() {
setContent();
}
// this function is need to work around
// a bug in IE related to element attributes
function hasClass(obj) {
var result = false;
if (obj.getAttributeNode("class") != null) {
result = obj.getAttributeNode("class").value;
}
return result;
}
function stripe(id) {
// the flag we'll use to keep track of
// whether the current row is odd or even
var even = false;
// if arguments are provided to specify the colours
// of the even & odd rows, then use the them;
// otherwise use the following defaults:
var evenColor = arguments[1] ? arguments[1] : "#fff";
var oddColor = arguments[2] ? arguments[2] : "#eee";
// obtain a reference to the desired table
// if no such table exists, abort
var table = document.getElementById(id);
if (! table) { return; }
// by definition, tables can have more than one tbody
// element, so we'll have to get the list of child
// &lt;tbody&gt;s
var tbodies = table.getElementsByTagName("tbody");
// and iterate through them...
for (var h = 0; h < tbodies.length; h++) {
// find all the &lt;tr&gt; elements...
var trs = tbodies[h].getElementsByTagName("tr");
// ... and iterate through them
for (var i = 0; i < trs.length; i++) {
// avoid rows that have a class attribute
// or backgroundColor style
if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
// get all the cells in this row...
var tds = trs[i].getElementsByTagName("td");
// and iterate through them...
for (var j = 0; j < tds.length; j++) {
var mytd = tds[j];
// avoid cells that have a class attribute
// or backgroundColor style
if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
mytd.style.backgroundColor = even ? evenColor : oddColor;
}
}
}
// flip from odd to even, or vice-versa
even = ! even;
}
}
}

View File

@@ -0,0 +1,173 @@
var xmlHttp
function GetXmlHttpObject()
{
var objXMLHttp=null;
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp;
}
function showStatus(url)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert("Browser does not support HTTP Request");
return;
}
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url+"&sid="+Math.random(),true);
xmlHttp.send(null);
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if (xmlHttp.responseText.indexOf("System Error") > 0)
{
var myWindow = window.open("", "_blank", "scrollbars,height=500,width=400");
myWindow.document.write(xmlHttp.responseText);
document.getElementById("statusArea").innerHTML="";
}
else
{
document.getElementById("statusArea").innerHTML=xmlHttp.responseText;
window.location.reload();
}
}
}
function runAction(useTemplate, Action, Doc, Msg)
{
if (Msg != "" && !confirm(Msg))
{
return;
}
document.getElementById("statusArea").innerHTML="Running action...";
showStatus("/alfresco/command/script/execute/workspace/SpacesStore/" + useTemplate + "/workspace/SpacesStore/" + Doc + "?action=" + Action);
}
function getWindowHeight() {
var windowHeight = 0;
if (typeof(window.innerHeight) == 'number') {
windowHeight = window.innerHeight;
}
else {
if (document.documentElement && document.documentElement.clientHeight) {
windowHeight = document.documentElement.clientHeight;
}
else {
if (document.body && document.body.clientHeight) {
windowHeight = document.body.clientHeight;
}
}
}
return windowHeight;
}
function setContent() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
var versionListHeaderElement = document.getElementById('versionListheader');
var versionListElement = document.getElementById('versionList');
var tabBarElement = document.getElementById('tabBar');
var bottomMarginElement = document.getElementById('bottomMargin');
var versionListHeight = versionListElement.offsetHeight;
var versionListHeaderHeight = versionListHeaderElement.offsetHeight;
var tabBarHeight = tabBarElement.offsetHeight;
var bottomMarginHeight = bottomMarginElement.offsetHeight;
if (windowHeight > 0) {
versionListElement.style.height = (windowHeight- (tabBarHeight + versionListHeaderHeight + bottomMarginHeight)) + 'px';
}
}
}
}
window.onload = function() {
setContent();
stripe('versionList', '#fff', '#f6f8fa');
}
window.onresize = function() {
setContent();
}
// this function is need to work around
// a bug in IE related to element attributes
function hasClass(obj) {
var result = false;
if (obj.getAttributeNode("class") != null) {
result = obj.getAttributeNode("class").value;
}
return result;
}
function stripe(id) {
// the flag we'll use to keep track of
// whether the current row is odd or even
var even = false;
// if arguments are provided to specify the colours
// of the even & odd rows, then use the them;
// otherwise use the following defaults:
var evenColor = arguments[1] ? arguments[1] : "#fff";
var oddColor = arguments[2] ? arguments[2] : "#eee";
// obtain a reference to the desired table
// if no such table exists, abort
var table = document.getElementById(id);
if (! table) { return; }
// by definition, tables can have more than one tbody
// element, so we'll have to get the list of child
// &lt;tbody&gt;s
var tbodies = table.getElementsByTagName("tbody");
// and iterate through them...
for (var h = 0; h < tbodies.length; h++) {
// find all the &lt;tr&gt; elements...
var trs = tbodies[h].getElementsByTagName("tr");
// ... and iterate through them
for (var i = 0; i < trs.length; i++) {
// avoid rows that have a class attribute
// or backgroundColor style
if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
// get all the cells in this row...
var tds = trs[i].getElementsByTagName("td");
// and iterate through them...
for (var j = 0; j < tds.length; j++) {
var mytd = tds[j];
// avoid cells that have a class attribute
// or backgroundColor style
if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
mytd.style.backgroundColor = even ? evenColor : oddColor;
}
}
}
// flip from odd to even, or vice-versa
even = ! even;
}
}
}