You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Michael <mh...@gmail.com> on 2010/02/24 02:53:17 UTC

Accessing Managers from Wicket Page

Anyone,

I am trying to accessing some managers (ie PageManager, UserManager, etc..) from a Wicket page.  I'm obtaining the portlet context by using the following code:

PortletRequestContext prc = (PortletRequestContext)RequestContext.get();
prc.getPortletRequest().getPortletSession().getPortletContext();

But when I try to access the manager by the following means:

(PageManager)portletContext.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);

The manager is never found.

Any suggestions on this would help.  I feel like I am just overlooking something simple but I can't figure out what I am doing wrong or if I am just on the wrong track.

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


Re: Accessing Managers from Wicket Page

Posted by Michael <mh...@gmail.com>.
Ok, I figured it out.  My code for getting the portlet context was  
incorrect.  It must be accessed through the portlet config and NOT the  
portlet session.

David, thanks again for the prompt reply.

Michael


On Feb 23, 2010, at 10:44 PM, Michael wrote:

> I forgot to mention, I am using Jetspeed 2.1.3 and Wicket 1.3, if  
> that makes a difference.
>
> Thanks,
> Michael
>
>
> On Feb 23, 2010, at 10:27 PM, Michael wrote:
>
>> David,
>>
>> Thank you so much for the reply, I appreciate it.
>>
>> Here is my jetspeed-portlet.xml contents:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <portlet-app id="smfjsservices" version="1.0"
>> 	xmlns="http://portals.apache.org/jetspeed" xmlns:js="http://portals.apache.org/jetspeed 
>> "
>> 	xmlns:dc="http://www.purl.org/dc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
>> "
>> 	xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/jetspeed-portlet.xsd 
>> ">
>>
>> 	<js:services>
>> 		<js:service name='GroupManager' />
>> 		<js:service name='PageManager' />
>> 		<js:service name='Profiler' />
>> 		<js:service name='RoleManager' />
>> 		<js:service name='UserManager' />
>> 	</js:services>
>>
>> </portlet-app>
>>
>>
>> It seems correct to me, but still have the same problem.  I just  
>> set the portlet-app id to something unique, is it supposed to  
>> correspond to anything?
>>
>> Thanks again for your help,
>> Michael
>>
>>
>> On Feb 23, 2010, at 8:05 PM, David Sean Taylor wrote:
>>
>>> On Tue, Feb 23, 2010 at 5:53 PM, Michael <mh...@gmail.com> wrote:
>>>
>>>> Anyone,
>>>>
>>>> I am trying to accessing some managers (ie PageManager,  
>>>> UserManager, etc..)
>>>> from a Wicket page.  I'm obtaining the portlet context by using the
>>>> following code:
>>>>
>>>> PortletRequestContext prc =  
>>>> (PortletRequestContext)RequestContext.get();
>>>> prc.getPortletRequest().getPortletSession().getPortletContext();
>>>>
>>>> But when I try to access the manager by the following means:
>>>>
>>>>
>>>> (PageManager 
>>>> )portletContext 
>>>> .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
>>>>
>>>> The manager is never found.
>>>>
>>>> Did you add this entry to your jetspeed-portlet.xml:
>>>
>>> <js:services>
>>>  <js:service name='PageManager' />
>>> </js:services>
>>>
>>> see:
>>>
>>> http://portals.apache.org/jetspeed-2/tutorial/04/jetspeed-service.html
>>>
>>> More general wicket portlet docs here:
>>>
>>> http://cwiki.apache.org/WICKET/portal-howto.html
>>
>


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


Re: Accessing Managers from Wicket Page

Posted by Michael <mh...@gmail.com>.
I forgot to mention, I am using Jetspeed 2.1.3 and Wicket 1.3, if that  
makes a difference.

Thanks,
Michael


On Feb 23, 2010, at 10:27 PM, Michael wrote:

