Sun Java System Calendar Server 6 2005Q4 Developer's Guide

Command: search_calprops

Purpose

Search for a calendar’s properties.

Parameters

Table 7–28 search_calprops Parameters

Parameter  

Type  

Purpose  

Required  

Default  

calid

integer (0,1)

A boolean indicating whether or not to search the calid property.

1 = Search the calid property

0 = Do not search it.

0, unless both primaryOwner and name are 0

id

unique identifier string 

The session identifier. 

N/A 

maxResults

integer 

The maximum number of results to return. 

200

name

integer (0,1)

A boolean indicating whether or not to search the name property.

1 = Search the name property0 = Do not search it.

0

primaryOwner

integer (0,1)

A boolean indicating whether or not to search the primaryOwner property.

1 = Search the primaryOwner property.0 = Do not search it.

0

searchOpts

integer 

0,1,2,3

How to perform the search. One of the following: 

0 = CONTAINS

1 = BEGINS_WITH

2 = ENDS_WITH

3 = EXACT

0

search-string

string 

The string to search for in calendars. 

N/A 

Description

This command requests a search for a calendar using the query type specified by searchOpts. WCAP returns the calendar properties for all calendars where a value in the one of the properties, primaryOwner, calid, name, exactly matches the search-string given in the search-string parameter. If there are multiple matches, it returns all of them, up to the maximum number of matches specified in maxResults.

When searching for the primary owner, the internal search filter is set to find exact matches. If you want to allow the system to perform wildcard searches, such that the search string appears anywhere within the property value, then you must edit the ics.conf file by uncommenting the following line:

!service.calendarsearch.ldap.primaryownersearchfilter = "(&(|(uid=*%s*)(cn=*%s*))(objectclass=icsCalendarUser))"


Caution – Caution –

Enabling the wildcard search can negatively impact performance.


Search Properties

This command searches for a match in one of three properties:

To search for the value of a specific property, set that parameter to 1. If both primaryOwner and name are set to 0, calid defaults to 1 and the server assumes the search-string is a calid, regardless of the calid parameter setting.

Search Options

The four search options are the following:

Example

The following example URL searches all calendars for the primary owner property, primaryOwner=1 to see if it contains (searchOpts=0) the string jdoe:


http://calendarserver/search_calprops.wcap
               ?id=n3o3m05sx9v6t98t8u2p
               &search-string=jdoe
               &primaryOwner=1
               &searchOpts=0
               &maxResults=50
               &fmt-out=text/calendar

The following data is a result of the example URL above:

BEGIN:VCALENDAR
PRODID:-//SunONE/Calendar Hosting Server//EN
METHOD:PUBLISH
VERSION:6.0
 X-NSCP-CALPROPS-LAST-MODIFIED:20011208T005613Z
X-NSCP-CALPROPS-CREATED:20010913T223336Z
X-NSCP-CALPROPS-READ:999
X-NSCP-CALPROPS-WRITE:999
X-NSCP-CALPROPS-RELATIVE-CALID:jdoe
X-NSCP-CALPROPS-NAME:John Doe
X-NSCP-CALPROPS-LANGUAGE:en
X-NSCP-CALPROPS-PRIMARY-OWNER:jdoe
X-NSCP-CALPROPS-TZID:America/Los_Angeles
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^c^WDEIC^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^a^RSF^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^a^frs^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^c^^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^a^frs^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^c^dw^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^a^rs^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^c^w^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^p^r^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:lucy^p^r^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:jjones^p^r^g
X-NSCP-CALPROPS-RESOURCE:0
X-NSCP-WCAP-ERRNO:0
END:VCALENDAR
BEGIN:VCALENDAR
PRODID:-//SunONE/Calendar Hosting Server//EN
METHOD:PUBLISH
VERSION:6.0
X-NSCP-CALPROPS-LAST-MODIFIED:20010917T213724Z
X-NSCP-CALPROPS-CREATED:20010917T213724Z
X-NSCP-CALPROPS-READ:999
X-NSCP-CALPROPS-WRITE:999
X-NSCP-CALPROPS-RELATIVE-CALID:jdoe:sports
X-NSCP-CALPROPS-NAME:Sports Calendar
X-NSCP-CALPROPS-LANGUAGE:en
X-NSCP-CALPROPS-PRIMARY-OWNER:jdoe
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^c^WDEIC^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@@o^a^RSF^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^a^^g
X-NSCP-CALPROPS-ACCESS-CONTROL-ENTRY:@^c^^g
X-NSCP-CALPROPS-RESOURCE:0
X-NSCP-WCAP-ERRNO:0
END:VCALENDAR