mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
MOB-589: Association control
- Made the category and association controls permanent rather than 'experimental' - Tested various combinations of category and association fields - Object picker can now be used with properties and associations via 'maintainAddedRemovedItems' flag - Fixed some minor issues raised recently - Removed old unused pickerquery data web script git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14224 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -9,18 +9,23 @@ 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"),
|
||||||
numItems = jsonItems.length(),
|
numItems = jsonItems.length(),
|
||||||
item, itemKind, result;
|
item, result;
|
||||||
|
|
||||||
for (count = 0; count < numItems; count++)
|
for (count = 0; count < numItems; count++)
|
||||||
{
|
{
|
||||||
result = search.findNode(jsonItems.get(count));
|
item = jsonItems.get(count);
|
||||||
if (result != null)
|
if (item != "")
|
||||||
{
|
{
|
||||||
results.push(result);
|
result = search.findNode(item);
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
results.push(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,9 +0,0 @@
|
|||||||
<webscript>
|
|
||||||
<shortname>PickerQuery</shortname>
|
|
||||||
<description>Service to return items to display in the object finder</description>
|
|
||||||
<url>/api/forms/picker/query</url>
|
|
||||||
<format default="json"/>
|
|
||||||
<authentication>user</authentication>
|
|
||||||
<transaction>required</transaction>
|
|
||||||
<lifecycle>internal</lifecycle>
|
|
||||||
</webscript>
|
|
@@ -1,53 +0,0 @@
|
|||||||
function main()
|
|
||||||
{
|
|
||||||
// Extract args
|
|
||||||
var type = args['type'];
|
|
||||||
var filter = args['filter'];
|
|
||||||
var maxResults = args['maxResults'];
|
|
||||||
|
|
||||||
if (type === null)
|
|
||||||
{
|
|
||||||
type = "cm:content";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maxResults === null)
|
|
||||||
{
|
|
||||||
maxResults = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (logger.isLoggingEnabled())
|
|
||||||
{
|
|
||||||
logger.log("type = " + type);
|
|
||||||
logger.log("filter = " + filter);
|
|
||||||
logger.log("maxResults = " + maxResults);
|
|
||||||
}
|
|
||||||
|
|
||||||
var results = [];
|
|
||||||
|
|
||||||
// execute a lucene query using the type parameter
|
|
||||||
var query = "+TYPE:\"" + type + "\"";
|
|
||||||
if (filter !== null)
|
|
||||||
{
|
|
||||||
query += " AND +@\\{http\\://www.alfresco.org/model/content/1.0\\}name:\"*" + filter + "*\"";
|
|
||||||
}
|
|
||||||
|
|
||||||
results = search.luceneSearch(query);
|
|
||||||
|
|
||||||
if (logger.isLoggingEnabled())
|
|
||||||
{
|
|
||||||
logger.log("result count = " + results.length);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (results.length > maxResults)
|
|
||||||
{
|
|
||||||
results = results.slice(0, maxResults);
|
|
||||||
if (logger.isLoggingEnabled())
|
|
||||||
{
|
|
||||||
logger.log("Restricted results size to " + maxResults);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
model.results = results;
|
|
||||||
}
|
|
||||||
|
|
||||||
main();
|
|
@@ -1,2 +0,0 @@
|
|||||||
<#import "pickerresults.lib.ftl" as pickerResultsLib />
|
|
||||||
<@pickerResultsLib.pickerResultsJSON results=results />
|
|
@@ -1,19 +0,0 @@
|
|||||||
<#macro pickerQueryJSON results>
|
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
|
||||||
{
|
|
||||||
"data" :
|
|
||||||
{
|
|
||||||
"items" :
|
|
||||||
[
|
|
||||||
<#list results as row>
|
|
||||||
{
|
|
||||||
"name" : "${row.properties.name}",
|
|
||||||
"description" : "${row.displayPath}",
|
|
||||||
"nodeRef" : "${row.nodeRef}"
|
|
||||||
}<#if row_has_next>,</#if>
|
|
||||||
</#list>
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</#escape>
|
|
||||||
</#macro>
|
|
Reference in New Issue
Block a user