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

View File

@@ -6,6 +6,7 @@ function main()
argsSelectableType = args['selectableType'], argsSelectableType = args['selectableType'],
argsSearchTerm = args['searchTerm'], argsSearchTerm = args['searchTerm'],
argsMaxResults = args['size'], argsMaxResults = args['size'],
argsXPath = args['xpath'],
parent = null, parent = null,
rootNode = companyhome, rootNode = companyhome,
results = [], results = [],
@@ -23,10 +24,19 @@ function main()
try 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") if (url.templateArgs.type == "node")
{ {
// nodeRef input // nodeRef input
var nodeRef = url.templateArgs.store_type + "://" + url.templateArgs.store_id + "/" + url.templateArgs.id;
if (nodeRef == "alfresco://company/home") if (nodeRef == "alfresco://company/home")
{ {
parent = companyhome; parent = companyhome;
@@ -52,8 +62,9 @@ function main()
var query = "+PARENT:\"" + parent.nodeRef + "\""; var query = "+PARENT:\"" + parent.nodeRef + "\"";
if (argsFilterType != null) if (argsFilterType != null)
{ {
//map short name to long name // map short name to long name
var types = { var types =
{
'rma:dispositionSchedule': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionSchedule', 'rma:dispositionSchedule': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionSchedule',
'rma:dispositionActionDefinition': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionActionDefinition', 'rma:dispositionActionDefinition': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionActionDefinition',
'rma:dispositionAction': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionAction', 'rma:dispositionAction': '{http://www.alfresco.org/model/recordsmanagement/1.0}dispositionAction',
@@ -114,8 +125,7 @@ function main()
} }
else if (url.templateArgs.type == "category") else if (url.templateArgs.type == "category")
{ {
var catAspect = (args["aspect"] != null) ? args["aspect"] : "cm:generalclassifiable", 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 // TODO: Better way of finding this
var rootCategories = classification.getRootCategories(catAspect); var rootCategories = classification.getRootCategories(catAspect);

View File

@@ -15,15 +15,33 @@ function main()
// convert the JSONArray object into a native JavaScript array // convert the JSONArray object into a native JavaScript array
var jsonItems = json.get("items"), var jsonItems = json.get("items"),
itemValueType = "nodeRef",
itemValueTypeHint = "",
numItems = jsonItems.length(), numItems = jsonItems.length(),
item, result; 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++) for (count = 0; count < numItems; count++)
{ {
item = jsonItems.get(count); item = jsonItems.get(count);
if (item != "") 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) if (result != null)
{ {
// create a separate object if the node represents a user or group // create a separate object if the node represents a user or group