Esempio n. 1
0
  /* (non-Javadoc)
   * @see ieci.tdw.ispac.api.IWorklistAPI#getTasksPCD(int, InputStream)
   */
  public IItemCollection getClosedTasksPCD(int taskPcdId, InputStream tasklistxml)
      throws ISPACException {

    String resp = getRespString();
    DbCnt cnt = context.getConnection();
    try {
      WLTaskListFactory wlfactory = new WLTaskListFactory();
      WLTaskListBuilder wlbuilder = null;

      wlbuilder = wlfactory.getClosedTaskListBuilder(tasklistxml);
      if (wlbuilder == null)
        throw new ISPACException(
            "No se ha podido construir WLTaskListBuilder para tramites cerrados");

      CollectionDAO coldao =
          wlbuilder.getTaskList(
              cnt,
              ISPACEntities.ENTITY_NULLREGKEYID,
              resp,
              ISPACEntities.ENTITY_NULLREGKEYID,
              taskPcdId);
      return coldao.disconnect();
    } catch (ISPACException ie) {
      throw new ISPACException(
          "Error en WLWorklist:getClosedTasksPCD(" + taskPcdId + ", tasklistxml)", ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }
Esempio n. 2
0
  private IItemCollection getClosedTasksCTL(
      int taskCtlId, InputStream tasklistxml, String resp, int pcdId) throws ISPACException {

    DbCnt cnt = context.getConnection();
    try {
      WLTaskListFactory wlfactory = new WLTaskListFactory();
      WLTaskListBuilder wlbuilder = null;

      wlbuilder = wlfactory.getClosedTaskListBuilder(tasklistxml);
      if (wlbuilder == null)
        throw new ISPACException(
            "No se ha podido construir WLTaskListBuilder para tramites cerrados");

      CollectionDAO coldao = wlbuilder.getTaskList(cnt, taskCtlId, resp, pcdId);
      return coldao.disconnect();
    } catch (ISPACException ie) {
      throw new ISPACException(
          "Error en WLWorklist:getClosedTasksCTL("
              + taskCtlId
              + ", tasklistxml, pcdId["
              + pcdId
              + "])",
          ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }
Esempio n. 3
0
  public IItemCollection getSubProcesses(int pcdId, int idActivityPCD, InputStream istream)
      throws ISPACException {

    DbCnt cnt = null;

    try {

      cnt = context.getConnection();
      WLWorklistFactory wlfactory = new WLWorklistFactory();
      WLProcessListBuilder wlbuilder = wlfactory.getProcessListBuilder(istream);
      if (wlbuilder == null) {
        throw new ISPACException("No se ha podido construir WLProcessListBuilder");
      }

      CollectionDAO coldao =
          wlbuilder.getWorklist(
              cnt, pcdId, idActivityPCD, getRespStringSubProceso(idActivityPCD, 0));
      return coldao.disconnect();

    } catch (ISPACException ie) {
      logger.error("Error al obtener los subprocesos", ie);
      throw new ISPACException("Error en WorklistAPI:getSubProcesses(" + idActivityPCD + ")", ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }
Esempio n. 4
0
 public IItemCollection getSubstitutesHistorics(String sustitutoUID) throws ISPACException {
   CollectionDAO collDAO =
       SustitucionDAO.getSustitutosHistorics(
           mDbCnt,
           sustitutoUID,
           DBUtil.getToDateByBD(mDbCnt, new Date(System.currentTimeMillis())));
   return collDAO.disconnect();
 }
Esempio n. 5
0
  public static IItemCollection getProcessBPM(DbCnt cnt, String idProcessBPM, ClientContext ctx)
      throws ISPACException {
    Object[] argsarr = new Object[1];
    argsarr[0] = ctx;

    String sql = "WHERE ID_PROCESO_BPM = '" + idProcessBPM + "'";

    CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class, argsarr);
    objlist.query(cnt, sql);
    return objlist.disconnect();
  }
Esempio n. 6
0
  private static IItemCollection getProcesses(
      DbCnt cnt, int idProcedimiento, ClientContext ctx, int type) throws ISPACException {
    Object[] argsarr = new Object[1];
    argsarr[0] = ctx;

    String sql = "WHERE ID_PCD = " + idProcedimiento + " AND TIPO = " + type;

    CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class, argsarr);
    objlist.query(cnt, sql);

    return objlist.disconnect();
  }
Esempio n. 7
0
  private static IItemCollection getProcess(DbCnt cnt, String numexp, ClientContext ctx, int type)
      throws ISPACException {
    Object[] argsarr = new Object[1];
    argsarr[0] = ctx;

    String sql = "WHERE NUMEXP = '" + DBUtil.replaceQuotes(numexp) + "' AND TIPO = " + type;

    CollectionDAO objlist = new CollectionDAO(TXProcesoDAO.class, argsarr);
    objlist.query(cnt, sql);

    return objlist.disconnect();
  }
Esempio n. 8
0
  public IItemCollection getProcesses(String[] numexps) throws ISPACException {

    DbCnt cnt = context.getConnection();
    try {
      WLProcessDAO process = new WLProcessDAO(cnt);
      CollectionDAO colDao = process.loadProcessByNumExps(cnt, numexps);
      return colDao.disconnect();
    } catch (ISPACException ie) {
      throw new ISPACException("Error en WLWorklist:getProcesses(" + numexps.toString() + ")", ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }
Esempio n. 9
0
  /* (non-Javadoc)
   * @see ieci.tdw.ispac.api.IWorklistAPI#getProcesses(int)
   */
  public IItemCollection getProcesses(int idStagePCD, String path) throws ISPACException {
    String resp = getRespString();
    DbCnt cnt = context.getConnection();
    try {
      WLWorklistFactory wlfactory = new WLWorklistFactory();
      WLProcessListBuilder wlbuilder = null;

      wlbuilder = wlfactory.getProcessListBuilder(path);
      if (wlbuilder == null)
        throw new ISPACException("No se ha podido construir WLProcessListBuilder");

      CollectionDAO coldao = wlbuilder.getWorklist(cnt, idStagePCD, resp);
      return coldao.disconnect();
    } catch (ISPACException ie) {
      throw new ISPACException("Error en WLWorklist:getProcesses(" + idStagePCD + ")", ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }
Esempio n. 10
0
 public String getDeadlineXML(DbCnt cnt) throws ISPACException {
   // obtener el id del proceso
   int idProcedure = getIdProcedure();
   CollectionDAO collDAO =
       PPlazoDAO.getDeadline(cnt, PRelPlazoDAO.DEADLINE_OBJ_PROCEDURE, idProcedure);
   // con el id del proceso obtener el plazo
   if (collDAO != null) {
     IItemCollection coll = collDAO.disconnect();
     if (coll != null) {
       List collList = coll.toList();
       for (Iterator iter = collList.iterator(); iter.hasNext(); ) {
         IItem element = (IItem) iter.next();
         String plazo = element.getString("PLAZO");
         return plazo;
       }
     }
   }
   return null;
 }
Esempio n. 11
0
  /* (non-Javadoc)
   * @see ieci.tdw.ispac.api.IWorklistAPI#getCreateProcedures()
   */
  public IItemCollection getCreateProcedures() throws ISPACException {
    // Si es supervisor podra crear todos, sino le corresponderan los suyos y y los que pueden crear
    // los que sustituye
    String resp = null;

    DbCnt cnt = context.getConnection();
    try {
      Responsible user = context.getUser();
      SecurityMgr securityMgr = new SecurityMgr(cnt);
      // Comprobar si el usuario tiene asignada la función de Supervisor Total
      if (securityMgr.isSupervisorTotal(user.getUID())) {
        resp = Responsible.SUPERVISOR;
      } else {
        // los que sustituye
        resp = getSubstitutesRespString();
      }

      CollectionDAO pcdset = new CollectionDAO(PProcedimientoDAO.class);

      /* Procedimientos en vigor */
      String sqlquery =
          "WHERE ESTADO="
              + IProcedure.PCD_STATE_CURRENT
              + " AND TIPO="
              + IProcedure.PROCEDURE_TYPE
              + " AND ID IN"
              + " (SELECT ID_PCD FROM SPAC_SS_PERMISOS WHERE  PERMISO="
              + ISecurityAPI.ISPAC_RIGHTS_CREATEEXP
              + DBUtil.addAndInResponsibleCondition("UID_USR", resp)
              + ") ORDER BY NOMBRE";

      pcdset.query(cnt, sqlquery);

      return pcdset.disconnect();
    } catch (ISPACException ie) {
      throw new ISPACException("Error en WLWorklist:getProcs()", ie);
    } finally {
      context.releaseConnection(cnt);
    }
  }
Esempio n. 12
0
  public IItemCollection getPermissionsResp(int typeObject, int idObject, String uid)
      throws ISPACException {

    CollectionDAO coldao = PermissionDAO.getPermissions(mDbCnt, typeObject, idObject, uid);
    return coldao.disconnect();
  }
Esempio n. 13
0
 public IItemCollection getSubstitutes(int idFechSustitucion) throws ISPACException {
   CollectionDAO collDAO = SustitucionDAO.getSubstitutes(mDbCnt, idFechSustitucion);
   return collDAO.disconnect();
 }
Esempio n. 14
0
 public IItemCollection getSubstitutes(String sustitutoUID) throws ISPACException {
   CollectionDAO collDAO = SustitucionDAO.getSubstitutes(mDbCnt, sustitutoUID);
   return collDAO.disconnect();
 }
Esempio n. 15
0
 public IItemCollection getSustitutos(String uidSustituido) throws ISPACException {
   CollectionDAO collDAO = SustitucionDAO.getSustitutos(mDbCnt, uidSustituido);
   return collDAO.disconnect();
 }