Examples of CustomFunctionVO


Examples of org.jallinone.system.customizations.java.CustomFunctionVO

   * Callback method invoked when the user has double clicked on the selected row of the grid.
   * @param rowNumber selected row index
   * @param persistentObject v.o. related to the selected row
   */
  public void doubleClick(int rowNumber,ValueObject persistentObject) {
    CustomFunctionVO vo = (CustomFunctionVO)persistentObject;
    new CustomFunctionController(frame,vo);
  }
View Full Code Here

Examples of org.jallinone.system.customizations.java.CustomFunctionVO

   * @param persistentObjects value objects to delete (related to the currently selected rows)
   * @return an ErrorResponse value object in case of errors, VOResponse if the operation is successfully completed
   */
  public Response deleteRecords(ArrayList persistentObjects) throws Exception {
    ArrayList pks = new ArrayList();
    CustomFunctionVO vo = null;
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (CustomFunctionVO)persistentObjects.get(i);
      pks.add(vo.getFunctionCodeSys06SYS16());
    }
    return ClientUtils.getData("deleteCustomFunctions",pks);
  }
View Full Code Here

Examples of org.jallinone.system.customizations.java.CustomFunctionVO

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) { }

        public void beforeLookupAction(ValueObject parentVO) {
          CustomFunctionVO vo = (CustomFunctionVO)parentVO;
          treeLevelPosDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,new BigDecimal(2))// tree menu hierarchy identifier...
        }

        public void forceValidate() {}
View Full Code Here

Examples of org.jallinone.system.customizations.java.CustomFunctionVO

   * Callback method called by the Form panel when the Form is set to INSERT mode.
   * The method can pre-set some v.o. attributes, so that some input controls will have a predefined value associated.
   * @param persistentObject new value object
   */
  public void createPersistentObject(ValueObject persistentObject) throws Exception {
    CustomFunctionVO vo = (CustomFunctionVO)persistentObject;
  }
View Full Code Here

