Most developers who have worked with Alfresco and Liferay have had the problem of having to integrate both applications.
This integration has become progressively more complex, especially since both platforms are competing for some products increasingly similar, which means that they no longer be supported. Fortunately we have the APIs to program our own applications.
Alfresco Search Portlet uses the Alfresco web services api to do searches on the repository. Similarly, we may develop several portlets for exploiting other features of Alfresco api.
Below are two scren shots of the portlet in view and edit modes:
The portlet uses a username and password to connect to alfresco and perform a search based on permissions for that user.
Finally, note that the portlet has been tested in the following environment:
Community Liferay 5.2.3 & 6.0, Alfresco 3.2 & 3.3, JDK 1.5 +.
Download Alfresco Search Portlet
Pd: Have I been helpful? I'd be happy to receive your donations;)
Wellcome!
In Cms Howto you'll find updated tutorials to work with Alfresco, Liferay, and other cms software. In a world without information, Cms Howto is the solution.
Showing posts with label alfresco. Show all posts
Showing posts with label alfresco. Show all posts
Sunday, February 21, 2010
Wednesday, December 2, 2009
Tuesday, November 24, 2009
Creating a webscript dashlet in Alfresco
To develop a custom dashlet in Alfresco we need 3 things:
- A Webscript.
- A Jsp.
- A Freemarker template.
1.- Firstly, create a webscript with the actions that you want to show in Alfresco Dashboard. WebScripts WikiPage.
For example:
\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\my_webscript.ftl
2.- Create a Jsp for the dashlet in: \tomcat\webapps\alfresco\jsp\extension\dashboards\dashlets\my_webscript.jsp with this content:
3.- Add to web-client-config-custom.xml the next config:
- A Webscript.
- A Jsp.
- A Freemarker template.
1.- Firstly, create a webscript with the actions that you want to show in Alfresco Dashboard. WebScripts WikiPage.
For example:
\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\my_webscript.ftl
2.- Create a Jsp for the dashlet in: \tomcat\webapps\alfresco\jsp\extension\dashboards\dashlets\my_webscript.jsp with this content:
3.- Add to web-client-config-custom.xml the next config:
Finally restart Alfresco and configure the dashboard to show your new dashlet.
Monday, November 9, 2009
Api JavaScript samples in Alfresco
Alfresco allows us to perform actions when an event occurs, such as content creation, modification, and so on. Here are some examples of use:
Js that sent mails:
// create mail action
var mail = actions.create("mail");
mail.parameters.to = "user@mail.com";
mail.parameters.subject = "News Letter Title";
mail.parameters.from = "alfresco@society.com";
mail.parameters.template = search.findNode("workspace://SpacesStore/9c74d256-ff43-4437-rio5-3098c54fbc7a");
mail.parameters.text = "Sorry, but the news letter is not available this week due to maintenance needs. Please apologize for disturbance";
// execute action against a document
mail.execute(document);
Js that start and advanced pooled workflow:
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:reviewpooled";
workflow.parameters["bpm:workflowDescription"] = document.name;
workflow.parameters["bpm:groupAssignee"] = people.getGroup("GROUP_myGroup");
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(document);
Js that change the name of an inbound document:
// change the name of this document
document.properties.name = "Backup of " + document.properties.name;
// add a new property string
document.properties["cm:locale"] = mylocalenode;
// save the property modifications
document.save();
More examples here:
Alfresco Js Api
Js that sent mails:
// create mail action
var mail = actions.create("mail");
mail.parameters.to = "user@mail.com";
mail.parameters.subject = "News Letter Title";
mail.parameters.from = "alfresco@society.com";
mail.parameters.template = search.findNode("workspace://SpacesStore/9c74d256-ff43-4437-rio5-3098c54fbc7a");
mail.parameters.text = "Sorry, but the news letter is not available this week due to maintenance needs. Please apologize for disturbance";
// execute action against a document
mail.execute(document);
Js that start and advanced pooled workflow:
var workflow = actions.create("start-workflow");
workflow.parameters.workflowName = "jbpm$wf:reviewpooled";
workflow.parameters["bpm:workflowDescription"] = document.name;
workflow.parameters["bpm:groupAssignee"] = people.getGroup("GROUP_myGroup");
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 7);
workflow.parameters["bpm:workflowDueDate"] = futureDate;
workflow.execute(document);
Js that change the name of an inbound document:
// change the name of this document
document.properties.name = "Backup of " + document.properties.name;
// add a new property string
document.properties["cm:locale"] = mylocalenode;
// save the property modifications
document.save();
More examples here:
Alfresco Js Api
Thursday, September 17, 2009
Expanding Alfresco JVM memory
When we launch for first time Alfresco Comunity 3.2, we get this warning:
Alfresco JVM - WARNING - maximum heap size 494.938MB is less than recommended 512MB
We have to expand the JVM memory to solve it. Go to Alfresco install home and edit the alfresco.bat/alfresco.sh file , and modify the JAVA_OPTS like that:
Linux:
export JAVA_OPTS='-Xms256m -Xmx1024m -XX:MaxPermSize=512m -server
Windows:
set JAVA_OPTS='-Xms256m -Xmx1024m -XX:MaxPermSize=512m -server
Alfresco JVM - WARNING - maximum heap size 494.938MB is less than recommended 512MB
We have to expand the JVM memory to solve it. Go to Alfresco install home and edit the alfresco.bat/alfresco.sh file , and modify the JAVA_OPTS like that:
Linux:
export JAVA_OPTS='-Xms256m -Xmx1024m -XX:MaxPermSize=512m -server
Windows:
set JAVA_OPTS='-Xms256m -Xmx1024m -XX:MaxPermSize=512m -server
Subscribe to:
Posts (Atom)

