Package org.dmlite.model

Examples of org.dmlite.model.IEntity


   * @param entity
   *            entity
   */
  private IEntity findNextEntity(final IOrderedEntities entities,
      final IEntity entity) {
    IEntity nextEntity = null;
    nextEntity = (IEntity) entities.next(entity);
    if (nextEntity == null) {
      nextEntity = (IEntity) entities.last();
    }
    return nextEntity;
View Full Code Here


   * @param entity
   *            entity
   */
  private IEntity findPriorEntity(final IOrderedEntities entities,
      final IEntity entity) {
    IEntity priorEntity = null;
    priorEntity = (IEntity) entities.prior(entity);
    if (priorEntity == null) {
      priorEntity = (IEntity) entities.first();
    }
    return priorEntity;
View Full Code Here

    try {
      App app = viewContext.getApp();
     
      ModelContext childModelContext = new ModelContext(modelContext,
          true);
      IEntity parentEntity = childModelContext.getEntity();
      childModelContext.setContextEntity(parentEntity);
      String childNeighbor = (String) modelContext.getMoreArgs().get(
          "childNeighbor");
      IDomainModel domainModel = childModelContext.getDomainModel();
      ModelMeta modelMeta = domainModel.getModelMeta();
View Full Code Here

   * @param item
   *            list item (line)
   */
  protected void populateItem(ListItem item) {
    try {
      IEntity entity = (IEntity) item.getModelObject();

      final App app = viewContext.getApp();

      ConceptConfig conceptConfig = entity.getConceptConfig();

      final ModelContext entityModelContext = new ModelContext(
          modelContext);
      entityModelContext.setEntity(entity);

      ModelContext parentModelContext = new ModelContext(modelContext);
      ViewContext parentViewContext = new ViewContext(viewContext);

      List<Panel> propertyValuePanels = new ArrayList<Panel>();

      // 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
                    .getNeighborEntity(neighborConfig
                        .getCode());
                Panel parentPropertyPanel;
                if (parentEntity != null) {
                  parentModelContext.setEntity(parentEntity);
View Full Code Here

      final ViewContext viewContext) {
    super(modelContext, viewContext);
    try {
      App app = viewContext.getApp();
     
      IEntity entity = modelContext.getEntity();

      IEntity firstEntity = null;
      if (entity == null) {
        firstEntity = (IEntity) modelContext.getOrderedEntities()
            .first();
        if (firstEntity == null) {
          Panel panel = new Panel("entityDisplaySlidePanel");
View Full Code Here

   */
  public TextFieldPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(viewContext.getWicketId());
    try {
      IEntity entity;
      String action = modelContext.getAction();
      if (action != null && action.equals("update")) {
        entity = modelContext.getUpdateEntity();
      } else {
        entity = modelContext.getEntity();
      }

      PropertyConfig propertyConfig = modelContext.getPropertyConfig();

      String propertyCode = propertyConfig.getCode();
      Class propertyClass = propertyConfig.getPropertyClassObject();
      if (propertyConfig.isReference()) {
        String neighborCode = propertyConfig.getReferenceNeighbor();
        NeighborConfig neighborConfig = entity.getConceptConfig()
            .getNeighborsConfig().getNeighborConfig(neighborCode);
        String neighborConceptCode = neighborConfig.getDestination();
        App app = (App) getApplication();
        IPersistentEntities persistentEntities = app.getDbContext()
            .getPersistentModel().getPersistentEntry(
                neighborConceptCode);
        IOrderedEntities neighborEntities = null;
        if (persistentEntities != null) {
          neighborEntities = (IOrderedEntities) persistentEntities
              .getEntities();
        }
        if (neighborEntities != null) {
          Long referenceOid = (Long) entity.getProperty(propertyCode);
          Oid neighborParentOid = new Oid(referenceOid);
          IEntity neighborParent = neighborEntities
              .retrieveByOid(neighborParentOid);
          if (neighborParent != null) {
            PropertyConfig firstEssentialPropertyConfig = neighborParent
                .getConceptConfig().getPropertiesConfig()
                .getFirstEssentialPropertyConfig();
            if (firstEssentialPropertyConfig != null) {
              String firstEssentialPropertyCode = firstEssentialPropertyConfig
                  .getCode();
View Full Code Here

   */
  public CheckBoxPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(viewContext.getWicketId());
    try {
      IEntity entity;
      String action = modelContext.getAction();
      if (action != null && action.equals("update")) {
        entity = modelContext.getUpdateEntity();
      } else {
        entity = modelContext.getEntity();
View Full Code Here

   */
  public MultiLineLabelPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(viewContext.getWicketId());
    try {
      IEntity entity = modelContext.getEntity();
      PropertyConfig propertyConfig = modelContext.getPropertyConfig();

      Class propertyClass = propertyConfig.getPropertyClassObject();
      String propertyCode = propertyConfig.getCode();
      String propertyValueText = "";
      if (propertyClass == String.class) {
        propertyValueText = (String) entity.getProperty(propertyCode);
        if (propertyConfig.isScramble()) {
          propertyValueText = "********";
        }
      } else {
        Object propertyValue = entity.getProperty(propertyCode);
        if (propertyValue != null) {
          propertyValueText = propertyValue.toString();
        } else {
          propertyValueText = "????????";
        }
View Full Code Here

                  IOrderedEntities orderedEntities = null;
                  try {
                    OrderCriteria criteria = OrderCriteria
                        .defineOrder(propertyCode, true);
                    orderedEntities = (IOrderedEntities) getEntities(criteria);
                    IEntity lastEntity = orderedEntities
                        .last();
                    if (lastEntity != null) {
                      Object lastEntityProperty = lastEntity
                          .getProperty(propertyCode);
                      if (lastEntityProperty != null) {
                        Integer lastEntityInteger = (Integer) lastEntityProperty;
                        int lastEntityNumber = lastEntityInteger
                            .intValue();
View Full Code Here

        emptyLink = new Link("emptyLink") {
          static final long serialVersionUID = 200861L;
          public void onClick() {
            ModelContext entityEditFormPageModelContext = new ModelContext(
                modelContext);
            IEntity afterUpdateEntity = entityEditFormPageModelContext
                .getUpdateEntity();
            if (afterUpdateEntity != null) {
              afterUpdateEntity.setProperty(baseEntityPropertyConfig
                  .getCode(), null);
              ViewContext entityEditFormPageViewContext = new ViewContext(
                  viewContext);
              if (modelContext.getAction().equals("update")) {
                setResponsePage(app.getViewMeta().getPage(
View Full Code Here

TOP

Related Classes of org.dmlite.model.IEntity

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.