Debug content model in Alfresco

Posted in IT StuffTagged

When you need to customize Alfresco content model, not always everything works fine so, it’s necessary to find a way to check if your model is correct or not. It’s possible to use the built-in Get Class Definitions webscript to debug. Basically, you can use this webscript to see if an expected content type exists….

Resolving java.lang.OutOfMemoryError: PermGen

Posted in IT StuffTagged ,

Today our Alfresco doesn’t start due to this error: java.lang.OutOfMemoryError: PermGenjava.lang.OutOfMemoryError: PermGen The PermGen (permanent generation) holds data needed by the virtual machine to describe objects that do not have an equivalence at the Java language level like objects describing classes and methodse. So often large, complex apps will need lots of PermGen space. Similarly….

Show post categories using Webscript

Posted in IT StuffTagged

To show all categories of a post, check if the cm:categories child association exists and, if yes, list all childs into the ftl file: <#if["cm:categories"]?exists> <categories> <#list["cm:categories"] as prop>${}</#list> </categories> </#if><#if["cm:categories"]?exists> <categories> <#list["cm:categories"] as prop>${}</#list> </categories> </#if>

Download Alfresco content from Java using Spring

Posted in IT StuffTagged , ,

To download content stored on Alfresco repository using Java, this is one possible way: String url = "http://localhost:18080/alfresco/d/a/workspace/SpacesStore/" + attach.getNode_ref() + "/" + attach.getAttach_filename() + "?ticket=" + ticket; return new ModelAndView("redirect:" + url);String url = "http://localhost:18080/alfresco/d/a/workspace/SpacesStore/" + attach.getNode_ref() + "/" + attach.getAttach_filename() + "?ticket=" + ticket; return new ModelAndView("redirect:" + url); Where getNode_ref() is a….

Query Alfresco Web script using REST

Posted in IT StuffTagged , ,

With Spring 3 querying a REST-based service it’s easy. For first, you need to authenticate on Alfresco repository using an Alfresco Ticket instead of an explicit user name and password. A ticket represents a pre-authenticated user who has already performed the login process. To log in, the url is: http://localhost:8081/alfresco/service/api/login?u=admin&amp;pw=adminhttp://localhost:8081/alfresco/service/api/login?u=admin&amp;pw=admin Assuming the userid and password….