mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
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:
@@ -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>
|
||||||
|
@@ -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',
|
||||||
@@ -61,7 +72,7 @@ function main()
|
|||||||
'rma:transfer':'{http://www.alfresco.org/model/recordsmanagement/1.0}transfer',
|
'rma:transfer':'{http://www.alfresco.org/model/recordsmanagement/1.0}transfer',
|
||||||
'cm:thumbnail': '{http://www.alfresco.org/model/content/1.0}thumbnail'
|
'cm:thumbnail': '{http://www.alfresco.org/model/content/1.0}thumbnail'
|
||||||
};
|
};
|
||||||
|
|
||||||
var filterTypes = argsFilterType.split(',');
|
var filterTypes = argsFilterType.split(',');
|
||||||
for (var i=0,len=filterTypes.length; i<len; i++)
|
for (var i=0,len=filterTypes.length; i<len; i++)
|
||||||
{
|
{
|
||||||
@@ -70,15 +81,15 @@ function main()
|
|||||||
{
|
{
|
||||||
query += " -TYPE:\"" + types[identifier] + "\"";
|
query += " -TYPE:\"" + types[identifier] + "\"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure we don't return system folders
|
// make sure we don't return system folders
|
||||||
query += " -TYPE:\"{http://www.alfresco.org/model/content/1.0}systemfolder\"";
|
query += " -TYPE:\"{http://www.alfresco.org/model/content/1.0}systemfolder\"";
|
||||||
|
|
||||||
if (logger.isLoggingEnabled())
|
if (logger.isLoggingEnabled())
|
||||||
logger.log("query = " + query);
|
logger.log("query = " + query);
|
||||||
|
|
||||||
var searchResults = search.luceneSearch(query, "@{http://www.alfresco.org/model/content/1.0}name", true);
|
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
|
// Ensure folders and folderlinks appear at the top of the list
|
||||||
@@ -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);
|
||||||
|
@@ -11,21 +11,39 @@ function main()
|
|||||||
{
|
{
|
||||||
status.setCode(status.STATUS_BAD_REQUEST, "items parameter is not present");
|
status.setCode(status.STATUS_BAD_REQUEST, "items parameter is not present");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
||||||
if (result.isSubType("cm:person"))
|
if (result.isSubType("cm:person"))
|
||||||
{
|
{
|
||||||
@@ -40,11 +58,11 @@ function main()
|
|||||||
result = createNodeResult(result);
|
result = createNodeResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
results.push(
|
results.push(
|
||||||
{
|
{
|
||||||
item: result
|
item: result
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user