Package com.agiletec.aps.system.services.page

Examples of com.agiletec.aps.system.services.page.Widget


  @Override
  public String extractShowletParam(HttpServletRequest request, String paramName) {
    String paramValue = null;
    RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
    if (reqCtx!=null) {
      Widget widget = (com.agiletec.aps.system.services.page.Widget) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_WIDGET);
      if (widget!=null) {
        ApsProperties config = widget.getConfig();
        if (null != config) {
          String showletParam = config.getProperty(paramName);
          if (showletParam!=null && showletParam.trim().length()>0) {
            paramValue = showletParam.trim();
          }
View Full Code Here


   * @param config the configuration for the current showlet
   * @return a new object with the given code and configuration
   * @throws ApsSystemException if the given code is unknown or faulting XML configuration
   */
  private Widget createShowletFromRecord(String widgetcode, String config) throws ApsSystemException {
    Widget newShowlet = new Widget();
    WidgetType inheritedType = this.getWidgetTypeManager().getWidgetType(widgetcode);
    newShowlet.setType(inheritedType);
    ApsProperties properties = null;
    newShowlet.setConfig(properties);
    return newShowlet;
  }
View Full Code Here

              "- utente " + username);
          continue;
        }
        String currentShowletCode = res.getString(3);
        String currentConfig = res.getString(4);
        Widget showlet = this.createShowletFromRecord(currentShowletCode, currentConfig);
        pageConfig.getConfig()[currentFramePos] = showlet;
        int status = res.getInt(5);
        pageConfig.getStatus()[currentFramePos] = status;
      }
    } catch (Throwable t) {
View Full Code Here

        if (null == frame) continue;
        Object showletCode = frame.get("code");
        if (null == showletCode) continue;
        WidgetType type = showletTypeManager.getWidgetType(showletCode.toString());
        if (null == type) continue;
        Widget showlet = null;
        if (showletCode.equals(voidShowletCode) || allowedShowlets.contains(showletCode) || this.isViewerType(type)) {
          showlet = new Widget();
          showlet.setType(type);
                                        /*
          JSONObject showletConfig = (JSONObject) frame.get("config");
          if (null != showletConfig) {
            ApsProperties properties = new ApsProperties();
            Set<String> keys = showletConfig.keySet();
View Full Code Here

    String value = null;
    try {
      JSONObject frames = new JSONObject();
      Widget[] showlets = this.getConfig();
      for (int i = 0; i < showlets.length; i++) {
        Widget showlet = showlets[i];
        if (null == showlet) continue;
        JSONObject frame = new JSONObject();
        frame.put("code", showlet.getType().getCode());
                                /*
        ApsProperties properties = showlet.getConfig();
        if (properties != null && !properties.isEmpty()) {
          JSONObject configFrame = new JSONObject();
          Set<Object> keys = properties.keySet();
View Full Code Here

  private boolean calculateFrameDestOnSwapAjax(Widget[] showletsToRender, Integer[] columnFrames) {
    //System.out.println("Partenza " + this.getStartFramePos() +
    //    " - POSIZIONE PREC  " + this.getTargetPrevFramePos() +
    //    " - POSIZIONE SUCC " + this.getTargetNextFramePos());
    Widget showlet = null;
    String voidShowletCode = this.getPageUserConfigManager().getVoidShowlet().getCode();
    try {
      Integer targetFramePos = null;
      if (this.getTargetPrevFramePos() == null) {
        //SPOSTAMENTO IN TESTA ALLA COLONNA
        //primo frame di colonna
        targetFramePos = columnFrames[0];
      } else if (this.getTargetNextFramePos() == null) {
        //SPOSTAMENTO IN CODA ALLA COLONNA
        //primo tra gli ultimi frame di colonna liberi
        Integer prevFrame = null;
        for (int i = 0; i < columnFrames.length; i++) {
          Integer frame = columnFrames[columnFrames.length - i - 1];
          Widget showletToRender = showletsToRender[frame];
          if (i==0 && showletToRender != null && !showletToRender.getType().getCode().equals(voidShowletCode)) {
            //L'ULTIMO FRAME DI COLONNA NON E' LIBERO... è quello il target
            targetFramePos = frame;
            //System.out.println("aaaa " + targetFramePos);
            break;
          }
          if (i==columnFrames.length-1 && (showletToRender == null || showletToRender.getType().getCode().equals(voidShowletCode))) {
            //SI E' ARIVATO IN TESTA SENZA TROVARE UN FRAME OCCUPATO... si mette in testa
            targetFramePos = columnFrames[0];
            //System.out.println("bbb " + targetFramePos);
            break;
          }
          if (frame.equals(this.getStartFramePos())) {
            //SI E' TROVATO IL FRAME DI PARTENZA
            targetFramePos = frame;
            //System.out.println("cccc " + targetFramePos);
            break;
          }
          if (showletToRender != null && !showletToRender.getType().getCode().equals(voidShowletCode)) {
            //SI E' TROVATO UN FRAME OCCUPATO... SI METTE IN QUELLO PRECEDENTE!
            targetFramePos = prevFrame;
            //System.out.println("ddd " + targetFramePos);
            break;
          }
View Full Code Here

      return true;
    }
  }

  private WidgetUpdateInfoBean buildShowletToMoveUpdateInfo(Widget[] showletsToRender) throws Throwable {
    Widget showletToMove = showletsToRender[this.getStartFramePos()];
    Integer statusShowletToMoveInteger = super.getCustomShowletStatus() != null ? super.getCustomShowletStatus()[this.getStartFramePos()] : null;
    int statusShowletToMove = (statusShowletToMoveInteger == null) ? 0 : statusShowletToMoveInteger;
    WidgetUpdateInfoBean frameTargetUpdate =
      new WidgetUpdateInfoBean(this.getTargetFramePos(), showletToMove, statusShowletToMove);
    //System.out.println("MESSA SHOWLET da spostare in POSIZIONE TARGET " + this.getTargetFramePos());
View Full Code Here

        framePos = columnFrames[i];
      } else {
        framePos = columnFrames[columnFrames.length - i - 1];
      }
      if (check) {
        Widget showlet = showletsToRender[framePos];
        if (framePos.equals(this.getStartFramePos())
            || (null == showlet || showlet.getType().getCode().equals(voidShowletCode))) {
          return framePos;
        }
      }
      if (framePos.equals(this.getTargetFramePos())) {
        check = true;
View Full Code Here

        check = true;
        prevFrames = framePos;
        continue;
      }
      if (check) {
        Widget showletToSwitch = showletsToRender[prevFrames];
        Integer statusShowletToSwitchInteger = super.getCustomShowletStatus() != null ? super.getCustomShowletStatus()[prevFrames] : null;
        int statusShowletToSwitch = (statusShowletToSwitchInteger == null) ? 0 : statusShowletToSwitchInteger;
        WidgetUpdateInfoBean showletToSwitchUpdateInfo = new WidgetUpdateInfoBean(framePos, showletToSwitch, statusShowletToSwitch);
        //System.out.println("MESSA SHOWLET da switchare da posizione " + prevFrames + " a POSIZIONE " + framePos);
        this.getShiftingElements().put(prevFrames, framePos);
View Full Code Here

      String voidShowletCode = this.getPageUserConfigManager().getVoidShowlet().getCode();
      for (int i = 0; i < showletsToRender.length; i++) {
        Frame frame = pageModel.getFrameConfigs()[i];
        Integer columnId = frame.getColumn();
        if (frame.isLocked() || null == columnId || i == this.getFrameWhereOpenSection().intValue()) continue;
        Widget widget = showletsToRender[i];
        if (columnId.equals(currentColumnId)) {
          if (widget != null && !widget.getType().getCode().equals(voidShowletCode)) {
            FrameSelectItem item = new FrameSelectItem(currentColumnId, columnId, widget, i, currentLang);
            selectItems.add(item);
          }
        } else {
          if (widget == null || widget.getType().getCode().equals(voidShowletCode)) {
            boolean check = this.check(columnId);
            if (!check) {
              FrameSelectItem item = new FrameSelectItem(currentColumnId, columnId, null, i, currentLang);
              selectItems.add(item);
            }
          }
        }
        if (i == this.getFrameWhereOpenSection() && null != widget) {
          this.setShowletCodeOnOpeningSection(widget.getType().getCode());
        }
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "openSwapSection", "Error on opening Swap Section");
    }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.page.Widget

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.