Extending an AssetRendererFactory

27 de enero de 2012 Por Juan Fernández

 

Many of you know a lot and do an extensive use of the Asset Framework, the framework within Liferay Portal that "provides a set of functionalities that are common to several different content types".
 
In many projects we find that developers need to extend the behaviour of the AssetRendererFactories to fit their needs, and, even it is not that hard, it takes a while to think on the best and cleaner way to achieve this. 
 
In a recent forum post, a user asked how to modify the UserAssetRendererFactory and I decided to write down the steps in a wiki article to share it with the rest of the community. 
 
Here's the link, but for the most impatients, here are the steps to do:
 
 
1.- Create an ext plugin
2.- Add the portlet you want to modify/extend to liferay-portlet-ext.xml 
3.- Make <asset-renderer-factory> point to your custom class
4.- Create a class that extends the original AssetRendererFactory and the add or modify the methods you need
5.- Deploy, restart the server and you are ready to go! :)
 
That's it!
I hope this is useful for you
Regards, 
Juan Fernández
 

Adding the workflow portlets to a page

30 de agosto de 2011 Por Juan Fernández

 

Hi all! 
In a recent project I had to add these portlets ("My Workflow Tasks" and "My Submissions") to a normal user page. By default they are shown in the control panel, but depending on your project needs you may want to use them elsewhere. Here are the steps you need to achieve this easily.
 
Basically you need three things:
 
  • Remove them from the control panel
  • Add them to the "Add Applications" menu
  • Add "ADD_TO_PAGE" permissions
 
To do this you need an ext plugin (which you can create in the liferay plugins sdk via <<create my-ext "my ext">> command)
 
Once you have your ext plugin ready in your plugins sdk, go to your-ext/docroot/WEB-INF/ext-web/docroot/WEB-INF
 
in your-ext/docroot/WEB-INF/ext-web/docroot/WEB-INF/liferay-portlet-ext.xml add this (this is the original content minus the control panel classes configuration)
 
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.0.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">
 
<liferay-portlet-app>
<portlet>
<portlet-name>153</portlet-name>
<icon>/html/icons/my_workflow_tasks.png</icon>
<struts-path>my_workflow_tasks</struts-path>
<portlet-url-class>com.liferay.portal.struts.StrutsActionPortletURL</portlet-url-class>
<use-default-template>false</use-default-template>
<private-request-attributes>false</private-request-attributes>
<private-session-attributes>false</private-session-attributes>
<render-weight>50</render-weight>
<header-portlet-css>/html/portlet/asset_publisher/css/main.jsp</header-portlet-css>
<header-portlet-css>/html/portlet/enterprise_admin/css/main.jsp</header-portlet-css>
<header-portlet-css>/html/portlet/workflow_definitions/css/main.jsp</header-portlet-css>
<css-class-wrapper>portlet-workflow-tasks</css-class-wrapper>
</portlet>
<portlet>
<portlet-name>158</portlet-name>
<icon>/html/icons/my_workflow_instances.png</icon>
<struts-path>my_workflow_instances</struts-path>
<portlet-url-class>com.liferay.portal.struts.StrutsActionPortletURL</portlet-url-class>
<use-default-template>false</use-default-template>
<private-request-attributes>false</private-request-attributes>
<private-session-attributes>false</private-session-attributes>
<render-weight>50</render-weight>
<header-portlet-css>/html/portlet/asset_publisher/css/main.jsp</header-portlet-css>
<header-portlet-css>/html/portlet/enterprise_admin/css/main.jsp</header-portlet-css>
<header-portlet-css>/html/portlet/workflow_definitions/css/main.jsp</header-portlet-css>
<css-class-wrapper>portlet-workflow-instances</css-class-wrapper>
</portlet>
</liferay-portlet-app>
 
in your-ext/docroot/WEB-INF/ext-web/docroot/WEB-INF/liferay-display.xml remove
<portlet id="153" />
<portlet id="158" />
from hidden category and add them to another one (the one which you prefer!)
 
In your-ext/docroot/WEB-INF/ext-impl/src/resource-actions/workflow.xml, add this (which is the original workflow.xml after deleting ACCESS_IN_CONTROL_PANEL permission and adding ADD_TO_PAGE):
 
...
<portlet-name>153</portlet-name>
<permissions>
<supports>
<action-key>ADD_TO_PAGE</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>
...
<portlet-name>158</portlet-name>
<permissions>
<supports>
<action-key>ADD_TO_PAGE</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>
...
 
 
When you're done, run ant deploy and restart your application server. 
And that's it! I hope I helped you
Regards, 
Juan Fernández

 

