コード例 #1
0
 protected StringBuffer getRelativeLinkToPage(Section page, boolean allowFriendly, String lang) {
   StringBuffer sb = new StringBuffer();
   sb.append(getRelativeLinkToWorkspace(page.getWorkspace(), allowFriendly, lang));
   String pageFriendlyUrl = page.getId().toString();
   if (allowFriendly) {
     pageFriendlyUrl = StringUtils.defaultIfEmpty(page.getFriendlyUrl(), page.getId().toString());
   }
   sb.append("/").append(pageFriendlyUrl);
   return sb;
 }
コード例 #2
0
  @Override
  public void service(HttpServletRequest request, HttpServletResponse response)
      throws FormatterException {
    currentSection = NavigationManager.lookup().getCurrentSection();
    cellspacingPanels = currentSection.getPanelsCellSpacing().intValue();
    String regionID = (String) request.getAttribute(Parameters.RENDER_IDREGION);
    currentRegion = currentSection.getLayout().getRegion(regionID);
    currentSectionRegion = currentSection.getSectionRegion(currentRegion.getId());

    regionPanels = getRegionPanels();

    panelRecommendedWidth =
        regionPanels.isEmpty()
            ? 100
            : (currentRegion.isRowRegion() ? (100 / regionPanels.size()) : 100);

    WorkspaceImpl workspace = NavigationManager.lookup().getCurrentWorkspace();

    if (workspace != null) {
      WorkspacePermission permToCheck =
          WorkspacePermission.newInstance(workspace, WorkspacePermission.ACTION_ADMIN);
      userAdmin = getUserStatus().hasPermission(permToCheck);
    }
  }