com.knowgate.dataxslt
Class PageSet

java.lang.Object
  extended by dom.DOMDocument
      extended by com.knowgate.dataxslt.PageSet

public class PageSet
extends dom.DOMDocument

PageSet DOMDocument


Field Summary
static short ClassId
           
 
Constructor Summary
PageSet(java.lang.String sMsiteURI)
          Create empty PageSet from a Microsite.
PageSet(java.lang.String sMsiteURI, boolean bValidateXML)
          Create empty PageSet from a Microsite
PageSet(java.lang.String sMsiteURI, java.lang.String sPageSetURI)
          Create PageSet from a Microsite and load data from an XML file.
PageSet(java.lang.String sMsiteURI, java.lang.String sPageSetURI, boolean bValidateXML)
          Create PageSet from a Microsite and load data from an XML file.
 
Method Summary
 java.lang.String addBlock(java.lang.String sFilePath, java.lang.String sPageGUID, java.lang.String sBlockXML)
          Add block at the end of a Page
 java.util.Vector addresses()
          Get Addresses for this PageSet
 Page buildPageForEdit(java.lang.String sPageGUID, java.lang.String sBasePath, java.lang.String sOutputPath, java.lang.String sCtrlPath, java.lang.String sMenuPath, java.lang.String sIntegradorPath, java.lang.String sSelPageOptions, java.util.Properties oEnvironmentProps, java.util.Properties oUserProps)
           
 java.util.Vector buildSite(java.lang.String sBasePath, java.lang.String sOutputPath, java.util.Properties oEnvironmentProps, java.util.Properties oUserProps)
          Generate XSL Transformation output for PageSet.
 void buildSiteForEdit(java.lang.String sBasePath, java.lang.String sOutputPath, java.lang.String sCtrlPath, java.lang.String sMenuPath, java.lang.String sIntegradorPath, java.lang.String sSelPageOptions, java.util.Properties oEnvironmentProps, java.util.Properties oUserProps)
          Generate XSL Transformation output with editing layers for PageSet.
 java.lang.String catalog()
          GUID of Catalog associated to this PageSet
 java.lang.String company()
          GUID of Company associated to this PageSet
static java.lang.String getMicrositeGUID(java.lang.String sPageSetURI)
          Get base Microsite GUID from a PageSet XML file.
 java.lang.String guid()
          Get PageSet <guid> value
 javax.xml.transform.TransformerException lastException()
          Last TransformerException raised by buildSite() or buildSiteForEdit()
static void main(java.lang.String[] argv)
           
static void mergeCompanyInfo(JDCConnection oConn, java.lang.String sFilePath, java.lang.String sCompanyGUID)
          Merge Company addresses, catalog and other information into a PageSet XML file Addresses are readed from k_addresses table and appended to the XML file after the <pages> node.
 Microsite microsite()
           
 Page page(java.lang.String sPageId)
          Get a Page from this PageSet
 java.util.Vector<Page> pages()
          Get pages for this PageSet
static void removeBlock(java.lang.String sFilePath, java.lang.String sPageGUID, java.lang.String sBlockId)
          Remove Block Block is searched by an internal XPath expression:
pageset/pages/page[@guid='sPageGUID']/blocks/block[@id='sBlockId']
static void removePage(java.lang.String sFilePath, java.lang.String sPageGUID)
          Remove Page from PageSet Page is searched by an internal XPath expression:
pageset/pages/page[@guid='sPageGUID']
static void removePageByTitle(java.lang.String sFilePath, java.lang.String sPageGUIDAttr)
          Remove a Page searching it by title Page is searched by an internal XPath expression:
pageset/pages/page[guid = 'sPageTitle']
 void save(java.lang.String sFilePath)
           
 
Methods inherited from class dom.DOMDocument
filterChildsByName, getAttribute, getDocument, getFirstElement, getNamesSpaces, getNextElement, getRootElement, getRootNode, getTextValue, getValidation, getWriterEncoding, parseStream, parseURI, parseURI, print, print, seekChildByAttr, seekChildByName, setAttribute, setNamesSpaces, setValidation, sortAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ClassId

public static final short ClassId
See Also:
Constant Field Values
Constructor Detail

PageSet

public PageSet(java.lang.String sMsiteURI)
        throws java.lang.ClassNotFoundException,
               java.lang.IllegalAccessException,
               java.io.FileNotFoundException,
               java.lang.Exception
Create empty PageSet from a Microsite. XML validation is disabled.

Parameters:
sMsiteURI - Microsite XML file URI
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.io.FileNotFoundException
java.lang.Exception

PageSet

public PageSet(java.lang.String sMsiteURI,
               boolean bValidateXML)
        throws java.lang.ClassNotFoundException,
               java.lang.Exception,
               java.lang.IllegalAccessException,
               java.io.FileNotFoundException
Create empty PageSet from a Microsite