Apoyando a Unicef en la campaña del Cuerno de África

18 de agosto de 2011 Por Juan Fernández

¡Muy buenas!
 
Esta vez no voy a escribir sobre liferay, ni siquiera sobre tecnología, sino sobre personas. Personas que como tú y como yo tienen sueños, proyectos, ilusiones...pero que han visto sus sueños truncados por una situación que les supera. Me refiero a la situación en el Cuerno de África.
 
Ya sabéis que más de medio millón de niños (sí, niños como tú lo fuiste, niños como tus hijos, o tus hermanos...) están en riesgo inminente de muerte debido a la desnutrición y cerca de 11 millones de personas en total están en una situación de riesgo ante la hambruna en la zona.
 
 
Viendo esta situación, y no queriendo quedarnos de brazos cruzados, desde las oficinas de Liferay España comenzamos una campaña para colaborar con Unicef ¿Te habías preguntado últimamente qué podías hacer tú para poder echar una mano? Pues esta es tu oportunidad de marcar la diferencia.
 
 
Las donaciones realizadas a través de este enlace quedarán registradas como relacionadas con Liferay y cuando acabe la campaña, nos comprometemos a igualar la donación recibida, de forma que si Unicef recibe por ejemplo 8.000€ en donaciones vía Liferay, nostros donaremos 8.000€ adicionales (hasta un máximo de 10.000€)
 
Podéis donar haciendo click en el siguiente link: donación a UNICEF para el cuerno de África
 
 
Quería dejar constancia, a modo personal, de que antes de entrar a trabajar en Liferay no comprendía muy bien el significado de la tercera frase de nuestro eslogan ("Liferay: Enterprise. Open Source. For Life"): hoy creo que queda bastante claro. 
 
Un saludo y muchas gracias, 
Juan Fernández

The magic of the community

28 de octubre de 2010 Por Juan Fernández

 Hi all!

 
Today, while I was reviewing bug and improvement requests tickets from the community members, I saw a ticket created by Sven Werlen from Savoir-faire Linux, a canadian company.
 
They needed the asset publisher to be able to access and publish assets from all their communities and organizations and they've developed a hook that does this so that they can choose the scope in a wider way, and, here's the magic of the Liferay open source community: they have decided to share it with all the community so they have published their hook in the community plugins repository (Link here: http://www.liferay.com/downloads/liferay-portal/community-plugins/-/software_catalog/products/6268657)
 
This is the kind of changes that we may not be interested in adding to the core but some of you may be interested in, and that's perfect for the community to share. I think this is great, to see that there are some companies and individual developers that are willing to share their expertise and experience with the rest of the community, and this is the starting point of the market place we are planning: a place where we can all share our plugins.
 
Things like this make me proud of working in an open source company like Liferay. 
Thank you, guys
Juan Fernández

How to use the new Global Scope

26 de octubre de 2010 Por Juan Fernández

Hi all:

In order to share content accross organizations and communities, we have included a new concept in Liferay 6.0: the global scope

 

 The Global Scope is a place for data that is common to all organization, communities and users of the portal. It does not have associated pages and can only be accessed from the control panel.

 

We have detected the most common use cases for the Global Repository, and this is an example of the most usual use cases:

 

1 - Shared Web Content templates and structures

After creating a template or a structure in the global scope you can select them in all the other scopes (organizations and communities) of your company.

 

To achieve this you just have to click on "advanced search" in the popup that appears when you select a template or a structure and select "Global" in the "My Places" dropdown menu.

 

2 - Shared contents of any type for the Asset Publisher

You can configure the asset publisher so that it shows assets from the global scope. This way you can publish any of the supported asset types including the following:

  • web content
  • images
  • blog entries
  • documents
  • bookmarks
  • wiki pages
  • calendar events

 

3 - Common asset categories

Any categories vocabulary will be shown as an option when a user is selecting a category for all asset types in all organizations and communities.

 

For the moment the Global content repository can only be administered by users with the "Administrator" role.

 

We are thinking in new ways of sharing content through organizations and communities, and we are looking forward to hearing from you. 

 

If you have any suggestions, post them in the suggestions forums

 

[Note: I have created a wiki page with this content so that we can all improve it]

[Pic credits]

Greetings!

 

Mostrando el intervalo 1 - 5 de 13 resultados.
Elementos por página 5
de 3