Package org.dmlite.model

Examples of org.dmlite.model.IEntities


  {
    final SelectionCriteria selectionCriteriaCode = SelectionCriteria
        .defineEqualCriteria("codeCategorie", codeCategorie);
    final SelectionCriteria selectionCriteriaSexe = SelectionCriteria
        .defineEqualCriteria("sexe", sexe);
    final IEntities entities = this.getEntities(selectionCriteriaCode)
        .getEntities(selectionCriteriaSexe);

    if (entities.size() > 1)
    {
      throw new HypotheseException(
          "Les categories contiennent plus d'une categorie ayant "
              + "le même code et le même sexe. ");
    }

    if (!entities.isEmpty())
    {
      return (Categorie) entities.getCollection().iterator().next();
    }

    return null;
  }
View Full Code Here


    try {
      IEntity entity = (IEntity) item.getModelObject();
     
      final App app = viewContext.getApp();
     
      IEntities entities = modelContext.getEntities();

      ConceptConfig conceptConfig = entity.getConceptConfig();
      String conceptCode = conceptConfig.getCode();

      // Neighbor display links
View Full Code Here

  {
    Validate.argNotNull(nom, "nom");

    final SelectionCriteria selectionCriteriaNom = SelectionCriteria
        .defineEqualCriteria("nom", nom);
    IEntities entities;
    try
    {
      entities = this.disciplines.getEntities(selectionCriteriaNom);
    }
    catch (final SelectionException e)
    {
      throw new SystemeException(e);
    }

    return (Discipline) Validate.elementUnique(entities.getCollection());
  }
View Full Code Here

      childModelContext.setContextEntity(parentEntity);
      String childNeighbor = (String) modelContext.getMoreArgs().get(
          "childNeighbor");
      IDomainModel domainModel = childModelContext.getDomainModel();
      ModelMeta modelMeta = domainModel.getModelMeta();
      IEntities childEntities = modelMeta.getNeighborEntities(
          parentEntity, childNeighbor);
      childModelContext.setEntities(childEntities);

      ViewContext childViewContext = new ViewContext(viewContext, true);
      childViewContext.setWicketId("childPropertyList");

      ListView childPropertyDisplayListListView = app.getViewMeta()
          .getListView("ChildPropertyDisplayListListView",
              childModelContext, childViewContext);
      add(childPropertyDisplayListListView);
      ConceptConfig childConceptConfig = childEntities.getConceptConfig();
      if (!app.isConceptDisplayAllowed(getAppSession(),
          childConceptConfig)) {
        childPropertyDisplayListListView.setVisible(false);
      }
    } catch (Exception e) {
View Full Code Here

        "MemberRoles");
  }

  public Users getUsers() {
    IPersistentModel persistentModel = domainContext.getPersistentModel();
    IEntities users = persistentModel.getEntry("Users");
    return (Users) users;
  }
