Package com.agiletec.plugins.jpmyportalplus.aps.system.services.userconfig.model

Examples of com.agiletec.plugins.jpmyportalplus.aps.system.services.userconfig.model.WidgetUpdateInfoBean


  protected void deleteUserConfig(String username, IPage page, WidgetUpdateInfoBean[] updateInfos, Connection conn) {
    PreparedStatement stat = null;
    try {
      stat = conn.prepareStatement(DELETE_PAGE_USER_CONFIG);
      for (int i = 0; i < updateInfos.length; i++) {
        WidgetUpdateInfoBean infoBean = updateInfos[i];
        stat.setString(1, username);
        stat.setString(2, page.getCode());
        stat.setInt(3, infoBean.getFramePos());
        stat.addBatch();
        stat.clearParameters();
      }
      stat.executeBatch();
    } catch (Throwable t) {
View Full Code Here


  protected void addUserConfig(String username, IPage page, WidgetUpdateInfoBean[] updateInfos, Connection conn) {
    PreparedStatement stat = null;
    try {
      stat = conn.prepareStatement(ADD_USER_CONFIG);
      for (int i = 0; i < updateInfos.length; i++) {
        WidgetUpdateInfoBean infoBean = updateInfos[i];
        stat.setString(1, username);
        stat.setString(2, page.getCode());
        stat.setInt(3, infoBean.getFramePos());
        stat.setString(4, infoBean.getShowlet().getType().getCode());
        stat.setNull(5, java.sql.Types.CHAR);
        stat.setInt(6, infoBean.getStatus());
        stat.addBatch();
        stat.clearParameters();
      }
      stat.executeBatch();
    } catch (Throwable t) {
View Full Code Here

        return SUCCESS;
      }
      //System.out.println("Frame di destinazione " + this.getTargetFramePos() + " - occupato " + isFrameDestBusy);
      if (!isFrameDestBusy) {
        //frame destinazione non occupato
        WidgetUpdateInfoBean frameStartUpdate =
          new WidgetUpdateInfoBean(this.getStartFramePos(), this.getShowletVoid(), IPageUserConfigManager.STATUS_OPEN);
        this.addUpdateInfoBean(frameStartUpdate);
        WidgetUpdateInfoBean frameTargetUpdate = this.buildShowletToMoveUpdateInfo(showletsToRender);
        this.addUpdateInfoBean(frameTargetUpdate);
      } else {
        //frame destinazione occupato
        this.setShiftingElements(new HashMap<Integer, Integer>());
        Integer nextVoidFrame = this.calculateVoidFramePos(showletsToRender, columnFrames, true);
View Full Code Here

  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());
    return frameTargetUpdate;
  }
View Full Code Here

        framePos = columnFrames[i];
      } else {
        framePos = columnFrames[columnFrames.length - i - 1];
      }
      if (framePos.equals(this.getTargetFramePos())) {
        WidgetUpdateInfoBean frameTargetUpdate = this.buildShowletToMoveUpdateInfo(showletsToRender);
        this.addUpdateInfoBean(frameTargetUpdate);
        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);
        this.addUpdateInfoBean(showletToSwitchUpdateInfo);
        if (framePos.equals(endFramePos)) {
          //System.out.println("TERMINE SWITCH");
          check = false;
        }
      }
      prevFrames = framePos;
    }
    if (!endFramePos.equals(this.getStartFramePos())) {
      //System.out.println("SVUOTAMENTO FRAME PARTENZA");
      WidgetUpdateInfoBean frameStartUpdate =
        new WidgetUpdateInfoBean(this.getStartFramePos(), this.getShowletVoid(), IPageUserConfigManager.STATUS_OPEN);
      this.addUpdateInfoBean(frameStartUpdate);
    } else {
      //System.out.println("CASO IN CUI IL FRAME DI PARTENZA E' IL DESTINATARIO DI UN FRAME SWITCHATO");
    }
  }
