Ejemplo n.º 1
0
  /**
   * Constructs the FAQ page.
   *
   * @param viewModel view model
   * @param view view
   */
  public FaqPage(final ViewModel viewModel, final View view) {
    DmEducApp dmEducApp = (DmEducApp) getApplication();
    DmEduc dmEduc = dmEducApp.getDmEduc();
    WebLink webLink = dmEduc.getWebLink();

    // Menu
    View menuView = new View();
    menuView.setWicketId("faqMenu");
    menuView.setPage(this);
    menuView.setContextView(view);

    add(new DmMenuPanel(viewModel, menuView));

    // FAQ Category Questions
    ViewModel faqModel = new ViewModel(webLink);
    Categories categories = webLink.getCategories();
    Category faqCategory = categories.getCategoryByName("FAQ");
    if (faqCategory != null) {
      Questions faqCategoryQuestions = faqCategory.getQuestions();
      faqModel.setEntities(faqCategoryQuestions);
    }

    View faqView = new View();
    faqView.setPage(this);
    faqView.setWicketId("faqCategoryQuestionsList");

    Panel faq;
    if (faqCategory != null) {
      faq = new EntityDisplayListPanel(faqModel, faqView);
    } else {
      faq = new Panel("faqCategoryQuestionsList");
      faq.setVisible(false);
    }
    add(faq);
  }
Ejemplo n.º 2
0
 /**
  * Gets a new view model.
  *
  * @param viewModel view model
  * @return new view model
  */
 private static ViewModel getNewViewModel(final ViewModel viewModel) {
   ViewModel newViewModel = new ViewModel();
   newViewModel.copyPropertiesFrom(viewModel);
   Presentations presentations = (Presentations) viewModel.getEntities();
   // presentations = presentations.getPresentationsOrderedBy????(true);
   newViewModel.setEntities(presentations);
   return newViewModel;
 }
Ejemplo n.º 3
0
 /**
  * Gets a new view model.
  *
  * @param viewModel view model
  * @return new view model
  */
 private static ViewModel getNewViewModel(final ViewModel viewModel) {
   ViewModel newViewModel = new ViewModel();
   newViewModel.copyPropertiesFrom(viewModel);
   InvoiceStatuss invoiceStatuss = (InvoiceStatuss) viewModel.getEntities();
   // invoiceStatuss = invoiceStatuss.getInvoiceStatussOrderedBy????(true);
   newViewModel.setEntities(invoiceStatuss);
   return newViewModel;
 }
Ejemplo n.º 4
0
 /**
  * Gets a new view model.
  *
  * @param viewModel view model
  * @return new view model
  */
 private static ViewModel getNewViewModel(final ViewModel viewModel) {
   ViewModel newViewModel = new ViewModel();
   newViewModel.copyPropertiesFrom(viewModel);
   Countries countries = (Countries) viewModel.getEntities();
   // countries = countries.getCountriesOrderedBy????(true);
   newViewModel.setEntities(countries);
   return newViewModel;
 }
Ejemplo n.º 5
0
 /**
  * Gets a new view model.
  *
  * @param viewModel view model
  * @return new view model
  */
 private static ViewModel getNewViewModel(final ViewModel viewModel) {
   ViewModel newViewModel = new ViewModel();
   newViewModel.copyPropertiesFrom(viewModel);
   Tests tests = (Tests) viewModel.getEntities();
   // tests = tests.getTestsOrderedBy????(true);
   newViewModel.setEntities(tests);
   return newViewModel;
 }
Ejemplo n.º 6
0
 /**
  * Gets a new view model.
  *
  * @param viewModel view model
  * @return new view model
  */
 private static ViewModel getNewViewModel(final ViewModel viewModel) {
   ViewModel newViewModel = new ViewModel();
   newViewModel.copyPropertiesFrom(viewModel);
   Rebates rebates = (Rebates) viewModel.getEntities();
   // rebates = rebates.getRebatesOrderedBy????(true);
   newViewModel.setEntities(rebates);
   return newViewModel;
 }
Ejemplo n.º 7
0
 /**
  * Gets a new view model.
  *
  * @param viewModel view model
  * @return new view model
  */
 private static ViewModel getNewViewModel(final ViewModel viewModel) {
   ViewModel newViewModel = new ViewModel();
   newViewModel.copyPropertiesFrom(viewModel);
   try {
     Parkings parkings = (Parkings) viewModel.getEntities();
     // parkings = parkings.getParkingsOrderedBy????(true);
     newViewModel.setEntities(parkings);
   } catch (Exception e) {
     log.error("Error in EntityDisplayTablePage.getNewViewModel: " + e.getMessage());
   }
   return newViewModel;
 }
Ejemplo n.º 8
0
  /**
   * Constructs an entry display table panel.
   *
   * @param viewModel viewModel
   * @param view view
   */
  public EntryDisplayTablePanel(final ViewModel viewModel, final View view) {
    super(view.getWicketId());
    String modelName = LocalizedText.getModelName(this, viewModel.getModel());
    add(new Label("modelName", modelName));

    ViewModel entryDisplayTableListViewModel = new ViewModel();
    entryDisplayTableListViewModel.copyPropertiesFrom(viewModel);

    View entryDisplayTableListView = new View();
    entryDisplayTableListView.copyPropertiesFrom(view);
    entryDisplayTableListView.setWicketId("entryDisplayTableListView");

    add(new EntryDisplayTableListView(entryDisplayTableListViewModel, entryDisplayTableListView));
  }