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 dee factorial <de...@gmail.com> on 2006/12/31 20:02:34 UTC

Portlet implementation question

I'm working with a php developer and our reqirements are that we both need
to be able execute each others code, the jetspeed php bridge code isn't
robust enough for our specifications we need to be able to use php 5 and
here
http://portals.apache.org/bridges/multiproject/portals-bridges-php/index.htmlit
states that php 5 isn't a good solution.
so I've found a robust integration of php and java where you can execute
each others code. http://php-java-bridge.sourceforge.net/ I've installed
this web application and it works fine. now I've come to the part of
integrating it into a portlet and I'm running into problems. I took the
Simplest portlet example code and created a portlet with the JavaBridge
webapp in it using the
org.apache.portals.bridges.common.GenericServletPortlet. jetspeed serves up
the app but there is a problem the JavaBridge Servlet does not implement the
Portlet specification so all the url's point to the wrong thing. I found the
class org.apache.portals.bridges.common.ScriptPostProcess but I havn;'t
found any code that implements these features. So my question is how do I
implement a portlet that wraps a regular web application?

Thanks, Dominique

Re: Portlet implementation question

Posted by Enrique Perez <pe...@dit.upm.es>.
Hi,

If that web application has Web Services or RMI or something similar, 
you can use them to write your own portlet in order to get users 
registered...
That's what I've done to get that thing fixed... But, as I said before, 
I'm not an expert =/

Regards.

dee factorial escribió:
> I wouldn't mind using those portlets if I had full access to the user
> properties within the web application. If I use the 
> SSOWebConetentPortlet, I
> could specifiy the sign on url , username, and password feilds and the 
> users
> info could sign the user in, but how do I get them registered in the web
> application ? is there a way to access the user properties within the web
> application ?
>
> On 1/2/07, Enrique Perez <pe...@dit.upm.es> wrote:
>>
>> Hi Dominique,
>>
>> Maybe there's someone in this forum more suitable to answer to your
>> questions, but I'll tell what I think... =)
>>
>> As far as I know, a regular web application can be accessed using an
>> "IFramePortlet" that points to it. I've read some posts at this forum
>> that recommend to use "WebContentPortlet" (or something similar)...
>> though, to be honest, I don't know which portlet is better to suite your
>> problem at this moment... =/
>>
>> Another option is to use web services or rmi solutions implemented in
>> your own particular portlet...
>>
>> Regards,
>> Enrique
>>
>> dee factorial escribió:
>> > I'm working with a php developer and our reqirements are that we both
>> > need
>> > to be able execute each others code, the jetspeed php bridge code 
>> isn't
>> > robust enough for our specifications we need to be able to use php 
>> 5 and
>> > here
>> >
>> http://portals.apache.org/bridges/multiproject/portals-bridges-php/index.htmlit 
>>
>> >
>> > states that php 5 isn't a good solution.
>> > so I've found a robust integration of php and java where you can 
>> execute
>> > each others code. http://php-java-bridge.sourceforge.net/ I've 
>> installed
>> > this web application and it works fine. now I've come to the part of
>> > integrating it into a portlet and I'm running into problems. I took 
>> the
>> > Simplest portlet example code and created a portlet with the 
>> JavaBridge
>> > webapp in it using the
>> > org.apache.portals.bridges.common.GenericServletPortlet. jetspeed
>> > serves up
>> > the app but there is a problem the JavaBridge Servlet does not
>> > implement the
>> > Portlet specification so all the url's point to the wrong thing. I
>> > found the
>> > class org.apache.portals.bridges.common.ScriptPostProcess but I 
>> havn;'t
>> > found any code that implements these features. So my question is 
>> how do
>> I
>> > implement a portlet that wraps a regular web application?
>> >
>> > Thanks, Dominique
>> >
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
>> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>



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


Re: Portlet implementation question

