Examples of PropertyConfig


Examples of org.dmlite.model.config.PropertyConfig

    log.info("(Code = " + entity.getCode() + ")");

    PropertiesConfig propertiesConfig = entity.getConceptConfig()
        .getPropertiesConfig();
    for (IEntity config : propertiesConfig) {
      PropertyConfig propertyConfig = (PropertyConfig) config;
      String propertyName = propertyConfig.getCode();
      if (propertyName.equals("code")) {
        continue;
      }
      String getMethodName = "get" + propertyConfig.getBigCode();
      Object value = Reflector.executeMethod(entity, getMethodName);
      log.info("(" + propertyConfig.getBigCode() + " = " + value + ")");
    }

    NeighborsConfig neighborsConfig = entity.getConceptConfig()
        .getNeighborsConfig();
    for (IEntity config : neighborsConfig) {
View Full Code Here

Examples of org.dmlite.model.config.PropertyConfig

            if (validation) {
              ModelMeta modelMeta = domainModel.getModelMeta();
              PropertiesConfig propertiesConfig = conceptConfig
                  .getPropertiesConfig();
              for (IEntity config : propertiesConfig) {
                PropertyConfig propertyConfig = (PropertyConfig) config;
                String propertyCode = propertyConfig.getCode();
                Object property = entity
                    .getProperty(propertyCode);
                if (propertyConfig.isRequired()) {
                  if (property != null) {
                    if (propertyConfig.isValidateType()) {
                      validation = modelMeta
                          .validPropertyType(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                    if (propertyConfig.getPropertyClass()
                        .equals("java.lang.String")) {
                      validation = modelMeta
                          .validMaxLength(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                  } else { // property is null
                    if (propertyConfig.getDefaultValue() != null) {
                      if (!modelMeta
                          .setPropertyDefaultValue(
                              entity,
                              propertyConfig,
                              property)) {
                        modelMeta
                            .addRequiredPropertyError(
                                this, entity,
                                propertyConfig);
                        validation = false;
                      }
                    } else {
                      modelMeta.addRequiredPropertyError(
                          this, entity,
                          propertyConfig);
                      validation = false;
                    }
                  }
                } else { // property is not required
                  if (property != null) {
                    if (propertyConfig.isValidateType()) {
                      validation = modelMeta
                          .validPropertyType(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                    if (propertyConfig.getPropertyClass()
                        .equals("java.lang.String")) {
                      validation = modelMeta
                          .validMaxLength(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                  } else { // property is null
                    if (propertyConfig.getDefaultValue() != null) {
                      modelMeta.setPropertyDefaultValue(
                          entity, propertyConfig,
                          property);
                    }
                  } // if
View Full Code Here

Examples of org.dmlite.model.config.PropertyConfig

        entity = modelContext.getUpdateEntity();
      } else {
        entity = modelContext.getEntity();
      }

      PropertyConfig propertyConfig = modelContext.getPropertyConfig();

      String propertyCode = propertyConfig.getCode();
      Class propertyClass = propertyConfig.getPropertyClassObject();
      if (propertyConfig.isReference()) {
        String neighborCode = propertyConfig.getReferenceNeighbor();
        NeighborConfig neighborConfig = entity.getConceptConfig()
            .getNeighborsConfig().getNeighborConfig(neighborCode);
        String neighborConceptCode = neighborConfig.getDestination();
        App app = (App) getApplication();
        IPersistentEntities persistentEntities = app.getDbContext()
            .getPersistentModel().getPersistentEntry(
                neighborConceptCode);
        IOrderedEntities neighborEntities = null;
        if (persistentEntities != null) {
          neighborEntities = (IOrderedEntities) persistentEntities
              .getEntities();
        }
        if (neighborEntities != null) {
          Long referenceOid = (Long) entity.getProperty(propertyCode);
          Oid neighborParentOid = new Oid(referenceOid);
          IEntity neighborParent = neighborEntities
              .retrieveByOid(neighborParentOid);
          if (neighborParent != null) {
            PropertyConfig firstEssentialPropertyConfig = neighborParent
                .getConceptConfig().getPropertiesConfig()
                .getFirstEssentialPropertyConfig();
            if (firstEssentialPropertyConfig != null) {
              String firstEssentialPropertyCode = firstEssentialPropertyConfig
                  .getCode();
              Class firstEssentialPropertyClass = firstEssentialPropertyConfig
                  .getPropertyClassObject();
              textField = new TextField("propertyValue",
                  new PropertyModel(neighborParent,
                      firstEssentialPropertyCode,
                      firstEssentialPropertyClass));
View Full Code Here

Examples of org.dmlite.model.config.PropertyConfig

      if (action != null && action.equals("update")) {
        entity = modelContext.getUpdateEntity();
      } else {
        entity = modelContext.getEntity();
      }
      PropertyConfig propertyConfig = modelContext.getPropertyConfig();

      checkBox = new CheckBox("propertyValue", new PropertyModel(entity,
          propertyConfig.getCode()));
      add(checkBox);
    } catch (Exception e) {
      log.error("Error in CheckBoxPanel: "
          + modelContext.getPropertyCode() + " - " + e.getMessage());
    }
View Full Code Here

Examples of org.openeai.config.PropertyConfig

  }

  public final void init(AppConfig aConfig) throws ScheduleIdStoreException {
    setAppConfig(aConfig);
    try {
      PropertyConfig pConfig = new PropertyConfig();
      pConfig = (PropertyConfig)getAppConfig().getObjectByType(pConfig.getClass().getName());
      setPath(pConfig.getProperties().getProperty("ScheduleIdPath",null));
      load();
    }
    catch (Exception e) {
      String errMessage = "Exception loading the FileSchedulIdStore.  Exception: " + e.getMessage();
      logger.fatal(errMessage, e);
View Full Code Here

Examples of org.openeai.config.PropertyConfig

   */
  public MockAddressValidationRequestCommand(CommandConfig cConfig) throws InstantiationException {
    super(cConfig);
   
    // Get and set the general properties for this command.
    PropertyConfig pConfig = new PropertyConfig();
    try {
      pConfig = (PropertyConfig)getAppConfig()
      .getObject("AddressValidationRequestCommandProperties");  
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      String errMsg = "Error retrieving a PropertyConfig object from " +
      "AppConfig: The exception is: " + eoce.getMessage();
      logger.fatal("[MockAddressValidationRequestCommand] " + errMsg);
      throw new InstantiationException(errMsg);
    }
    setProperties(pConfig.getProperties());
   
    // Initialize response document.
    XmlDocumentReader xmlReader = new XmlDocumentReader();
    try {
      logger.debug("[MockAddressValidationRequestCommand] " +
View Full Code Here

Examples of org.openeai.config.PropertyConfig

        "setting logger to be org.openeai.OpenEaiObject.logger.");
      logger = org.openeai.OpenEaiObject.logger;
    }
  
    // Get and set the general properties for this command.
    PropertyConfig pConfig = new PropertyConfig();
    try {
      pConfig = (PropertyConfig)getAppConfig()
        .getObject("I2sRequestCommandProperties");  
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      String errMsg = "Error retrieving a PropertyConfig object from " +
        "AppConfig: The exception is: " + eoce.getMessage();
      logger.fatal("[I2sRequestCommand] " + errMsg);
      throw new InstantiationException(errMsg);
    }
    setProperties(pConfig.getProperties());

    // Initialize response and provide documents.
    XmlDocumentReader xmlReader = new XmlDocumentReader();
    try {
      logger.debug("[I2sRequestCommand] " +
        "responseDocumentUri: " + getProperties()
        .getProperty("responseDocumentUri"));
      m_responseDoc = xmlReader.initializeDocument(getProperties()
        .getProperty("responseDocumentUri"), getOutboundXmlValidation());
      if (m_responseDoc == null) {
        String errMsg = "Missing 'responseDocumentUri' " +
          "property in the deployment descriptor.  Can't continue.";
        logger.fatal("[I2sRequestCommand] " + errMsg);
        throw new InstantiationException(errMsg);
      }
      logger.debug("[I2sRequestCommand] " +
        "provideDocumentUri: " + getProperties()
        .getProperty("provideDocumentUri"));
      m_provideDoc = xmlReader.initializeDocument(getProperties()
        .getProperty("provideDocumentUri"), getOutboundXmlValidation());
      if (m_provideDoc == null) {
        String errMsg = "Missing 'provideDocumentUri' " +
          "property in the deployment descriptor.  Can't continue.";
        logger.fatal("[I2sRequestCommand] " + errMsg);
        throw new InstantiationException(errMsg);
      }
    }
    catch (XmlDocumentReaderException e) {
      logger.fatal("[I2sRequestCommand] Error initializing" +
        " the primed documents.");
      e.printStackTrace();
      throw new InstantiationException(e.getMessage());
    }
   
    // Get the I2sRepositoryProperties from AppConfig.
    PropertyConfig i2spConfig = new PropertyConfig();
    try {
      i2spConfig = (PropertyConfig)getAppConfig()
        .getObject("I2sRepositoryProperties");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      String errMsg = "Error retrieving PropertyConfig object from " +
        "AppConfig for the I2sRepositoryProperties. The exception is: " +
        eoce.getMessage();
      logger.fatal("[I2sRequestCommand] " + errMsg);
      throw new InstantiationException(errMsg);
    }
    Properties i2sRepositoryProps = i2spConfig.getProperties();

    // Determine which I2sRepository implementation to use.
    String repositoryClassName = i2sRepositoryProps
      .getProperty("repositoryClassName");
    if (repositoryClassName == null) {
View Full Code Here

Examples of org.openeai.config.PropertyConfig

    super(cConfig);

    // Get the general properties for this command.
    try {
      PropertyConfig pConfig = new PropertyConfig();
      pConfig = (PropertyConfig)getAppConfig().getObject("GeneralProperties");
      setProperties(pConfig.getProperties());
    }
    catch (EnterpriseConfigurationObjectException ecoe) {
      // An error occurred retreiving the general properties objects. Log it and
      // throw an exception.
      String errMsg = "An error occurred retrieving the general properties " +
View Full Code Here

Examples of org.openeai.config.PropertyConfig

  public FailureRequestCommand(CommandConfig cConfig) throws
    InstantiationException {
    super(cConfig);

    // Get and set the general properties for this command.
    PropertyConfig pConfig = new PropertyConfig();
    try {
      pConfig = (PropertyConfig)getAppConfig()
        .getObjectByType(pConfig.getClass().getName());  
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      String errMsg = "Error retrieving a PropertyConfig object from " +
        "AppConfig: The exception is: " + eoce.getMessage();
      throw new InstantiationException(errMsg);
    }
    setProperties(pConfig.getProperties());

    // Initialize the response document.
    XmlDocumentReader xmlReader = new XmlDocumentReader();
    try {
      m_responseDoc = xmlReader.initializeDocument(getProperties()
View Full Code Here

Examples of org.openeai.config.PropertyConfig

    boolean foundHandler = false;
    String mappingName = null;
    try {
      java.util.List handlerProperties = _appConfig.getObjectsLike("Handler");
      handlerLoop: for (int i=0; i<handlerProperties.size(); i++) {
        PropertyConfig p = (PropertyConfig)handlerProperties.get(i);
        LogService.log(LogService.INFO, "handler [" + i + "] " + p.getName());
        Properties props = p.getProperties();
        String handlerClassName = props.getProperty("handlerClassName",null);
        mappingName = p.getName();
        if (handlerClassName != null) {
          if (rd.getParameter(mappingName) != null) {           
            LogService.log(LogService.INFO, mappingName + " form variable maps to a known handler.");
            foundHandler = true;
            _styleSheet = props.getProperty("styleSheet", null);
            processHandler(mappingName, handlerClassName, props, rd);
            break handlerLoop;
          }
        }
        else {
          // error
          throw new UportalFormHandlerException("Missing 'handlerClassName' " +
            "property in the " + mappingName + " PropertyConfig object.");
        }
      }
    }
    catch (Exception e) {
      throw new UportalFormHandlerException(e.getMessage(), e);
    }
   
    if (foundHandler == false) {
      try {       
        PropertyConfig p = (PropertyConfig)_appConfig.getObject("defaultHandler");
        mappingName = p.getName();
        LogService.log(LogService.INFO, "using default handler " + mappingName);
        Properties props = p.getProperties();
        String handlerClassName = props.getProperty("handlerClassName",null);
        _styleSheet = props.getProperty("styleSheet", null);
        if (handlerClassName != null) {
          processHandler(mappingName, handlerClassName, props, rd);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.