Esempio n. 1
0
        public EDSTask(CalComponent task, EDSCategory category)
        {
            this.name = task.Summary;
            Logger.Debug("Creating New Task Object : {0}", this.name);
            this.id             = task.Uid;
            this.category       = category;
            this.completionDate = task.Dtend;
            this.taskComp       = task;

            if (task.Status == CalStatus.Completed)
            {
                this.state = TaskState.Completed;
            }
            else
            {
                this.state = TaskState.Active;
            }

            //Descriptions
            notes = new List <INote>();

            foreach (string description in task.Descriptions)
            {
                EDSNote edsNote = new EDSNote(description);
                Logger.Debug("Note :" + description);
                notes.Add(edsNote);
            }
        }
Esempio n. 2
0
        private Indexable TodoToIndexable(CalComponent cc)
        {
            Indexable indexable = new Indexable(GetComponentUri(cc));

            indexable.Timestamp = cc.Dtstart;
            indexable.HitType   = "Task";

            indexable.AddProperty(Property.NewUnsearched("fixme:source_uid", this.source.Uid));
            indexable.AddProperty(Property.NewUnsearched("fixme:uid", cc.Uid));

            indexable.AddProperty(Property.NewDate("fixme:starttime", cc.Dtstart.ToUniversalTime()));

            if (cc.Dtend != DateTime.MinValue)
            {
                indexable.AddProperty(Property.NewDate("fixme:endtime", cc.Dtend.ToUniversalTime()));
            }

            foreach (string description in cc.Descriptions)
            {
                indexable.AddProperty(Property.New("fixme:description", description));
            }

            indexable.AddProperty(Property.New("fixme:summary", cc.Summary));

            foreach (string category in cc.Categories)
            {
                indexable.AddProperty(Property.NewUnsearched("fixme:category", category));
            }

            return(indexable);
        }
Esempio n. 3
0
        public ITask CreateTask(string taskName, ICategory category)
        {
            Gtk.TreeIter taskIter;
            EDSTask      edsTask;

            if (category == null)
            {
                return(null);
            }

            if (category is Tasque.AllCategory && defaultCategory != null)
            {
                category = this.defaultCategory;
            }

            EDSCategory  edsCategory = category as EDSCategory;
            CalComponent task        = new CalComponent(edsCategory.TaskList);

            task.Summary = taskName;

            lock (taskLock) {
                edsTask  = new EDSTask(task, edsCategory);
                taskIter = taskStore.AppendNode();
                taskStore.SetValue(taskIter, 0, edsTask);
                taskIters [task.Uid] = taskIter;
            }

            task.Commit();

            return(edsTask);
        }
Esempio n. 4
0
        private Indexable MemoToIndexable(CalComponent cc)
        {
            Indexable indexable = new Indexable(GetComponentUri(cc));

            indexable.Timestamp = cc.Dtstart;
            indexable.HitType   = "Note";
            indexable.Filtering = IndexableFiltering.AlreadyFiltered;

            indexable.AddProperty(Property.NewUnsearched("fixme:application", "evolution"));

            indexable.AddProperty(Property.New("dc:title", cc.Summary));

            // We remember the note's text so that we can stuff it in
            // the TextCache later.
            // This is here form compability with Tomboy notes.
            foreach (string description in cc.Descriptions)
            {
                queryable.IndexableTextCache [indexable.Uri] = description;

                StringReader reader = new StringReader(description);
                indexable.SetTextReader(reader);
            }

            return(indexable);
        }
Esempio n. 5
0
        private Indexable EventToIndexable(CalComponent cc)
        {
            Indexable indexable = new Indexable(GetComponentUri(cc));

            indexable.Timestamp = cc.Dtstart;
            indexable.HitType   = "Calendar";

            indexable.AddProperty(Property.NewUnsearched("fixme:source_uid", this.source.Uid));
            indexable.AddProperty(Property.NewUnsearched("fixme:uid", cc.Uid));

            indexable.AddProperty(Property.NewDate("fixme:starttime", cc.Dtstart.ToUniversalTime()));

            if (cc.Dtend != DateTime.MinValue)
            {
                indexable.AddProperty(Property.NewDate("fixme:endtime", cc.Dtend.ToUniversalTime()));
            }

            foreach (CalComponentAttendee attendee in cc.Attendees)
            {
                indexable.AddProperty(Property.New("fixme:attendee", attendee.value));
            }

            foreach (string comment in cc.Comments)
            {
                indexable.AddProperty(Property.New("fixme:comment", comment));
            }

            foreach (string description in cc.Descriptions)
            {
                indexable.AddProperty(Property.New("fixme:description", description));
            }

            indexable.AddProperty(Property.New("fixme:summary", cc.Summary));

            foreach (string category in cc.Categories)
            {
                indexable.AddProperty(Property.NewUnsearched("fixme:category", category));
            }

            indexable.AddProperty(Property.New("fixme:location", cc.Location));

            return(indexable);
        }
Esempio n. 6
0
        /////////////////////////////////////

        private Indexable CalComponentToIndexable(CalComponent cc)
        {
            switch (cal_source_type)
            {
            case CalSourceType.Event:
                return(EventToIndexable(cc));

                break;

            case CalSourceType.Todo:
                return(TodoToIndexable(cc));

                break;

            case CalSourceType.Journal:
                return(MemoToIndexable(cc));

                break;
            }

            return(null);
        }
