コード例 #1
0
 protected void renderDropRegion(int index) {
   String width = currentRegion.isColumnRegion() ? getMaxDropSize() : getMinDropSize();
   String height = currentRegion.isColumnRegion() ? getMinDropSize() : getMaxDropSize();
   setAttribute("width", width);
   setAttribute("height", height);
   setAttribute("index", index);
   setAttribute("regionId", currentRegion.getId());
   renderFragment("panelDropRegion");
 }
コード例 #2
0
 protected void renderRegionStart() {
   // Render region start
   if (userAdmin) {
     setAttribute("regionId", currentRegion.getId());
     setAttribute("numPanels", regionPanels.size());
     setAttribute("regionDescription", currentRegion.getDescription());
     setAttribute("cellspacingPanels", cellspacingPanels);
     renderFragment("regionStartWithTitle");
   } else {
     setAttribute("cellspacingPanels", cellspacingPanels);
     renderFragment("regionStartWithoutTitle");
   }
 }
コード例 #3
0
 public boolean execute(CommandRequest cmdReq) throws Exception {
   if (log.isDebugEnabled()) log.debug("ShowJSPAjaxResponse: " + jsp);
   cmdReq.getResponseObject().setHeader("Content-Encoding", HTTPSettings.lookup().getEncoding());
   cmdReq
       .getResponseObject()
       .setContentType("text/html;charset=" + HTTPSettings.lookup().getEncoding());
   if (region != null) {
     cmdReq.getRequestObject().setAttribute(Parameters.RENDER_IDREGION, region.getId());
   }
   cmdReq
       .getRequestObject()
       .getRequestDispatcher(jsp)
       .include(cmdReq.getRequestObject(), cmdReq.getResponseObject());
   return true;
 }
コード例 #4
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);
    }
  }
コード例 #5
0
 protected void renderRegionEnd() {
   setAttribute("regionId", currentRegion.getId());
   renderFragment("regionEnd");
 }