ALF-4158: F1 Create a replication job [name, title, description]

ALF-4165: F3 Edit, delete action for replication job from list of existing jobs

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21902 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2010-08-20 14:10:06 +00:00
parent d1924830c9
commit b51b85b8c1
3 changed files with 49 additions and 20 deletions

View File

@@ -2,6 +2,7 @@
<shortname>PickerList</shortname>
<description>Service to return metadata of child items in a parent space to display in the object finder</description>
<url>/api/forms/picker/{type}/{store_type}/{store_id}/{id}/children</url>
<url>/api/forms/picker/{type}/children</url>
<format default="json"/>
<authentication>user</authentication>
<transaction allow="readonly">required</transaction>

View File

@@ -6,6 +6,7 @@ function main()
argsSelectableType = args['selectableType'],
argsSearchTerm = args['searchTerm'],
argsMaxResults = args['size'],
argsXPath = args['xpath'],
parent = null,
rootNode = companyhome,
results = [],
@@ -23,10 +24,19 @@ function main()
try
{
var nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id;
if (argsXPath != null)
{
var nodes = search.xpathSearch(argsXPath);
if (nodes.length > 0)
{
nodeRef = String(nodes[0].nodeRef);
}
}
if (url.templateArgs.type == "node")
{
// nodeRef input
var nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id;
if (nodeRef == "alfresco://company/home")
{
parent = companyhome;
@@ -52,8 +62,9 @@ function main()
var query = "+PARENT:\"" + parent.nodeRef + "\"";
if (argsFilterType != null)
{
//map short name to long name
var types = {
// map short name to long name
var types =
{
'rma:dispositionSchedule': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionSchedule',
'rma:dispositionActionDefinition': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionActionDefinition',
'rma:dispositionAction': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionAction',
@@ -61,7 +72,7 @@ function main()
'rma:transfer':'{http://www.alfresco.org/model/recordsmanagement/1.0}transfer',
'cm:thumbnail': '{http://www.alfresco.org/model/content/1.0}thumbnail'
};
var filterTypes = argsFilterType.split(',');
for (var i=0,len=filterTypes.length; i<len; i++)
{
@@ -70,15 +81,15 @@ function main()
{
query += " -TYPE:\"" + types[identifier] + "\"";
}
}
}
}
// make sure we don't return system folders
query += " -TYPE:\"{http://www.alfresco.org/model/content/1.0}systemfolder\"";
if (logger.isLoggingEnabled())
logger.log("query = " + query);
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
@@ -114,8 +125,7 @@ function main()
}
else if (url.templateArgs.type == "category")
{
var catAspect = (args["aspect"] != null) ? args["aspect"] : "cm:generalclassifiable",
nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id;
var catAspect = (args["aspect"] != null) ? args["aspect"] : "cm:generalclassifiable";
// TODO: Better way of finding this
var rootCategories = classification.getRootCategories(catAspect);

View File

@@ -11,21 +11,39 @@ function main()
{
status.setCode(status.STATUS_BAD_REQUEST, "items parameter is not present");
return;
}
}
// convert the JSONArray object into a native JavaScript array
var jsonItems = json.get("items"),
itemValueType = "nodeRef",
itemValueTypeHint = "",
numItems = jsonItems.length(),
item, result;
if (json.has("itemValueType"))
{
var jsonValueTypes = json.get("itemValueType").split(";");
itemValueType = jsonValueTypes[0];
itemValueTypeHint = (jsonValueTypes.length > 1) ? jsonValueTypes[1] : "";
}
for (count = 0; count < numItems; count++)
{
item = jsonItems.get(count);
if (item != "")
{
item = jsonItems.get(count);
if (item != "")
{
result = search.findNode(item);
result = null;
if (itemValueType == "nodeRef")
{
result = search.findNode(item);
}
else if (itemValueType == "xpath")
{
result = search.xpathSearch(itemValueTypeHint.replace("%VALUE%", search.ISO9075Encode(item)))[0];
}
if (result != null)
{
{
// create a separate object if the node represents a user or group
if (result.isSubType("cm:person"))
{
@@ -40,11 +58,11 @@ function main()
result = createNodeResult(result);
}
results.push(
{
item: result
results.push(
{
item: result
});
}
}
}
}