Examples of NeighborConfig


Examples of org.dmlite.model.config.NeighborConfig

      // Properties absorbed from parents.
      NeighborsConfig neighborsConfig = conceptConfig
          .getNeighborsConfig();
      for (IEntity neighborConfigEntity : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) neighborConfigEntity;
        if (neighborConfig.getType().equals("parent")
            && 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());
                if (parentEntity != null) {
                  String parentCode = parentEntity
                      .getConceptConfig().getCode();
                  String parentPropertyKey = parentCode
View Full Code Here

Examples of org.dmlite.model.config.NeighborConfig

      // Properties absorbed from parents.
      NeighborsConfig neighborsConfig = conceptConfig
          .getNeighborsConfig();
      for (IEntity neighborConfigEntity : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) neighborConfigEntity;
        if (neighborConfig.getType().equals("parent")
            && neighborConfig.getMax().equals("1")
            && neighborConfig.isAbsorb()) {
          ConceptConfig parentConceptConfig = neighborConfig
              .getNeighborDestinationConceptConfig();
          if (parentConceptConfig != null) {
            PropertiesConfig parentConceptPropertiesConfig = parentConceptConfig
                .getPropertiesConfig();
            for (IEntity propertyConfigEntity : parentConceptPropertiesConfig) {
              PropertyConfig parentConceptPropertyConfig = (PropertyConfig) propertyConfigEntity;
              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 parentPropertyValuePanel;
                  if (parentConceptPropertyConfig
                      .getPropertyClass().equals(
                          "java.net.URL")
                      || parentConceptPropertyConfig
                          .getPropertyClass()
                          .equals(
                              "org.dmlite.type.email.Email")) {
                    parentPropertyValuePanel = new ExternalLinkPanel(
                        parentModelContext,
                        parentViewContext);
                  } else {
                    parentPropertyValuePanel = new LabelPanel(
                        parentModelContext,
                        parentViewContext);
                  }
                  if (!app.isNeighborDisplayAllowed(
                      getAppSession(), neighborConfig)) {
                    parentPropertyNameLabel.setVisible(false);
                    parentPropertyValuePanel.setVisible(false);
                  } else if (!app.isPropertyDisplayAllowed(
                      getAppSession(),
                      parentConceptPropertyConfig)) {
                    parentPropertyNameLabel.setVisible(false);
                    parentPropertyValuePanel.setVisible(false);
                  }

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

      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      for (IEntity config : propertiesConfig) {
        PropertyConfig propertyConfig = (PropertyConfig) config;
        String propertyCode = propertyConfig.getCode();
        String propertyKey = conceptConfig.getCode() + "."
            + propertyCode;
        String propertyName = getLocalizer().getString(propertyKey,
            this);
        PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = new PropertyNameLabelValuePanelPair();
        Label propertyNameLabel = new Label("propertyName",
            propertyName);
        propertyNameLabelValuePanelPair
            .setPropertyNameLabel(propertyNameLabel);
        ModelContext entityModelContext = new ModelContext(modelContext);
        entityModelContext.setPropertyConfig(propertyConfig);
        Panel propertyValuePanel;
        if (propertyConfig.getPropertyClass().equals(
            "java.lang.Boolean")) {
          ViewContext checkBoxPanelContext = new ViewContext(
              viewContext);
          checkBoxPanelContext.setWicketId("valuePanel");
          propertyValuePanel = new CheckBoxPanel(entityModelContext,
              checkBoxPanelContext);
        } else if (propertyConfig.getPropertyClass().equals(
            "java.lang.String")
            && propertyConfig.getDisplayLengthInt() > App.MIN_LONG_TEXT_LENGTH) {
          ViewContext textAreaPanelContext = new ViewContext(
              viewContext);
          textAreaPanelContext.setWicketId("valuePanel");
          propertyValuePanel = new TextAreaPanel(entityModelContext,
              textAreaPanelContext);
        } else if (propertyConfig.isReference()) {
          String neighborCode = propertyConfig.getReferenceNeighbor();
          NeighborConfig neighborConfig = conceptConfig
              .getNeighborsConfig().getNeighborConfig(
                  neighborCode);
          String neighborConceptCode = neighborConfig
              .getDestination();
          IPersistentEntities persistentEntities = app.getDbContext()
              .getPersistentModel().getPersistentEntry(
                  neighborConceptCode);
          IOrderedEntities lookupEntities = null;
          if (persistentEntities != null) {
            lookupEntities = (IOrderedEntities) persistentEntities
                .getEntities();
          }
          if (lookupEntities != null) {
            ModelContext neighborModelContext = new ModelContext(
                modelContext);
            neighborModelContext.setPropertyConfig(propertyConfig);
            neighborModelContext.setLookupEntities(lookupEntities);
            ViewContext lookupViewContext = new ViewContext(
                viewContext);
            lookupViewContext.setWicketId("valuePanel");
            if (neighborConfig.getMinInt() == 0) {
              propertyValuePanel = new LookupEmptyPanel(
                  neighborModelContext, lookupViewContext);

            } else {
              propertyValuePanel = new LookupPanel(
View Full Code Here

Examples of org.dmlite.model.config.NeighborConfig

      Class propertyClass = propertyConfig.getPropertyClassObject();
      String propertyValueText = "";
      if (entity != null) {
        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);
View Full Code Here

Examples of org.dmlite.model.config.NeighborConfig

      // Neighbor update links
      List<NeighborNameLabelLinkPair> neighborNameLabelLinkPairs = new ArrayList<NeighborNameLabelLinkPair>();
      NeighborsConfig neighborsConfig = conceptConfig
          .getNeighborsConfig();
      for (IEntity neighborConfigEntity : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) neighborConfigEntity;
        if (neighborConfig.getType().equals("child")
            && neighborConfig.isInternal()) {
          NeighborNameLabelLinkPair neighborNameLabelLinkPair = new NeighborNameLabelLinkPair();
          String conceptCode = conceptConfig.getCode();
          String neighborKey = conceptCode + "."
              + neighborConfig.getCode();
          String neighborName = getLocalizer().getString(neighborKey,
              this);
          Label neighborNameLabel = new Label("neighborName",
              neighborName);
          neighborNameLabelLinkPair
              .setNeighborNameLabel(neighborNameLabel);
          Link neighborLink = null;
          IDomainModel domainModel = app.getDomainModel();
          final IOrderedEntities neighborEntities = (IOrderedEntities) domainModel
              .getModelMeta().getNeighborEntities(entity,
                  neighborConfig.getCode());

          final ModelContext neighborModelContext = new ModelContext(
              modelContext);
          neighborModelContext.setContextEntities(entities);
          neighborModelContext.setContextEntity(entity);
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.