private void test() { // Have a bash... try { // Create the FUNCTION Function function = new Function(); function.setId("PVJ"); function.setLabel("Prompt and Validate Test Stub"); function.setDescription("Prompt and Validate Test Stub"); // Records DisplayFieldSetWrapper setWrapper = getRecord1(); function.addInputFieldSet(setWrapper.getInputFieldSet()); Layout layout = new Layout(function, setWrapper.getDisplayAttributesSet()); // Print the XML EqBeanFactory beanFactory = EqBeanFactory.getEqBeanFactory(); String serviceXML = beanFactory.serialiseBeanAsXML(function); System.out.println(serviceXML); String layoutXML = beanFactory.serialiseBeanAsXML(layout); System.out.println(layoutXML); // Write to GAXPF XMLToolbox.getXMLToolbox() .writeDefinitionXMLtoDB( session, unit.getKFILLibrary(), GAXRecordDataModel.SERVICE_CODE, function.getId(), Toolbox.formatDate(Calendar.getInstance(), Toolbox.TIMESTAMP_FORMAT), serviceXML); // Write to GBXPF XMLToolbox.getXMLToolbox() .writeDefinitionXMLtoDB( session, unit.getKFILLibrary(), GAXRecordDataModel.LAYOUT_CODE, layout.getId(), Toolbox.formatDate(Calendar.getInstance(), Toolbox.TIMESTAMP_FORMAT), layoutXML); } catch (Exception e) { e.printStackTrace(); } }
/** * Constructor * * @param primaryFunction - the primary function * @throws EQException */ public ServiceLinkageLayout(Layout primaryLayout) throws EQException { this.linkedLayout = XMLToolbox.getXMLToolbox().duplicateLayout(primaryLayout); }