Package com.centraview.common

Examples of com.centraview.common.TimeSlipList


      timeSlipColumns.addElement("CreatedBy");
      timeSlipColumns.addElement("Date");
      timeSlipColumns.addElement("StartTime");
      timeSlipColumns.addElement("EndTime");

      TimeSlipList timesliplist = new TimeSlipList();

      ListGenerator lg = ListGenerator.getListGenerator(dataSource); //get the List Generator object for Listing

      String searchTimeSlipString =
        "ADVANCE:select ts.TimeSlipID, ts.Description, ts.CreatedBy, individual.FirstName,"
View Full Code Here


      timeSlipColumns.addElement("Date");
      timeSlipColumns.addElement("StartTime");
      timeSlipColumns.addElement("EndTime");
      timeSlipColumns.addElement("Duration");

      TimeSlipList timesliplist = new TimeSlipList();
      ListGenerator lg = ListGenerator.getListGenerator(dataSource);

      String searchTimeSlipString = "ADVANCE:select ts.TimeSlipID, ts.Description, ts.CreatedBy, individual.FirstName," + "individual.LastName, ts.BreakTime, ts.Date, ts.Start, ts.End " + "from timeslip ts left outer join individual on " + "ts.CreatedBy = individual.IndividualID where ts.ticketid=" + ticketID;

      timesliplist = (TimeSlipList)lg.getTimeSlipList(individualID, 1, 200, searchTimeSlipString, "Description");
