Package com.cosmo.orm.apps

Examples of com.cosmo.orm.apps.OrmApplication


      Node actionNode;
      NodeList appsList;
      NodeList attribList;
      Element appElement;
      Element actionElement;
      OrmApplication oa;

      this.ormApps = new HashMap<String, OrmApplication>();

      // Comprueba si existe la definici�n
      attribList = doc.getElementsByTagName(OrmServiceProperties.XML_TAG_SERVICE);
      if (attribList.getLength() < 1)
      {
         return;
      }

      appsList = doc.getElementsByTagName(OrmServiceProperties.XML_TAG_CORM_APP);
      for (int pidx = 0; pidx < appsList.getLength(); pidx++)
      {
         Node appNode = appsList.item(pidx);
         if (appNode.getNodeType() == Node.ELEMENT_NODE)
         {
            appElement = (Element) appNode;

            oa = new OrmApplication();
            oa.setId(appElement.getAttribute(OrmServiceProperties.XML_ATT_ID));
            oa.setClassName(appElement.getAttribute(OrmServiceProperties.XML_ATT_CLASS));
            oa.setConnectionId(appElement.getAttribute(OrmServiceProperties.XML_ATT_CONNECTION));
            oa.setTitle(appElement.getAttribute(OrmServiceProperties.XML_ATT_TITLE));
            oa.setDescription(appElement.getAttribute(OrmServiceProperties.XML_ATT_DESCRIPTION));

            attribList = appElement.getElementsByTagName(OrmServiceProperties.XML_TAG_APPACTION);
            for (int aidx = 0; aidx < attribList.getLength(); aidx++)
            {
               actionNode = attribList.item(aidx);
               if (actionNode.getNodeType() == Node.ELEMENT_NODE)
               {
                  actionElement = (Element) actionNode;

                  if (actionElement.getAttribute(OrmServiceProperties.XML_ATT_TYPE).toLowerCase().trim().equals("delete"))
                  {
                     oa.setDeleteEnabled(true);
                  }
                  else if (actionElement.getAttribute(OrmServiceProperties.XML_ATT_TYPE).toLowerCase().trim().equals("create"))
                  {
                     oa.setCreateEnabled(true);
                  }
                  else if (actionElement.getAttribute(OrmServiceProperties.XML_ATT_TYPE).toLowerCase().trim().equals("edit"))
                  {
                     oa.setEditEnabled(true);
                  }
               }
            }

            this.ormApps.put(oa.getId(), oa);
         }
      }
   }
View Full Code Here

TOP

Related Classes of com.cosmo.orm.apps.OrmApplication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.