Package org.dmlite.model

Examples of org.dmlite.model.IEntities


      if (viewContext.isUpdate()) {
        actionType = "update";
      } else {
        actionType = "display";
      }
      IEntities entities = modelContext.getEntities();
      String entitySmallName = entities.getConceptConfig()
          .getSmallConceptCode();
      String className = App.PACKAGE_VIEW_COMPONENT_PREFIX + "."
          + entitySmallName + "." + actionType + "."
          + classSimpleName;
      Class claz = getClass(className);
View Full Code Here


      if (viewContext.isUpdate()) {
        actionType = "update";
      } else {
        actionType = "display";
      }
      IEntities entities = modelContext.getEntities();
      String entitySmallName = entities.getConceptConfig()
          .getSmallConceptCode();
      String className = App.PACKAGE_VIEW_COMPONENT_PREFIX + "."
          + entitySmallName + "." + actionType + "."
          + classSimpleName;
      Class claz = getClass(className);
View Full Code Here

      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      App app = viewContext.getApp();
     
      IEntities entities = modelContext.getEntities();
      PropertyConfig propertyConfig = modelContext.getPropertyConfig();

      String keywords = (String) viewContext.getMoreArgs()
          .get("keywords");
      Boolean andKeywords = (Boolean) viewContext.getMoreArgs().get(
          "andKeywords");

      IEntities entitiesThatContainKeywords = null;
      keywords.trim();
      if (keywords.equals("")) {
        entitiesThatContainKeywords = entities;
      } else {
        String[] keywordsArray = keywords.split(",");
View Full Code Here

   */
  protected void onSubmit() {
    try {
      App app = viewContext.getApp();
     
      IEntities entities = modelContext.getEntities();
      IEntity entity = modelContext.getEntity();
      ConceptConfig conceptConfig = entities.getConceptConfig();

      if (app.isConceptUpdateAllowed(getAppSession(), conceptConfig, entity,
          "add")) {
        entities.getErrors().empty();
        if (entities.add(entity)) {
          ModelContext entityUpdateTablePageModelContext = new ModelContext(
              modelContext);
          ViewContext entityUpdateTablePageViewContext = new ViewContext(
              viewContext);
          setResponsePage(app.getViewMeta().getPage(
View Full Code Here

      final ViewContext viewContext) {
    super(viewContext.getWicketId());
    try {
      App app = viewContext.getApp();
     
      IEntities entities = modelContext.getEntities();

      ConceptConfig conceptConfig = entities.getConceptConfig();
      String conceptsKey = conceptConfig.getEntitiesCode();
      String conceptsName = getLocalizer().getString(conceptsKey, this);
      add(new Label("conceptsName", conceptsName));

      ModelContext entityDisplayListListModelContext = new ModelContext(
View Full Code Here

      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;
            IOrderedEntities validationTypeEntitiesOrderedByCode = orderedValidationTypeEntities
                .getOrderByCode();
            validationTypeList = validationTypeEntitiesOrderedByCode
                .getCodeList();
          } else {
            throw new OrderException(validationTypeEntities
                .getConceptConfig().getEntitiesCode()
                + " entities are not ordered.");
          }
          PropertyModel propertyModel = new PropertyModel(entity,
              propertyCode, propertyClass);
View Full Code Here

  public EntryListPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      ModelContext entriesModelContext = new ModelContext(modelContext);
      IEntities entries = entriesModelContext.getEntities();
      if (entries != null) {
        ViewContext entriesViewContext = new ViewContext(viewContext);
        entriesViewContext.setWicketId("entryList");
        EntryList entryList = new EntryList(entriesModelContext,
            entriesViewContext);
View Full Code Here

      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      final App app = viewContext.getApp();
     
      final IEntities entities = modelContext.getEntities();
      final ConceptConfig conceptConfig = entities.getConceptConfig();

      // Table title
      String conceptsKey = conceptConfig.getEntitiesCode();
      String conceptsName = getLocalizer().getString(conceptsKey, this);
      add(new Label("conceptsName", conceptsName));

      // Absorbed parent essential property names
      List<String> parentEssentialPropertyNames = new ArrayList<String>();
      List<String> parentEssentialPropertyCodes = entities
          .getConceptConfig().getParentCodeEssentialPropertyCodes();
      for (String parentPropertyKey : parentEssentialPropertyCodes) {
        String parentPropertyName = getLocalizer().getString(
            parentPropertyKey, this);
        parentEssentialPropertyNames.add(parentPropertyName);
      }

      // Concept essential property names
      List<String> conceptEssentialPropertyNames = new ArrayList<String>();
      List<String> conceptEssentiaPropertyCodes = entities
          .getConceptConfig().getConceptCodeEssentialPropertyCodes();
      for (String conceptPropertyKey : conceptEssentiaPropertyCodes) {
        String conceptPropertyName = getLocalizer().getString(
            conceptPropertyKey, this);
        conceptEssentialPropertyNames.add(conceptPropertyName);
      }

      List<String> essentialPropertyNames = parentEssentialPropertyNames;
      essentialPropertyNames.addAll(conceptEssentialPropertyNames);
      add(new PropertyNameLabelListView("propertyNameLabelListView",
          essentialPropertyNames));

      // Neighbor empty labels
      List<String> childInternalNeighborNames = conceptConfig
          .getInternalChildNeighborNames();
      add(new NeighborEmptyNameLabelListView(
          "neighborEmptyNameLabelListViewHead",
          childInternalNeighborNames));

      ModelContext entityUpdateTableListModelContext = new ModelContext(
          modelContext);

      ViewContext entityUpdateTableListViewContext = new ViewContext(
          viewContext);
      entityUpdateTableListViewContext
          .setWicketId("entityUpdateTableListView");

      PageableListView entityUpdateTableListView = app.getViewMeta()
          .getPageableListView("EntityUpdateTableListView",
              entityUpdateTableListModelContext,
              entityUpdateTableListViewContext);
      add(entityUpdateTableListView);
      if (!app.isConceptDisplayAllowed(getAppSession(), conceptConfig)) {
        entityUpdateTableListView.setVisible(false);
      }

      add(new PropertyEmptyNameLabelListView(
          "propertyEmptyNameLabelListView", essentialPropertyNames));
      add(new PagingNavigator("blockNavigator", entityUpdateTableListView));
      add(new NeighborEmptyNameLabelListView(
          "neighborEmptyNameLabelListViewTail",
          childInternalNeighborNames));

      final Integer currentBlock = new Integer(entityUpdateTableListView
          .getCurrentPage());
      Link addLink = new Link("add") {
        static final long serialVersionUID = 200761L;

        public void onClick() {
          if (app.isConceptUpdateAllowed(getAppSession(),
              conceptConfig, null, "add")) {
            ModelContext entityAddFormPageModelContext = new ModelContext(
                modelContext);
            entityAddFormPageModelContext.setEntity(null);
            ViewContext entityAddPageContext = new ViewContext(
                viewContext);
            entityAddPageContext.setPageBlock(currentBlock);
            setResponsePage(app.getViewMeta().getPage(
                "EntityAddFormPage",
                entityAddFormPageModelContext,
                entityAddPageContext));
          } else {
            String error = getLocalizer().getString(
                "entities.config.add", this);
            error(error);
          }
        }
      };
      add(addLink);

      final IEntity clipboardEntity = getAppSession().getClipboard()
          .getEntity();
      Link pasteLink = new Link("paste") {
        static final long serialVersionUID = 200762L;

        public void onClick() {
          try {
            if (clipboardEntity != null) {
              if (app.isConceptUpdateAllowed(getAppSession(),
                  conceptConfig, clipboardEntity, "add")
                  && clipboardEntity.getConceptConfig() == entities
                      .getConceptConfig()) {
                if (entities.add(clipboardEntity)) {
                  ViewContext entityUpdateTablePageContext = new ViewContext(
                      viewContext);
                  entityUpdateTablePageContext
                      .setPageBlock(currentBlock);
                  setResponsePage(app.getViewMeta().getPage(
View Full Code Here

TOP

Related Classes of org.dmlite.model.IEntities

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.