Package org.dmlite.model.config

Examples of org.dmlite.model.config.PropertiesConfig


            && neighborConfig.getMax().equals("1")
            && neighborConfig.isAbsorb()) {
          ConceptConfig parentConceptConfig = neighborConfig
              .getNeighborDestinationConceptConfig();
          if (parentConceptConfig != null) {
            PropertiesConfig parentConceptPropertiesConfig = parentConceptConfig
                .getPropertiesConfig();
            for (IEntity parentPropertyConfigEntity : parentConceptPropertiesConfig) {
              PropertyConfig parentConceptPropertyConfig = (PropertyConfig) parentPropertyConfigEntity;
              if (parentConceptPropertyConfig.isEssential()) {
                IEntity parentEntity = entity
                    .getNeighborEntity(neighborConfig
                        .getCode());
                Panel parentPropertyPanel;
                if (parentEntity != null) {
                  parentModelContext.setEntity(parentEntity);
                  parentModelContext
                      .setPropertyConfig(parentConceptPropertyConfig);
                  parentViewContext.setWicketId("valuePanel");
                  parentViewContext.getMoreArgs().add(
                      "shortText", Boolean.TRUE);
                  if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.net.URL")
                      || parentConceptPropertyConfig
                          .getPropertyClass()
                          .equals(
                              "org.dmlite.type.email.Email")) {
                    parentPropertyPanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.lang.String")
                      && parentConceptPropertyConfig
                          .isValidateType()
                      && (parentConceptPropertyConfig
                          .getValidationType()
                          .equals("java.net.URL") || parentConceptPropertyConfig
                          .getValidationType()
                          .equals(
                              "org.dmlite.type.email.Email"))) {
                    parentPropertyPanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else {
                    parentPropertyPanel = new LabelPanel(
                        parentModelContext,
                        parentViewContext);
                  } // if
                  if (!app.isNeighborDisplayAllowed(
                      getAppSession(), neighborConfig)) {
                    parentPropertyPanel.setVisible(false);
                  } else if (!app.isPropertyDisplayAllowed(
                      getAppSession(),
                      parentConceptPropertyConfig)) {
                    parentPropertyPanel.setVisible(false);
                  }
                } else {
                  parentPropertyPanel = new Panel(
                      "valuePanel");
                  parentPropertyPanel.setVisible(false);
                }
                propertyValuePanels.add(parentPropertyPanel);
              } // if
            } // for
          } // if
        } // if
      } // for

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity propertyConfigEntity : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) propertyConfigEntity;
        if (propertyConfig.isEssential()) {
          entityModelContext.setPropertyConfig(propertyConfig);
View Full Code Here


      List<PropertyNameLabelValuePanelPair> propertyNameLabelValuePanelPairs = new ArrayList<PropertyNameLabelValuePanelPair>();

      ModelContext entityContext = new ModelContext(modelContext);
      entityContext.setEntity(entity);

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity propertyConfigEntity : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) propertyConfigEntity;
        if (propertyConfig.isEssential()) {
          String propertyKey = conceptConfig.getCode() + "."
View Full Code Here

   */
  private void loadPropertyChildren(Element element) throws DmException {
    try {
      ConceptConfig conceptConfig = entity.getConceptConfig();
      if (conceptConfig != null) {
        PropertiesConfig propertiesConfig = conceptConfig
            .getPropertiesConfig();
        for (IEntity config : propertiesConfig) {
          PropertyConfig propertyConfig = (PropertyConfig) config;
          Class propertyClass = propertyConfig
              .getPropertyClassObject();
View Full Code Here

   *             exception if there is a problem
   */
  private void fillPropertyChildren(Element element) throws DmException {
    try {
      if (entity.getConceptConfig() != null) {
        PropertiesConfig propertiesConfig = entity.getConceptConfig()
            .getPropertiesConfig();
        TextHandler textHandler = new TextHandler();
        for (IEntity config : propertiesConfig) {
          PropertyConfig propertyConfig = (PropertyConfig) config;
          String propertyCode = propertyConfig.getCode();
View Full Code Here

                    "slide")) {
              // Do not absorb the context parent properties when
              // the parent is displayed as a slide.
              continue;
            }
            PropertiesConfig parentConceptPropertiesConfig = parentConceptConfig
                .getPropertiesConfig();
            for (IEntity parentPropertyConfigEntity : parentConceptPropertiesConfig) {
              PropertyConfig parentConceptPropertyConfig = (PropertyConfig) parentPropertyConfigEntity;
              if (parentConceptPropertyConfig.isEssential()) {
                IEntity parentEntity = entity
                    .getNeighborEntity(neighborConfig
                        .getCode());
                if (parentEntity != null) {
                  String parentCode = parentEntity
                      .getConceptConfig().getCode();
                  String parentPropertyKey = parentCode
                      + "."
                      + parentConceptPropertyConfig
                          .getCode();
                  String parentPropertyName = getLocalizer()
                      .getString(parentPropertyKey, this);
                  Label parentPropertyNameLabel = new Label(
                      "propertyName", parentPropertyName);
                  PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = new PropertyNameLabelValuePanelPair();
                  propertyNameLabelValuePanelPair
                      .setPropertyNameLabel(parentPropertyNameLabel);

                  ModelContext parentModelContext = new ModelContext(
                      modelContext);
                  parentModelContext.setEntity(parentEntity);
                  parentModelContext
                      .setPropertyConfig(parentConceptPropertyConfig);

                  ViewContext parentViewContext = new ViewContext(
                      viewContext);
                  parentViewContext.setWicketId("valuePanel");
                  Panel parentPropertyPanel;
                  if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.net.URL")
                      || parentConceptPropertyConfig
                          .getPropertyClass()
                          .equals(
                              "org.dmlite.type.email.Email")) {
                    parentPropertyPanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else {
                    parentPropertyPanel = new LabelPanel(
                        parentModelContext,
                        parentViewContext);
                  } // if
                  if (!app.isNeighborDisplayAllowed(
                      getAppSession(), neighborConfig)) {
                    parentPropertyPanel.setVisible(false);
                  } else if (!app.isPropertyDisplayAllowed(
                      getAppSession(),
                      parentConceptPropertyConfig)) {
                    parentPropertyPanel.setVisible(false);
                  }

                  propertyNameLabelValuePanelPair
                      .setPropertyValuePanel(parentPropertyPanel);
                  propertyNameLabelValuePanelPairs
                      .add(propertyNameLabelValuePanelPair);
                } // if
              } // if
            } // for
          } // if
        } // if
      } // for

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity propertyConfigEntity : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) propertyConfigEntity;
        if (!propertyConfig.isReference()) {
          String propertyKey = conceptCode + "."
View Full Code Here

            + entityClassName;
        throw new DmException(error);
      }
      ConceptConfig conceptConfig = entity.getConceptConfig();
      if (conceptConfig != null) {
        PropertiesConfig propertiesConfig = conceptConfig
            .getPropertiesConfig();
        for (IEntity config : propertiesConfig) {
          PropertyConfig propertyConfig = (PropertyConfig) config;
          if (propertyConfig.getDefaultValue() != null) {
            String propertyCode = propertyConfig.getCode();
View Full Code Here

      return true;
    } else if (entity1 == null || entity2 == null) {
      return false;
    }
    try {
      PropertiesConfig propertiesConfig = entity1.getConceptConfig()
          .getPropertiesConfig();
      for (IEntity config : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) config;
        String propertyCode = propertyConfig.getCode();
        Object entity1Property = entity1.getProperty(propertyCode);
View Full Code Here

    Entity entityRight = (Entity) entity2;
    boolean updated = false;
    try {
      // oid cannot be updated
      entityLeft.setCode(entityRight.getCode());
      PropertiesConfig propertiesConfig = entityLeft.getConceptConfig()
          .getPropertiesConfig();
      for (IEntity config : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) config;
        String getMethodName = "get" + propertyConfig.getBigCode();
        Object getObject = Reflector.executeMethod(entityRight,
View Full Code Here

  public void output(IEntity entity, String title) {
    log.info("=== " + title + " ===");
    log.info("(Oid = " + entity.getOid() + ")");
    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")) {
View Full Code Here

          ConceptConfig conceptConfig = entity.getConceptConfig();
          if (conceptConfig != null) {
            validation = validMaxCardinality(1);
            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
View Full Code Here

TOP

Related Classes of org.dmlite.model.config.PropertiesConfig

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.