{"id":31695,"date":"2015-04-23T22:28:16","date_gmt":"2015-04-24T06:28:16","guid":{"rendered":"https:\/\/ephesoft.com\/docs\/2019-1-2\/developers\/scripting-guide\/jdom-script-configuration\/"},"modified":"2020-05-19T12:24:44","modified_gmt":"2020-05-19T19:24:44","slug":"jdom-script-configuration","status":"publish","type":"docs","link":"https:\/\/ephesoft.com\/docs\/products\/transact\/developers\/scripting-guide\/jdom-script-configuration\/","title":{"rendered":"JDOM Script Configuration"},"content":{"rendered":"
Update the dcma-scripting-plugin.properties in {EPHESOFT_INSTALL_DIR}EphesoftApplicationWEB-INFclassesMETA-INFdcma-scripting-plugin<\/p>\n
If anything other than jdom is specified for script.parser_type then the IScript parser will be used and Scripts using IScript will be executed.<\/p>\n
Let\u2019s take the simple example for converting IScript scripts into JDOM scripts. Changes to be made to convert the present script to JDOM.<\/p>\n
and replace the following import<\/p>\n
with the following<\/p>\n
3) API difference in JDOM w.r.t ISCRIPT<\/b><\/p>\n 1. Getting Pages Nodes in JDOM vs. ISCRIPT<\/p>\n \/\/ Getting first child of DOCUMENTS node<\/p>\n List documentList = documents.getChildren(DOCUMENT); for (int documentIndex = 0; documentIndex < documentList.size(); documentIndex++) { Element document = (Element) documentList.get(documentIndex); Element pages = (Element) document.getChild(PAGES); }<\/td>\n 2. Getting Text Content from element:<\/p>\n 3. Setting Text Context in element:<\/p>\n 4. To get a child node for any particular node\u00a0:<\/p>\n 5. To get the textual content of the named child element:<\/p>\n 6. To set the textual content of the element:<\/p>\n 7. To create a new child node in the parent:<\/p>\n Changes needed to be made to the scripts for making the old scripts work with the new ZIP functionality. For each script:<\/p>\n\n
\n
\n\n
\n JDOM<\/th>\n IScript<\/th>\n<\/tr>\n \n \/\/ Getting PAGES tag with accessing its parent in batch.xml\/\/ Getting first child of root nodeElement documents = document.getRootElement().getChild(DOCUMENTS);<\/p>\n \/\/ Getting directly PAGES tag without accessing its parent in batch.xmlNodeList documentList = document.getElementsByTagName(PAGES);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n JDOM<\/th>\n IScript<\/th>\n<\/tr>\n \n String elementValue = element.getText();<\/td>\n String elementValue = element.getTextContent();<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n JDOM<\/th>\n IScript<\/th>\n<\/tr>\n \n element.setText(\u201cString Data”);<\/td>\n element.setTextContent(\u201cString Data\u201d);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n JDOM<\/th>\n IScript<\/th>\n<\/tr>\n \n Element variableName = (Element) parentElement.getChild(\u201cName_of_child\u201d);<\/td>\n Element variableName = (Element) parentElement.getChild(\u201cName_of_child\u201d);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n JDOM<\/th>\n IScript<\/th>\n<\/tr>\n \n String textName = element.getChildText(\u201cName_of_child\u201d);<\/td>\n String name = parentElement.getElementsByTagName(” Name “).item(0).getTextContent();<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n JDOM<\/th>\n IScript<\/th>\n<\/tr>\n \n Element.setText(\u201cText_to_be_put_as_name\u201d);<\/td>\n Element.setTextContent(\u201cText_to_be_put_as_name\u201d);<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n JDOM<\/th>\n IScript<\/th>\n<\/tr>\n \n Element newElement = new
\nElement(\u201cName_of_element\u201d); parentElement.addContent( newElement);<\/td>\nElement childElement = document.createElement(\u201cChild\u201d);parentElement.appendChild(childElement);Here document is the argument passed to the method.
\nEx: \u201cexecute(Document document, String fieldName, String docIdentifier)\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\nHow to implement zip functionality in the present scripts<\/span><\/h1>\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n