The next step is to create our PodLoader class. The PodLoader extends the class curam.cefwidgets.pods.pod.impl.PodLoader and implements the createPod method. Create a new class on the Server by copying the example below into a class named HelloWorld in the package pods.loaders.
001 package pods.podloaders;
002
003 import java.util.Map;
004 import org.w3c.dom.Document;
005 import org.w3c.dom.Node;
006 import curam.cefwidgets.docbuilder.impl.PodBuilder;
007 import curam.cefwidgets.pods.pod.impl.PodLoader;
008 import curam.codetable.PODTYPE;
009
010 public class HelloWorld extends PodLoader {
011
012 @Override
013 public Node createPod(Document document, Map<String,Object> contexts) {
014 try{
015 PodBuilder helloWorld =
016 PodBuilder.newPod(document, PODTYPE.HELLOWORLD);
017 helloWorld.setTitle("Hello World");
018 return helloWorld.getWidgetRootNode();
019 }catch(Exception e){
020 throw new RuntimeException(e);
021 }
022 }
023 }
Input
| Parameter | Description |
|---|---|
| document | The Document parameter is an instance of a org.w3c.Document class. It is passed to the method by the infrastructure that calls it. The Document instance is used to create and append the 'pod' Node that describes the Pod. |
| context | The context parameter is used to pass page level paramtets to the Pods. Currently this is not support. |
Output
| Return object | Description |
|---|---|
| org.w3cNode | The content of the Node returned must match a predefined schema. The PodBuilder class provides an API to create our 'pod' Node in the correct format. |