Recent

Author Topic: TvPlanit - party: How to filter for ressources AND cathegories by source?  (Read 648 times)

Nicole

  • Sr. Member
  • ****
  • Posts: 351
Susi and John want to make a great summer party.
To find a good date they want to ask (by source code):

"Display me in week- / month- view only the events from
- ressource  Susi / cathegory private and business
AND in the SAME VIEW
- ressource John/ cathegory family and misc
?"

This means that e.g. Susi's cathegory familiy is hidden als well as John's cathegory business.
And those wicked guy Peter may just use tvplanit, - but will not be invited to any party.
So the whole ressource Peter is hidden as well.

wp

  • Hero Member
  • *****
  • Posts: 10060
TvPlanIt has no filtering capabilities. You must filter the dataset which is linked to the datastore.

Nicole

  • Sr. Member
  • ****
  • Posts: 351
Thank you for your reply.

I have to decide between ini and Firebird as datastore.
Will it be possible in the ini-datastore to filter?
About the zeos-data-store, - I have not idea about it.
So filter may be hard.

But I speak Firebird SQL quite will.
I used it with Delphi and Firedac / Flamerobin.
If tvplanit allows me to use SQL as I know it, I will solve it easily.

At the moment I cannot decide between Firebird and ini.
Ini is much more light-weight.

So my question is: Can I filter the datastore, if I use an ini-file as tvplanit-datasource?

wp

  • Hero Member
  • *****
  • Posts: 10060
As I said, filtering is not implemented.

A "poor man's" filtering idea would be:
- add a field FHidden to the TVpEvent
- the day/week/month views only display an even when it is not hidden.
- add an event handler OnFilter to TVpResource; it has the event to be filtered as parameter. The handler sets event.Hidden to true, when the event should be removed.
- provide a boolean property Filtered in TVpResource which, when changed, iterates over all events and fires the OnFilter event (if Filtered=true) or deletes the event.Hidden flag if Filtered = false.

However, this probably is low-performance because it does not take advantage of the database capabilities. On the pro side would be that it works also for the non-database datastores.

Nicole

  • Sr. Member
  • ****
  • Posts: 351
Thank you for the answer.
I am afraid, I have not only understood half of it. Is there anywhere a tutorial for this elements?
I studied the turorial in the examples, but as far as I remember, such sophisticated details are not part of it.

I think, I want both:
Knowing the things, you mentioned in your posting for many purposes and use a filter for many purposes.
And I found in the fb-example a prefab SQL-query. Such queries shall give me search-results very nicely.
SQL requests are nice to debug as well as they give resulst on scratch.

btw datastore:
I cried of joy as I found in an example popup-menue "import ical" and I tried. It worked at sudden.
Is there a good way to encaplsula (can we say this?) such ical downloads and to import it as test?
The idea is, that such downloads from the internet may mess the whole database with unwanted verbose events.
My idea at them moment is:
Create a new ressource, import the ical there and delete the ressource as a bundle in the worst case.
Is this a good way?
The disadvantage is, that it is too tricky for a DAU like me in 2 years, who will not be able to remember this way any more.

wp

  • Hero Member
  • *****
  • Posts: 10060
Thank you for the answer.
I am afraid, I have not only understood half of it. Is there anywhere a tutorial for this elements?
I studied the turorial in the examples, but as far as I remember, such sophisticated details are not part of it.
Sorry to have confused you. These notes were mainly written to myself, just an idea how filtering could be implemented in the datastore itself. But I am not sure if this is the correct path. And I am also not sure if I want to implement filtering in tvplanit at all. This has not been in the mind of the original authors, and somehow I have the feeling that stuffing too many features into these components could blow them into pieces...

Ideally filtering should be done by the database - that's what it is made for. Unfortunately I am not very experienced with the large database systems.

btw datastore:
I cried of joy as I found in an example popup-menue "import ical" and I tried. It worked at sudden.
Is there a good way to encaplsula (can we say this?) such ical downloads and to import it as test?
The idea is, that such downloads from the internet may mess the whole database with unwanted verbose events.
My idea at them moment is:
Create a new ressource, import the ical there and delete the ressource as a bundle in the worst case.
Is this a good way?
The disadvantage is, that it is too tricky for a DAU like me in 2 years, who will not be able to remember this way any more.
There is not much mind-power behind the ical import - use it or not, it's your responsibility to not get flooded by the mess out there. I think your idea is correct, but I would not even use your main database for a test import: Move the ical test into a separate form, add a temporary ini datastore and a contactviewer, import and check the ical file, delete those items that you don't need. Then iterate over all remaining contacts and copy them to your main datastore. In the end, when the test form is closed, delete the ini file.

Nicole

  • Sr. Member
  • ****
  • Posts: 351
This "delete the inifile", - this is a very nice idea. I like sandbox ways.

And here I am reading your first idea again, "too many features may blow up". This is so true!
I clone a "small" Delphi applicaton of mine at the moment. I have programmed pop-ups and functions I could not even remember, that I ever had done! I wasted time with programming and debugging and they were of that little use, that I simply forgot them completely.

Thank you for reminding me...

wp

  • Hero Member
  • *****
  • Posts: 10060
btw datastore:
I cried of joy as I found in an example popup-menue "import ical" and I tried. It worked at sudden.
Is there a good way to encaplsula (can we say this?) such ical downloads and to import it as test?
The idea is, that such downloads from the internet may mess the whole database with unwanted verbose events.
My idea at them moment is:
Create a new ressource, import the ical there and delete the ressource as a bundle in the worst case.
Is this a good way?
The disadvantage is, that it is too tricky for a DAU like me in 2 years, who will not be able to remember this way any more.
There is not much mind-power behind the ical import - use it or not, it's your responsibility to not get flooded by the mess out there. I think your idea is correct, but I would not even use your main database for a test import: Move the ical test into a separate form, add a temporary ini datastore and a contactviewer, import and check the ical file, delete those items that you don't need. Then iterate over all remaining contacts and copy them to your main datastore. In the end, when the test form is closed, delete the ini file.
This work-around is not necessary any more with the new revision 8377 on ccr. When the "Preview" parameter of the ImportICalFile function is set to true a simple preview form is opened which lists the ical items to be imported, but without actually adding them to the datastore. Each item has a checkbox, and only the checked items are imported when the preview form is closed for import.

Nicole

  • Sr. Member
  • ****
  • Posts: 351
Have not fully understood, but I am thankful for the improvement. I will grab it and onTrying  :) I will understand.

 

TinyPortal © 2005-2018