Package org.dmrad.view

Examples of org.dmrad.view.App


   *            view context
   */
  public ApplicantAddFormPage(final ModelContext modelContext,
      final ViewContext viewContext) {
    try {
      App app = viewContext.getApp();

      ModelContext menuModelContext = new ModelContext(modelContext);
      ViewContext menuViewContext = new ViewContext(viewContext);
      menuViewContext.setWicketId("dmRadMenuPanel");
      add(app.getViewMeta().getDmRadMenuPanel(menuModelContext,
          menuViewContext));

      add(new FeedbackPanel("feedbackPanel"));

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


  public ChildPropertyDisplayListPanel(final ModelContext modelContext,
      final ViewContext viewContext) {
    super(modelContext, viewContext);
    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();
      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) {
      log.error("Error in ChildPropertyDisplayListPanel: "
View Full Code Here

   *             String value conversion exception
   */
  public ApplicantConfirmPage(final PageParameters parameters)
      throws StringValueConversionException {
    long applicantOid = parameters.getLong("oid");
    App app = (App) getApplication();
    Applicants applicants = (Applicants) app.getEntry("Applicants");
    Applicant applicant = (Applicant) applicants.getApplicant(applicantOid);
    try {
      add(new ApplicantConfirmPanel("applicantConfirmPanel",
          applicant));
    } catch (Exception e) {
View Full Code Here

    try {
      remove("cancel");
      add(new Button("cancel") {
        static final long serialVersionUID = 201131L;
        protected void onSubmit() {
          App app = (App) getApplication();
          setResponsePage(app.getHomePage());
        }
      }.setDefaultFormProcessing(false));
    } catch (Exception e) {
      log.error("Error in ApplicantAddForm: " + e.getMessage());
    }
View Full Code Here

    try {
      Applicants applicants = (Applicants) modelContext.getEntities();
      Applicant applicant = (Applicant) modelContext.getEntity();
      applicants.getErrors().empty();
      if (applicants.add(applicant)) {
        App app = viewContext.getApp();
        EmailConfig emailConfig = app.getEmailConfig();

        String applicantMessageStart = "...please copy the following confirmation number: ";
        Long applicantConfirmationNumber = applicant.getOid()
            .getUniqueNumber();
        String applicantMessageFinish = ", and paste it in the Confirmation Number field of the Login page.";
View Full Code Here

   *            view context
   */
  public DmRadUpdatePage(final ModelContext modelContext,
      final ViewContext viewContext) {
    try {
      App app = viewContext.getApp();

      ModelContext menuModelContext = new ModelContext(modelContext);
      ViewContext menuViewContext = new ViewContext(viewContext);
      menuViewContext.setWicketId("dmRadMenuPanel");
      add(app.getViewMeta().getDmRadMenuPanel(menuModelContext,
          menuViewContext));
    } catch (Exception e) {
      log.error("Error in DmLiteUpdatePage: "
          + modelContext.getEntitiesCode() + " - " + e.getMessage());
    }
View Full Code Here

   */
  public EntityDisplaySlidePage(final ModelContext modelContext,
      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");
          panel.setVisible(false);
          add(panel);
        } else {
          ModelContext entityDisplaySlidePanelModelContext = new ModelContext(
              modelContext);
          entityDisplaySlidePanelModelContext.setEntity(firstEntity);

          ViewContext entityDisplaySlidePanelViewContext = new ViewContext(
              viewContext);
          entityDisplaySlidePanelViewContext.setPage(this);
          entityDisplaySlidePanelViewContext.setUpdate(false);
          entityDisplaySlidePanelViewContext
              .setWicketId("entityDisplaySlidePanel");

          add(app.getViewMeta().getPanel("EntityDisplaySlidePanel",
              entityDisplaySlidePanelModelContext,
              entityDisplaySlidePanelViewContext));
        }
      } else {
        ModelContext entityDisplaySlidePanelModelContext = new ModelContext(
            modelContext);

        ViewContext entityDisplaySlidePanelViewContext = new ViewContext(
            viewContext);
        entityDisplaySlidePanelViewContext.setPage(this);
        entityDisplaySlidePanelViewContext.setUpdate(false);
        entityDisplaySlidePanelViewContext
            .setWicketId("entityDisplaySlidePanel");

        add(app.getViewMeta().getPanel("EntityDisplaySlidePanel",
            entityDisplaySlidePanelModelContext,
            entityDisplaySlidePanelViewContext));
      }
    } catch (Exception e) {
      log.error("Error in EntityDisplaySlidePage: "
View Full Code Here

  /**
   * Constructs the application home page.
   */
  public HomePage() {
    try {
      App app = (App) getApplication();
      add(app.getViewMeta().getHomePageMenuPanel("homePageMenuPanel"));
      ModelConfig modelConfig = app.getDomainModel().getModelConfig();
      String modelDescriptionKey = modelConfig.getCode() + ".description";
      String modelDescription = getLocalizer().getString(modelDescriptionKey, this);
      add(new Label("modelDescription", modelDescription));
    } catch (Exception e) {
      log.error("Error in HomePage: " + e.getMessage());
View Full Code Here

   */
  public EntityLookupTablePanel(final ModelContext modelContext,
      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);
        parentEssentialPropertyNames.add(parentPropertyName);
      }

      List<String> essentialPropertyNames = conceptEssentialPropertyNames;
      if (parentEssentialPropertyNames.size() > 0) {
        essentialPropertyNames.addAll(parentEssentialPropertyNames);
      }
      add(new PropertyNameLabelListView("propertyNameLabelListView",
          essentialPropertyNames));

      List<String> childNeighborNames = lookupConceptConfig
          .getChildNeighborNames();
      add(new NeighborEmptyNameLabelListView(
          "neighborEmptyNameLabelListViewHead", childNeighborNames));

      ModelContext lookupModelContext = new ModelContext(modelContext);
      lookupModelContext.setContextEntities(lookupModelContext
          .getEntities());
      lookupModelContext.setEntities(lookupEntities);

      ViewContext lookupViewContext = new ViewContext(viewContext);
      lookupViewContext.setWicketId("entityLookupTableListView");
      PageableListView entityLookupTableListView = app.getViewMeta()
          .getPageableListView("EntityLookupTableListView",
              lookupModelContext, lookupViewContext);
      add(entityLookupTableListView);
      if (!app.isConceptDisplayAllowed(getAppSession(),
          lookupConceptConfig)) {
        entityLookupTableListView.setVisible(false);
      }

      add(new PropertyEmptyNameLabelListView(
View Full Code Here

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

TOP

Related Classes of org.dmrad.view.App

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.