I'm trying to learn web scripting. I've bought two Alfresco books. I can't get the examples in either book to work. Very frustrating. Time vampire.
If anyone has a simple web script(s) they're willing to share I'd very much appreciate it. I'm trying to: a) List files in the repository. b) Search files in the repository. c) Upload files to the repository.
Simple stuff (I thought, but I've been unsuccessful).
I also bought two books… and experienced the same frustrations. I know what you're going through! The wikis are good, but I didn't feel that they sufficiently explain what parameters need to be sent to search.luceneSearch("…") For example, your path to Company Home should be "app:company_home". Sites needs to be "st:sites". (I stumbled across this piece of information in one of the forums somebody said PATH:\"/app:company_home/st:sites.) And documentLibrary has to be cm:documentLibrary. So if you are searching for a particular space, your search would look something like this:
var RM_PATH = 'PATH:"/app:company_home/st:sites/cm:myCustomSpace/cm:documentLibrary//*"' var query = RM_PATH + ' AND @cm\\:name:\"' + spaceName + '\"'; var results = search.luceneSearch(query);