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:
GitHub - share-extras/js-console: Administration Console component for Alfresco Share, that enables the execution of arb…
And here are some docs:
Search API | Alfresco Documentation
Modifying and creating API | Alfresco Documentation
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.
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