Re: [Hypercontent-users] How to read groups.xml from the CAS server.
Brought to you by:
alexvigdor
From: tom t. <j_l...@ya...> - 2007-01-24 00:17:15
|
Hi Alex, Last couple of days I had to deal with lot of Single Sign On Developments with uPortal but couldn't do any HC developent at all from where I left. But HC also will be on production in the next release Hence now I am going to do the final touches, UI customization and the ajax pipeline (Edit link). As per your response please see my observationsto know the following > The ajax will not require any direct involvement > from uPortal. You > would define a pipeline like this in your project's > /config/ > pipelines.xml (or in the bootstrap repository if you > want to have > this available for all projects) > > <pipeline basedir="/" binding="all" > content-type="text/xml" > mode="page-edit-link" > > <exec > stage="org.hypercontent.project.engine.stage.VelocityStage"> > <with-param name="source" > value="/skin/page-edit-link.vm" /> > <with-param name="localize-with" > value="/l10n/listing" /> > </exec> > </pipeline> > > Then, create the file /skin/page-edit-link.vm in > your project > repository or the bootstrap repository and put > something like this: How can I create the above /skin/page-edit-link.vm file should I have a seperate resource-directory in my project definition file. > > <div> > #if ($session.Authenticated && > $session.hasPermission > ($project,'write',$request-path)) > <a target="hc2-window" > href="${abs-project-base}${request-path}? > mode=interactive&screen=edit">edit</a> > #end > </div> > > Finally in your XSL that generates the markup > presented in the portal > put something like: > > <script type="text/javascript" language="javascript" > src="${abs- > server-base}/js/common.js"> > </script> > <script type="text/javascript" language="javascript" > src="${abs- > server-base}/js/ajax.js"> > </script> > > <div id="page-edit-link-div"></div> > > <script type="text/javascript" > language="javascript"> > > loadToElement(document.getElementById('page-edit-link- > > div'),'<xsl:value-of > select="concat($abs-project-base,$request-path)"/ > >?mode=page-edit-link'); > </script> > > > and make sure you have declared the XSL parameters > > <xsl:param name="abs-project-base"/> > <xsl:param name="abs-server-base"/> > <xsl:param name="request-path"/> > > This will load the output of the page-edit-link > pipeline, which > performs the authorization check, directly into the > target div, > presenting the edit link if there is one. > > Let me know if any part is unclear! within uPortal what we have is jsps infact the portlet development strategy is struts-bridge what this means is our portlets are not govern by xsls. But still I will incooperate the above <script type="text/j...... code segment and try but let me know what are the values that I should give for abs-project-base, bs-server-base, and request-path assuming my project is running in the following url http://<HC Server>:<HC Port>/hypercontent/test_project/?mode=interactive Also explain me how does that entire logic works, how does the HC knows about the user credentials. Thanks, > > Alex > > On Dec 14, 2006, at 10:54 PM, tom tom wrote: > > > Hi Alex, > > My objective is to show a link within a channel > > provided > > > > 1) The user logs in to uPortal via CAS is one of > the > > HC users listed in groups.xml > > > > Otherwise the link in the uPortal is disable. > > > > > > At this moment of time am not too sure how will > > uPortal and HC servers will sit in production. We > have > > requested for a seperate box for HC. Yes Most > Probably > > HC will sit in the same domain. > > > > Please let me know the steps to proceed. > > > > The bottom line is I just want to know the logged > in > > user in uPortal(via CAS) is HC user(e.g augther > e.g) > > or not? > > > > am not too sure how AJAX components work in > uPortal > > > > thanks, > > > > > > > > > > --- Alex Vigdor <al...@bi...> wrote: > > > >> Were you hoping to control whether the uPortal > >> channel edit icon > >> appears, or do you want to display a link within > the > >> channel > >> content? If your uPortal and HC instances are on > >> the same domain, > >> you could embed a little AJAX call in the HC > output > >> that will render > >> an edit link if appropriate for the user. The > blog > >> sample project in > >> the recent distribution shows this effect. If > you > >> are interested, > >> let me know and I can outline the steps to > implement > >> the AJAX approach. > >> > >> Alex > >> > >> On Dec 11, 2006, at 11:41 PM, tom tom wrote: > >> > >>> Hi Alex, > >>> > >>> In our setup, during the CAS authentication (we > do > >>> part of authorization as well and fill > additional > >>> attributes to the principal). > >>> > >>> Assume when a HC author login to the CAS and > >> control > >>> passes to the Uportal there is a link (HREF) to > >> the HC > >>> server for auhoring. > >>> > >>> Well.... the question is if some other staff > (not > >> a HC > >>> user) we do not want to show the link to HC. > >>> > >>> So what would be the best way to check whether > the > >>> given user is a HC user (e.g auther) during the > >> CAS > >>> authentication level, so that we can populate > the > >>> principal and pass back to uPortal. > >>> > >>> > >>> Currently am thinking of providing a servlet in > HC > >> Web > >>> Application which reads the groups.xml and check > >>> whether the given user is inside the xml. And > this > >>> servelet will be called from the CAS machine > >>> (URLConnection). > >>> > >>> Let me know your thoughts on this. > >>> > >>> It is assumed that HC authors are listed in the > >>> groups.xml and HC server is a seperate box > similar > >> to > >>> the CAS box > >>> > >>> > >>> --- Alex Vigdor <al...@bi...> wrote: > >>> > >>>> > >>>> On Dec 7, 2006, at 7:43 PM, tom tom wrote: > >>>> > >>>>> > >>>>> Everything working fine, but for.e.g if author > >>>> wants > >>>>> to add a new file(xml) under a new folder, > what > >>>> can he > >>>>> do? > >>>>> Definite can add a folder because of the > >>>>> resource-directory but after that xml? > >>>> > >>>> There are two solutions people use for this > === message truncated === ____________________________________________________________________________________ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 |