portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mansour <mansou...@yahoo.com>
Subject j2-admin - adding functionality
Date Wed, 24 Oct 2007 00:17:58 GMT
I don't know if this is the right place to ask this question, but since 
my question is related to modifying the j2-admin, I decided to ask here.
I have a small scenario where an portlet entity is created, and access 
is to be specified for some users. The admin is the one who created this 
entity. For example, if I need to create a reporting service portlet and 
customize the source of data, I don't want all the users to view this 
data. However, I still want the users to be able to access this 
functionality, where the admin can create another entity of this portlet 
with different data source. Therefore I need the admin to be able to set 
security permissions for each portlet entity. Furthermore, the admin 
needs to be able to destroy the entity.

I looked into the docs and played with the jetspeed installation, but 
couldn't find what I need. I decided to start with the last requirement 
and see what I can add. Browsing the source, led me to a point where I 
can implement this requirement. In


          org.apache.jetspeed.portlets.entityeditor.PortletEntityBrowserPortlet
          there's a methods called doCreate(). What I need is the
          opposite of this method. I need doDelete(). I had to look into
          an interface "PortletEntityAccessComponent" where it has three
          methods that are not sufficiently documented. Now the jetspeed
          API docs are missing some info that I really need. The three
          methods are : removeFromCache, removePortletEntities, and
          removePortletEntity.

I need to know which one is the one I need to get this functionality 
(deleting a portlet entity from the data base and not only from the pages).
do there three methods remove the entity from the DB or only from the page?


protected final void doDelete(ActionRequest request, ActionResponse 
response)
            throws PortletException, PortletEntityNotDeletedException {
        try {
            PortletDefinition pd = getPortletDefintion(request);
            String newId = request.getParameter("deletedEntityId");
            PortletEntity entity = null;

            if (newId != null) {
                entityAccess.removePortletEntity(entity);
            } else {
                entity = entityAccess.newPortletEntityInstance(pd);
            }

            entityAccess.storePortletEntity(entity);
        } catch (PortletEntityNotStoredException e) {
            throw new PortletException(e.getMessage(), e);
        } catch (PortletException e) {
            throw new PortletException(e.getMessage(), e);
        }
    }


Thank you in advance.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message