View Full Code Here

  public List<IEntities> getEntries() {
    List<IEntities> entries = new ArrayList<IEntities>();
    List actionsList = actions.getCopyOfActions();
    for (Object action : actionsList) {
      EntitiesAction entitiesAction = (EntitiesAction) action;
      IEntities entities = entitiesAction.getEntities();
      IDomainModel domainModel = session.getDomainModel();
      IEntities entry = domainModel.getModelMeta().getEntry(entities);
      if (entry != null && !entries.contains(entry)) {
        entries.add(entry);
      }
    }
    return entries;
View Full Code Here

    try {
      final IEntity entity = (IEntity) item.getModelObject();
     
      final App app = viewContext.getApp();
     
      final IEntities entities = modelContext.getEntities();
      final ConceptConfig conceptConfig = entity.getConceptConfig();

      final Integer currentPageBlock = new Integer(getCurrentPage());

      final ModelContext entityModelContext = new ModelContext(
          modelContext);
      entityModelContext.setEntity(entity);
      Link copyLink = new Link("copy") {
        static final long serialVersionUID = 200741L;

        public void onClick() {
          getAppSession().getClipboard().setEntity(entity);
          ViewContext entityCopyPageContext = new ViewContext(
              viewContext);
          entityCopyPageContext.setPageBlock(currentPageBlock);
          setResponsePage(app.getViewMeta().getPage(
              "EntityUpdateTablePage", entityModelContext,
              entityCopyPageContext));
        }
      };
      item.add(copyLink);

      final ViewContext entityUpdatePageContext = new ViewContext(
          viewContext);
      entityUpdatePageContext.setPageBlock(currentPageBlock);
      Link editLink = new PageLink("edit", new IPageLink() {
        static final long serialVersionUID = 200742L;

        public Page getPage() {
          return app.getViewMeta().getPage("EntityEditFormPage",
              entityModelContext, entityUpdatePageContext);
        }

        public Class getPageIdentity() {
          return app.getViewMeta().getPageClass("EntityEditFormPage",
              entityModelContext, entityUpdatePageContext);
        }
      });
      item.add(editLink);

      final ViewContext entityRemovePageContext = new ViewContext(
          viewContext);
      entityRemovePageContext.setPageBlock(currentPageBlock);
      item.add(new Link("remove") {
        static final long serialVersionUID = 200743L;

        public void onClick() {
          try {
            if (app.isConceptUpdateAllowed(
                getAppSession(), conceptConfig, entity, "remove")) {
              entities.getErrors().empty();
              if (app.getModelConfig().isConfirmRemove()) {
                setResponsePage(app.getViewMeta().getPage(
                    "EntityConfirmRemovePage",
                    entityModelContext,
                    entityRemovePageContext));
              } else if (entities.remove(entity)) {
                setResponsePage(app.getViewMeta().getPage(
                    "EntityUpdateTablePage",
                    entityModelContext,
                    entityRemovePageContext));
              } else {
View Full Code Here

      final ViewContext viewContext) {
    super(viewContext.getWicketId());
    try {
      App app = viewContext.getApp();
     
      IEntities lookupEntities = modelContext.getLookupEntities();
      ConceptConfig lookupConceptConfig = lookupEntities
          .getConceptConfig();

      String conceptsKey = lookupConceptConfig.getEntitiesCode();
      String conceptsName = getLocalizer().getString(conceptsKey, this);
      add(new Label("conceptsName", conceptsName));

      List<String> conceptEssentialPropertyNames = new ArrayList<String>();
      List<String> conceptEssentiaPropertyCodes = lookupEntities
          .getConceptConfig().getConceptCodeEssentialPropertyCodes();
      String conceptPropertyName;
      for (String conceptPropertyKey : conceptEssentiaPropertyCodes) {
        conceptPropertyName = getLocalizer().getString(
            conceptPropertyKey, this);
        conceptEssentialPropertyNames.add(conceptPropertyName);
      }

      List<String> parentEssentialPropertyNames = new ArrayList<String>();
      List<String> parentEssentialPropertyCodes = lookupEntities
          .getConceptConfig().getParentCodeEssentialPropertyCodes();
      String parentPropertyName;
      for (String parentPropertyKey : parentEssentialPropertyCodes) {
        parentPropertyName = getLocalizer().getString(
            parentPropertyKey, this);
View Full Code Here

      final ViewContext viewContext) {
    super(viewContext.getWicketId());
    try {
      App app = viewContext.getApp();
     
      IEntities entities = modelContext.getEntities();
      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();

      String parentPropertyName;
      for (String parentPropertyKey : parentEssentialPropertyCodes) {
        parentPropertyName = getLocalizer().getString(
            parentPropertyKey, this);
        parentEssentialPropertyNames.add(parentPropertyName);
      }

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

      if (action != null && action.equals("update")) {
        entity = modelContext.getUpdateEntity();
      } else {
        entity = modelContext.getEntity();
      }
      IEntities entities = modelContext.getEntities();

      PropertyConfig propertyConfig = modelContext.getPropertyConfig();

      String propertyCode = propertyConfig.getCode();
      Class propertyClass = propertyConfig.getPropertyClassObject();

      IOrderedEntities orderedEntities = null;
      if (entities instanceof IOrderedEntities) {
        orderedEntities = (IOrderedEntities) entities;
      } else {
        throw new OrderException(entities.getConceptConfig()
            .getEntitiesCode()
            + " entities are not ordered.");
      }
      List propertyValueList = orderedEntities
          .getPropertyList(propertyCode);
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.