Foros de discusión
I don't understand what is an Action-key!
t d p, modificado hace 15 años.
I don't understand what is an Action-key!
New Member Mensaje: 1 Fecha de incorporación: 23/11/08 Mensajes recientes
I'm a newbie in liferay and i am trying create a portlet.In this portlet,i want to limit some function if user hasn't login yet.So i view the sample "blogs" portlet of liferay.But when i view this code:
<?xml version="1.0"?>
<resource-action-mapping>
<portlet-resource>
<portlet-name>33</portlet-name>
<supports>
<action-key>ADD_ENTRY</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>
<community-defaults>
<action-key>VIEW</action-key>
</community-defaults>
<guest-defaults>
<action-key>VIEW</action-key>
</guest-defaults>
<guest-unsupported>
<action-key>ADD_ENTRY</action-key>
</guest-unsupported>
</portlet-resource>
<model-resource>
<model-name>com.liferay.portlet.blogs.model.BlogsCategory</model-name>
I can not understand where is the source code what correctlative with an action-key , ex: ADD_ENTRY. And If i want create an new action-key, what is i had to do?
Thank you
<?xml version="1.0"?>
<resource-action-mapping>
<portlet-resource>
<portlet-name>33</portlet-name>
<supports>
<action-key>ADD_ENTRY</action-key>
<action-key>CONFIGURATION</action-key>
<action-key>VIEW</action-key>
</supports>
<community-defaults>
<action-key>VIEW</action-key>
</community-defaults>
<guest-defaults>
<action-key>VIEW</action-key>
</guest-defaults>
<guest-unsupported>
<action-key>ADD_ENTRY</action-key>
</guest-unsupported>
</portlet-resource>
<model-resource>
<model-name>com.liferay.portlet.blogs.model.BlogsCategory</model-name>
I can not understand where is the source code what correctlative with an action-key , ex: ADD_ENTRY. And If i want create an new action-key, what is i had to do?
Thank you
Puj Z, modificado hace 13 años.
RE: I don't understand what is an Action-key!
Regular Member Mensajes: 220 Fecha de incorporación: 14/01/10 Mensajes recientes
hi,
check the info on this page. It a tad old, but still gives you the idea:
http://content.liferay.com/4.0.0/docs/developers/ch07s03.html
check the info on this page. It a tad old, but still gives you the idea:
http://content.liferay.com/4.0.0/docs/developers/ch07s03.html
Jan Gregor, modificado hace 13 años.
RE: I don't understand what is an Action-key!
Regular Member Mensajes: 224 Fecha de incorporación: 20/10/10 Mensajes recientes
Hi, I think there are a couple of perfect WIKI articles that will answer all your questions : http://www.liferay.com/community/wiki/-/wiki/Main/Permissioning .
http://www.liferay.com/community/wiki/-/wiki/Main/Using+Liferay's+Permission+System+from+a+portlet
I was really surprised how much of Liferay functionality have a nice article in wiki, so guys, keep on good work!
To your questions:
The xml file that you have posted actually defines action keys = permissions, for your portlet & model.
Permissions for portlet is i.e Configuration, so some functionality part of a portlet that can be restricted to a role.
PErmission for a model is i.e add, update, edit, so actions, that can be done a special model (Class) defined for your application.
If you want to add a new permission (action key), just add a new entry to this file and redeploy your portlet. After deployment, Liferay will know, that there is such a permission defined for this portlet/model and will be available in system. More info can you find in the mentioned Article/search for more info in WIKI.
Good luck!
http://www.liferay.com/community/wiki/-/wiki/Main/Using+Liferay's+Permission+System+from+a+portlet
I was really surprised how much of Liferay functionality have a nice article in wiki, so guys, keep on good work!
To your questions:
The xml file that you have posted actually defines action keys = permissions, for your portlet & model.
Permissions for portlet is i.e Configuration, so some functionality part of a portlet that can be restricted to a role.
PErmission for a model is i.e add, update, edit, so actions, that can be done a special model (Class) defined for your application.
If you want to add a new permission (action key), just add a new entry to this file and redeploy your portlet. After deployment, Liferay will know, that there is such a permission defined for this portlet/model and will be available in system. More info can you find in the mentioned Article/search for more info in WIKI.
Good luck!
Mika Koivisto, modificado hace 13 años.