Re: [Hypercontent-users] How to read groups.xml from the CAS server.
Brought to you by:
alexvigdor
From: Alex V. <al...@bi...> - 2006-12-15 05:52:40
|
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: <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! 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 >>>> >>>> 1) declare a separate xml-doctype "/**/index.xml" >> if >>>> you want each >>>> new directory to have an index page. >>>> >>>> 2) declare a resource-directory "/**/" labelled >>>> "Directory" with no >>>> content-types - this will allow you to create a >> new >>>> empty directory. >>>> >>>> Alex >>>> >>>> >>>> >>>> >>>> >>> >> > ---------------------------------------------------------------------- >> >>> --- >>>> Take Surveys. Earn Cash. Influence the Future of >> IT >>>> Join SourceForge.net's Techsay panel and you'll >> get >>>> the chance to share your >>>> opinions on IT & business topics through brief >>>> surveys - and earn cash >>>> >>> http://www.techsay.com/default.php? >>> page=join.php&p=sourceforge&CID=DEVDEV >>>> _______________________________________________ >>>> Hypercontent-users mailing list >>>> Hyp...@li... >>>> >>> >> > https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>>> >>> >>> >>> >>> >>> >> > ______________________________________________________________________ >> >>> ______________ >>> Cheap talk? >>> Check out Yahoo! Messenger's low PC-to-Phone call >> rates. >>> http://voice.yahoo.com >>> >> >> > > > > > ______________________________________________________________________ > ______________ > Have a burning question? > Go to www.Answers.yahoo.com and get answers from real people who know. > |