Beispiel #1
0
  private static synchronized void init() {
    if (gsInit) return;
    Reloader.addReloader(Design.class);

    String lDesignClient = SystemInformation.getShortClientDir();
    if (lDesignClient.length() != 0) lDesignClient += File.separatorChar;
    String lDesignServer = SystemInformation.getServerDir() + File.separatorChar;

    synchronized (LOCK_DESIGN) {
      gsDesignClient = lDesignClient + DESIGN_SUBDIR;
      gsDesignServer = lDesignServer + DESIGN_SUBDIR;
      gsInit = true;
    }
  }
Beispiel #2
0
  private static void XML2Design() throws SystemException {
    // get default design
    String lDefaultDesign, lDefaultStyle = null;
    lDefaultDesign = SystemInformation.getDesign();
    if (lDefaultDesign == null) lDefaultDesign = SystemInformation.DESIGN;
    if (lDefaultDesign != null) {
      String[] lDefault = split(lDefaultDesign);
      lDefaultDesign = lDefault[0];
      lDefaultStyle = lDefault[1];
    } else throw new SystemException("DesignManager.XML2Design: No DefaultDesign defined");

    synchronized (LOCK_DESIGNMANAGER) {
      gsDefaultDesign = lDefaultDesign;
      gsDefaultStyle = lDefaultStyle;
    }

    // get designs
    NodeList nl;
    synchronized (gsXML) {
      nl = gsXML.getDocument().getElementsByTagName("Item");
    }

    for (int i = 0; i < nl.getLength(); i++) {
      try {
        addDesign(nl.item(i));
      } catch (Exception e) {
        throw new SystemException(
            "DesignManager.XML2Design: Unable to init Designs (addDesign)\n" + e);
      }
    }
  }
Beispiel #3
0
 private static void getXMLFile() throws SystemException {
   try {
     synchronized (LOCK_DESIGNMANAGER) {
       gsXML = new Config(SystemInformation.getDesignFile());
     }
   } catch (Exception e) {
     throw new SystemException("DesignManager: Unable to get DesignFile\n" + e);
   }
 }
Beispiel #4
0
  /**
   * gsDesignClient & gsDesignServer are not synchronized!!! (to speed up)
   *
   * @param pId
   * @param pName
   * @param pStyle
   * @param pGroups
   * @param pWindow
   * @param pCopyright
   * @param pComment
   */
  public Design(
      String pId,
      String pName,
      Hashtable pStyle,
      Vector pGroups,
      boolean pWindow,
      String pCopyright,
      String pComment) {
    if (!gsInit) init();

    gId = pId;
    gName = pName;
    if (pName.indexOf(":") != -1) {
      gPath = pId;
      gFile = new File(gName + File.separator + "design.xsl"); // File-->URL
      // ERROR - Path conflict
    } else {
      if (pName.charAt(0) == '/') {
        gPath = pId;
        gFile =
            new File(
                SystemInformation.getBaseDir()
                    + pId.replace('/', File.separatorChar)
                    + File.separator
                    + "design.xsl"); // File-->URL
      } else {
        /*
         * String lDesignClient, lDesignServer;
         * synchronized(LOCK_DESIGN) { lDesignClient=gsDesignClient;
         * lDesignServer=gsDesignServer; }
         * gPath=lDesignClient+File.separator+pPath; gFile=new
         * File(lDesignServer+File.separator+pPath.replace('/',File.separatorChar)+File.separator+pName+".xsl");
         */
        gPath = gsDesignClient + File.separator + pId;
        gFile =
            new File(
                gsDesignServer
                    + File.separator
                    + pId.replace('/', File.separatorChar)
                    + File.separator
                    + "design.xsl");
      }
    }
    gStyle = pStyle;
    gGroups = pGroups;
    gWindow = pWindow;
    gCopyright = pCopyright;
    gComment = pComment;
  }