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:
Gavin Cornwell
2009-05-06 19:53:30 +00:00
parent fe75d397a6
commit d685b2f36a
5 changed files with 11 additions and 89 deletions

View File

@@ -10,17 +10,22 @@ 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"),
numItems = jsonItems.length(),
item, itemKind, result;
item, result;
for (count = 0; count < numItems; count++)
{
result = search.findNode(jsonItems.get(count));
if (result != null)
item = jsonItems.get(count);
if (item != "")
{
results.push(result);
result = search.findNode(item);
if (result != null)
{
results.push(result);
}
}
}

View File

@@ -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>

View File

@@ -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();

View File

@@ -1,2 +0,0 @@
<#import "pickerresults.lib.ftl" as pickerResultsLib />
<@pickerResultsLib.pickerResultsJSON results=results />

View File

@@ -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>