Examples of TriggerInfo


Examples of it.eng.spagobi.tools.scheduler.to.TriggerInfo

     
        SchedulerServiceSupplier schedulerService=new SchedulerServiceSupplier();
      String jobName = (String)request.getAttribute("jobName");
      String jobGroupName = (String)request.getAttribute("jobGroupName");
      getSchedule(request, response);
      TriggerInfo tInfo = (TriggerInfo)sessCont.getAttribute(SpagoBIConstants.TRIGGER_INFO);
      StringBuffer message = createMessageSaveSchedulation(tInfo, true,profile);
      // call the web service to create the schedule
      String resp = schedulerService.scheduleJob(message.toString());
      SourceBean schedModRespSB = SchedulerUtilities.getSBFromWebServiceResponse(resp);
      if(schedModRespSB!=null) {
View Full Code Here

Examples of it.eng.spagobi.tools.scheduler.to.TriggerInfo

          SourceBean triggerDetailSB = SchedulerUtilities.getSBFromWebServiceResponse(respStr_gt);     
      String respStr_gj = schedulerService.getJobDefinition(jobName, jobGroupName);
            SourceBean jobDetailSB = SchedulerUtilities.getSBFromWebServiceResponse(respStr_gj);           
      if(triggerDetailSB!=null) {
        if(jobDetailSB!=null){
          TriggerInfo tInfo = SchedulerUtilities.getTriggerInfoFromTriggerSourceBean(triggerDetailSB, jobDetailSB);
          sessCont.setAttribute(SpagoBIConstants.TRIGGER_INFO, tInfo);
        } else {
          throw new Exception("Detail not recovered for job " + jobName +
                          "associated to trigger " + triggerName);
        }
View Full Code Here

Examples of it.eng.spagobi.tools.scheduler.to.TriggerInfo

      RequestContainer reqCont = getRequestContainer();
      SessionContainer sessCont = reqCont.getSessionContainer();
      SessionContainer permSess = sessCont.getPermanentContainer();
      IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
        SchedulerServiceSupplier schedulerService=new SchedulerServiceSupplier();
      TriggerInfo triggerInfo = (TriggerInfo)sessCont.getAttribute(SpagoBIConstants.TRIGGER_INFO);
      JobInfo jobInfo = triggerInfo.getJobInfo();
      String jobName = jobInfo.getJobName();
      String jobGroupName = jobInfo.getJobGroupName();
      String triggername = (String)request.getAttribute("triggername")
      String triggerDescription  = (String)request.getAttribute("triggerdescription")
      String startdate  = (String)request.getAttribute("startdate")
      String starttime = (String)request.getAttribute("starttime")
      String chronstr = (String)request.getAttribute("chronstring");
      String enddate = (String)request.getAttribute("enddate")
      String endtime = (String)request.getAttribute("endtime")
      String repeatinterval = (String)request.getAttribute("repeatInterval");
      triggerInfo.setEndDate(enddate);
      triggerInfo.setEndTime(endtime);
      triggerInfo.setRepeatInterval(repeatinterval);
      triggerInfo.setStartDate(startdate);
      triggerInfo.setStartTime(starttime);
      triggerInfo.setChronString(chronstr);
      triggerInfo.setTriggerDescription(triggerDescription);
      triggerInfo.setTriggerName(triggername);

      Map saveOptions = new HashMap();
      List biobjIds = jobInfo.getBiobjectIds();
      Iterator iterBiobjIds = biobjIds.iterator();
      int index = 0;
      while(iterBiobjIds.hasNext()){
        index ++;
        SaveInfo sInfo = new SaveInfo();
        Integer biobId = (Integer)iterBiobjIds.next();
        String saveassnap = (String)request.getAttribute("saveassnapshot_"+biobId+"__"+index)
        if(saveassnap!=null) {
          sInfo.setSaveAsSnapshot(true);
          String snapname = (String)request.getAttribute("snapshotname_"+biobId+"__"+index)
          sInfo.setSnapshotName(snapname);
          String snapdescr = (String)request.getAttribute("snapshotdescription_"+biobId+"__"+index);
          sInfo.setSnapshotDescription(snapdescr);
          String snaphistlength = (String)request.getAttribute("snapshothistorylength_"+biobId+"__"+index);
          sInfo.setSnapshotHistoryLength(snaphistlength);
       
     
        String sendToJavaClass = (String)request.getAttribute("sendtojavaclass_"+biobId+"__"+index)
        if(sendToJavaClass!=null) {
          sInfo.setSendToJavaClass(true);
          String javaClassPath = (String)request.getAttribute("javaclasspath_"+biobId+"__"+index)
          JavaClassDestination tryClass=null;
          try{
          tryClass=(JavaClassDestination)Class.forName(javaClassPath).newInstance();
          }
          catch (ClassCastException e) {
            logger.error("Error in istantiating class");
            EMFValidationError emfError=new EMFValidationError(EMFErrorSeverity.ERROR, "sendtojavaclass_"+biobId+"__"+index, "12200");
            errorHandler.addError(emfError);
         
          }       
          catch (Exception e) {
            logger.error("Error in istantiating class");
            EMFValidationError emfError=new EMFValidationError(EMFErrorSeverity.ERROR, "sendtojavaclass_"+biobId+"__"+index, "12100");
            errorHandler.addError(emfError);
          }         
          sInfo.setJavaClassPath(javaClassPath);
       
       
       
        String saveasdoc = (String)request.getAttribute("saveasdocument_"+biobId+"__"+index)
        if(saveasdoc!=null) {
          sInfo.setSaveAsDocument(true);
          String docname = (String)request.getAttribute("documentname_"+biobId+"__"+index)
          sInfo.setDocumentName(docname);
          String docdescr = (String)request.getAttribute("documentdescription_"+biobId+"__"+index)
          sInfo.setDocumentDescription(docdescr);
          boolean useFixedFolder = "true".equalsIgnoreCase((String) request.getAttribute("useFixedFolder_"+biobId+"__"+index));
          sInfo.setUseFixedFolder(useFixedFolder);
          if (useFixedFolder) {
            String functIdsConcat = "";
            String tmpValReq = "tree_"+biobId+"__"+index+"_funct_id";
            List functIds = request.getAttributeAsList(tmpValReq)
            Iterator iterFunctIds = functIds.iterator();
            while(iterFunctIds.hasNext()) {
              String idFunct = (String)iterFunctIds.next();
              functIdsConcat += idFunct;
              if(iterFunctIds.hasNext()){
                functIdsConcat += ",";
              }
            }
            sInfo.setFunctionalityIds(functIdsConcat);
          }
          //gestire acquisizione folder
          boolean useFolderDataset = "true".equalsIgnoreCase((String) request.getAttribute("useFolderDataset_"+biobId+"__"+index));
          sInfo.setUseFolderDataSet(useFolderDataset);
          if (useFolderDataset) {
            String dsLabel = (String)request.getAttribute("datasetFolderLabel_"+biobId+"__"+index)
            sInfo.setDataSetFolderLabel(dsLabel);
            String datasetParameterLabel = (String)request.getAttribute("datasetFolderParameter_"+biobId+"__"+index)
            sInfo.setDataSetFolderParameterLabel(datasetParameterLabel);
            if (dsLabel == null || dsLabel.trim().equals("")) {
              BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
              List params = new ArrayList();
              params.add(biobj.getName());
              this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSet", params, "component_scheduler_messages"));
            }
            if (datasetParameterLabel == null || datasetParameterLabel.trim().equals("")) {
              BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
              List params = new ArrayList();
              params.add(biobj.getName());
              this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSetParameter", params, "component_scheduler_messages"));
            }
          //  sInfo.setFunctionalityIds(functIdsConcat);
          }
        }
        String sendmail = (String)request.getAttribute("sendmail_"+biobId+"__"+index)
        if(sendmail!=null) {
          sInfo.setSendMail(true);
          boolean useFixedRecipients = "true".equalsIgnoreCase((String) request.getAttribute("useFixedRecipients_"+biobId+"__"+index));
          sInfo.setUseFixedRecipients(useFixedRecipients);
          if (useFixedRecipients) {
            String mailtos = (String)request.getAttribute("mailtos_"+biobId+"__"+index);
            sInfo.setMailTos(mailtos);
            if (mailtos == null || mailtos.trim().equals("")) {
              BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
              List params = new ArrayList();
              params.add(biobj.getName());
              this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingFixedRecipients", params, "component_scheduler_messages"));
            }
          }
          boolean useDataset = "true".equalsIgnoreCase((String) request.getAttribute("useDataset_"+biobId+"__"+index));
          sInfo.setUseDataSet(useDataset);
          if (useDataset) {
            String dsLabel = (String)request.getAttribute("datasetLabel_"+biobId+"__"+index)
            sInfo.setDataSetLabel(dsLabel);
            String datasetParameterLabel = (String)request.getAttribute("datasetParameter_"+biobId+"__"+index)
            sInfo.setDataSetParameterLabel(datasetParameterLabel);
            if (dsLabel == null || dsLabel.trim().equals("")) {
              BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
              List params = new ArrayList();
              params.add(biobj.getName());
              this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSet", params, "component_scheduler_messages"));
            }
            if (datasetParameterLabel == null || datasetParameterLabel.trim().equals("")) {
              BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
              List params = new ArrayList();
              params.add(biobj.getName());
              this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSetParameter", params, "component_scheduler_messages"));
            }
          }
          boolean useExpression = "true".equalsIgnoreCase((String) request.getAttribute("useExpression_"+biobId+"__"+index));
          sInfo.setUseExpression(useExpression);
          if (useExpression) {
            String expression = (String)request.getAttribute("expression_"+biobId+"__"+index)
            sInfo.setExpression(expression);
            if (expression == null || expression.trim().equals("")) {
              BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
              List params = new ArrayList();
              params.add(biobj.getName());
              this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingExpression", params, "component_scheduler_messages"));
            }
          }
         
          if (!useFixedRecipients && !useDataset && !useExpression) {
            BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
            List params = new ArrayList();
            params.add(biobj.getName());
            this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingRecipients", params, "component_scheduler_messages"))
          }
         
          String mailsubj = (String)request.getAttribute("mailsubj_"+biobId+"__"+index)
          sInfo.setMailSubj(mailsubj);
          String mailtxt = (String)request.getAttribute("mailtxt_"+biobId+"__"+index)
          sInfo.setMailTxt(mailtxt);
        }
        String sendtodl = (String)request.getAttribute("saveasdl_"+biobId+"__"+index)
        if(sendtodl!=null) {
          sInfo.setSendToDl(true);
          sInfo.setBiobjId(biobId.intValue());
          List dlist = DAOFactory.getDistributionListDAO().loadAllDistributionLists()
          Iterator it = dlist.iterator();
          while(it.hasNext()){
            DistributionList dl = (DistributionList)it.next();
            int dlId = dl.getId();
            String listID = (String)request.getAttribute("sendtodl_"+dlId+"_"+biobId+"__"+index);
            if(listID!=null){
              sInfo.addDlId(new Integer(listID));
            }
            else{
             
              DAOFactory.getDistributionListDAO().eraseDistributionListObjects(dl,biobId.intValue(),triggername);
            }
                     
          }
         
        }
       
        saveOptions.put(biobId+"__"+index, sInfo);
      }
      triggerInfo.setSaveOptions(saveOptions);
     
      // check for input validation errors
      if(!this.getErrorHandler().isOKByCategory(EMFErrorCategory.VALIDATION_ERROR)) {
        List functionalities = DAOFactory.getLowFunctionalityDAO().loadAllLowFunctionalities(false);
        response.setAttribute(SpagoBIConstants.FUNCTIONALITIES_LIST, functionalities);
View Full Code Here

Examples of it.eng.spagobi.tools.scheduler.to.TriggerInfo

    String jobName = "";
    try{
        SchedulerServiceSupplier schedulerService=new SchedulerServiceSupplier();
      jobName = (String)request.getAttribute("jobName");
      String jobGroupName = (String)request.getAttribute("jobGroupName");
      TriggerInfo ti = new TriggerInfo();
      String respStr = schedulerService.getJobDefinition(jobName, jobGroupName);
            SourceBean jobDetailSB = SchedulerUtilities.getSBFromWebServiceResponse(respStr);     
      if(jobDetailSB!=null) {
        JobInfo jobInfo = SchedulerUtilities.getJobInfoFromJobSourceBean(jobDetailSB);
        ti.setJobInfo(jobInfo);
        Map saveOptions = new HashMap();
        List biobjids = jobInfo.getBiobjectIds();
        Iterator iterbiobjids = biobjids.iterator();
        int index = 0;
        while(iterbiobjids.hasNext()) {
          index ++;
          Integer idobj = (Integer)iterbiobjids.next();
          saveOptions.put(idobj+"__" + index, new SaveInfo());
        }
        ti.setSaveOptions(saveOptions);
      } else {
        throw new Exception("Cannot recover job " + jobName);
      }   
     
      List functionalities = DAOFactory.getLowFunctionalityDAO().loadAllLowFunctionalities(false);
View Full Code Here

Examples of it.eng.spagobi.tools.scheduler.to.TriggerInfo

   
      currTheme=ThemesManager.getCurrentTheme(reqCont);
      if(currTheme==null)currTheme=ThemesManager.getDefaultTheme();
   
    SessionContainer sessionContainer = reqCont.getSessionContainer();
    TriggerInfo tInfo = (TriggerInfo)sessionContainer.getAttribute(SpagoBIConstants.TRIGGER_INFO);
    String idObjStr = treename.substring(5);
    String indexStr = idObjStr.substring(idObjStr.lastIndexOf("__"));
    Integer idBiobj = Integer.valueOf(idObjStr.substring(0, idObjStr.lastIndexOf("__")));
    Map saveOpts = tInfo.getSaveOptions();
    SaveInfo sInfo = (SaveInfo)saveOpts.get(idBiobj+indexStr);
    String functIdsConcat = sInfo.getFunctionalityIds();
    String[] functIds =  functIdsConcat.split(",");
    for(int i=0; i<functIds.length; i++) {
      String functIdStr = functIds[i];
View Full Code Here

Examples of it.eng.spagobi.tools.scheduler.to.TriggerInfo

   *
   * @return the trigger info from trigger source bean
   */
  public static TriggerInfo getTriggerInfoFromTriggerSourceBean(SourceBean triggerDetSB, SourceBean jobDetSB) {
 
    TriggerInfo tInfo = new TriggerInfo();
    String triggername = (String)triggerDetSB.getAttribute("triggerName")
    String triggerDescription  = (String)triggerDetSB.getAttribute("triggerDescription")
    String startdate  = (String)triggerDetSB.getAttribute("triggerStartDate")
    String starttime = (String)triggerDetSB.getAttribute("triggerStartTime");
    String chronstring = (String)triggerDetSB.getAttribute("triggerChronString");
    String enddate = (String)triggerDetSB.getAttribute("triggerEndDate");
    if(enddate==null) enddate = "";
    String endtime = (String)triggerDetSB.getAttribute("triggerEndTime")
    if(endtime==null) endtime = "";
    String repeatinterval = (String)triggerDetSB.getAttribute("triggerRepeatInterval");
    if(repeatinterval==null) repeatinterval = "";
    tInfo.setEndDate(enddate);
    tInfo.setEndTime(endtime);
    tInfo.setRepeatInterval(repeatinterval);
    tInfo.setStartDate(startdate);
    tInfo.setStartTime(starttime);
    tInfo.setChronString(chronstring);
    tInfo.setTriggerDescription(triggerDescription);
    tInfo.setTriggerName(triggername);
   
    JobInfo jInfo = SchedulerUtilities.getJobInfoFromJobSourceBean(jobDetSB);
    tInfo.setJobInfo(jInfo);
   
    Map saveOptions = new HashMap();
    List biobjIds = jInfo.getBiobjectIds();
    Iterator iterBiobjIds = biobjIds.iterator();
    int index = 0;
    while(iterBiobjIds.hasNext()) {
      index ++;
      SaveInfo sInfo = new SaveInfo();
      Integer biobjid = (Integer)iterBiobjIds.next();
      SourceBean objParSB = (SourceBean)triggerDetSB.getFilteredSourceBeanAttribute("JOB_PARAMETERS.JOB_PARAMETER", "name", "biobject_id_" + biobjid.toString()+"__"+index);
      if(objParSB!=null) {
        String parString = (String)objParSB.getAttribute("value");
        sInfo = SchedulerUtilities.fromSaveInfoString(parString);
      }
      saveOptions.put(biobjid+"__"+index, sInfo);
    }
   
    tInfo.setSaveOptions(saveOptions);
   
    return tInfo;
  }
View Full Code Here

Examples of lineage2.gameserver.stats.triggers.TriggerInfo

              }
              else if (type.equalsIgnoreCase("red"))
              {
                ((List<Integer>) _redSkills[k]).add(augmentationId);
              }
              _allSkills.put(augmentationId, new TriggerInfo(skillId, skillLvL, t, chance));
            }
          }
        }
      }
      if (badAugmantData != 0)
View Full Code Here

Examples of lineage2.gameserver.stats.triggers.TriggerInfo

        break;
      default:
        return 0;
    }
    int resultColor = Rnd.get(0, 3);
    TriggerInfo triggerInfo = null;
    stat12 = Rnd.get(ACC_STAT_SUBBLOCKSIZE);
    if (Rnd.get(1, 100) <= Config.AUGMENTATION_ACC_SKILL_CHANCE)
    {
      stat34 = base + Rnd.get(skillsLength);
      triggerInfo = _allSkills.get(stat34);
View Full Code Here

Examples of lineage2.gameserver.stats.triggers.TriggerInfo

      Element element = iterator.next();
      int id = parseNumber(element.attributeValue("id")).intValue();
      int level = parseNumber(element.attributeValue("level")).intValue();
      TriggerType t = TriggerType.valueOf(element.attributeValue("type"));
      double chance = parseNumber(element.attributeValue("chance")).doubleValue();
      TriggerInfo trigger = new TriggerInfo(id, level, t, chance);
      triggerable.addTrigger(trigger);
      for (Iterator<Element> subIterator = element.elementIterator(); subIterator.hasNext();)
      {
        Element subElement = subIterator.next();
        Condition condition = parseFirstCond(subElement);
        if (condition != null)
        {
          trigger.addCondition(condition);
        }
      }
    }
  }
View Full Code Here

Examples of lineage2.gameserver.stats.triggers.TriggerInfo

        NamedNodeMap map = n.getAttributes();
        int id = parseNumber(map.getNamedItem("id").getNodeValue()).intValue();
        int level = parseNumber(map.getNamedItem("level").getNodeValue()).intValue();
        TriggerType t = TriggerType.valueOf(map.getNamedItem("type").getNodeValue());
        double chance = parseNumber(map.getNamedItem("chance").getNodeValue()).doubleValue();
        TriggerInfo trigger = new TriggerInfo(id, level, t, chance);
        template.addTrigger(trigger);
        for (Node n2 = n.getFirstChild(); n2 != null; n2 = n2.getNextSibling())
        {
          Condition condition = parseCondition(n.getFirstChild());
          if (condition != null)
          {
            trigger.addCondition(condition);
          }
        }
      }
    }
  }
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.