Examples of GenericList


Examples of it.eng.spago.paginator.basic.impl.GenericList

  logger.debug("parameterFieldName=" + parameterFieldName);

  // define the spago paginator and list object
  PaginatorIFace paginator = new GenericPaginator();
  paginator.setPageSize(40);
  ListIFace list = new GenericList();



  // recover lov object
  IParameterDAO pardao = DAOFactory.getParameterDAO();
  Parameter par = pardao.loadForExecutionByParameterIDandRoleName(parId, roleName);
  ModalitiesValue modVal = par.getModalityValue();

  // get the lov provider
  String lovProvider = modVal.getLovProvider();

  // get from the request the type of lov
  String typeLov = LovDetailFactory.getLovTypeCode(lovProvider);

  // get the user profile
  SessionContainer permSession = this.getRequestContainer().getSessionContainer().getPermanentContainer();
  if (permSession == null)
      logger.warn("Permanent session container is null!!!!");
  IEngUserProfile profile = (IEngUserProfile) permSession.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
  if (profile == null)
      logger.warn("IEngUserProfile is null!!!!");

  // read data
  SourceBean rowsSourceBean = null;
  if (typeLov.equalsIgnoreCase("QUERY")) {
      rowsSourceBean = executeQuery(lovProvider, response, profile);
      if (rowsSourceBean == null)
    return list;

  } else if (typeLov.equalsIgnoreCase("FIXED_LIST")) {
      rowsSourceBean = executeFixedList(lovProvider, response, profile);
      if (rowsSourceBean == null)
    return list;

  } else if (typeLov.equalsIgnoreCase("SCRIPT")) {
      rowsSourceBean = executeScript(lovProvider, response, profile);
      if (rowsSourceBean == null)
    return list;

  } else if (typeLov.equalsIgnoreCase("JAVA_CLASS")) {
      rowsSourceBean = executeJavaClass(lovProvider, response, profile);
      if (rowsSourceBean == null)
    return list;
  }
  logger.debug("valColName="+valColName);
  int rowSize = 0;
  // fill paginator
//  int count = 0;
  if (rowsSourceBean != null) {
      List rows = rowsSourceBean.getAttributeAsList(DataRow.ROW_TAG);
      rowSize = rows.size();
      for (int i = 0; i < rows.size(); i++) {
    paginator.addRow(rows.get(i));
//    count++;
      }
  }
 
  //in case it is a check list, sets all values in one page
  // if(isChecklist) paginator.setPageSize(rowSize*10);
 
  list.setPaginator(paginator);

  // get all the columns name
  rowsSourceBean = list.getPaginator().getAll();
  List colNames = new ArrayList();
  List rows = null;
 
  if (rowsSourceBean != null) {
      rows = rowsSourceBean.getAttributeAsList(DataRow.ROW_TAG);
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.