psdi.app.scconfig

Class StartCenterLoader

  • java.lang.Object
    • psdi.app.scconfig.StartCenterLoader


  • public class StartCenterLoader
    extends java.lang.Object
    Class used for parsing presentation xml of start center templates. A start center template is stored in the database an XML document.
    This resides in SCTEMPLATE.PRESENTATION field.

    XML elements are logically mapped to MBO in the following way. The attributes in the XML elements are mapped to the fields for a given MBO.
    The main elements are mapped as: startcenter => SCCONFIG

    quickinsert, resultset, favoriteapplications, bulletinboard, kpigraph, kpilist, inbox, reportlist == > LAYOUT

    This class is used for 2 main purposes A. Loading a user's start center based on a template
    The main method here is loadStartCenterFromTemplate

    B. Creating a new or editing an existing template The main method is saveStartCenterXML
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addChild(org.w3c.dom.Element parentElement, org.w3c.dom.Element childElement, int spaces)
      Adds child element to parent element element
      void addChildren(java.lang.String id, MboSetRemote portletDataSet, org.w3c.dom.Element rootElement, org.w3c.dom.Element portletElement, java.lang.String tagName, java.lang.String[] attributes)
      Creates children for a given portlet type, sets indentation and data.
      java.lang.String getWebClientProperty(java.lang.String prop, java.lang.String defaultValue)
      Returns webclient properties
      void loadStartCenterForUser(java.lang.String groupName)
      Reads XML from database, creates a dom and inserts info into Start Center and Portlet Tables
      long loadStartCenterFromTemplate(java.lang.String templateId, java.lang.String groupName, boolean modifyTemplate)
      Main method for loading a start center based on a template and for a given group.
      void saveStartCenterXML(java.lang.String startCenterId)
      Used to save the XML for a template being created/edited.
      Takes start center information for a given template (as its sat in SCCONFIG), creates XML DOM for it and stores it the database for the selected groups.
      void setAttributes(java.lang.String currentSaveContentUID, java.lang.String[] attributes, MboRemote mbo, org.w3c.dom.Element element, java.lang.String parentTagName)
      Sets information from a given MboRemote into an Element for the given set of attributes
      org.w3c.dom.Text spaceAndNewLine(org.w3c.dom.Document doc, int spaces)
      Returns a node with spaces and new line for formatting
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StartCenterLoader

        public StartCenterLoader(UserInfo ui)
        Constructor
        Parameters:
        ui -
    • Method Detail

      • loadStartCenterForUser

        public void loadStartCenterForUser(java.lang.String groupName)
                                    throws MXException
        Reads XML from database, creates a dom and inserts info into Start Center and Portlet Tables
        Parameters:
        groupName - Group Name
        ui - UserInfo
        Throws:
        MXException
      • loadStartCenterFromTemplate

        public long loadStartCenterFromTemplate(java.lang.String templateId,
                                                java.lang.String groupName,
                                                boolean modifyTemplate)
                                         throws MXException
        Main method for loading a start center based on a template and for a given group. The XML of the template is read and based on mapping all the portlets are processed and data is inserted into start center tables for the user.
        Parameters:
        templateId - SCTEMPLATE.SCTEMPLATEID
        groupName - group name
        modifyTemplate - flag that tells if this is during a edit of a template
        Throws:
        MXException
      • setAttributes

        public void setAttributes(java.lang.String currentSaveContentUID,
                                  java.lang.String[] attributes,
                                  MboRemote mbo,
                                  org.w3c.dom.Element element,
                                  java.lang.String parentTagName)
                           throws MXException,
                                  java.rmi.RemoteException
        Sets information from a given MboRemote into an Element for the given set of attributes
        Parameters:
        attributes -
        mbo -
        element -
        Throws:
        MXException
        java.rmi.RemoteException
      • saveStartCenterXML

        public void saveStartCenterXML(java.lang.String startCenterId)
        Used to save the XML for a template being created/edited.
        Takes start center information for a given template (as its sat in SCCONFIG), creates XML DOM for it and stores it the database for the selected groups. Previous template XML is overwritten in case of edit.
        Parameters:
        startCenterId - which start center has to be copied
      • spaceAndNewLine

        public org.w3c.dom.Text spaceAndNewLine(org.w3c.dom.Document doc,
                                                int spaces)
        Returns a node with spaces and new line for formatting
        Parameters:
        doc -
        forChild -
        Returns:
      • addChild

        public void addChild(org.w3c.dom.Element parentElement,
                             org.w3c.dom.Element childElement,
                             int spaces)
        Adds child element to parent element element
      • addChildren

        public void addChildren(java.lang.String id,
                                MboSetRemote portletDataSet,
                                org.w3c.dom.Element rootElement,
                                org.w3c.dom.Element portletElement,
                                java.lang.String tagName,
                                java.lang.String[] attributes)
        Creates children for a given portlet type, sets indentation and data.
        Parameters:
        id - contentuid to be used on the element
        portletDataSet - MboSetRemote for portlet data
        rootElement - Root element
        portletElement - portlet element
        tagName - tag name for the portlet data
        attributes - array of attribute names
      • getWebClientProperty

        public java.lang.String getWebClientProperty(java.lang.String prop,
                                                     java.lang.String defaultValue)
        Returns webclient properties