View Full Code Here

    return;
  }

  public TimeSlipList getAllTimeSlipList(int userID, HashMap info)
  {
    TimeSlipList timeSlipList = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectListsLocalHome home = (ProjectListsLocalHome)ic.lookup("local/ProjectLists");
      ProjectListsLocal remote = (ProjectListsLocal)home.create();
      remote.setDataSource(this.dataSource);
View Full Code Here

    return;
  }

  public TimeSlipList getTimeSlipListForProject(int userId, int projectId, HashMap info)
  {
    TimeSlipList timeSlipList = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectListsLocalHome home = (ProjectListsLocalHome)ic.lookup("local/ProjectLists");
      ProjectListsLocal remote = (ProjectListsLocal)home.create();
      remote.setDataSource(this.dataSource);
View Full Code Here

    return timeSlipList;
  }

  public TimeSlipList getTimeSlipListForProject(int userId, int projectId)
  {
    TimeSlipList timeSlipList = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      ProjectListsLocalHome home = (ProjectListsLocalHome)ic.lookup("local/ProjectLists");
      ProjectListsLocal remote = (ProjectListsLocal)home.create();
      remote.setDataSource(this.dataSource);
View Full Code Here

      DisplayList displaylistSession = ( DisplayList )session.getAttribute( "displaylist") ;

      DisplayList displaylist = ( DisplayList )request.getAttribute( "displaylist") ;

      TimeSlipList DL= null;
      if( displaylist == null  )
      {
         ListGenerator lg = ListGenerator.getListGenerator(dataSource);

         DL = ( TimeSlipList )lg.getTimeSlipList( userobjectd.getIndividualID() , 1,listpreference.getRecordsPerPage() , "" ,listpreference.getSortElement());
View Full Code Here

      cvdl.setSqlQuery(strQuery);
      Collection col;
      col = cvdl.executeQuery();
      Iterator it = col.iterator();
      int i=0 ;
      TimeSlipList timeSlipList = new TimeSlipList();
      while( it.hasNext() )
      {
        i++;
        HashMap hm = ( HashMap  )it.next();
        int timeSlipID = ((Long)hm.get("TimeSlipID")).intValue();

        StringMember  reference = null, description, projectName = null, taskName =null, createdBy=null;
        PureDateMember date=null;
        PureTimeMember startTime=null, endTime=null;
        IntMember creator, taskId;
        IntMember referencetype = new IntMember( "Reference" ,0 , 10 , "", 'T' , true , 10 );

        IntMember intmem = new IntMember( "ID" , timeSlipID , 10 , "URL", 'T' , true , 10 );
        //IntMember projectId = new IntMember( "ProjectID" , projectID , 10 , "URL", 'T' , true , 10 );

        Time tStartTime = (Time)hm.get("Start");
        Time tEndTime = (Time)hm.get("End");

        Calendar calendarStart = Calendar.getInstance();
        calendarStart.setTime(tStartTime);

        Calendar calendarEnd = Calendar.getInstance();
        calendarEnd.setTime(tEndTime);

        //int startHrsmm[] = CVUtility.convertTimeTo24HrsFormat(StartTime);
        int startHrs = calendarStart.get(Calendar.HOUR_OF_DAY);//startHrsmm[0];
        int startMins = calendarStart.get(Calendar.MINUTE);//startHrsmm[1];

        //int endHrsmm[] = CVUtility.convertTimeTo24HrsFormat(EndTime);
        int endHrs = calendarEnd.get(Calendar.HOUR_OF_DAY);//endHrsmm[0];
        int endMins = calendarEnd.get(Calendar.MINUTE);//endHrsmm[1];


        float Duration = 0;

        Double dBreakTime = (Double)hm.get("BreakTime");
        float BreakTime = dBreakTime.floatValue();
        float remMin = 0;

        if ( startMins != 0 && endMins != 0 && (startMins-endMins !=0))
        {
          if(endMins > startMins)
            remMin = 60/(endMins - startMins);
          else
            remMin = 60/(startMins - endMins);
        }


        Duration = (endHrs - startHrs) + remMin - BreakTime ;

        totalDuration += Duration;


        if( hm.get( "ActivityID" ) != null && hm.get( "ProjectID" ) !=null  && hm.get( "TicketID" ) !=null ){

          int activityId = ((Integer)hm.get("ActivityID")).intValue();
          int projectId = ((Long)hm.get("ProjectID")).intValue();
          int ticketId = ((Long)hm.get("TicketID")).intValue();

          if( projectId != 0){

            String title = " Project : ";
            strQuery = "select ProjectTitle from project where ProjectID = "+projectId;
            cvdl.setSqlQuery(strQuery);
            Collection colProject = null;
            colProject = cvdl.executeQuery();

            if (colProject != null)
            {
              Iterator projectIterator = colProject.iterator();
              while( projectIterator.hasNext() )
              {
                HashMap hm1 = ( HashMap  )projectIterator.next();
                title = title + (String) hm1.get( "ProjectTitle" );
              }
            }

            if( activityId != 0){
              strQuery = "select Title from activity where activityId = "+activityId;
              cvdl.setSqlQuery(strQuery);
              Collection colActivity = null;
              colActivity = cvdl.executeQuery();
              if (colActivity != null)
              {

                Iterator activityIterator = colActivity.iterator();
                while( activityIterator.hasNext() )
                {
                  HashMap hm1 = ( HashMap  )activityIterator.next();
                  title = title +"/"+ (String) hm1.get( "Title" );
                }
              }
            }

            reference  = new StringMember( "Reference", title ,10 , "", 'T' , false  );
          }




          if( ticketId != 0){

            strQuery = "select subject from ticket where ticketid = "+ticketId;
            cvdl.setSqlQuery(strQuery);
            Collection colTicket = null;
            colTicket = cvdl.executeQuery();
            if (colTicket != null)
            {
              Iterator itTicket = colTicket.iterator();
              while( itTicket.hasNext() )
              {
                HashMap hm1 = ( HashMap  )itTicket.next();
                reference  = new StringMember( "Reference", " Ticket : "+(String) hm1.get( "subject" ,10 , "", 'T' , false  );
              }
            }

          }
        }
        else{
          referencetype = new IntMember( "ReferenceType" ,4 , 10 , "", 'T' , true , 10 );
          reference  = new StringMember( "Reference", "" ,10 , "", 'T' , false  );
        }

        if( hm.get( "Description" ) !=null)
          description  = new StringMember( "Description", (String) hm.get( "Description" ) ,10 , "", 'T' , false  );
        else
          description  = new StringMember( "Description", "" ,10 , "", 'T' , false  );



        if( hm.get( "Date" ) !=null)
          date  = new PureDateMember( "Date" ,(java.util.Date)hm.get("Date"),10 , "URL" , 'T' , false ,100 ,"EST");
        else
          date  = new PureDateMember( "Date" ,null,10 , "URL" , 'T' , false ,100 ,"EST"  );

        if( hm.get( "Start" ) !=null)
          startTime  = new PureTimeMember( "StartTime" ,(java.util.Date)hm.get("Start"),10 , "URL" , 'T' , false ,100 ,"EST");
        else
          startTime  = new PureTimeMember( "StartTime" ,null,10 , "URL" , 'T' , false ,100 ,"EST");


        if( hm.get( "End" ) !=null)
          endTime  = new PureTimeMember( "EndTime" ,(java.util.Date)hm.get("End"),10 , "URL" , 'T' , false ,100 ,"EST");
        else
          endTime  = new PureTimeMember( "EndTime" ,null,10 , "URL" , 'T' , false ,100 ,"EST");


        TimeSlipListElement ele = new TimeSlipListElement(timeSlipID);
        ele.put("ID", intmem );
        ele.put("Description", description );
        ele.put("Reference", reference );
        ele.put("ReferenceType", referencetype );
        ele.put("Task" ,  taskName );
        if ( Duration > 1.0 )
        {
          StringMember duration = new StringMember( "Duration" , Float.toString(Duration)+ " hours"  , 10 , "URL", 'T' , false );
          ele.put("Duration" ,  duration );
        }
        else if ( Duration == 1.0 )
        {
          StringMember duration = new StringMember( "Duration" , Float.toString(Duration)+ " hour"  , 10 , "URL", 'T' , false );
          ele.put("Duration" ,  duration );
        }
        else if ( Duration > 0.0 && Duration < 1.0 )
        {
             StringMember duration = new StringMember( "Duration" , Float.toString(Duration*60)+ " minutes"  , 10 , "URL", 'T' , false );
          ele.put("Duration" ,  duration );
        }
        else
        {
             StringMember duration = new StringMember( "Duration" , ""  , 10 , "URL", 'T' , false );
          ele.put("Duration" ,  duration );
        }
        ele.put("Date" , date );
        ele.put("StartTime" , startTime);
        ele.put("EndTime" , endTime);

        StringBuffer sb = new StringBuffer("00000000000");
        sb.setLength(11);
        String str = (new Integer(i)).toString();
        sb.replace((sb.length()-str.length()),(sb.length()),str);
        String newOrd = sb.toString();
        timeSlipList.put(newOrd , ele);
        //timeSlipList.setTotalNoOfRecords( timeSlipList.size() );
        timeSlipList.setListType( "Timeslip" );
        //Set timeslip list in vo
        tvo.setTimeSlipList(timeSlipList);


        tvo.setTotalDuration(totalDuration);
View Full Code Here

TOP

Related Classes of com.centraview.common.TimeSlipList

Copyright © 2018 www.massapicom. 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.