[Hypercontent-users] Re: Can hypercontent handle servlets and JSP?
Brought to you by:
alexvigdor
From: Alex V. <av...@co...> - 2005-10-28 17:26:47
|
HI Mike, There isn't currently a plugin for rendering JSPs, but it should = be=20 possible. Similarly, there is no built-in database access, but you=20 should be able to accommodate that via plugins. There are 2 APIs you should look at: org.hypercontent.project.engine.IPipelineStage - sample implementations under = org.hypercontent.project.engine.stage - can be added into any view by binding into a pipeline; see=20 "/config/pipelines.xml" in the bootstrap project for how all the=20 built-in screens are configured - this is where you would query the database to pre-populate a = form. =20 You could render the information into XML and follow with an XSL stage=20= for presentation, or bind the values into java objects and place them in a=20= VelocityContext for presentation with a Velocity template (see=20 VelocityStage.getContext()) - you could develop a stage which would render with a JSP, = though this=20 would probably take more work - the stage "process" method gives you a Task which has a buffer = of=20 type "IWriteableAsset". You control what comes out of the stage by=20 setting the IDataLoader on the buffer; this is simply an object that = returns an=20 InputStream with your data (e.g. your XML rendered information). If=20 you're using velocity, all you have to do is add your objects into the context = and follow up=20 with a VelocityStage that runs through a .vm template that references=20 those objects. If you were to develop a JSP stage, you would create an = IDataLoader=20 implementation that presents the output of the JSP as an InputStream. org.hypercontent.form.IFormProcessor - this is where you collect data from user form inputs - you could write a form processor to store the form inputs in a=20= database - see samples under "org.hypercontent.form" - these are bound into views in the pipelines file once again; = you=20 assign them a key like "my-form", and assign individual form inputs to=20= it like so: XSL: <input name=3D"{$my-form}name"/> Velocity <input name=3D"${my-form}name"/> Your processor will see it with the name "name": the = prefix is used=20 by the framework to route individual inputs to individual processors. In this way, you could have different inputs in the same = form routed=20 to separate logical processors, e.g. <input name=3D"${my-form}name"/> <input name=3D"${my-other-form}name"/> All the built in application screens are developed with these two APIs,=20= so there are plenty of examples. There are some screen-specific=20 stages, like "ManagePrepStage", and other commonly reused stages like=20 "XSLTransformStage", "VelocityStage" and "TrimStage". You can chain=20 any number of stages in any way, so the possibilties are endless! -Alex On Oct 28, 2005, at 12:14 PM, michael ayodele wrote: > How would one go about querying and storing information in databases? > Thanks again for all your help. > =A0 > Michael Ayodele= |