Package org.dmlite.model.config

Examples of org.dmlite.model.config.ConceptConfig


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

      ModelContext parentChildModelContext = new ModelContext(
          modelContext, true);
      String sectionTitle = (String) parentChildModelContext
View Full Code Here


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

   * @return list of persistent entry codes
   */
  public List<String> getPersistentEntryCodes() {
    List<String> persistentEntryCodes = new ArrayList<String>();
    for (Map.Entry e : persistentEntriesMap.entrySet()) {
      ConceptConfig conceptConfig = (ConceptConfig) e.getKey();
      String persitentEntryCode = conceptConfig.getEntitiesCode();
      persistentEntryCodes.add(persitentEntryCode);
    }
    return persistentEntryCodes;
  }
View Full Code Here

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

      ConceptConfig conceptConfig = entity.getConceptConfig();

      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() + "."
              + propertyConfig.getCode();
          String propertyName = getLocalizer().getString(propertyKey,
              this);
          PropertyNameLabelValuePanelPair propertyNameLabelValuePanelPair = new PropertyNameLabelValuePanelPair();
          Label propertyNameLabel = new Label("propertyName",
View Full Code Here

     
      CountryLanguage countryLanguage = (CountryLanguage) modelContext
          .getEntity();
      CountryLanguages countryLanguages = (CountryLanguages) modelContext
          .getEntities();
      ConceptConfig countryLanguageConceptConfig = countryLanguages
          .getConceptConfig();
      String currentLanguage = countryLanguage.getLanguage();
      List languageList = countryLanguages.getLanguageList();

      IModel choiceModel = new Model(currentLanguage);
View Full Code Here

   * @throws dmLite
   *             exception if there is a problem
   */
  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();
          String propertyCode = propertyConfig.getCode();
          if (propertyCode.equals("code")) {
            continue;
          }
          String conceptDotProperty = conceptConfig.getCode() + "."
              + propertyCode;
          Element codeChild = element.element(propertyCode);
          if (codeChild != null) {
            String propertyStringValue = codeChild.getText().trim();
            if (propertyClass == String.class) {
View Full Code Here

              && neighborConfig.isInternal()) {
            String neigborProperty = textHandler
                .firstLetterToLower(neighborConfig.getCode());
            Element neighborChildElement = element
                .element(neigborProperty);
            ConceptConfig neighborChildConceptConfig = (ConceptConfig) persistentModel
                .getDomainModel().getModelConfig()
                .getConceptsConfig().retrieveByCode(
                    neighborConfig.getDestination());
            if (neighborChildConceptConfig != null) {
              String neighborChildClassName = neighborChildConceptConfig
                  .getEntitiesClass();
              IDomainModel domainModel = persistentModel
                  .getDomainModel();
              IEntities neighborChildEntities = domainModel
                  .getModelMeta().createEntities(
View Full Code Here

   * @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 entryModelContext = new ModelContext(modelContext);
      entryModelContext.setEntities(entry);

      ViewContext entryViewContext = new ViewContext(viewContext);
      WebPage entryConceptPage = null;
      String displayType = entry.getConceptConfig().getDisplayType();
      if (displayType == null) {
        displayType = "table";
      }
      if (displayType.equals("table")) {
        entryConceptPage = app.getViewMeta().getPage(
            "EntityDisplayTablePage", entryModelContext,
            entryViewContext);
      } else if (displayType.equals("list")) {
        entryConceptPage = app.getViewMeta().getPage(
            "EntityDisplayListPage", entryModelContext,
            entryViewContext);
      } else if (displayType.equals("slide")) {
        entryConceptPage = app.getViewMeta().getPage(
            "EntityDisplaySlidePage", entryModelContext,
            entryViewContext);
      }
      Link entryConceptLink = new PageLink("entry", entryConceptPage);
      item.add(entryConceptLink);

      ModelContext keywordSelectionModelContext = new ModelContext(
          modelContext);
      keywordSelectionModelContext.setEntities(entry);
      PropertyConfig propertyConfig = entryConceptConfig
          .getPropertiesConfig().getFirstMaxTextSizePropertyConfig();
      keywordSelectionModelContext.setPropertyConfig(propertyConfig);

      ViewContext keywordSelectionViewContext = new ViewContext(
          viewContext);
View Full Code Here

      if (entity == null) {
        String error = "Error in ModelMeta.createEntities: "
            + 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

   *            entities
   * @throws dmLite
   *             order exception if there is a problem
   */
  public IEntity createEntity(IEntities entities) throws DmException {
    ConceptConfig conceptConfig = entities.getConceptConfig();
    String conceptClassName = conceptConfig.getEntityClass();
    return createEntity(conceptClassName);
  }
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.