Parameters:
sMsiteURI - Microsite XML file URI (for example file:///opt/knowgate/storage/xslt/templates/Comtemporary.xml)
bValidateXML - true if XML validation with W3C schemas is to be done, false is no validation is to be done.
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.io.FileNotFoundException
java.lang.Exception

PageSet

public PageSet(java.lang.String sMsiteURI,
               java.lang.String sPageSetURI)
        throws java.lang.ClassNotFoundException,
               java.lang.Exception,
               java.lang.IllegalAccessException,
               java.io.FileNotFoundException
Create PageSet from a Microsite and load data from an XML file.

Parameters:
sMsiteURI - Microsite XML file URI
sPageSetURI - PageSet XML file URI (for example file:///opt/knowgate/storage/domains/1026/workareas/f7f055ca39854673b17518ec5f87de3b/apps/Mailwire/data/Newsletter01.xml)
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.Exception
java.io.FileNotFoundException

PageSet

public PageSet(java.lang.String sMsiteURI,
               java.lang.String sPageSetURI,
               boolean bValidateXML)
        throws java.lang.ClassNotFoundException,
               java.lang.Exception,
               java.lang.IllegalAccessException,
               java.io.FileNotFoundException
Create PageSet from a Microsite and load data from an XML file.

Parameters:
sMsiteURI - Microsite XML file URI
sPageSetURI - PageSet XML file URI
bValidateXML - true if XML validation with W3C schemas is to be done, false is no validation is to be done.
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.Exception
java.io.FileNotFoundException
Method Detail

guid

public java.lang.String guid()
Get PageSet <guid> value


lastException

public javax.xml.transform.TransformerException lastException()
Last TransformerException raised by buildSite() or buildSiteForEdit()


microsite

public Microsite microsite()

catalog

public java.lang.String catalog()
                         throws org.w3c.dom.DOMException
GUID of Catalog associated to this PageSet

Returns:
Catalog GUID or null if <catalog> node does not exist.
Throws:
org.w3c.dom.DOMException

company

public java.lang.String company()
                         throws org.w3c.dom.DOMException
GUID of Company associated to this PageSet

Returns:
Company GUID or null if <company> node does not exist.
Throws:
org.w3c.dom.DOMException

page

public Page page(java.lang.String sPageId)
          throws org.w3c.dom.DOMException,
                 java.lang.NullPointerException
Get a Page from this PageSet

Parameters:
sPageId - GUID of page to be retrieved
Returns:
Page object or null if no page with such GUID was found at XML file
Throws:
org.w3c.dom.DOMException - If node is not found
java.lang.NullPointerException - If sPageId is null

pages

public java.util.Vector<Page> pages()
                             throws org.w3c.dom.DOMException
Get pages for this PageSet

Returns:
vector of Page objects
Throws:
org.w3c.dom.DOMException - If node is not found

addresses

public java.util.Vector addresses()
                           throws org.w3c.dom.DOMException
Get Addresses for this PageSet

Returns:
vector of Page objects
Throws:
org.w3c.dom.DOMException - If node is not found

buildSite

public java.util.Vector buildSite(java.lang.String sBasePath,
                                  java.lang.String sOutputPath,
                                  java.util.Properties oEnvironmentProps,
                                  java.util.Properties oUserProps)
                           throws java.io.FileNotFoundException,
                                  java.io.IOException,
                                  org.w3c.dom.DOMException,
                                  javax.xml.transform.TransformerException,
                                  javax.xml.transform.TransformerConfigurationException

Generate XSL Transformation output for PageSet.

Parameters:
sBasePath - Path to directory containing XSL stylesheets
sOutputPath - Path to output directory where generated files shall be saved.
oEnvironmentProps - Environment Properties
oUserProps - User Properties
Returns:
Throws:
java.io.IOException
javax.xml.transform.TransformerException
javax.xml.transform.TransformerConfigurationException
java.io.FileNotFoundException
org.w3c.dom.DOMException

buildPageForEdit

public Page buildPageForEdit(java.lang.String sPageGUID,
                             java.lang.String sBasePath,
                             java.lang.String sOutputPath,
                             java.lang.String sCtrlPath,
                             java.lang.String sMenuPath,
                             java.lang.String sIntegradorPath,
                             java.lang.String sSelPageOptions,
                             java.util.Properties oEnvironmentProps,
                             java.util.Properties oUserProps)
                      throws java.io.FileNotFoundException,
                             java.io.IOException,
                             org.w3c.dom.DOMException,
                             javax.xml.transform.TransformerException,
                             javax.xml.transform.TransformerConfigurationException,
                             java.net.MalformedURLException
Throws:
java.io.FileNotFoundException
java.io.IOException
org.w3c.dom.DOMException
javax.xml.transform.TransformerException
javax.xml.transform.TransformerConfigurationException
java.net.MalformedURLException

buildSiteForEdit

public void buildSiteForEdit(java.lang.String sBasePath,
                             java.lang.String sOutputPath,
                             java.lang.String sCtrlPath,
                             java.lang.String sMenuPath,
                             java.lang.String sIntegradorPath,
                             java.lang.String sSelPageOptions,
                             java.util.Properties oEnvironmentProps,
                             java.util.Properties oUserProps)
                      throws java.io.IOException,
                             org.w3c.dom.DOMException,
                             javax.xml.transform.TransformerException,
                             javax.xml.transform.TransformerConfigurationException,
                             java.net.MalformedURLException

Generate XSL Transformation output with editing layers for PageSet.

Parameters:
sBasePath - Path to directory containing XSL stylesheets
sOutputPath - Path to output directory where generated files shall be saved.
sCtrlPath - Path to source code of the edition layer (tipically /includes/integrador_ctrl.inc file)
sMenuPath - Path to dynamic page that generates the block list (tipically /webbuilder/wb_mnuintegrador.jsp)
sIntegradorPath - Path to JavaScript functions of edition layer (tipically integrador.js)
sSelPageOptions - If this is a single Page PageSet this parameter must be "", else it is a list of available pages in HTML format.
oEnvironmentProps - Environment properties to be replaced at templated
oUserProps - User Properties to be replaced at templated
Throws:
java.io.IOException
org.w3c.dom.DOMException
javax.xml.transform.TransformerException
javax.xml.transform.TransformerConfigurationException
java.lang.NullPointerException
java.net.MalformedURLException

addBlock

public java.lang.String addBlock(java.lang.String sFilePath,
                                 java.lang.String sPageGUID,
                                 java.lang.String sBlockXML)
                          throws java.lang.IllegalAccessException,
                                 java.io.IOException,
                                 java.lang.ClassNotFoundException,
                                 java.lang.NumberFormatException,
                                 java.io.UTFDataFormatException,
                                 java.lang.Exception

Add block at the end of a Page

Parameters:
sFilePath - Path to PageSet XML file
sPageGUID - <Page> GUID attribute
sBlockXML - XML of Block to be added
Returns:
New Block Id
Throws:
java.lang.IllegalAccessException
java.io.IOException
java.lang.ClassNotFoundException
java.lang.NumberFormatException - If Identifier attribute is not an integer number.
java.io.UTFDataFormatException
java.lang.Exception

save

public void save(java.lang.String sFilePath)
          throws java.io.IOException
Throws:
java.io.IOException

mergeCompanyInfo

public static void mergeCompanyInfo(JDCConnection oConn,
                                    java.lang.String sFilePath,
                                    java.lang.String sCompanyGUID)
                             throws java.sql.SQLException,
                                    java.io.IOException

Merge Company addresses, catalog and other information into a PageSet XML file

Addresses are readed from k_addresses table and appended to the XML file after the <pages> node.

Parameters:
oConn - JDBC database connection
sFilePath - Complete path to the PageSet XML data file
sCompanyGUID - GUID of Company which addresses are to be merged into the PageSet XML file
Throws:
java.sql.SQLException
java.io.IOException

removePage

public static void removePage(java.lang.String sFilePath,
                              java.lang.String sPageGUID)
                       throws java.io.IOException

Remove Page from PageSet

Page is searched by an internal XPath expression:
pageset/pages/page[@guid='sPageGUID']

Parameters:
sFilePath - Path to PageSet XML file
sPageGUID - <Page> GUID attribute
Throws:
java.io.IOException

removePageByTitle

public static void removePageByTitle(java.lang.String sFilePath,
                                     java.lang.String sPageGUIDAttr)
                              throws java.io.IOException

Remove a Page searching it by title

Page is searched by an internal XPath expression:
pageset/pages/page[guid = 'sPageTitle']

Parameters:
sFilePath - Path to PageSet XML file
sPageGUIDAttr - Page GUID
Throws:
java.io.IOException

removeBlock

public static void removeBlock(java.lang.String sFilePath,
                               java.lang.String sPageGUID,
                               java.lang.String sBlockId)
                        throws java.io.IOException

Remove Block

Block is searched by an internal XPath expression:
pageset/pages/page[@guid='sPageGUID']/blocks/block[@id='sBlockId']

Parameters:
sFilePath - Path to PageSet XML file
sPageGUID - <Page> GUID attribute
sBlockId - id attribute of Block to be removed
Throws:
java.io.IOException

getMicrositeGUID

public static java.lang.String getMicrositeGUID(java.lang.String sPageSetURI)
                                         throws java.io.FileNotFoundException,
                                                java.io.IOException

Get base Microsite GUID from a PageSet XML file.

GUID is obtained directly from raw text reading without parsing the input file.

Parameters:
sPageSetURI - Path to PageSet XML file
Returns:
Microsite GUID
Throws:
java.io.FileNotFoundException
java.io.IOException

main

public static void main(java.lang.String[] argv)
                 throws java.lang.IllegalAccessException,
                        java.lang.ClassNotFoundException,
                        java.lang.Exception
Throws:
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
java.lang.Exception