AnsweredAssumed Answered

How to structure share dashlets that use the repository

Question asked by patorjk on Sep 26, 2011
Latest reply on Sep 28, 2011 by patorjk
I'm building a dashlet that lets users search for folders. It correctly works, but now my aim is to make it a simple package. To learn how to create dashlets, I initially just created the files in the Alfresco source. I ended up having to create an Alfresco web script and a Share web script, since I wasn't able to access repository functions from within the dashlet. These were the locations of the scripts:

C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\dashlets
C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\webscripts\foldersearch

Based on the share examples I've seen, I was able to construct and build a jar, which I placed into the WEB-INF/lib directory of the share.jar file.

The dashlet came up correctly, and I can place it on my dashboard (once integrated into share.war), but it doesn't work correctly. I get these errors:


2011-09-26 20:50:59,309  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 0826
0004 Read-Write transaction started within read-only transaction
org.alfresco.error.AlfrescoRuntimeException: 08260004 Read-Write transaction started within read-only transaction
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:309)

2011-09-26 20:51:06,434  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 08260001 Script url /inteldocs/folder-search does not map to a Web Script.
org.springframework.extensions.webscripts.WebScriptException: 08260001 Script url /inteldocs/folder-search does not map to a Web Script.

My guess is because I'm placing the Alfresco web script in the Share war (in the \templates\webscripts\foldersearch path) . The simple solution is to have the build.xml file output two jars (one to integrate into alfresco.war and one to integrate into share.war). However, I don't see any other projects structured like this. Am I missing something (my alfresco webscript makes use of search.luceneSearch), or do people typically not structure the alfresco webscript part of their dashlet with the share part?

Anyway, my main question is to make sure I'm developing this correctly. I can create two jars and add them into the different wars, but since I don't see anyone else doing that, I want to make sure I'm not doing something wrong.

- Pat

Outcomes