View Full Code Here

      Widget[] showletsToRender = this.getPageUserConfigManager().getShowletsToRender(currentPage, customShowlets);

      Widget movedShowlet = showletsToRender[this.getStartFramePos()];
      Integer movedShowletStatusInteger = super.getCustomShowletStatus() != null ? super.getCustomShowletStatus()[this.getStartFramePos()] : null;
      int movedShowletStatus = (movedShowletStatusInteger == null) ? 0 : movedShowletStatusInteger;
      WidgetUpdateInfoBean movedShowletUpdateInfo = new WidgetUpdateInfoBean(this.getTargetFramePos(), movedShowlet, movedShowletStatus);
      this.addUpdateInfoBean(movedShowletUpdateInfo);

      Widget showletToMove = showletsToRender[this.getTargetFramePos()];
      Integer showletToMoveStatusInteger = super.getCustomShowletStatus() != null ? super.getCustomShowletStatus()[this.getTargetFramePos()] : null;
      int showletToMoveStatus = (showletToMoveStatusInteger == null) ? 0 : showletToMoveStatusInteger;
      WidgetUpdateInfoBean showletToMoveUpdateInfo = new WidgetUpdateInfoBean(this.getStartFramePos(), showletToMove, showletToMoveStatus);
      this.addUpdateInfoBean(showletToMoveUpdateInfo);

      super.executeUpdateUserConfig(currentPage);
      this.updateSessionParams();
    } catch (Throwable t) {
View Full Code Here

          if (isFrameToFlow) {
            if (showletsToAdd.size()>0) {
              this.addNewWidgetUpdateInfo(showletsToAdd, i, isFrameToFlow);
            } else {
              Widget showletToInsert = this.getShowletVoid();
              WidgetUpdateInfoBean infoBean = new WidgetUpdateInfoBean(i, showletToInsert, IPageUserConfigManager.STATUS_OPEN);
              this.addUpdateInfoBean(infoBean);
            }
          } else {
            Widget showlet = showletsToRender[i];
            if ((null == showlet || (null != showlet && showlet.getType().getCode().equals(voidShowletCode))) && showletsToAdd.size()>0) {
View Full Code Here

    Collections.sort(codes);
    return codes;
  }

  protected void addNewWidgetUpdateInfo(List<String> showletsToAdd, int framePos, boolean frameToFlow) {
    WidgetUpdateInfoBean infoBean = null;
    Widget showletToInsert = null;
    String typeCode = showletsToAdd.get(0);
    WidgetType type = this.getWidgetTypeManager().getWidgetType(typeCode);
    if (null != type) {
      showletsToAdd.remove(typeCode);
      showletToInsert = new Widget();
      showletToInsert.setType(type);
    }
    if (null != showletToInsert) {
      infoBean = new WidgetUpdateInfoBean(framePos, showletToInsert, IPageUserConfigManager.STATUS_OPEN);
      this.addUpdateInfoBean(infoBean);
    } else if (frameToFlow) {
      infoBean = new WidgetUpdateInfoBean(framePos, this.getShowletVoid(), IPageUserConfigManager.STATUS_OPEN);
      this.addUpdateInfoBean(infoBean);
    }
  }
View Full Code Here

      Widget[] showletsToRender = this.getPageUserConfigManager().getShowletsToRender(currentPage, customShowlets);

      Widget showletToMove = showletsToRender[this.getStartFramePos()];
      Integer statusShowletToMoveInteger = this.getCustomShowletStatus() != null ? this.getCustomShowletStatus()[this.getStartFramePos()] : null;
      int statusShowletToMove = (statusShowletToMoveInteger == null) ? 0 : statusShowletToMoveInteger;
      WidgetUpdateInfoBean frameTargetUpdate =
        new WidgetUpdateInfoBean(this.getTargetFramePos(), showletToMove, statusShowletToMove);
      this.addUpdateInfoBean(frameTargetUpdate);
      Widget showletOnFrameDest = showletsToRender[this.getTargetFramePos()];
      Integer statusShowletOnFrameDestInteger = this.getCustomShowletStatus() != null ? this.getCustomShowletStatus()[this.getTargetFramePos()] : null;
      int statusShowletOnFrameDest = (statusShowletOnFrameDestInteger == null) ? 0 : statusShowletOnFrameDestInteger;
      WidgetUpdateInfoBean frameStartUpdate =
        new WidgetUpdateInfoBean(this.getStartFramePos(), showletOnFrameDest, statusShowletOnFrameDest);
      this.addUpdateInfoBean(frameStartUpdate);

      this.executeUpdateUserConfig(currentPage);
      this.updateSessionParams();
    } catch (Throwable t) {
View Full Code Here

  }

  protected boolean executeResetFrame() throws ApsSystemException {
    try {
      IPage currentPage = this.getCurrentPage();
      WidgetUpdateInfoBean resetFrame =
        new WidgetUpdateInfoBean(this.getFrameToEmpty(), this.getShowletVoid(), IPageUserConfigManager.STATUS_OPEN);
      this.addUpdateInfoBean(resetFrame);
      this.executeUpdateUserConfig(currentPage);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "executeResetFrame", "Error on executeResetFrame");
      return false;
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpmyportalplus.aps.system.services.userconfig.model.WidgetUpdateInfoBean

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.