mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged V3.2 to HEAD
18052: Merged DEV/REPO-DOCLIB to V3.2 17653: Checkpoint Repo DocLib prototype work 17741: Repo DocLib checkpoint. Forms tag picker support for "create new tag". Data webscripts to also support create tag. Object picker appears in YUI panel rather than inline. Edit metadata dialog now uses Forms runtime. Document & Folder details pages working in non-site mode (but not actions). Added new Share form config file. RM fixes based on DocLib refactoring. Numerous other fixes throughout to support Repository mode. 17742: Merged V3.2 to DEV/REPO-DOCLIB 17633-17741: Latest V3.2 fixes 17761: Repo DocLib checkpoint. New category code & visuals. Path fixes. Object picker fixes. New "locate" action. 17783: Merged DEV/GAV/FORMS-33 to DEV/REPO-DOCLIB 17673: First cut of rich text form control (tinymce) 17691: Wrapped the Alfresco.util.RichEditor object as a Share JavaScript component (Alfresco.RichTextControl) Updated rich text control FTL to instantiate new Alfresco.RichTextControl component 17699: Created separate controls for 'richtext' and 'content', both use same underlying JavaScript object though content control displays appropriate control or completely hides field depending on content's mimetype Added ability to persist content properties (now able to create new instance of cm:content from test form) Error message is now displayed when form fails to submit successfully 17707: Mimetype of created content can now be controlled via form field 17713: Content control now retrieves content so inline editing of textual content is now possible 17810: Repo DocLib checkpoint. Create content 17817: Fixed code path where mimetype for created content does not get set and thus defaults to octet-stream 17979: Repo DocLib checkpoint. DocLib History manager (& YUI bugfix) and cross-Share filter handling refactor. 18027: Repo DocLib checkpoint: Records Management DocLib refactor to new extension pattern. New config to show/hide Repository link in header (hidden by default). "Company Home" renamed to "Repository" to allow arbitrary nodeRefs as root (draft impl.) 18035: Merged V3.2 to DEV/REPO-DOCLIB 17743-18030: Latest V3.2 fixes git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18296 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<shortname>Tagging Actions</shortname>
|
||||
<description>Add and remove tags to nodes</description>
|
||||
<url>/collaboration/tagActions</url>
|
||||
<format default="html"/>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction>required</transaction>
|
||||
</webscript>
|
||||
|
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"statusString":"${tagActions.resultString}",
|
||||
"statusCode":${tagActions.resultCode?string},
|
||||
"newTag":"${tagActions.newTag?string}"
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
"statusString": "${tagActions.resultString}",
|
||||
"statusCode": ${tagActions.resultCode?string},
|
||||
"newTag": "${tagActions.newTag?string}"
|
||||
}
|
||||
</#escape>
|
@@ -1,8 +1,17 @@
|
||||
<webscript>
|
||||
<shortname>Tagging Query</shortname>
|
||||
<description>Query tag usage</description>
|
||||
<url>/collaboration/tagQuery</url>
|
||||
<format default="html"/>
|
||||
<description><![CDATA[
|
||||
Query tag usage.
|
||||
<br />
|
||||
The following properties may be updated.
|
||||
<dl>
|
||||
<dt>nodeRef</dt><dd>nodeRef to anchor tag query from. Defaults to Company Home</dd>
|
||||
<dt>maxResults</dt><dd>maximum number of results to return. Defaults to all results (limited by Lucene)</dd>
|
||||
<dt>sortOrder</dt><dd>sort order for results. Possible values are: "name" (default), "count"</dd>
|
||||
</dl>
|
||||
]]></description>
|
||||
<url>/collaboration/tagQuery?n={nodeRef?}&m={maxResults?}&s={sortOrder?}</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction>required</transaction>
|
||||
</webscript>
|
||||
|
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"countMin": "${tagQuery.countMin}",
|
||||
"countMax": "${tagQuery.countMax}",
|
||||
"tags":
|
||||
<#assign n=0>
|
||||
[
|
||||
<#list tagQuery.tags as tag>
|
||||
<#if (n > 0)>,</#if>
|
||||
{"name": "${tag.name}", "count": "${tag.count}"}
|
||||
<#assign n=n+1>
|
||||
</#list>
|
||||
]
|
||||
}
|
@@ -1,28 +1,40 @@
|
||||
model.tagQuery = tagQuery(args["n"], args["m"]);
|
||||
|
||||
function tagQuery(nodeRef, maxResults)
|
||||
function tagQuery()
|
||||
{
|
||||
var tags = new Array();
|
||||
var countMin = Number.MAX_VALUE,
|
||||
var nodeRef = args.n,
|
||||
maxResults = args.m,
|
||||
sortOrder = args.s,
|
||||
tags = [],
|
||||
countMin = Number.MAX_VALUE,
|
||||
countMax = 0;
|
||||
|
||||
/* nodeRef input */
|
||||
var node = null;
|
||||
if ((nodeRef != null) && (nodeRef != ""))
|
||||
if ((nodeRef !== null) && (nodeRef !== ""))
|
||||
{
|
||||
node = search.findNode(nodeRef);
|
||||
}
|
||||
if (node == null)
|
||||
if (node === null)
|
||||
{
|
||||
node = companyhome;
|
||||
}
|
||||
|
||||
/* maxResults input */
|
||||
if ((maxResults == null) || (maxResults == ""))
|
||||
if ((maxResults === null) || (maxResults === ""))
|
||||
{
|
||||
maxResults = -1;
|
||||
}
|
||||
|
||||
/* sortOrder input */
|
||||
var validSortOrders =
|
||||
{
|
||||
"name": true,
|
||||
"count": true
|
||||
};
|
||||
if (!(sortOrder in validSortOrders))
|
||||
{
|
||||
sortOrder = "name";
|
||||
}
|
||||
|
||||
/* Query for tagged node(s) */
|
||||
var query = "PATH:\"" + node.qnamePath;
|
||||
if (node.isContainer)
|
||||
@@ -33,20 +45,21 @@ function tagQuery(nodeRef, maxResults)
|
||||
|
||||
var taggedNodes = search.luceneSearch(query);
|
||||
|
||||
if (taggedNodes.length == 0)
|
||||
if (taggedNodes.length === 0)
|
||||
{
|
||||
countMin = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Build a hashtable of tags and tag count */
|
||||
var tagHash = {};
|
||||
var count;
|
||||
var tagHash = {},
|
||||
count, taggedNode, tag, key;
|
||||
|
||||
for each (taggedNode in taggedNodes)
|
||||
{
|
||||
for each(tag in taggedNode.properties["cm:taggable"])
|
||||
for each (tag in taggedNode.properties["cm:taggable"])
|
||||
{
|
||||
if (tag != null)
|
||||
if (tag !== null)
|
||||
{
|
||||
count = tagHash[tag.name];
|
||||
tagHash[tag.name] = count ? count+1 : 1;
|
||||
@@ -79,15 +92,18 @@ function tagQuery(nodeRef, maxResults)
|
||||
}
|
||||
|
||||
/* Calculate the min and max tag count values */
|
||||
for each(tag in tags)
|
||||
for each (tag in tags)
|
||||
{
|
||||
countMin = Math.min(countMin, tag.count);
|
||||
countMax = Math.max(countMax, tag.count);
|
||||
}
|
||||
|
||||
if (sortOrder == "name")
|
||||
{
|
||||
/* Sort the results by tag name (ascending) */
|
||||
tags.sort();
|
||||
}
|
||||
}
|
||||
|
||||
var results =
|
||||
{
|
||||
@@ -102,3 +118,5 @@ function sortByCountDesc(a, b)
|
||||
{
|
||||
return (b.count - a.count);
|
||||
}
|
||||
|
||||
model.tagQuery = tagQuery();
|
@@ -0,0 +1,10 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
"countMin": ${tagQuery.countMin?c},
|
||||
"countMax": ${tagQuery.countMax?c},
|
||||
"tags":
|
||||
[<#list tagQuery.tags as tag>
|
||||
{ "name": "${tag.name}", "count": ${tag.count?c} }<#if tag_has_next>,</#if>
|
||||
</#list>]
|
||||
}
|
||||
</#escape>
|
@@ -2,6 +2,7 @@
|
||||
<shortname>Document Actions (Office Add-In)</shortname>
|
||||
<description>Used by the Office Add-In to perform actions on managed documents</description>
|
||||
<url>/office/docActions</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction>required</transaction>
|
||||
</webscript>
|
@@ -1 +0,0 @@
|
||||
{"statusString":"${message(resultString)}","statusCode":${resultCode?string}}
|
@@ -0,0 +1,6 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
"statusString": "${message(resultString)}",
|
||||
"statusCode": ${resultCode?string}
|
||||
}
|
||||
</#escape>
|
@@ -2,6 +2,7 @@
|
||||
<shortname>Get Users (Office Add-In)</shortname>
|
||||
<description>Used by the Office Add-In to query for users</description>
|
||||
<url>/office/getUsers?s={searchTerm}</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction>required</transaction>
|
||||
</webscript>
|
@@ -1,5 +1,7 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
[
|
||||
<#list searchResults as result>
|
||||
"${"${result.properties.firstName} ${result.properties.lastName}"?trim} (${result.properties.userName})"<#if result_has_next>,</#if>
|
||||
</#list>
|
||||
]
|
||||
</#escape>
|
@@ -73,9 +73,10 @@ function main()
|
||||
var searchResults = search.luceneSearch(query, "@{http://www.alfresco.org/model/content/1.0}name", true);
|
||||
|
||||
// Ensure folders and folderlinks appear at the top of the list
|
||||
var containerResults = new Array();
|
||||
var contentResults = new Array();
|
||||
for each(var result in searchResults)
|
||||
var containerResults = new Array(),
|
||||
contentResults = new Array();
|
||||
|
||||
for each (var result in searchResults)
|
||||
{
|
||||
if (result.isContainer || result.type == "{http://www.alfresco.org/model/application/1.0}folderlink")
|
||||
{
|
||||
@@ -104,8 +105,9 @@ function main()
|
||||
}
|
||||
else if (url.templateArgs.type == "category")
|
||||
{
|
||||
var catAspect = (args["aspect"] != null) ? args["aspect"] : "cm:generalclassifiable";
|
||||
var nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id;
|
||||
var catAspect = (args["aspect"] != null) ? args["aspect"] : "cm:generalclassifiable",
|
||||
nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id;
|
||||
|
||||
// TODO: Better way of finding this
|
||||
var rootCategories = classification.getRootCategories(catAspect);
|
||||
if (rootCategories != null && rootCategories.length > 0)
|
||||
@@ -122,8 +124,10 @@ function main()
|
||||
categoryResults = parent.children;
|
||||
}
|
||||
|
||||
categoryResults.sort(sortByName);
|
||||
|
||||
// make each result an object and indicate it is selectable in the UI
|
||||
for each(var result in categoryResults)
|
||||
for each (var result in categoryResults)
|
||||
{
|
||||
results.push(
|
||||
{
|
||||
@@ -166,4 +170,10 @@ function isItemSelectable(node, selectableType)
|
||||
return selectable;
|
||||
}
|
||||
|
||||
/* Sort the results by case-insensitive name */
|
||||
function sortByName(a, b)
|
||||
{
|
||||
return (b.properties.name.toLowerCase() > a.properties.name.toLowerCase() ? -1 : 1);
|
||||
}
|
||||
|
||||
main();
|
@@ -53,8 +53,26 @@ function findNodeInSite()
|
||||
|
||||
function findFromReference()
|
||||
{
|
||||
var nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id;
|
||||
var node = search.findNode(nodeRef);
|
||||
var nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id,
|
||||
node = null;
|
||||
|
||||
if (nodeRef == "alfresco://company/home")
|
||||
{
|
||||
node = companyhome;
|
||||
}
|
||||
else if (nodeRef == "alfresco://user/home")
|
||||
{
|
||||
node = userhome;
|
||||
}
|
||||
else if (nodeRef == "alfresco://sites/home")
|
||||
{
|
||||
node = companyhome.childrenByXPath("st:sites")[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
node = search.findNode(nodeRef);
|
||||
}
|
||||
|
||||
if (node === null)
|
||||
{
|
||||
status.setCode(status.STATUS_NOT_FOUND, "Node " + nodeRef + " does not exist");
|
||||
|
@@ -0,0 +1,17 @@
|
||||
<webscript>
|
||||
<shortname>Create new tag</shortname>
|
||||
<description><![CDATA[
|
||||
Create a new tag in the specified store.
|
||||
<br />
|
||||
The following properties need be set in the POST body.
|
||||
<dl>
|
||||
<dt>name</dt><dd>Name of the tag to create. Note tags are created in lowercase.</dd>
|
||||
</dl>
|
||||
]]></description>
|
||||
<url>/api/tag/{store_type}/{store_id}</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction allow="readwrite">required</transaction>
|
||||
<lifecycle>draft_public_api</lifecycle>
|
||||
<family>Tagging</family>
|
||||
</webscript>
|
@@ -0,0 +1,7 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
"name": "${tag.name}",
|
||||
"nodeRef": "${tag.nodeRef}",
|
||||
"itemExists": ${tagExists?string}
|
||||
}
|
||||
</#escape>
|
@@ -0,0 +1,33 @@
|
||||
function main()
|
||||
{
|
||||
// Get the store reference
|
||||
var store = url.templateArgs.store_type + "://" + url.templateArgs.store_id;
|
||||
|
||||
// Get the details of the tag
|
||||
if (json.has("name") == false || json.get("name").length == 0)
|
||||
{
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "Name missing when creating tag");
|
||||
return;
|
||||
}
|
||||
var tagName = json.get("name");
|
||||
|
||||
// See if the tag already exists
|
||||
var tag = taggingService.getTag(store, tagName),
|
||||
tagExists = (tag != null);
|
||||
|
||||
if (!tagExists)
|
||||
{
|
||||
tag = taggingService.createTag(store, tagName);
|
||||
if (tag == null)
|
||||
{
|
||||
status.setCode(status.STATUS_INTERNAL_SERVER_ERROR, "error.cannotCreateTag");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Put the created tag into the model
|
||||
model.tag = tag;
|
||||
model.tagExists = tagExists;
|
||||
}
|
||||
|
||||
main();
|
@@ -0,0 +1,9 @@
|
||||
<webscript>
|
||||
<shortname>category node</shortname>
|
||||
<description>Document List Component - category node data webscript</description>
|
||||
<url>/slingshot/doclib/categorynode/node/{store_type}/{store_id}/{id}/{path}</url>
|
||||
<url>/slingshot/doclib/categorynode/node/{store_type}/{store_id}/{id}</url>
|
||||
<format default="json">argument</format>
|
||||
<authentication>user</authentication>
|
||||
<transaction allow="readwrite" buffersize="0">required</transaction>
|
||||
</webscript>
|
@@ -0,0 +1 @@
|
||||
<#include "categorynode.get.json.ftl">
|
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Document List Component: category node
|
||||
*/
|
||||
model.categorynode = getCategoryNode();
|
||||
|
||||
/* Create collection of categories for the given path */
|
||||
function getCategoryNode()
|
||||
{
|
||||
try
|
||||
{
|
||||
var items = new Array(),
|
||||
hasSubfolders = true,
|
||||
evalChildFolders = args["children"] !== "false";
|
||||
|
||||
var catAspect = (args["aspect"] != null) ? args["aspect"] : "cm:generalclassifiable",
|
||||
nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id,
|
||||
path = url.templateArgs.path,
|
||||
rootCategories = classification.getRootCategories(catAspect),
|
||||
rootNode, parent, categoryResults;
|
||||
|
||||
if (rootCategories != null && rootCategories.length > 0)
|
||||
{
|
||||
rootNode = rootCategories[0].parent;
|
||||
if (path == null)
|
||||
{
|
||||
categoryResults = classification.getRootCategories(catAspect);
|
||||
}
|
||||
else
|
||||
{
|
||||
var queryPath = "/" + catAspect + "/" + encodePath(path);
|
||||
categoryResults = search.luceneSearch("+PATH:\"" + queryPath + "/*\" -PATH:\"" + queryPath + "/member\"");
|
||||
}
|
||||
|
||||
// make each result an object and indicate it is selectable in the UI
|
||||
for each (item in categoryResults)
|
||||
{
|
||||
if (evalChildFolders)
|
||||
{
|
||||
hasSubfolders = item.children.length > 0;
|
||||
}
|
||||
|
||||
items.push(
|
||||
{
|
||||
node: item,
|
||||
hasSubfolders: hasSubfolders
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
items.sort(sortByName);
|
||||
|
||||
return (
|
||||
{
|
||||
"items": items
|
||||
});
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
status.setCode(status.STATUS_INTERNAL_SERVER_ERROR, e.toString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the path as an ISO9075 encoded path */
|
||||
function encodePath(path)
|
||||
{
|
||||
var parts = path.split("/");
|
||||
for (var i = 0, ii = parts.length; i < ii; i++)
|
||||
{
|
||||
parts[i] = "cm:" + search.ISO9075Encode(parts[i]);
|
||||
}
|
||||
return parts.join("/");
|
||||
}
|
||||
|
||||
/* Sort the results by case-insensitive name */
|
||||
function sortByName(a, b)
|
||||
{
|
||||
return (b.node.name.toLowerCase() > a.node.name.toLowerCase() ? -1 : 1);
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
{
|
||||
"totalResults": ${categorynode.items?size?c},
|
||||
"items":
|
||||
[
|
||||
<#list categorynode.items as item>
|
||||
<#assign c = item.node>
|
||||
{
|
||||
"nodeRef": "${c.nodeRef}",
|
||||
"name": "${c.name}",
|
||||
"description": "${(c.properties.description!"")}",
|
||||
"hasChildren": ${item.hasSubfolders?string},
|
||||
"userAccess":
|
||||
{
|
||||
"create": ${c.hasPermission("CreateChildren")?string},
|
||||
"edit": ${c.hasPermission("Write")?string},
|
||||
"delete": ${c.hasPermission("Delete")?string}
|
||||
}
|
||||
}<#if item_has_next>,</#if>
|
||||
</#list>
|
||||
]
|
||||
}
|
||||
</#escape>
|
@@ -3,7 +3,8 @@
|
||||
<import resource="classpath:/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/parse-args.lib.js">
|
||||
|
||||
const THUMBNAIL_NAME = "doclib",
|
||||
PREF_FAVOURITES = "org.alfresco.share.documents.favourites";
|
||||
PREF_DOCUMENT_FAVOURITES = "org.alfresco.share.documents.favourites";
|
||||
PREF_FOLDER_FAVOURITES = "org.alfresco.share.folders.favourites";
|
||||
|
||||
var PeopleCache = {},
|
||||
SiteCache = {};
|
||||
@@ -17,27 +18,30 @@ function getPerson(username)
|
||||
{
|
||||
if (typeof PeopleCache[username] == "undefined")
|
||||
{
|
||||
PeopleCache[username] = people.getPerson(username);
|
||||
var person = people.getPerson(username);
|
||||
if (person == null && username == "System")
|
||||
{
|
||||
person =
|
||||
{
|
||||
properties:
|
||||
{
|
||||
userName: "System",
|
||||
firstName: "System",
|
||||
lastName: "User"
|
||||
}
|
||||
}
|
||||
}
|
||||
PeopleCache[username] =
|
||||
{
|
||||
userName: person.properties.userName,
|
||||
firstName: person.properties.firstName,
|
||||
lastName: person.properties.lastName,
|
||||
displayName: (person.properties.firstName + " " + person.properties.lastName).replace(/^\s+|\s+$/g, "")
|
||||
};
|
||||
}
|
||||
return PeopleCache[username];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a person's full name
|
||||
* @method getPersonName
|
||||
* @param username {string} User name
|
||||
*/
|
||||
function getPersonName(username)
|
||||
{
|
||||
var user = getPerson(username);
|
||||
if (user)
|
||||
{
|
||||
// Return trimmed full name
|
||||
return (user.properties.firstName + " " + user.properties.lastName).replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
return username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets / caches a site object
|
||||
* @method getSite
|
||||
@@ -79,22 +83,37 @@ function main()
|
||||
}
|
||||
|
||||
// Get the user's favourite docs from our slightly eccentric Preferences Service
|
||||
var prefs = preferenceService.getPreferences(person.properties.userName, PREF_FAVOURITES),
|
||||
favourites = {};
|
||||
var prefs = preferenceService.getPreferences(person.properties.userName, PREF_DOCUMENT_FAVOURITES),
|
||||
favourites = {},
|
||||
strFavs, f, ff;
|
||||
try
|
||||
{
|
||||
/**
|
||||
* Fasten seatbelts...
|
||||
* An "eval" could be used here, but the Rhino debugger will complain if throws an exception, which gets old very quickly.
|
||||
* e.g. var strFavs = eval('try{(prefs.' + PREF_FAVOURITES + ')}catch(e){}');
|
||||
* e.g. var strFavs = eval('try{(prefs.' + PREF_DOCUMENT_FAVOURITES + ')}catch(e){}');
|
||||
*/
|
||||
if (prefs && prefs.org && prefs.org.alfresco && prefs.org.alfresco.share && prefs.org.alfresco.share.documents)
|
||||
{
|
||||
var strFavs = prefs.org.alfresco.share.documents.favourites;
|
||||
strFavs = prefs.org.alfresco.share.documents.favourites;
|
||||
if (typeof strFavs == "string")
|
||||
{
|
||||
arrFavs = strFavs.split(",");
|
||||
for (var f = 0, ff = arrFavs.length; f < ff; f++)
|
||||
for (f = 0, ff = arrFavs.length; f < ff; f++)
|
||||
{
|
||||
favourites[arrFavs[f]] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Same thing but for folders
|
||||
prefs = preferenceService.getPreferences(person.properties.userName, PREF_FOLDER_FAVOURITES);
|
||||
if (prefs && prefs.org && prefs.org.alfresco && prefs.org.alfresco.share && prefs.org.alfresco.share.folders)
|
||||
{
|
||||
strFavs = prefs.org.alfresco.share.folders.favourites;
|
||||
if (typeof strFavs == "string")
|
||||
{
|
||||
arrFavs = strFavs.split(",");
|
||||
for (f = 0, ff = arrFavs.length; f < ff; f++)
|
||||
{
|
||||
favourites[arrFavs[f]] = true;
|
||||
}
|
||||
@@ -241,7 +260,7 @@ function main()
|
||||
site: null,
|
||||
siteTitle: null,
|
||||
container: null,
|
||||
path: null,
|
||||
path: "/" + displayPaths.slice(2, displayPaths.length).join("/"),
|
||||
file: locationAsset.name
|
||||
};
|
||||
}
|
||||
|
@@ -41,20 +41,20 @@
|
||||
<#assign version = "1.0">
|
||||
<#if d.hasAspect("cm:versionable") && d.versionHistory?size != 0><#assign version = d.versionHistory[0].versionLabel></#if>
|
||||
<#if item.createdBy??>
|
||||
<#assign createdBy = ((item.createdBy.properties.firstName!"") + " " + (item.createdBy.properties.lastName!""))?trim>
|
||||
<#assign createdByUser = item.createdBy.properties.userName>
|
||||
<#assign createdBy = item.createdBy.displayName>
|
||||
<#assign createdByUser = item.createdBy.userName>
|
||||
<#else>
|
||||
<#assign createdBy="" createdByUser="">
|
||||
</#if>
|
||||
<#if item.modifiedBy??>
|
||||
<#assign modifiedBy = ((item.modifiedBy.properties.firstName!"") + " " + (item.modifiedBy.properties.lastName!""))?trim>
|
||||
<#assign modifiedByUser = item.modifiedBy.properties.userName>
|
||||
<#assign modifiedBy = item.modifiedBy.displayName>
|
||||
<#assign modifiedByUser = item.modifiedBy.userName>
|
||||
<#else>
|
||||
<#assign modifiedBy="" modifiedByUser="">
|
||||
</#if>
|
||||
<#if item.lockedBy??>
|
||||
<#assign lockedBy = ((item.lockedBy.properties.firstName!"") + " " + (item.lockedBy.properties.lastName!""))?trim>
|
||||
<#assign lockedByUser = item.lockedBy.properties.userName>
|
||||
<#assign lockedBy = item.lockedBy.displayName>
|
||||
<#assign lockedByUser = item.lockedBy.userName>
|
||||
<#else>
|
||||
<#assign lockedBy="" lockedByUser="">
|
||||
</#if>
|
||||
@@ -86,6 +86,7 @@
|
||||
"contentUrl": "api/node/content/${d.storeType}/${d.storeId}/${d.id}/${d.name?url}",
|
||||
"actionSet": "${item.actionSet}",
|
||||
"tags": <#noescape>[${tags}]</#noescape>,
|
||||
"categories": [<#list d.properties.categories![] as c>["${c.name}", "${c.displayPath?replace("/categories/General","")}"]<#if c_has_next>,</#if></#list>],
|
||||
"activeWorkflows": "<#list item.activeWorkflows as aw>${aw}<#if aw_has_next>,</#if></#list>",
|
||||
"isFavourite": ${item.isFavourite?string},
|
||||
"location":
|
||||
|
@@ -93,7 +93,7 @@ var Evaluator =
|
||||
if (asset.hasAspect("cm:workingcopy"))
|
||||
{
|
||||
lockedBy = getPerson(asset.properties["cm:workingCopyOwner"]);
|
||||
lockOwnerUser = lockedBy.properties.userName;
|
||||
lockOwnerUser = lockedBy.userName;
|
||||
if (lockOwnerUser == person.properties.userName)
|
||||
{
|
||||
status["editing"] = true;
|
||||
@@ -101,7 +101,7 @@ var Evaluator =
|
||||
}
|
||||
else
|
||||
{
|
||||
status["locked " + getPersonName(lockOwnerUser) + "|" + lockedBy.properties.userName] = true;
|
||||
status["locked " + lockedBy.displayName + "|" + lockedBy.userName] = true;
|
||||
actionSet = "locked";
|
||||
}
|
||||
var wcNode = asset.properties["source"];
|
||||
@@ -117,7 +117,7 @@ var Evaluator =
|
||||
else if (asset.isLocked)
|
||||
{
|
||||
lockedBy = getPerson(asset.properties["cm:lockOwner"]);
|
||||
lockOwnerUser = lockedBy.properties.userName;
|
||||
lockOwnerUser = lockedBy.userName;
|
||||
if (lockOwnerUser == person.properties.userName)
|
||||
{
|
||||
status["lock-owner"] = true;
|
||||
@@ -125,7 +125,7 @@ var Evaluator =
|
||||
}
|
||||
else
|
||||
{
|
||||
status["locked " + getPersonName(lockOwnerUser) + "|" + lockedBy.properties.userName] = true;
|
||||
status["locked " + lockedBy.displayName + "|" + lockedBy.userName] = true;
|
||||
actionSet = "locked";
|
||||
}
|
||||
var srcNodes = search.query(
|
||||
|
@@ -7,6 +7,17 @@ var Filters =
|
||||
"images": "-TYPE:\"{http://www.alfresco.org/model/content/1.0}thumbnail\" +@cm\\:content.mimetype:image/*"
|
||||
},
|
||||
|
||||
/* Encode a path with ISO9075 encoding */
|
||||
iso9075EncodePath: function Filter_iso9075EncodePath(path)
|
||||
{
|
||||
var parts = path.split("/");
|
||||
for (var i = 1, ii = parts.length; i < ii; i++)
|
||||
{
|
||||
parts[i] = "cm:" + search.ISO9075Encode(parts[i]);
|
||||
}
|
||||
return parts.join("/");
|
||||
},
|
||||
|
||||
getFilterParams: function Filter_getFilterParams(filter, parsedArgs, optional)
|
||||
{
|
||||
var filterParams =
|
||||
@@ -43,7 +54,7 @@ var Filters =
|
||||
filterQuery = "";
|
||||
|
||||
// Common types and aspects to filter from the UI
|
||||
filterQueryDefaults =
|
||||
var filterQueryDefaults =
|
||||
" -TYPE:\"{http://www.alfresco.org/model/content/1.0}thumbnail\"" +
|
||||
" -TYPE:\"{http://www.alfresco.org/model/content/1.0}systemfolder\"" +
|
||||
" -TYPE:\"{http://www.alfresco.org/model/forum/1.0}forums\"" +
|
||||
@@ -123,7 +134,7 @@ var Filters =
|
||||
filterParams.query = filterQuery;
|
||||
break;
|
||||
|
||||
case "favouriteDocuments":
|
||||
case "favourites":
|
||||
var foundOne = false;
|
||||
|
||||
for (var favourite in favourites)
|
||||
@@ -147,6 +158,10 @@ var Filters =
|
||||
filterParams.query = "+PATH:\"" + parsedArgs.rootNode.qnamePath + "//*\" +PATH:\"/cm:taggable/cm:" + search.ISO9075Encode(filterData) + "/member\"";
|
||||
break;
|
||||
|
||||
case "category":
|
||||
filterParams.query = "+PATH:\"/cm:generalclassifiable" + Filters.iso9075EncodePath(filterData) + "/member\"";
|
||||
break;
|
||||
|
||||
default:
|
||||
filterParams.variablePath = false;
|
||||
filterQuery = "+PATH:\"" + parsedArgs.parentNode.qnamePath + "/*\"";
|
||||
|
@@ -59,7 +59,7 @@ var ParseArgs =
|
||||
var storeType = url.templateArgs.store_type,
|
||||
storeId = url.templateArgs.store_id,
|
||||
id = url.templateArgs.id,
|
||||
type = "node";
|
||||
type = url.templateArgs.type;
|
||||
|
||||
nodeRef = storeType + "://" + storeId + "/" + id;
|
||||
|
||||
@@ -77,6 +77,7 @@ var ParseArgs =
|
||||
}
|
||||
else
|
||||
{
|
||||
type = "node"
|
||||
rootNode = search.findNode(nodeRef);
|
||||
if (rootNode === null)
|
||||
{
|
||||
@@ -183,6 +184,10 @@ var ParseArgs =
|
||||
};
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
location.path = "/" + displayPaths.slice(2, displayPaths.length).join("/");
|
||||
}
|
||||
|
||||
var objRet =
|
||||
{
|
||||
|
@@ -3,10 +3,10 @@
|
||||
/**
|
||||
* Document List Component: treenode
|
||||
*/
|
||||
model.treenode = getTreenode();
|
||||
model.treenode = getTreeNode();
|
||||
|
||||
/* Create collection of folders in the given space */
|
||||
function getTreenode(siteId, path)
|
||||
function getTreeNode()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
Reference in New Issue
Block a user