Ejemplo n.º 1
0
  /**
   * Return the xsl export management page ( list of export format )
   *
   * @param request The Http request
   * @return Html of the xsl export management page
   */
  public String getManageXslExport(HttpServletRequest request) {
    HashMap<String, Object> model = new HashMap<String, Object>();
    List<XslExport> listXslExport = XslExportHome.getList();
    _strCurrentPageIndex =
        Paginator.getPageIndex(request, Paginator.PARAMETER_PAGE_INDEX, _strCurrentPageIndex);
    _nItemsPerPage =
        Paginator.getItemsPerPage(
            request, Paginator.PARAMETER_ITEMS_PER_PAGE, _nItemsPerPage, _nDefaultItemsPerPage);

    model.put(
        MARK_PERMISSION_CREATE,
        RBACService.isAuthorized(
            XslExport.RESOURCE_TYPE,
            RBAC.WILDCARD_RESOURCES_ID,
            XslExportResourceIdService.PERMISSION_CREATE,
            getUser()));
    model.put(
        MARK_PERMISSION_MODIFY,
        RBACService.isAuthorized(
            XslExport.RESOURCE_TYPE,
            RBAC.WILDCARD_RESOURCES_ID,
            XslExportResourceIdService.PERMISSION_MODIFY,
            getUser()));
    model.put(
        MARK_PERMISSION_DELETE,
        RBACService.isAuthorized(
            XslExport.RESOURCE_TYPE,
            RBAC.WILDCARD_RESOURCES_ID,
            XslExportResourceIdService.PERMISSION_DELETE,
            getUser()));

    LocalizedPaginator<XslExport> paginator =
        new LocalizedPaginator<XslExport>(
            listXslExport,
            _nItemsPerPage,
            getJspManageXslExport(request),
            PARAMETER_PAGE_INDEX,
            _strCurrentPageIndex,
            getLocale());

    model.put(MARK_PAGINATOR, paginator);
    model.put(MARK_NB_ITEMS_PER_PAGE, EMPTY_STRING + _nItemsPerPage);
    model.put(MARK_XSL_EXPORT_LIST, paginator.getPageItems());
    setPageTitleProperty(PROPERTY_MANAGE_XSL_EXPORT_TITLE);

    HtmlTemplate templateList =
        AppTemplateService.getTemplate(TEMPLATE_MANAGE_XSL_EXPORT, getLocale(), model);

    return getAdminPage(templateList.getHtml());
  }
  /**
   * Returns the Gismap HTML management page
   *
   * @param request The HTTP request.
   * @param nMode The current mode. [not implemented]
   * @throws UserNotSignedException
   * @throws SiteMessageException occurs when a site message need to be displayed
   */
  public String getManageGismap(HttpServletRequest request) {
    setPageTitleProperty(PROPERTY_PAGE_TITLE_FEATURES);

    Map<String, Object> model = new HashMap<String, Object>();

    // List<Geometry> listGeometry = GeometryHome.getList();
    model.put(PARAMETER_ADD, AddressParamHome.getAddressParameters());
    model.put(PARAMETER_MAP, GismapService.getInstance().getMapTemplate(request));

    HtmlTemplate templateList =
        AppTemplateService.getTemplate(TEMPLATE_HOME, request.getLocale(), model);

    return getAdminPage(templateList.getHtml());
  }
Ejemplo n.º 3
0
  /**
   * Gets the export format modification page
   *
   * @param request The HTTP request
   * @throws AccessDeniedException the {@link AccessDeniedException}
   * @return The export format creation page
   */
  public String getModifyXslExport(HttpServletRequest request) throws AccessDeniedException {
    if (!RBACService.isAuthorized(
        XslExport.RESOURCE_TYPE,
        RBAC.WILDCARD_RESOURCES_ID,
        XslExportResourceIdService.PERMISSION_MODIFY,
        getUser())) {
      throw new AccessDeniedException(MESSAGE_PERMISSION_DENIED);
    }

    XslExport xslExport;
    String strIdXslExport = request.getParameter(PARAMETER_ID_XSL_EXPORT);
    HashMap<String, Object> model = new HashMap<String, Object>();
    int nIdXslExport = Integer.parseInt(strIdXslExport);
    xslExport = XslExportHome.findByPrimaryKey(nIdXslExport);
    model.put(MARK_XSL_EXPORT, xslExport);

    Collection<Plugin> listPlugins = PluginService.getPluginList();
    ReferenceList refListPlugins = new ReferenceList();
    ReferenceItem refItem = new ReferenceItem();
    Plugin pluginCore = PluginService.getCore();
    refItem.setCode(pluginCore.getName());
    refItem.setName(pluginCore.getName());
    refListPlugins.add(refItem);

    for (Plugin plugin : listPlugins) {
      if (plugin != null) {
        refItem = new ReferenceItem();
        refItem.setCode(plugin.getName());
        refItem.setName(plugin.getName());
        refListPlugins.add(refItem);
      }
    }

    model.put(MARK_LIST_PLUGINS, refListPlugins);

    setPageTitleProperty(PROPERTY_MODIFY_XSL_EXPORT_TITLE);

    HtmlTemplate template =
        AppTemplateService.getTemplate(TEMPLATE_MODIFY_XSL_EXPORT, getLocale(), model);

    return getAdminPage(template.getHtml());
  }
Ejemplo n.º 4
0
  /**
   * Gets the xsl export creation page
   *
   * @param request The HTTP request
   * @throws AccessDeniedException the {@link AccessDeniedException}
   * @return The xsl export creation page
   */
  public String getCreateXslExport(HttpServletRequest request) throws AccessDeniedException {
    HashMap<String, Object> model = new HashMap<String, Object>();

    Collection<Plugin> listPlugins = PluginService.getPluginList();
    ReferenceList refListPlugins = new ReferenceList();
    ReferenceItem refItem = new ReferenceItem();
    Plugin pluginCore = PluginService.getCore();
    refItem.setCode(pluginCore.getName());
    refItem.setName(pluginCore.getName());
    refListPlugins.add(refItem);

    for (Plugin plugin : listPlugins) {
      if (plugin != null) {
        refItem = new ReferenceItem();
        refItem.setCode(plugin.getName());
        refItem.setName(plugin.getName());
        refListPlugins.add(refItem);
      }
    }

    model.put(MARK_LIST_PLUGINS, refListPlugins);

    if (!RBACService.isAuthorized(
        XslExport.RESOURCE_TYPE,
        RBAC.WILDCARD_RESOURCES_ID,
        XslExportResourceIdService.PERMISSION_CREATE,
        getUser())) {
      throw new AccessDeniedException(MESSAGE_PERMISSION_DENIED);
    }

    setPageTitleProperty(PROPERTY_CREATE_XSL_EXPORT_TITLE);

    HtmlTemplate template =
        AppTemplateService.getTemplate(TEMPLATE_CREATE_XSL_EXPORT, getLocale(), model);

    return getAdminPage(template.getHtml());
  }