Comments (10)
~9yrs ago... we can close as stale
from caldav4j.
Hi Pascal,
how do you think to implement it? can you write a sample caldav-query?
Peace, R.
Original comment by [email protected]
on 25 Mar 2008 at 2:26
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from caldav4j.
Hi guys,
I also faced the same problem.
For the while, I just loop on all the calendars for a time-range and look up
for the
good SENT_BY...Very inefficient I know :(
Generate such a query would be great.
<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<D:getetag/>
<C:calendar-data/>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:prop-filter name="SENT-BY">
<C:text-match collation="i;ascii-casemap">
mailto:[email protected]
</C:text-match>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>
</C:filter>
</C:calendar-query>
Original comment by cteaudaxis
on 11 Aug 2009 at 8:45
from caldav4j.
did you try with GenerateQuery ?
Original comment by [email protected]
on 17 Aug 2009 at 2:36
from caldav4j.
[deleted comment]
from caldav4j.
In fact, I made a mistake. In the above query, "SENT-BY" is not a Property, but
a
Paramerter of "ORGANIZER". So the query should look like
<?xml version="1.0" encoding="utf-8" ?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<D:getetag/>
<C:calendar-data/>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:prop-filter name="ORGANIZER">
<C:param-filter name="SENT-BY">
<C:text-match collation="i;ascii-casemap">
mailto:[email protected]
</C:text-match>
</C:param-filter>
</C:prop-filter>
</C:comp-filter>
</C:comp-filter>
</C:filter>
</C:calendar-query>
I tried to use GenerateQuery as advised, but there is no getter/setter into
Class
ParamFilter for the variable "name"...Is it missing ? If I have this, I can
create
the necessary "ParamFilter".
Original comment by cteaudaxis
on 18 Aug 2009 at 10:15
from caldav4j.
It seems it's missing. Can you create a test method ParamFilterTest too?
LetMeKnow+Peace,
R.
Original comment by [email protected]
on 24 Aug 2009 at 9:54
- Changed state: Accepted
from caldav4j.
I don't really know where/how to commit (what is my login ? cteaudaxis not
working).
Nevertheless, after adding the getter and setter for name, this is the method I
use,
that can be used as ParamFilterTest:
/**
*
* @param property The Property name to query (i.e: Property.ORGANIZER)
* @param param The Parameter to query (i.e: Parameter.SENT-BY)
* @param textToMatch (i.e: "mailto:[email protected]")
* @return <p>A query matching a given text for the given Property or Parameter of
a VEVENT
* (With priority to the parameter if provided !)</p>
*/
protected CalendarQuery getQueryForPropertyAndParameter(String property, String
param, String textToMatch){
CalendarQuery query = null;
try {
//Generate a basic query
GenerateQuery genQuery = new GenerateQuery();
genQuery.setFilterComponent(Component.VEVENT);
query = genQuery.generateQuery();
CompFilter vEventCompFilter = query.getCompFilter();
//Create the Property Filter with text match to add
PropFilter propFilter = new PropFilter("C");
propFilter.setName(property);
if(!StringUtils.isEmpty(param)){
ParamFilter paramFilter = new ParamFilter("C");
paramFilter.setName(param);
paramFilter.setTextMatch(new TextMatch("C", null, null, null, textToMatch));
propFilter.addParamFilter(paramFilter);
}else{
//filter on property if parameter is empty
propFilter.setTextMatch(new TextMatch("C", null, null, null, textToMatch));
}
//Add the Property filter
vEventCompFilter.addPropFilter(propFilter);
query.setCompFilter(vEventCompFilter);
//Print the query
//System.out.println(GenerateQuery.printQuery(query));
}
catch (CalDAV4JException e) {
log.error(e.getMessage());
}
return query;
}
Original comment by cteaudaxis
on 24 Aug 2009 at 12:24
from caldav4j.
thx! I'll put something like that in the GenerateQuery test.
The game is just add getter/setter and create ae ParamFilterTest like
public class ParamFilterTest {
... testSimpleConstructor() {
ParamFilter p = new ParamFilter("C");
p.validate();
}
.. testSetter() {
ParamFilter p = new ParamFilter("C");
p.setName("newname");
p.validate();
}
}
if you like to join the project you should start with posting junit+patch to
caldav4j
list.
Original comment by [email protected]
on 24 Aug 2009 at 1:14
from caldav4j.
@ioggstream Any inputs?
from caldav4j.
Related Issues (20)
- Remove deprecated methods from CalDAVCollection
- Add owasp dependency check to maven HOT 1
- Remove references to caldav4j test account HOT 3
- How to get shared calendar list using caldav4j from davical? HOT 12
- Discussion: move to CalDAVResource<T extends Serializable> HOT 6
- CI: separate the owasp checks in another circleci job HOT 1
- How to use FreeBusyQuery with caldav4j? HOT 5
- Exception due to closed content stream. HOT 4
- CalendarQuery HOT 8
- Enforce code formatting
- javadoc: set configuration.version=8
- Solve warnings related to unneeded variables
- NoSuchMethodError: net.fortuna.ical4j.model.PropertyList.add HOT 6
- Bump dependency-check to 6.0.1
- Bump source version to 1.7? HOT 4
- Creating a calendar in Radicale HOT 6
- java.lang.IllegalStateException: Connection is still allocated HOT 3
- Generate pom.lock
- Is there a JAR file I could use? HOT 1
- Search by date range not returning results
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caldav4j.