Esempio n. 7
0
        public EDSTask(CalComponent task, EDSCategory category)
        {
            this.name = task.Summary;
                       Logger.Debug ("Creating New Task Object : {0}",this.name);
                       this.id = task.Uid;
                       this.category = category;
                       this.completionDate = task.Dtend;
                       this.taskComp = task;

               if (task.Status == CalStatus.Completed)
                   this.state = TaskState.Completed;
               else
                   this.state = TaskState.Active;

               //Descriptions
               notes = new List<INote>();

               foreach(string description in task.Descriptions) {
                   EDSNote edsNote = new EDSNote (description);
                   Logger.Debug ("Note :" + description);
                   notes.Add(edsNote);
               }
        }
Esempio n. 8
0
		private Indexable EventToIndexable (CalComponent cc)
		{
			Indexable indexable = new Indexable (GetComponentUri (cc));
			indexable.Timestamp = cc.Dtstart;
			indexable.HitType = "Calendar";

			indexable.AddProperty (Property.NewUnsearched ("fixme:source_uid", this.source.Uid));
			indexable.AddProperty (Property.NewUnsearched ("fixme:uid", cc.Uid));

			indexable.AddProperty (Property.NewDate ("fixme:starttime", cc.Dtstart.ToUniversalTime ()));

			if (cc.Dtend != DateTime.MinValue)
				indexable.AddProperty (Property.NewDate ("fixme:endtime", cc.Dtend.ToUniversalTime ()));

			foreach (CalComponentAttendee attendee in cc.Attendees)
				indexable.AddProperty (Property.New ("fixme:attendee", attendee.value));

			foreach (string comment in cc.Comments)
				indexable.AddProperty (Property.New ("fixme:comment", comment));
			
			foreach (string description in cc.Descriptions)
				indexable.AddProperty (Property.New ("fixme:description", description));

			indexable.AddProperty (Property.New ("fixme:summary", cc.Summary));

			foreach (string category in cc.Categories)
				indexable.AddProperty (Property.NewUnsearched ("fixme:category", category));

			indexable.AddProperty (Property.New ("fixme:location", cc.Location));

			return indexable;
		}
Esempio n. 9
0
		private Indexable MemoToIndexable (CalComponent cc)
		{
			Indexable indexable = new Indexable (GetComponentUri (cc));
			indexable.Timestamp = cc.Dtstart;
			indexable.HitType = "Note";
			indexable.Filtering = IndexableFiltering.AlreadyFiltered;

			indexable.AddProperty (Property.NewUnsearched ("fixme:application","evolution"));

			indexable.AddProperty (Property.New ("dc:title", cc.Summary));

			// We remember the note's text so that we can stuff it in
			// the TextCache later.
			// This is here form compability with Tomboy notes.
			foreach (string description in cc.Descriptions) {
				queryable.IndexableTextCache [indexable.Uri] = description;

				StringReader reader = new StringReader (description);
				indexable.SetTextReader (reader);
			}

			return indexable;
		}
Esempio n. 10
0
		/////////////////////////////////////

		private Indexable CalComponentToIndexable (CalComponent cc)
		{
			switch (cal_source_type) {
			case CalSourceType.Event:
				return EventToIndexable (cc);
				break;

			case CalSourceType.Todo:
				return TodoToIndexable (cc);
				break;

			case CalSourceType.Journal:
				return MemoToIndexable (cc);
				break;
			}			

			return null;
		}
Esempio n. 11
0
		/////////////////////////////////////

		private void AddCalComponent (CalComponent cc)
		{
			Indexable indexable = CalComponentToIndexable (cc);
			this.queryable.ScheduleIndexable (indexable, this.priority);
		}
Esempio n. 12
0
		/////////////////////////////////////
			
		// URI scheme is:
		// calendar:///?source-uid=<value>&comp-uid=<value>[&comp-rid=value]
		//
		// The Uri class sucks SO MUCH ASS.  It shits itself
		// on foo:///?bar so we have to insert something in
		// before "?bar".  This is filed as Ximian bug #76146.
		// Hopefully it is just a bug in Mono and not a
		// fundamental problem of the Uri class.  Fortunately
		// Evolution can handle the horribly mangled URIs
		// that come out of it.

		private Uri GetComponentUri (CalComponent cc)
		{
			return GetComponentUri (cc.Uid);
		}
Esempio n. 13
0
        /////////////////////////////////////

        private void AddCalComponent(CalComponent cc)
        {
            Indexable indexable = CalComponentToIndexable(cc);

            this.queryable.ScheduleIndexable(indexable, this.priority);
        }
Esempio n. 14
0
        /////////////////////////////////////

        // URI scheme is:
        // calendar:///?source-uid=<value>&comp-uid=<value>[&comp-rid=value]
        //
        // The Uri class sucks SO MUCH ASS.  It shits itself
        // on foo:///?bar so we have to insert something in
        // before "?bar".  This is filed as Ximian bug #76146.
        // Hopefully it is just a bug in Mono and not a
        // fundamental problem of the Uri class.  Fortunately
        // Evolution can handle the horribly mangled URIs
        // that come out of it.

        private Uri GetComponentUri(CalComponent cc)
        {
            return(GetComponentUri(cc.Uid));
        }
Esempio n. 15
0
        public ITask CreateTask(string taskName, ICategory category)
        {
            Gtk.TreeIter taskIter;
               EDSTask edsTask;

                       if (category == null )
                               return null;

               if (category is Tasque.AllCategory && defaultCategory != null)
                   category = this.defaultCategory;

                       EDSCategory edsCategory = category as EDSCategory;
                       CalComponent task = new CalComponent (edsCategory.TaskList);
                       task.Summary = taskName;

                       lock (taskLock) {
                   edsTask = new EDSTask (task, edsCategory);
                   taskIter = taskStore.AppendNode ();
                   taskStore.SetValue (taskIter, 0, edsTask);
                   taskIters [task.Uid] = taskIter;
               }

                       task.Commit ();

                       return edsTask;
        }