07-04-2011 07:13 AM
07-05-2011 08:33 AM
07-05-2011 09:37 AM
07-14-2011 09:33 AM
07-26-2011 08:36 AM
07-26-2011 08:59 AM
08-01-2011 10:20 AM
08-08-2011 09:44 AM
this.modules.actions.genericAction(
{
success:
{
message: this.msg("message.subscribe.success", file.displayName)
},
failure:
{
callback:
{
fn: failureHandler,
scope: this
}
},
webscript:
{
name: "subscribe/site/{site}/{container}",
method: Alfresco.util.Ajax.POST
},
wait:
{
message: this.msg("message.please-wait")
},
params:
{
site: this.options.siteId,
container: this.options.containerId
},
config:
{
requestContentType: Alfresco.util.Ajax.JSON,
dataObj:
{
nodeRefs: [file.nodeRef]
}
}
});
SubscribeWebScript.javapublic class SubscribeWebScript extends AbstractWebScript
{
……final public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException
{
try
{
//userTransaction = registry.getTransactionService().getUserTransaction();
authenticationService = registry.getAuthenticationService();
String userName = authenticationService.getCurrentUserName();
String rootNodeRef = req.getParameter("nodeRefs");
if(rootNodeRef != null && NodeRef.isNodeRef(rootNodeRef))
{
nodeRef = new NodeRef(rootNodeRef);
nodeuuid = nodeRef.getId();
}
nodeService = registry.getNodeService();
String fileName = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
This one bombs out on (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);org.springframework.extensions.webscripts.WebScriptException: 07080002 Couldn't subscribe to resource [color=#BF4080]NodeRef may not be null for calls to NodeService. Check client code.[/color] at uk.nhs.sth.crest.webscript.subscribe.SubscribeWebScript.execute(SubscribeWebScript.java:151)
at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:383)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:381)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
subscribe.post.json.ftl<#import "action.lib.ftl" as actionLib />
web-scripts-application-context.xml<bean id="webscript.org.alfresco.slingshot.documentlibrary.action.subscribe.post"
class="uk.nhs.sth.crest.webscript.subscribe.SubscribeWebScript"
parent="webscript">
<property name="repository" ref="repositoryHelper" />
<property name="serviceRegistry" ref="ServiceRegistry" />
<property name="subscribeDAOImpl" ref="subscribeDAO" />
</bean>
subscribe.post.desc.xml<webscript>
<shortname>Subscribe Webscript</shortname>
<description>Document/Folder List Action - Subscribe document/folder</description>
<url>/slingshot/doclib/action/subscribe/site/{site}/{container}</url>
<authentication>user</authentication>
<format default="json">argument</format>
<transaction>required</transaction>
</webscript>
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.