08-30-2016 03:37 AM
10-12-2016 09:58 AM
It would be far more instructive for you to give it a shot and then report back if you get stuck.
To get you started, here is a JavaScript snippet that does a search:
var query = "+TYPE:\"cm:folder\" +@cm\\:name:\"" + PARENT_FOLDER_NAME + "\"";
var results = search.luceneSearch(query);
if (results.length != 1) {
logger.log("Expected to find exactly one folder named " + PARENT_FOLDER_NAME + " but instead found " + results.length);
return;
}
You may also want to install the JavaScript console. It can be used as a nice little JavaScript testing Ui directly within Alfresco Share:
And here are some docs:
09-07-2016 03:46 PM
It sounds like you want to create an association between two objects if and only if the property on one of the objects has a certain value. You can do this on an ad hoc basis by writing a script that performs a search for documents with the property value, then creates the association if it does not exist.
If you want to do this every time a document is created, you can write a behavior to check the property value, then create the association.
10-12-2016 07:10 AM
Hi Jeff,
Am setting a property with a default value when ever a document being uploaded in a space by applying a rule.
"You can do this on an ad hoc basis by writing a script that performs a search for documents with the property value, then creates the association if it does not exist." can you please help to make the script or showing some sample script
10-12-2016 09:58 AM
It would be far more instructive for you to give it a shot and then report back if you get stuck.
To get you started, here is a JavaScript snippet that does a search:
var query = "+TYPE:\"cm:folder\" +@cm\\:name:\"" + PARENT_FOLDER_NAME + "\"";
var results = search.luceneSearch(query);
if (results.length != 1) {
logger.log("Expected to find exactly one folder named " + PARENT_FOLDER_NAME + " but instead found " + results.length);
return;
}
You may also want to install the JavaScript console. It can be used as a nice little JavaScript testing Ui directly within Alfresco Share:
And here are some docs:
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.