Closed fredgi closed 7 years ago
Finally made it work after updating the CardDavCollection class :
public VCard[] getComponents() throws ObjectStoreException {
try {
DavPropertyNameSet properties = new DavPropertyNameSet();
properties.add(DavPropertyName.GETETAG);
properties.add(CardDavPropertyName.ADDRESS_DATA);
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element filter = DomUtil.createElement(document, CalDavConstants.PROPERTY_FILTER,
CalDavConstants.CARDDAV_NAMESPACE);
ReportInfo info = new ReportInfo(ReportMethod.ADDRESSBOOK_QUERY, 1, properties);
info.setContentElement(filter);
ReportMethod method = new ReportMethod(getPath(), info);
getStore().getClient().execute(method);
if (method.getStatusCode() == DavServletResponse.SC_MULTI_STATUS) {
return method.getVCards();
} else if (method.getStatusCode() == DavServletResponse.SC_NOT_FOUND) {
return new VCard[0];
}
} catch (IOException e) {
e.printStackTrace();
} catch (DOMException e) {
e.printStackTrace();
} catch (DavException e) {
} catch (ParserConfigurationException e) {
e.printStackTrace();
} /* catch (ParserException e) {
e.printStackTrace();
} */
return new VCard[0];
}
Not found yet how to make a Query by fn, phone, nor any vcard property.
Regards, Fred
Hi,
I'm trying to use ical4j-connector to acccess a synology carddav server.
This does not work with the following error :
Which is the response to the following request :
I already tryed to add an empty filter (response is the same without this empty filter).
How can I add some filter ? Error is seen in CardDavCollection class
public VCard[] getComponents() throws ObjectStoreException I don't know how to add a Filter node to the DavPropertyNameSet.
For information, Synology PathResolver is following
I'm using ical4j 2.0.0 with ical4j-connector trunk
Thanks for any help.
Fred