Examples of ETLProcessVO


Examples of org.jallinone.system.importdata.java.ETLProcessVO

   * Callback method called when the data loading is completed.
   * @param error <code>true</code> if an error occours during data loading, <code>false</code> if data loading is successfully completed
   */
  public void loadDataCompleted(boolean error) {
    if (!error) {
      ETLProcessVO vo = (ETLProcessVO)frame.getMainPanel().getVOModel().getValueObject();
      frame.setControlImportType();
      frame.getButtonExecNow().setEnabled(true);
      frame.getGrid().getOtherGridParams().put(ApplicationConsts.FILTER_VO,vo);
      frame.getGrid().reloadData();
    }
View Full Code Here

Examples of org.jallinone.system.importdata.java.ETLProcessVO

   * @param oldPersistentObject original value object, previous to the changes
   * @param persistentObject value object to save
   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response updateRecord(ValueObject oldPersistentObject,ValueObject persistentObject) throws Exception {
    ETLProcessVO processVO = (ETLProcessVO)frame.getMainPanel().getVOModel().getValueObject();
    try {
      frame.getGrid().getTable().getGrid().stopCellEditing();
    }
    catch (Exception ex) {
    }

    // check for grid content...
    SelectableFieldVO vo = null;
    boolean atLeastOne = false;
    for(int i=0;i< frame.getGrid().getVOListTableModel().getRowCount();i++) {
      vo = (SelectableFieldVO)frame.getGrid().getVOListTableModel().getObjectForRow(i);
      if (vo.isSelected()) {
        atLeastOne = true;
        if ((processVO.getFileFormatSYS23().equals("XLS") ||
             processVO.getFileFormatSYS23().equals("CSV1") ||
             processVO.getFileFormatSYS23().equals("CSV2")) &&
            vo.getField().getPosSYS24()==null)
          return new ErrorResponse("A mandatory column is empty.");
        if (processVO.getFileFormatSYS23().equals("TXT") &&
            (vo.getField().getStartPosSYS24()==null ||
             vo.getField().getEndPosSYS24()==null))
          return new ErrorResponse("A mandatory column is empty.");
      }
    }
View Full Code Here

Examples of org.jallinone.system.importdata.java.ETLProcessVO

   * @param newValue new cell value (just edited)
   * @return <code>true</code> if cell value is valid, <code>false</code> otherwise
   */
  public boolean validateCell(int rowNumber,String attributeName,Object oldValue,Object newValue) {
    SelectableFieldVO vo = (SelectableFieldVO)frame.getGrid().getVOListTableModel().getObjectForRow(rowNumber);
    ETLProcessVO processVO = (ETLProcessVO)frame.getMainPanel().getVOModel().getValueObject();
    if ("TXT".equals(processVO.getFileFormatSYS23()) &&
        attributeName.equals("field.startPosSYS24") &&
        newValue!=null &&
        vo.getField().getEndPosSYS24()!=null &&
        ((Number)newValue).intValue()>vo.getField().getEndPosSYS24().intValue())
      return false;
    if ("TXT".equals(processVO.getFileFormatSYS23()) &&
        attributeName.equals("field.endPosSYS24") &&
        newValue!=null &&
        vo.getField().getStartPosSYS24()!=null &&
        ((Number)newValue).intValue()<vo.getField().getStartPosSYS24().intValue())
      return false;
View Full Code Here

Examples of org.jallinone.system.importdata.java.ETLProcessVO

   * @param attributeName attribute name that identifies the selected grid column
   * @return <code>true</code> if the selected cell is editable, <code>false</code> otherwise
   */
  public boolean isCellEditable(GridControl grid,int row,String attributeName) {
    SelectableFieldVO vo = (SelectableFieldVO)grid.getVOListTableModel().getObjectForRow(row);
    ETLProcessVO processVO = (ETLProcessVO)frame.getMainPanel().getVOModel().getValueObject();
    if (attributeName.equals("selected"))
      return true;
    if (vo.isSelected()) {
      if (("XLS".equals(processVO.getFileFormatSYS23()) ||
           "CSV1".equals(processVO.getFileFormatSYS23()) ||
           "CSV2".equals(processVO.getFileFormatSYS23())) &&
          attributeName.equals("field.posSYS24"))
        return true;
      if ("TXT".equals(processVO.getFileFormatSYS23()) &&
          (attributeName.equals("field.startPosSYS24") ||
           attributeName.equals("field.endPosSYS24")))
        return true;
      if (("TXT".equals(processVO.getFileFormatSYS23()) ||
           "CSV1".equals(processVO.getFileFormatSYS23()) ||
           "CSV2".equals(processVO.getFileFormatSYS23())) &&
          attributeName.equals("field.dateFormatSYS24"))
        return true;
    }
    return false;
  }
View Full Code Here

Examples of org.jallinone.system.importdata.java.ETLProcessVO

   * @param value object contained in the selected cell
   * @return background color of the selected cell
   */
  public Color getBackgroundColor(int row,String attributeName,Object value) {
    SelectableFieldVO vo = (SelectableFieldVO)frame.getGrid().getVOListTableModel().getObjectForRow(row);
    ETLProcessVO processVO = (ETLProcessVO)frame.getMainPanel().getVOModel().getValueObject();
    if (vo.isRequired()) {
      Color c = new Color(200,100,100);
      if ("XLS".equals(processVO.getFileFormatSYS23()) && attributeName.equals("field.posSYS24") && value==null)
        return c;
      else if ("CSV1".equals(processVO.getFileFormatSYS23()) && attributeName.equals("field.posSYS24") && value==null)
        return c;
      else if ("CSV2".equals(processVO.getFileFormatSYS23()) && attributeName.equals("field.posSYS24") && value==null)
        return c;
      else if ("TXT".equals(processVO.getFileFormatSYS23()) && attributeName.equals("field.startPosSYS24") && value==null)
        return c;
      else if ("TXT".equals(processVO.getFileFormatSYS23()) && attributeName.equals("field.endPosSYS24") && value==null)
        return c;
    }
    return ClientSettings.GRID_CELL_BACKGROUND;
  }
View Full Code Here

Examples of org.jallinone.system.importdata.java.ETLProcessVO

    Connection conn = null;
    try {
      if (this.conn==null) conn = getConn(); else conn = this.conn;
      bean.setConn(conn); // use same transaction...
      langsBean.setConn(conn); // use same transaction...
      ETLProcessVO processVO = (ETLProcessVO)gridParams.getOtherGridParams().get(ApplicationConsts.FILTER_VO);

      // read from SYS24 table...
      Response res = bean.loadETLProcessFields(processVO.getProgressiveSYS23(),username);

      if (!res.isError()) {
        java.util.List vos = ( (VOListResponse) res).getRows();
        HashMap map = new HashMap();
        ETLProcessFieldVO vo = null;
        for (int i = 0; i < vos.size(); i++) {
          vo = (ETLProcessFieldVO) vos.get(i);
          map.put(new FieldEntry(vo.getLanguageCodeSYS24(),vo.getFieldNameSYS24()), vo);
        }

        ArrayList rows = new ArrayList();
        SelectableFieldVO selVO = null;
        ImportDescriptorVO impVO = (ImportDescriptorVO) Class.forName(processVO.getClassNameSYS23()).newInstance();
        FieldEntry pk = null;
        for (int i = 0; i < impVO.getFields().length; i++) {
          pk = new FieldEntry(ApplicationConsts.JOLLY, impVO.getFields()[i]);
          if (map.containsKey(pk)) {
            vo = (ETLProcessFieldVO) map.get(pk);

            selVO = new SelectableFieldVO();
            selVO.setField(vo);
            selVO.setSelected(true);
            selVO.setLabel(p.getProperty(impVO.getLabels()[i]));
            selVO.setRequired(impVO.getRequiredFields().contains(impVO.getFields()[i]));
            rows.add(selVO);
          }
          else {
            vo = new ETLProcessFieldVO();
            vo.setFieldNameSYS24(impVO.getFields()[i]);
            vo.setLanguageCodeSYS24(ApplicationConsts.JOLLY);
            vo.setProgressiveSys23SYS24(processVO.getProgressiveSYS23());

            selVO = new SelectableFieldVO();
            selVO.setField(vo);
            selVO.setSelected(false);
            selVO.setLabel(p.getProperty(impVO.getLabels()[i]));
            selVO.setRequired(impVO.getRequiredFields().contains(impVO.
                getFields()[i]));
            rows.add(selVO);
          }
        } // end for

        // retrieve supported languages...
        res = langsBean.loadLanguages( serverLanguageId,username);
        if (res.isError())
          throw new Exception(res.getErrorMessage());
        java.util.List langsVO = ( (VOListResponse) res).getRows();

        // for each progressive SYS10 x language...
        Iterator it = impVO.getProgressiveSys10Fields().keySet().iterator();
        String field = null;
        LanguageVO langVO = null;
        while(it.hasNext()) {
          field = it.next().toString();
          for(int i=0;i<langsVO.size();i++) {
            langVO = (LanguageVO)langsVO.get(i);
            pk = new FieldEntry(langVO.getLanguageCodeSYS09(),field);
            if (map.containsKey(pk)) {
              vo = (ETLProcessFieldVO)map.get(new FieldEntry(langVO.getLanguageCodeSYS09(),field));

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(true);
              selVO.setLabel(
                p.getProperty((String)impVO.getProgressiveSys10Fields().get(field))+
                " "+
                langVO.getDescriptionSYS09()
              );
              selVO.setRequired(impVO.getRequiredFields().contains(field));
              rows.add(selVO);
            }
            else {
              vo = new ETLProcessFieldVO();
              vo.setFieldNameSYS24(field);
              vo.setLanguageCodeSYS24(langVO.getLanguageCodeSYS09());
              vo.setProgressiveSys23SYS24(processVO.getProgressiveSYS23());

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(false);
              selVO.setLabel(
                p.getProperty((String)impVO.getProgressiveSys10Fields().get(field))+
                " "+
                langVO.getDescriptionSYS09()
              );
              selVO.setRequired(impVO.getRequiredFields().contains(field));
              rows.add(selVO);
            }
          }

        } // end while on descriptions...

        // if a hierarchy level has been defined, create an object for each supported language...
        if (processVO.getProgressiveHIE02()!=null) {
          field = impVO.getHierarchyField();

          for(int i=0;i<langsVO.size();i++) {
            langVO = (LanguageVO)langsVO.get(i);
            pk = new FieldEntry(langVO.getLanguageCodeSYS09(),field);

            if (map.containsKey(pk)) {
              vo = (ETLProcessFieldVO)map.get(pk);

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(true);
              selVO.setLabel(
                  p.getProperty("hierarchy") +
                  " " +
                  langVO.getDescriptionSYS09()
                  );
              selVO.setRequired(impVO.getRequiredFields().contains(field));
              rows.add(selVO);
            }
            else {

              vo = new ETLProcessFieldVO();
              vo.setFieldNameSYS24(field);
              vo.setLanguageCodeSYS24(langVO.getLanguageCodeSYS09());
              vo.setProgressiveSys23SYS24(processVO.getProgressiveSYS23());

              selVO = new SelectableFieldVO();
              selVO.setField(vo);
              selVO.setSelected(false);
              selVO.setLabel(
View Full Code Here

Examples of org.jallinone.system.importdata.java.ETLProcessVO

        GridParams gridParams = new GridParams();
        Response answer = bean.loadETLProcesses(gridParams,"",null);
        if (!answer.isError()) {
          java.util.List list = ((VOListResponse)answer).getRows();
          ETLProcessVO vo = null;
          for(int i=0;i<list.size();i++) {
            vo = (ETLProcessVO)list.get(i);
            if (!vo.getSchedulingTypeSYS23().equals(ApplicationConsts.SCHEDULING_TYPE_NO_SCHED)) {
              scheduledProcesses.add(new ETLProcessThread(vo));
            }
          }
        }
      }
View Full Code Here

Examples of org.jallinone.system.importdata.java.ETLProcessVO

    return "startETLProcess";
  }


  public final Response executeCommand(Object inputPar,UserSessionParameters userSessionPars,HttpServletRequest request, HttpServletResponse response,HttpSession userSession,ServletContext context) {
    ETLProcessVO processVO = (ETLProcessVO)inputPar;
    try {
      String defCompanyCodeSys01SYS03 = ((JAIOUserSessionParameters)userSessionPars).getDefCompanyCodeSys01SYS03();
      StartETLProcess bean = (StartETLProcess)JAIOBeanFactory.getInstance().getBean(StartETLProcess.class);
      Response answer = bean.startETLProcess(processVO,((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername(),defCompanyCodeSys01SYS03);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.