> David,
>
> Thank you so much for the reply, I appreciate it.
>
> Here is my jetspeed-portlet.xml contents:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <portlet-app id="smfjsservices" version="1.0"
> 	xmlns="http://portals.apache.org/jetspeed" xmlns:js="http://portals.apache.org/jetspeed 
> "
> 	xmlns:dc="http://www.purl.org/dc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
> "
> 	xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/jetspeed-portlet.xsd 
> ">
>
> 	<js:services>
> 		<js:service name='GroupManager' />
> 		<js:service name='PageManager' />
> 		<js:service name='Profiler' />
> 		<js:service name='RoleManager' />
> 		<js:service name='UserManager' />
> 	</js:services>
>
> </portlet-app>
>
>
> It seems correct to me, but still have the same problem.  I just set  
> the portlet-app id to something unique, is it supposed to correspond  
> to anything?
>
> Thanks again for your help,
> Michael
>
>
> On Feb 23, 2010, at 8:05 PM, David Sean Taylor wrote:
>
>> On Tue, Feb 23, 2010 at 5:53 PM, Michael <mh...@gmail.com> wrote:
>>
>>> Anyone,
>>>
>>> I am trying to accessing some managers (ie PageManager,  
>>> UserManager, etc..)
>>> from a Wicket page.  I'm obtaining the portlet context by using the
>>> following code:
>>>
>>> PortletRequestContext prc =  
>>> (PortletRequestContext)RequestContext.get();
>>> prc.getPortletRequest().getPortletSession().getPortletContext();
>>>
>>> But when I try to access the manager by the following means:
>>>
>>>
>>> (PageManager 
>>> )portletContext 
>>> .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
>>>
>>> The manager is never found.
>>>
>>> Did you add this entry to your jetspeed-portlet.xml:
>>
>> <js:services>
>>   <js:service name='PageManager' />
>> </js:services>
>>
>> see:
>>
>> http://portals.apache.org/jetspeed-2/tutorial/04/jetspeed- 
>> service.html
>>
>> More general wicket portlet docs here:
>>
>> http://cwiki.apache.org/WICKET/portal-howto.html
>


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


Re: Accessing Managers from Wicket Page

Posted by Michael <mh...@gmail.com>.
David,

Thank you so much for the reply, I appreciate it.

Here is my jetspeed-portlet.xml contents:

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app id="smfjsservices" version="1.0"
	xmlns="http://portals.apache.org/jetspeed" xmlns:js="http://portals.apache.org/jetspeed 
"
	xmlns:dc="http://www.purl.org/dc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance 
"
	xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/jetspeed-portlet.xsd 
">

	<js:services>
		<js:service name='GroupManager' />
		<js:service name='PageManager' />
		<js:service name='Profiler' />
		<js:service name='RoleManager' />
		<js:service name='UserManager' />
	</js:services>

</portlet-app>


It seems correct to me, but still have the same problem.  I just set  
the portlet-app id to something unique, is it supposed to correspond  
to anything?

Thanks again for your help,
Michael


On Feb 23, 2010, at 8:05 PM, David Sean Taylor wrote:

> On Tue, Feb 23, 2010 at 5:53 PM, Michael <mh...@gmail.com> wrote:
>
>> Anyone,
>>
>> I am trying to accessing some managers (ie PageManager,  
>> UserManager, etc..)
>> from a Wicket page.  I'm obtaining the portlet context by using the
>> following code:
>>
>> PortletRequestContext prc =  
>> (PortletRequestContext)RequestContext.get();
>> prc.getPortletRequest().getPortletSession().getPortletContext();
>>
>> But when I try to access the manager by the following means:
>>
>>
>> (PageManager 
>> )portletContext 
>> .getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
>>
>> The manager is never found.
>>
>> Did you add this entry to your jetspeed-portlet.xml:
>
> <js:services>
>    <js:service name='PageManager' />
> </js:services>
>
> see:
>
> http://portals.apache.org/jetspeed-2/tutorial/04/jetspeed-service.html
>
> More general wicket portlet docs here:
>
> http://cwiki.apache.org/WICKET/portal-howto.html


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


Re: Accessing Managers from Wicket Page

Posted by David Sean Taylor <d....@onehippo.com>.
On Tue, Feb 23, 2010 at 5:53 PM, Michael <mh...@gmail.com> wrote:

> Anyone,
>
> I am trying to accessing some managers (ie PageManager, UserManager, etc..)
> from a Wicket page.  I'm obtaining the portlet context by using the
> following code:
>
> PortletRequestContext prc = (PortletRequestContext)RequestContext.get();
> prc.getPortletRequest().getPortletSession().getPortletContext();
>
> But when I try to access the manager by the following means:
>
>
> (PageManager)portletContext.getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);
>
> The manager is never found.
>
> Did you add this entry to your jetspeed-portlet.xml:

 <js:services>
    <js:service name='PageManager' />
</js:services>

see:

http://portals.apache.org/jetspeed-2/tutorial/04/jetspeed-service.html

More general wicket portlet docs here:

http://cwiki.apache.org/WICKET/portal-howto.html