Package org.dmlite.model.config

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();
      String validationType = propertyConfig.getValidationType();
      if (propertyConfig.isValidateType() && validationType != null) {
        IDomainModel domainModel = modelContext.getDomainModel();
        if (propertyConfig.isValidatationTypeEntities(domainModel)) {
          IEntities validationTypeEntities = domainModel
              .getEntry(validationType);
          List validationTypeList;
          if (validationTypeEntities instanceof IOrderedEntities) {
            IOrderedEntities orderedValidationTypeEntities = (IOrderedEntities) validationTypeEntities;
View Full Code Here


      parentModelContext.setEntity(parentEntity);

      ViewContext parentViewContext = new ViewContext(viewContext, true);
      parentViewContext.setWicketId("parentProperty");

      PropertyConfig parentPropertyConfig = parentModelContext
          .getPropertyConfig();
      Panel parentPropertyPanel;
      String propertyType = parentPropertyConfig.getPropertyClass();
      if (propertyType.equals("java.net.URL")
          || propertyType.equals("org.dmlite.type.email.Email")) {
        parentPropertyPanel = new ExternalLinkPanel(parentModelContext,
            parentViewContext);
        item.add(parentPropertyPanel);
      } else if (parentPropertyConfig.getPropertyClass().equals(
          "java.lang.String")
          && parentPropertyConfig.isValidateType()) {
        if (parentPropertyConfig.getValidationType().equals(
            "java.net.URL")
            || parentPropertyConfig.getValidationType().equals(
                "org.dmlite.type.email.Email")) {
          parentPropertyPanel = new ExternalLinkPanel(
              parentModelContext, parentViewContext);
          item.add(parentPropertyPanel);
        } else {
View Full Code Here

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

      textArea = new TextArea("propertyValue", new PropertyModel(entity,
          propertyConfig.getCode()));

      ModelConfig modelConfig = propertyConfig.getContextConceptConfig()
          .getContextModelConfig();
      if (modelConfig.isValidateForm()) {
        if (propertyConfig.isRequired() && propertyConfig.isUpdate()) {
          textArea.setRequired(true);
        }
      }

      int propertySize = propertyConfig.getDisplayLengthInt();
      int areaRowSize = (propertySize/App.AREA_COLUMN_SIZE) + 1;
      String noOfRows = Transformer.string(areaRowSize);
      String noOfColumns = Transformer.string(App.AREA_COLUMN_SIZE);
      setAttribute("rows", noOfRows);
      setAttribute("cols", noOfColumns);
      if (!propertyConfig.isUpdate()) {
        setAttribute("readonly", "readonly");
      }

      FormComponentFeedbackBorder propertyFeedback = new FormComponentFeedbackBorder(
          "propertyFeedback");
View Full Code Here

      ViewContext entityViewContext = new ViewContext(viewContext);
      entityViewContext.setWicketId("entityProperty");
      entityViewContext.getMoreArgs().add("shortText", Boolean.TRUE);

      PropertyConfig propertyConfig = entityModelContext
          .getPropertyConfig();
      Panel entityPropertyPanel;

      String propertyType = propertyConfig.getPropertyClass();
      if (propertyType.equals("java.net.URL")
          || propertyType.equals("org.dmlite.type.email.Email")) {
        entityPropertyPanel = new ExternalLinkPanel(entityModelContext,
            entityViewContext);
        item.add(entityPropertyPanel);
      } else if (propertyConfig.getPropertyClass().equals(
          "java.lang.String")
          && propertyConfig.isValidateType()) {
        if (propertyConfig.getValidationType().equals("java.net.URL")
            || propertyConfig.getValidationType().equals(
                "org.dmlite.type.email.Email")) {
          entityPropertyPanel = new ExternalLinkPanel(
              entityModelContext, entityViewContext);
          item.add(entityPropertyPanel);
        } else {
View Full Code Here

   */
  public LookupPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      PropertyConfig baseEntityPropertyConfig = modelContext
          .getPropertyConfig();
      final App app = viewContext.getApp();

      if (baseEntityPropertyConfig.isReference()) {
        lookupLink = new Link("lookupLink") {
          static final long serialVersionUID = 200871L;
          public void onClick() {
            ModelContext lookupModelContext = new ModelContext(
                modelContext);
            ViewContext lookupViewContext = new ViewContext(
                viewContext);
            lookupViewContext.setUpdate(false);
            setResponsePage(app.getViewMeta().getPage(
                "EntityLookupTablePage",
                lookupModelContext, lookupViewContext));
          }
        };
        add(lookupLink);
      } else {
        throw new DmException("The property is not reference: "
            + baseEntityPropertyConfig.getCode());
      }
    } catch (DmException e) {
      log.error("Error in LookupPanel: " + modelContext.getEntityCode()
          + " - " + e.getMessage());
    }
View Full Code Here

TOP

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

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.