Re: [Hypercontent-users] Is there a sample project for web forms?
Brought to you by:
alexvigdor
From: Alex V. <av...@co...> - 2005-06-20 20:54:15
|
Hi Liying, There are only very loose integration possibilities between HC2 = and =20 uPortal at the moment. HC2 is now a standalone service; you can use it =20= to host XML or HTML destined for presentation in uPortal, which you can =20= publish as Generic XSLT or WebProxy channels in uPortal using the URLs =20= of the content hosted in HyperContent. You will be able to achieve =20 single sign-on to secure content between uPortal and HC2 using CAS =20 soon. We are planning to offer WSRP content publishing and a UDDI = directory =20 of hosted WSRP portlets in HC2.1. As of right now I would estimate =20 that to be at least 6 months out, and should support recent uPortal 2.x =20= releases or 3.0 when all is said and done. =09 The forms framework in HC2 is not well documented yet, so I will = =20 provide a brief overview. Form screens are configured using pipelines =20= (see /repositories/bootstrap/config/pipelines.xml). A pipeline defines =20= a sequence of operations which are used to generate the HTML form with =20= the appropriate hooks back to your processing logic. Let's look at a =20 sample pipeline configuration: <pipeline name=3D"upload" mode=3D"io-edit" basedir=3D"/" =20 content-type=3D"text/html" permissions=3D"read,write"> <open-file/> <bind-form =20 processor=3D"org.hypercontent.form.upload.UploadFormProcessor" =20 as=3D"upload-form"/> <exec = stage=3D"org.hypercontent.project.engine.stage.VelocityStage"> <with-param name=3D"source" = value=3D"/screens/upload.vm"/> <with-param name=3D"localize-with" = value=3D"/l10n/common"/> </exec> <exec = stage=3D"org.hypercontent.project.engine.stage.TrimStage"/> </pipeline> Interactive pipelines must always have a unique "mode" parameter; this =20= mode is then added to the query string of a URL to activate that =20 pipeline. The optional "name" parameter allows you to bind the form as =20= a file editor using the "editor" configuration tag in your project =20 definition, or globally from =20 /WEB-INF/classes/properties/ContentTypes.xml. It will then show up as =20= a subscreen under "Edit" in the GUI. If a pipeline is not meant to be =20= bound as an editor, you can use a "binding" attribute to specify =20 whether it should apply to "files","directories" or "all", or you can =20= specify a pattern (e.g. binding=3D"/survey/*.xml"). The first pipeline command "open-file" indicates that for the rest of =20= the pipeline to continue, the active user session must open the =20 underlying file for writing, which will fail if a lock cannot be =20 acquired (e.g. someone else is editing that file). The second stage binds an implementation of =20 org.hypercontent.form.IFormProcessor to a variable, in this case called =20= "upload-form". The form binding is then applied to individual form =20 inputs in order to associate them with that FormProcessor; a pipeline =20= can have multiple FormProcessors bound to it, and a single HTML form =20 can contain inputs bound to multiple FormProcessors. You reference the =20= form binding in a Velocity template like this: <input name=3D"${upload-form}myinput" ...> Or slightly different syntax in XSL rendered screens: <input name=3D"{$upload-form}myinput" ...> The value of that variable is a unique ID which is bound only to the =20 active Session, and which can then be invalidated in your FormProcessor =20= logic to prevent form resubmission, e.g. opener.getSession().unbindForm(input.getBinding()); The next stage calls a Velocity template in the repository with a =20 particular resource bundle for localization (which is always referenced =20= as $bundle), and the final stage trims excess whitespace from the =20 output. Every application screen in HyperContent is configured this way, so =20 there are lots of examples in pipelines.xml. Every project can define =20= its own pipelines.xml as well for project-specific forms. HC2 will =20 look for velocity templates, XSL files and resource bundles first in =20 the current project, and failing that will fall back to the bootstrap =20= project. In this way a project can override any individual screen. Good luck, Alex On Jun 20, 2005, at 3:32 PM, Liying Miao wrote: > Hi All, > > New to Hypercontent tool, new to uPortal, and I got two questions: > > 1. Is there any detailed documentation about linking HC2 with uPortal =20= > 3.0, or earlier version. I just downloaded the newest version of both, = =20 > and trying to figure out how to use HC2 within uPortal environment. > > 2. Is there an online form sample that I can look at to figure out how = =20 > to deal with transactions within Hypercontent? I went to =20 > C:=20 > \UPORTAL\hypercontent2.0b2\hypercontent2\source\org\hypercontent\form =20= > directory, and got completely lost, don=92t know where to start. > > Any recommendations are highly appreciated! > > Lillian Miao > > ERP/IT > Florida A&M University > (850) 412-7999 > |