Posted by dee factorial <de...@gmail.com>.
One of the solutions that I was considering was to modify the php demo
portlet. In the Class PHPApplicationPortlet. There is a refrence to a
phpServletImpl = new com.itgroundwork.portlet.php.servlet(); I was thinking
that I could just rewrite this class to extend the JavaBridge servlet
provided by the php-java-bridge project.(
http://php-java-bridge.sourceforge.net/)  but I've been running into
problems. one is that I can't find the source code for the
com.itgroundwork.portlet.php package. its packaged in the
phpportlet-1.0.jar. I tried reverse engeneering the class files, but
the decompiler couldn't
completely get the source back. if anyone has the source files I could try
upgrading the php demo to support php5.

On 1/4/07, David Sean Taylor <da...@bluesunrise.com> wrote:
>
> Aaron Evans wrote:
> > On 1/4/07, David Sean Taylor <da...@bluesunrise.com> wrote:
> >>
> >> I think the SSO solution in Jetspeed needs more testing and bug fixing.
> >> It does have a lot of potential. If we could get the IFrame portlet
> >> supporting the same authentication kinds as the WebContent, that would
> >> be a great start.
> >>
> >
> > David,
> > as an aside, I plan on making pretty heavy use of the SSOWebContent
> > portlet after we upgrade to 2.1, so I'll be more than happy to do more
> > testing and logging of bugs for it. ;-)
> >
> > -aaron
>
> Great, more bugs ;)
>
> I was just speaking with Roger about the PHP Portlet, and the advantages
> of using it over the WebContent or IFrame. He pointed out that the PHP
> portlet runs PHP inside of your Java application server, so you get the
> advantages running a single instance of PHP inside the application
> server, requiring less configuration and centralized administration.
> It also takes advantage of the load balancing provided by the
> application server. One thing that is missing is SSO functionality to
> the PHP portlet as well.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Portlet implementation question

Posted by David Sean Taylor <da...@bluesunrise.com>.
Aaron Evans wrote:
> On 1/4/07, David Sean Taylor <da...@bluesunrise.com> wrote:
>>
>> I think the SSO solution in Jetspeed needs more testing and bug fixing.
>> It does have a lot of potential. If we could get the IFrame portlet
>> supporting the same authentication kinds as the WebContent, that would
>> be a great start.
>>
> 
> David,
> as an aside, I plan on making pretty heavy use of the SSOWebContent
> portlet after we upgrade to 2.1, so I'll be more than happy to do more
> testing and logging of bugs for it. ;-)
> 
> -aaron

Great, more bugs ;)

I was just speaking with Roger about the PHP Portlet, and the advantages 
of using it over the WebContent or IFrame. He pointed out that the PHP 
portlet runs PHP inside of your Java application server, so you get the 
advantages running a single instance of PHP inside the application 
server, requiring less configuration and centralized administration.
It also takes advantage of the load balancing provided by the 
application server. One thing that is missing is SSO functionality to 
the PHP portlet as well.

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


Re: Portlet implementation question

Posted by Aaron Evans <aa...@gmail.com>.
On 1/4/07, David Sean Taylor <da...@bluesunrise.com> wrote:
>
> I think the SSO solution in Jetspeed needs more testing and bug fixing.
> It does have a lot of potential. If we could get the IFrame portlet
> supporting the same authentication kinds as the WebContent, that would
> be a great start.
>

David,
as an aside, I plan on making pretty heavy use of the SSOWebContent
portlet after we upgrade to 2.1, so I'll be more than happy to do more
testing and logging of bugs for it. ;-)

-aaron

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


Re: Portlet implementation question