Examples of org.jallinone.system.customizations.java.CustomFunctionVO

          ClientSettings.getInstance().getResources().getResource("Error"),
          JOptionPane.WARNING_MESSAGE
        );
        return;
      }
      CustomFunctionVO vo = (CustomFunctionVO)((VOResponse)res).getVo();
      setTitle(vo.getDescriptionSYS10());
      controlNote.setValue(vo.getNoteSYS16());

      // retrieve columns info...
      GridParams gridParams = new GridParams();
      gridParams.getOtherGridParams().put(ApplicationConsts.FUNCTION_CODE_SYS06,functionCode);
      res = ClientUtils.getData("loadCustomColumns",gridParams);
      if (res.isError()) {
        JOptionPane.showMessageDialog(
          MDIFrame.getInstance(),
          ClientSettings.getInstance().getResources().getResource(res.getErrorMessage()),
          ClientSettings.getInstance().getResources().getResource("Error"),
          JOptionPane.WARNING_MESSAGE
        );
        return;
      }
      java.util.List customCols = ((VOListResponse)res).getRows();

      // construct main tables list...
      StringTokenizer st = new StringTokenizer(vo.getMainTablesSYS16(),",");
      ArrayList tables = new ArrayList();
      while(st.hasMoreTokens()) {
        tables.add(st.nextToken());
      }

      // retrieve query info...
      TableVO tableVO = new TableVO(vo.getSql(),tables,true);
      res = ClientUtils.getData("getQueryInfo",tableVO);
      if (res.isError()) {
        JOptionPane.showMessageDialog(
          MDIFrame.getInstance(),
          ClientSettings.getInstance().getResources().getResource(res.getErrorMessage()),
          ClientSettings.getInstance().getResources().getResource("Error"),
          JOptionPane.WARNING_MESSAGE
        );
        return;
      }
      tableVO = (TableVO)((VOResponse)res).getVo();
      ColumnVO colVO = null;
      CustomColumnVO customColVO = null;
      boolean found;
      Hashtable whereParamColNames = new Hashtable(); // collection of <columnname,index in where> related to where params...
      boolean paramsRequired = false; // flag used to disable auto data loading...
      ArrayList paramsDefined = new ArrayList(); // input controls defined in filter panel; used to auto set filter panel height into the split pane...
      int count = 0;
      for(int i=0;i<customCols.size();i++) {
        customColVO = (CustomColumnVO)customCols.get(i);

        found = false;
        for(int j=0;j<tableVO.getColumns().size();j++) {
          colVO = (ColumnVO)tableVO.getColumns().get(j);
          if (customColVO.getColumnNameSYS22().equals(colVO.getColumnName())) {
            found = true;
            break;
          }
        }

        if (!found && customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_WHERE)) {
          // parameter in where clause...
          colVO = new ColumnVO(tableVO);
          colVO.setColumnName(customColVO.getColumnNameSYS22());
          colVO.setAttributeName(customColVO.getColumnNameSYS22());
          colVO.setColumnHeaderName(customColVO.getColumnNameSYS22());
          colVO.setColumnType(ApplicationConsts.TYPE_TEXT);
          colVO.setColumnSize(new BigDecimal(255));
          whereParamColNames.put(colVO.getAttributeName(),new Integer(count));
          whereParamsFilled.put(new Integer(count),new Boolean(false));
          count++;
          found = true;
        }

        if (!found)
          continue;

        if (customColVO.isIsParamRequiredSYS22())
          paramsRequired = true;
        if (customColVO.isIsParamSYS22()) {
          if (paramsDefined.size()==0) {
            // add filter panel title...
            TitledBorder titledBorder1 = new TitledBorder(ClientSettings.getInstance().getResources().getResource("filter conditions"));
            titledBorder1.setTitleColor(Color.blue);
            filterPanel.setBorder(titledBorder1);
          }

          // define label + input control for filter panel...
          LabelControl label = new LabelControl();
          label.setText(colVO.getColumnHeaderName());
          InputControl inputControl = null;
          if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_TEXT) ||
              customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_WHERE)) {
            inputControl = new TextControl();
            inputControl.setAttributeName(colVO.getAttributeName());
            if (colVO.getColumnSize().intValue()>10)
              ((TextControl)inputControl).setColumns(Math.min(30,colVO.getColumnSize().intValue()));
            ((TextControl)inputControl).setRequired(customColVO.isIsParamRequiredSYS22());
            ((TextControl)inputControl).setValue(customColVO.getDefaultValueTextSYS22());
            ((TextControl)inputControl).setMaxCharacters(colVO.getColumnSize().intValue());
          }
          else if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_NUM)) {
            inputControl = new NumericControl();
            inputControl.setAttributeName(colVO.getAttributeName());
            if (colVO.getColumnSize().intValue()>10)
              ((NumericControl)inputControl).setColumns(Math.min(30,colVO.getColumnSize().intValue()));
            ((NumericControl)inputControl).setRequired(customColVO.isIsParamRequiredSYS22());
            ((NumericControl)inputControl).setValue(customColVO.getDefaultValueNumSYS22());
            ((NumericControl)inputControl).setMaxValue(Math.pow(10d,colVO.getColumnSize().doubleValue()));
            if (colVO.getColumnDec()!=null)
              ((NumericControl)inputControl).setDecimals(colVO.getColumnDec().intValue());
          }
          else if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_DATE)) {
            inputControl = new DateControl();
            inputControl.setAttributeName(colVO.getAttributeName());
            ((DateControl)inputControl).setRequired(customColVO.isIsParamRequiredSYS22());
            ((DateControl)inputControl).setValue(customColVO.getDefaultValueNumSYS22());
            if (customColVO.getDefaultValueDateSYS22()!=null &&
                customColVO.getDefaultValueDateSYS22().equals(Boolean.TRUE))
              ((DateControl)inputControl).setValue(new java.sql.Date(System.currentTimeMillis()));
          }
          else if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_ENUM) &&
                   customColVO.getConstraintValuesSYS22()!=null &&
                   customColVO.getConstraintValuesSYS22().length()>0) {
            inputControl = new ComboBoxControl();
            inputControl.setAttributeName(colVO.getAttributeName());
            ((ComboBoxControl)inputControl).setRequired(customColVO.isIsParamRequiredSYS22());
            ((ComboBoxControl)inputControl).setValue(customColVO.getDefaultValueNumSYS22());
            ArrayList domainValues = new ArrayList();
            StringTokenizer stt = new StringTokenizer(customColVO.getConstraintValuesSYS22(),",");
            String token = null;
            Domain domain = new Domain(colVO.getColumnName());
            while(stt.hasMoreTokens()) {
              token = stt.nextToken();
              domain.addDomainPair(token,token);
            }
            ((ComboBoxControl)inputControl).setDomain(domain);
          }

          // add label + input control to filter panel...
          filterPanel.add(label,       new GridBagConstraints(0, paramsDefined.size(), 1, 1, 0.0, 0.0
                  ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
          filterPanel.add((JComponent)inputControl,       new GridBagConstraints(1, paramsDefined.size(), 1, 1, 1.0, 0.0
                  ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));

          paramsDefined.add(inputControl);
        }
        colVO.setColumnVisible(customColVO.isColumnVisibleSYS22());
        if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_PROG)) {
          colVO.setProgressive(true);
          colVO.setColumnRequired(false);
        }
        if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_TEXT))
          colVO.setDefaultValue(customColVO.getDefaultValueTextSYS22());
        else if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_NUM))
          colVO.setDefaultValue(customColVO.getDefaultValueNumSYS22());
        else if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_DATE) &&
                 customColVO.getDefaultValueDateSYS22()!=null &&
                 customColVO.getDefaultValueDateSYS22().equals(Boolean.TRUE))
          colVO.setDefaultValue(new java.sql.Date(System.currentTimeMillis()));
        else if (customColVO.getColumnTypeSYS22().equals(ApplicationConsts.TYPE_ENUM) &&
                 customColVO.getConstraintValuesSYS22()!=null &&
                 customColVO.getConstraintValuesSYS22().length()>0) {
          ArrayList domainValues = new ArrayList();
          StringTokenizer stt = new StringTokenizer(customColVO.getConstraintValuesSYS22(),",");
          while(stt.hasMoreTokens())
            domainValues.add(stt.nextToken());
          colVO.setColumnValues(domainValues);
        }
      }


      // create grid panel...
      panel = new TablePanel(tableVO,tableVO.getMainTables().size()==0,!paramsRequired && vo.getAutoLoadDataSYS16());
      splitPane.add(panel, JSplitPane.BOTTOM);
      if (paramsDefined.size()>0)
        splitPane.setDividerLocation((paramsDefined.size()>5?0:150)+Math.min(paramsDefined.size()*30,300));
      else if (vo.getNoteSYS16()!=null && vo.getNoteSYS16().trim().length()>0)
        splitPane.setDividerLocation(150);
      else
        splitPane.setDividerLocation(0);

      for(int i=0;i<paramsDefined.size();i++)
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.