Wiki source code of Portal


Show last authors
1 In order to integrate custom pages with cusom UIs into {{formcycle /}}, a class has to be created which implements the interface {{jpath path="de.xima.fc.plugin.interfaces.portal.IPluginPortal" /}}.
2
3 {{panel title="{{code language='java'~}~}String getContextName(){{/code~}~}" triggerable="true" fullwidth="true"}}
4 Returns the context name of the portal, which defines the URL for accessing the portal.<br><br>
5 The URL for accessing the form has the following form: {{code language='html'}}http://<server>/<formcycle>/<contextName>{{/code}}
6 {{/panel}}
7
8 This allows you to create custom JSF pages.
9
10 Once you do so, you can
11 * create a Java web servlet class in the plugin with the [[annotation @WebServlet>>url:https://javaee.github.io/javaee-spec/javadocs/javax/servlet/annotation/WebServlet.html]]. When you upload the plugin, the system scans the JAR files for these classes and registers them automatically. You can then access this web servlet in the context name you defined in the portal plugin.
12 * create XHTMLfiles in the resource directory (for a normal Maven project, this is //src/main/resources//). You can then access these XHTML files in the context name you defined in the portal plugin.
13 * create JSF bean classes with the annotation [[@Named>>url:https://javaee.github.io/javaee-spec/javadocs/javax/inject/Named.html]] and an appropriate scope such as [[@ViewScope>>url:https://javaee.github.io/javaee-spec/javadocs/javax/faces/view/ViewScoped.html]]. These bean classes are recognized automatically as well and are available in your XHTML pages.
14 * create JSF validator classes and JSF converter classes with the annotations [[@FacesValiator>>url:https://javaee.github.io/javaee-spec/javadocs/javax/faces/validator/FacesValidator.html]] and [[@Converter>>url:https://javaee.github.io/javaee-spec/javadocs/javax/faces/validator/Validator.html]]. These classes too are recogized and registered and are also available in your XHTML pages.