Posted by David Sean Taylor <da...@bluesunrise.com>.
dee factorial wrote:
> I mean that I wish to access the portal user properties/attributes that the
> portal contains. my scenario is simple. I have a php web application, lets
> say a forum, a user registers using jetspeed, the registration 
> propigates to
> the forum(I'm still a little vauge as to how this is done.) then when the
> user logs onto jetspeed a portlet with the forum shows up with the user
> logged on.
> 
> how do you get access the the portlet attributes within the php application
> ? or do you just use the form based authentication to register the user in
> the php application using the SSOWebContentPortlet? I'm a little unclear as
> to how it is all done and it looks as though there a mulitple ways to go
> about it. I'm just trying to find the best way.
> 
> Any help is much appreciated.
> Thanks.
> 
OK, it sounds like you want to simply get the user automatically logged 
in. There are a number of ways to get that working, such as a federated 
authentication solution. The SSOWebContent portlet is another good 
solution. It handles passing the credentials from the portal to your php 
  web application. Additional user parameters could be passed in as 
request parameters, or even post parameters. The WebContentPortlet 
supports this.

Sounds like you need to learn a bit more about SSOWebContent portlet, or 
the SSOIFrame portlet. (The SSOIFramePortlet doesn't yet support 
form-based authentication, coming soon)

First, here is all the docs Im aware of:

http://portals.apache.org/jetspeed-2/multiproject/jetspeed-sso/index.html
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/design-docs/src/sso/

If you have Jetspeed running on your localhost, try out our demo of SSO.

Login as admin, and go here:

http://localhost:8080/jetspeed/portal/p002.psml

Goto the 2nd portlet on the bottom "SSO Web Content"
Its almost setup for the NY Times site.
Just need to enter the credentials:

username = jetspeed_test0
password = jetspeed

As you can see, it works but its a little sloppy.
That is because the CSS styles are not being included in the proxied 
WebContent under the <head> area. At the time of writing this portlet, 
we didn't have a header phase built into Jetspeed. We now do support a 
header phase, so its just a matter of implementing the header phase in 
the WebContent portlet.

The SSOWebContentPortlet supports 3 kinds of authentication:

1. Form
2. Basic
3. Query Params

IMPORTANT: a little Additional Documentation is in help mode
Click on the "i" button of the SSOWebContentPortlet

Areas that need improvement:

1. CSS integration
2. better customization in general
3. customization for content rewrite rules
4. better icons for next, prev, refresh
5. SSOIFrame has lagged behind the SSOWebContentPortlet

Where as the SSOWebContent has form and basic authentication,
the SSOIFrame only supports the authentication queryparams.
Additionally, SSOWebContent tracks cookies, SSOIFrame does not.
Where as this might not seem to be important for an IFrame since the 
IFrame has prebuilt support for navigation, the problem occurs when you 
navigate to another page, and then come back to the IFrame portlet, you 
will lose navigational state.

---------------------------------------------------------
You can use the SSO Administration portlet to administer your SSO 
credentials.
So lets take the JIRA issue tracking system as an example, you could 
enter something like:

Site Name: JIRA Server
Site URL: https://issues.apache.org/jira/secure/Dashboard.jspa
Realm: (leave blank - for basic authentication)
Field name for User ID: os_username
Field name for Password value: os_password

Press Save.

Now click on the JIRA Site, to get the details on the LHS:
Here you can enter:

Portal Principal: either a portal user or portal group
Remote Principal: the remote user principal name
Remote Credential: the remote user credential (password)

Notice that there are two icons you can click on, the first gives a list 
of users, the second a list of groups. Its important to point out a bad 
UI design. The portal principal defaults to a user. You can only change 
that to a group  by actually selecting the group from the popup. Thats 
bad, and we need to fix it. (A hidden field is populated by the popup)

Its an association mapping between:

Site -> Portal Principal -> Remove Credentials

When any user navigates to an SSO portlet, upon render it queries the 
SSO store, trying to find a user credential. If it fails, it next 
queries the SSO store for all groups that the user is in. If it fails 
there it switches to edit mode, allowing you to configure the portlet 
for the user only (not group). Upon success (either with user or group 
credential) it attempts to login, with the SSOWebContent portlet, using 
the configured authentication mode (Form, Basic, Param) in the portlet, 
or with the SSOIFrame using on the Param case.

Additionally, the SSOWebContent and SSOIFrame portlets can also update 
the SSO credential store from edit mode
If there are no credentials found in view mode, the SSOWebContent and 
SSOIFrame portlets automatically switch to edit mode, as you can see in 
the demo.

Finally, I want to point out that the Jetspeed SSO is a portal-centric 
credential store solution. Where as Shibboleth or Josso or CAS are 
federated identity provider solutions: much more complicated beast.
At my organization we have successfully integrated Jetspeed with the 
Athens Eduserv Federated Authentication server. We are also close to 
integrating with Shibboleth, although its been really painful.

I think the SSO solution in Jetspeed needs more testing and bug fixing.
It does have a lot of potential. If we could get the IFrame portlet 
supporting the same authentication kinds as the WebContent, that would 
be a great start.

As for using the Jetspeed SSO approach vs. the PHP bridge, its up to you 
what best fits your needs. Maybe try out both, and see which approach 
works best. I used the PHP bridge on one project a while back. It seemed 
to work OK, but I would think the PHP 4 limitation is a roadblock for 
most users.





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


Re: Portlet implementation question

Posted by dee factorial <de...@gmail.com>.
I mean that I wish to access the portal user properties/attributes that the
portal contains. my scenario is simple. I have a php web application, lets
say a forum, a user registers using jetspeed, the registration propigates to
the forum(I'm still a little vauge as to how this is done.) then when the
user logs onto jetspeed a portlet with the forum shows up with the user
logged on.

how do you get access the the portlet attributes within the php application
? or do you just use the form based authentication to register the user in
the php application using the SSOWebContentPortlet? I'm a little unclear as
to how it is all done and it looks as though there a mulitple ways to go
about it. I'm just trying to find the best way.

Any help is much appreciated.
Thanks.

On 1/3/07, David Sean Taylor <da...@bluesunrise.com> wrote:
>
> dee factorial wrote:
> > I wouldn't mind using those portlets if I had full access to the user
> > properties within the web application. If I use the
> > SSOWebConetentPortlet, I
> > could specifiy the sign on url , username, and password feilds and the
> > users
> > info could sign the user in, but how do I get them registered in the web
> > application ? is there a way to access the user properties within the
> web
> > application ?
> >
>
> When you say "full access to the user properties within the web
> application", do you mean the PHP web application?
> And what user properties, do you mean like the user attributes from the
> portal, or just the username and password?
>
> The SSOWebContentPortlet does support HTTP and form based authentication
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Portlet implementation question

Posted by David Sean Taylor <da...@bluesunrise.com>.
dee factorial wrote:
> I wouldn't mind using those portlets if I had full access to the user
> properties within the web application. If I use the 
> SSOWebConetentPortlet, I
> could specifiy the sign on url , username, and password feilds and the 
> users
> info could sign the user in, but how do I get them registered in the web
> application ? is there a way to access the user properties within the web
> application ?
> 

When you say "full access to the user properties within the web 
application", do you mean the PHP web application?
And what user properties, do you mean like the user attributes from the 
portal, or just the username and password?

The SSOWebContentPortlet does support HTTP and form based authentication

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


Re: Portlet implementation question

Posted by dee factorial <de...@gmail.com>.
I wouldn't mind using those portlets if I had full access to the user
properties within the web application. If I use the SSOWebConetentPortlet, I
could specifiy the sign on url , username, and password feilds and the users
info could sign the user in, but how do I get them registered in the web
application ? is there a way to access the user properties within the web
application ?

On 1/2/07, Enrique Perez <pe...@dit.upm.es> wrote:
>
> Hi Dominique,
>
> Maybe there's someone in this forum more suitable to answer to your
> questions, but I'll tell what I think... =)
>
> As far as I know, a regular web application can be accessed using an
> "IFramePortlet" that points to it. I've read some posts at this forum
> that recommend to use "WebContentPortlet" (or something similar)...
> though, to be honest, I don't know which portlet is better to suite your
> problem at this moment... =/
>
> Another option is to use web services or rmi solutions implemented in
> your own particular portlet...
>
> Regards,
> Enrique
>
> dee factorial escribió:
> > I'm working with a php developer and our reqirements are that we both
> > need
> > to be able execute each others code, the jetspeed php bridge code isn't
> > robust enough for our specifications we need to be able to use php 5 and
> > here
> >
> http://portals.apache.org/bridges/multiproject/portals-bridges-php/index.htmlit
> >
> > states that php 5 isn't a good solution.
> > so I've found a robust integration of php and java where you can execute
> > each others code. http://php-java-bridge.sourceforge.net/ I've installed
> > this web application and it works fine. now I've come to the part of
> > integrating it into a portlet and I'm running into problems. I took the
> > Simplest portlet example code and created a portlet with the JavaBridge
> > webapp in it using the
> > org.apache.portals.bridges.common.GenericServletPortlet. jetspeed
> > serves up
> > the app but there is a problem the JavaBridge Servlet does not
> > implement the
> > Portlet specification so all the url's point to the wrong thing. I
> > found the
> > class org.apache.portals.bridges.common.ScriptPostProcess but I havn;'t
> > found any code that implements these features. So my question is how do
> I
> > implement a portlet that wraps a regular web application?
> >
> > Thanks, Dominique
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Portlet implementation question

Posted by Enrique Perez <pe...@dit.upm.es>.
Hi Dominique,

Maybe there's someone in this forum more suitable to answer to your 
questions, but I'll tell what I think... =)

As far as I know, a regular web application can be accessed using an 
"IFramePortlet" that points to it. I've read some posts at this forum 
that recommend to use "WebContentPortlet" (or something similar)... 
though, to be honest, I don't know which portlet is better to suite your 
problem at this moment... =/

Another option is to use web services or rmi solutions implemented in 
your own particular portlet...

Regards,
Enrique

dee factorial escribió:
> I'm working with a php developer and our reqirements are that we both 
> need
> to be able execute each others code, the jetspeed php bridge code isn't
> robust enough for our specifications we need to be able to use php 5 and
> here
> http://portals.apache.org/bridges/multiproject/portals-bridges-php/index.htmlit 
>
> states that php 5 isn't a good solution.
> so I've found a robust integration of php and java where you can execute
> each others code. http://php-java-bridge.sourceforge.net/ I've installed
> this web application and it works fine. now I've come to the part of
> integrating it into a portlet and I'm running into problems. I took the
> Simplest portlet example code and created a portlet with the JavaBridge
> webapp in it using the
> org.apache.portals.bridges.common.GenericServletPortlet. jetspeed 
> serves up
> the app but there is a problem the JavaBridge Servlet does not 
> implement the
> Portlet specification so all the url's point to the wrong thing. I 
> found the
> class org.apache.portals.bridges.common.ScriptPostProcess but I havn;'t
> found any code that implements these features. So my question is how do I
> implement a portlet that wraps a regular web application?
>
> Thanks, Dominique
>



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