Package org.dmrad.view.context

Examples of org.dmrad.view.context.ModelContext


   *            model context
   * @return model context
   */
  private static ModelContext getNewModelContext(
      final ModelContext modelContext) {
    ModelContext newModelContext = new ModelContext(modelContext);
    Categories categories = (Categories) modelContext.getEntities();
    categories = categories.getCategoriesOrderedByName();
    newModelContext.setEntities(categories);
    return newModelContext;
  }
View Full Code Here


      }
      MultiLineLabel entryBodyLabel = new MultiLineLabel("entryBody",
          entryBody);
      add(entryBodyLabel);

      ModelContext entryModelContext = new ModelContext(modelContext);
      ViewContext entryViewContext = new ViewContext(viewContext);
      EntityDisplayPage entryPage = new EntityDisplayPage(
          entryModelContext, entryViewContext);
      Link moreLink = new PageLink("moreLink", entryPage);
      if (completeText) {
View Full Code Here

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

      ModelContext entityEditFormModelContext = new ModelContext(
          modelContext);
      entityEditFormModelContext.setAction("update");
      IEntity afterEntity;
      if (entityEditFormModelContext.getUpdateEntity() == null) {
        afterEntity = modelContext.getEntity().copy();
        entityEditFormModelContext.setUpdateEntity(afterEntity);
      }
     
      ViewContext entityEditFormViewContext = new ViewContext(viewContext);
      entityEditFormViewContext.setWicketId("entityUpdateForm");
View Full Code Here

      try {
        String keywords = keywordsField.getModelObjectAsString();
        Boolean andKeywords = new Boolean(andKeywordsBox
            .getModelObjectAsString());

        ModelContext keywordSelectionModelContext = new ModelContext(
            modelContext);

        ViewContext keywordSelectionViewContext = new ViewContext(
            viewContext);
        keywordSelectionViewContext.getMoreArgs().add("keywords",
View Full Code Here

   *            model context
   * @return model context
   */
  private static ModelContext getNewModelContext(
      final ModelContext modelContext) {
    ModelContext newModelContext = new ModelContext(modelContext);
    Members members = (Members) modelContext.getEntities();
    members = members.getMembersOrderedByLastFirstName(true);
    newModelContext.setEntities(members);
    return newModelContext;
  }
View Full Code Here

   *            model context
   * @return model context
   */
  private static ModelContext getNewModelContext(
      final ModelContext modelContext) {
    ModelContext newModelContext = new ModelContext(modelContext);
    Quotes quotes = (Quotes) modelContext.getEntities();
    quotes = quotes.getQuotesOrderedByCreationDate(false);
    newModelContext.setEntities(quotes);
    return newModelContext;
  }
View Full Code Here

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

      ModelContext entityDisplayTablePanelModelContext = new ModelContext(
          modelContext);

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

   *            model context
   * @return model context
   */
  private static ModelContext getNewModelContext(
      final ModelContext modelContext) {
    ModelContext newModelContext = new ModelContext(modelContext);
    Quotes quotes = (Quotes) modelContext.getEntities();
    quotes = quotes.getQuotesOrderedByCreationDate(false);
    newModelContext.setEntities(quotes);
    return newModelContext;
  }
View Full Code Here

      if (!app.getModelConfig().isLogin()) {
        loginLink.setVisible(false);
      }

      if (app.getModelConfig().isI18n()) {
        ModelContext countryLanguageModelContext = new ModelContext();
        countryLanguageModelContext
            .setDomainModel(app.getDomainModel());
        CountryLanguages countryLanguages = (CountryLanguages) app
            .getEntry("CountryLanguages");
        countryLanguageModelContext.setEntities(countryLanguages);

        String languageCode = null;
        CountryLanguage defaultCountryLanguage = null;
        languageCode = getSession().getLocale().getLanguage();
        defaultCountryLanguage = (CountryLanguage) countryLanguages
            .retrieveByCode(languageCode);
        countryLanguageModelContext.setEntity(defaultCountryLanguage);
        ViewContext countryLanguageViewContext = new ViewContext();
        countryLanguageViewContext.setApp(app);
        countryLanguageViewContext.setPage(app.getViewMeta()
            .getHomePage());
        countryLanguageViewContext
            .setWicketId("countryLanguageChoicePanel");
        CountryLanguageChoicePanel countryLanguageChoicePanel = new CountryLanguageChoicePanel(
            countryLanguageModelContext, countryLanguageViewContext);
        add(countryLanguageChoicePanel);
      } else {
        Panel panel = new Panel("countryLanguageChoicePanel");
        add(panel);
        panel.setVisible(false);
      }

      ModelContext dmLiteEntryPageModelContext = new ModelContext();
      dmLiteEntryPageModelContext.setDomainModel(app.getDomainModel());

      ViewContext dmLiteEntryPageViewContext = new ViewContext();
      dmLiteEntryPageViewContext.setApp(app);

      WebPage dmLiteEntryPage = new DmLiteEntryPage(
View Full Code Here

    try {
      IEntity parentEntity = (IEntity) item.getModelObject();
     
      App app = viewContext.getApp();

      ModelContext parentModelContext = new ModelContext(modelContext,
          true);
      parentModelContext.setEntity(parentEntity);

      ViewContext parentViewContext = new ViewContext(viewContext, true);
      parentViewContext.setWicketId("parentProperty");

      PropertyConfig parentPropertyConfig = parentModelContext
          .getPropertyConfig();
      Panel parentPropertyPanel;
      String propertyType = parentPropertyConfig.getPropertyClass();
      if (propertyType.equals("java.net.URL")
          || propertyType.equals("org.dmlite.type.email.Email")) {
        parentPropertyPanel = new ExternalLinkPanel(parentModelContext,
            parentViewContext);
        item.add(parentPropertyPanel);
      } else if (parentPropertyConfig.getPropertyClass().equals(
          "java.lang.String")
          && parentPropertyConfig.isValidateType()) {
        if (parentPropertyConfig.getValidationType().equals(
            "java.net.URL")
            || parentPropertyConfig.getValidationType().equals(
                "org.dmlite.type.email.Email")) {
          parentPropertyPanel = new ExternalLinkPanel(
              parentModelContext, parentViewContext);
          item.add(parentPropertyPanel);
        } else {
          parentPropertyPanel = new LabelPanel(parentModelContext,
              parentViewContext);
          item.add(parentPropertyPanel);
        }
      } else {
        parentPropertyPanel = new LabelPanel(parentModelContext,
            parentViewContext);
        item.add(parentPropertyPanel);
      }
      if (!app.isPropertyDisplayAllowed(getAppSession(),
          parentPropertyConfig)) {
        parentPropertyPanel.setVisible(false);
      }

      ModelContext childModelContext = new ModelContext(modelContext,
          true);
      childModelContext.setEntity(parentEntity);

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

      item.add(app.getViewMeta().getPanel(
View Full Code Here

TOP

Related Classes of org.dmrad.view.context.ModelContext

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.