You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Mansour <ma...@yahoo.com> on 2007/10/24 02:17:58 UTC

j2-admin - adding functionality

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


Re: j2-admin - adding functionality

Posted by Mansour <ma...@yahoo.com>.
David Sean Taylor wrote:
>>
>> Yes, David. A portlet entity that's not on the page. I have a single 
>> portlet that creates reports. I need to create an entity from this 
>> portlet and configure it to use a specific DB. I need another entity 
>> of this portlet that will display different info. Both entity 1 and 2 
>> are targeted toward different users.
>> Is this possible. The reason I am asking just to know if it's 
>> possible or not, and if yes, how hard ?
>>
>
> Why are the entities not on a page?
> I guess I don't understand why the portlet needs to create entities. 
> Normally this is done automatically for you by doing things like 
> adding a portlet to a page.
Assuming this this portlet is to be accessed by groupA and groupB. 
GroupC do not have access to this portlet. GroupA uses different 
settings that groupB. How can this be achieved ? I am thinking about 
groups or users.
> Then you can set preferences on a per user basis. A preference could 
> be a database connection string I suppose, although I wonder if thats 
> the best way to handle that.
Is there a better way?
> Im just wondering if you are developing things that are already provided
I didn't find it. That's why I asked.
If it's done, then that's great. I don't seem to be able to find this 
functionality. How can I get this?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>


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


Re: j2-admin - adding functionality

Posted by Mansour <ma...@yahoo.com>.
>>
>
> Why are the entities not on a page?
When you use the entity Editor, there's an option to create an entity. 
The entity is not added to the page.

> I guess I don't understand why the portlet needs to create entities. 
> Normally this is done automatically for you by doing things like 
> adding a portlet to a page.
> Then you can set preferences on a per user basis. A preference could 
> be a database connection string I suppose, although I wonder if thats 
> the best way to handle that.
> Im just wondering if you are developing things that are already provided
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>


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


Re: j2-admin - adding functionality

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Oct 24, 2007, at 1:10 PM, Mansour wrote:

> David Sean Taylor wrote:
>>
>> On Oct 23, 2007, at 5:17 PM, Mansour wrote:
>>
>>> 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.
>>>
>> Im not really sure if I understand what you are trying to do
>> You have a portlet entity, but it is not placed on a page?
>
> Yes, David. A portlet entity that's not on the page. I have a  
> single portlet that creates reports. I need to create an entity  
> from this portlet and configure it to use a specific DB. I need  
> another entity of this portlet that will display different info.  
> Both entity 1 and 2 are targeted toward different users.
> Is this possible. The reason I am asking just to know if it's  
> possible or not, and if yes, how hard ?
>

Why are the entities not on a page?
I guess I don't understand why the portlet needs to create entities.  
Normally this is done automatically for you by doing things like  
adding a portlet to a page.
Then you can set preferences on a per user basis. A preference could  
be a database connection string I suppose, although I wonder if thats  
the best way to handle that.
Im just wondering if you are developing things that are already provided


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


Re: j2-admin - adding functionality

Posted by Mansour <ma...@yahoo.com>.
David Sean Taylor wrote:
>
> On Oct 23, 2007, at 5:17 PM, Mansour wrote:
>
>> 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.
>>
> Im not really sure if I understand what you are trying to do
> You have a portlet entity, but it is not placed on a page?

Yes, David. A portlet entity that's not on the page. I have a single 
portlet that creates reports. I need to create an entity from this 
portlet and configure it to use a specific DB. I need another entity of 
this portlet that will display different info. Both entity 1 and 2 are 
targeted toward different users.
Is this possible. The reason I am asking just to know if it's possible 
or not, and if yes, how hard ?

>
> I think I security permission would be a good choice. Jetspeed defines 
> several permission classes for typical portal resources, see the base 
> class:
>
> http://portals.apache.org/jetspeed-2/multiproject/jetspeed-commons/apidocs/org/apache/jetspeed/security/PortalResourcePermission.html 
>
>
> and subclasses
>
>     FolderPermission, FragmentPermission, PagePermission, 
> PortletPermission
>
> A FragmentPermission is somewhat like an EntityPermission, although a 
> fragment is always on a page, where as an entity is not
>
>> 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?
>>
>>
> removeFromCache is non-persistent, the other two remove from the 
> persistent store
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>


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


Re: j2-admin - adding functionality

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Oct 23, 2007, at 5:17 PM, Mansour wrote:

> 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.
>
Im not really sure if I understand what you are trying to do
You have a portlet entity, but it is not placed on a page?

I think I security permission would be a good choice. Jetspeed  
defines several permission classes for typical portal resources, see  
the base class:

http://portals.apache.org/jetspeed-2/multiproject/jetspeed-commons/ 
apidocs/org/apache/jetspeed/security/PortalResourcePermission.html

and subclasses

     FolderPermission, FragmentPermission, PagePermission,  
PortletPermission

A FragmentPermission is somewhat like an EntityPermission, although a  
fragment is always on a page, where as an entity is not

> 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?
>
>
removeFromCache is non-persistent, the other two remove from the  
persistent store


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