Package org.dmlite.model.config

Examples of org.dmlite.model.config.ConceptConfig


   * @param item
   *            list item (line)
   */
  protected void populateItem(ListItem item) {
    IOrderedEntities entry = (IOrderedEntities) item.getModelObject();
    ConceptConfig entryConceptConfig = entry.getConceptConfig();
    try {
      App app = viewContext.getApp();

      String conceptKey = entryConceptConfig.getCode();
      String conceptName = getLocalizer().getString(conceptKey, this);
      Label entryConceptName = new Label("entryName", conceptName);
      item.add(entryConceptName);

      ModelContext entryContext = new ModelContext(modelContext);
View Full Code Here


   */
  protected boolean preAdd(T entity) {
    IDomainModel model = this.getDomainModel();
    if (model != null) {
      if (model.isInitialized()) {
        ConceptConfig conceptConfig = entity.getConceptConfig();
        if (conceptConfig != null) {
          PropertiesConfig propertiesConfig = conceptConfig
              .getPropertiesConfig();
          for (IEntity config : propertiesConfig) {
            PropertyConfig propertyConfig = (PropertyConfig) config;
            String propertyCode = propertyConfig.getCode();
            if (propertyConfig.isAutoIncrement()) {
View Full Code Here

      final App app = viewContext.getApp();
     
      final IOrderedEntities entities = modelContext.getOrderedEntities();
      final IEntity entity = modelContext.getEntity();

      ConceptConfig conceptConfig = entity.getConceptConfig();
      ModelContext slideNavigateModelContext = new ModelContext(
          modelContext);

      ViewContext slideNavigateViewContext = new ViewContext(viewContext);
      slideNavigateViewContext.setWicketId("slideNavigatePanel");
      Panel entitySlideNavigatePanel = new EntitySlideNavigatePanel(
          slideNavigateModelContext, slideNavigateViewContext);
      add(entitySlideNavigatePanel);
      if (!app.isConceptDisplayAllowed(getAppSession(), conceptConfig)) {
        entitySlideNavigatePanel.setVisible(false);
      }

      List<Panel> neighborList = new ArrayList<Panel>();
      NeighborsConfig neighborsConfig = conceptConfig
          .getNeighborsConfig();
      for (IEntity neighborConfigEntity : neighborsConfig) {
        NeighborConfig neighborConfig = (NeighborConfig) neighborConfigEntity;
        if (neighborConfig.getType().equals("child")) {
          String neighborCode = neighborConfig.getCode();
View Full Code Here

      App app = viewContext.getApp();
     
      IEntities<IEntity> entities = modelContext.getEntities();
      IEntity entity = modelContext.getEntity();
      IEntity updateEntity = modelContext.getUpdateEntity();
      ConceptConfig conceptConfig = entities.getConceptConfig();

      if (app.isConceptUpdateAllowed(getAppSession(), conceptConfig,
          entity, "update")) {
        entities.getErrors().empty();
        if (entities.update(entity, updateEntity)) {
View Full Code Here

    try {
      App app = viewContext.getApp();
     
      IEntity entity = modelContext.getEntity();

      ConceptConfig conceptConfig = entity.getConceptConfig();
      String conceptKey = conceptConfig.getCode();
      String conceptName = getLocalizer().getString(conceptKey, this);
      add(new Label("conceptName", conceptName));

      ModelContext entityContext = new ModelContext(modelContext);

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

      // 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
View Full Code Here

      final App app = viewContext.getApp();
     
      final IEntity entity = modelContext.getEntity();
      final IDomainModel domainModel = modelContext.getDomainModel();

      ConceptConfig conceptConfig = entity.getConceptConfig();
      String conceptKey = conceptConfig.getCode();
      String conceptName = getLocalizer().getString(conceptKey, this);
      add(new Label("conceptName", conceptName));

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

      // 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
View Full Code Here

   * Creates model entries. Meta handling is used.
   */
  private void createEntries() {
    try {
      for (IEntity config : modelConfig.getConceptsConfig()) {
        ConceptConfig conceptConfig = (ConceptConfig) config;
        if (conceptConfig.isEntry() && !conceptConfig.isAbstraction()) {
          String entitiesClassName = conceptConfig.getEntitiesClass();
          IEntities entities = modelMeta
              .createEntities(entitiesClassName);
          entriesMap.put(conceptConfig, entities);
        }
      }
View Full Code Here

   * @return entry entities
   */
  public IEntities getEntry(String entryCode) {
    IEntities entry = null;
    for (Map.Entry e : entriesMap.entrySet()) {
      ConceptConfig conceptConfig = (ConceptConfig) e.getKey();
      if ((conceptConfig.getCode().equalsIgnoreCase(entryCode))
          || (conceptConfig.getEntitiesCode()
              .equalsIgnoreCase(entryCode))) {
        entry = (IEntities) e.getValue();
        break;
      }
    }
View Full Code Here

   * @return domain model list of entry codes
   */
  public List<String> getEntryCodes() {
    List<String> entryCodes = new ArrayList<String>();
    for (Map.Entry e : entriesMap.entrySet()) {
      ConceptConfig conceptConfig = (ConceptConfig) e.getKey();
      String conceptCode = conceptConfig.getCode();
      entryCodes.add(conceptCode);
    }
    Collections.sort(entryCodes);
    return entryCodes;
  }
View Full Code Here

   * @return domain model list of entry names
   */
  public List<String> getEntryNames() {
    List<String> entryNames = new ArrayList<String>();
    for (Map.Entry e : entriesMap.entrySet()) {
      ConceptConfig conceptConfig = (ConceptConfig) e.getKey();
      String conceptName = conceptConfig.getConceptName();
      entryNames.add(conceptName);
    }
    Collections.sort(entryNames);
    return entryNames;
  }
View Full Code Here

TOP

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

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.