infoRouter Document Management System - Web Services API Documentation
Search
Prepares a search results using given criteria in xml format.
Syntax
[Visual Basic]
Public Shared Function Search(Byval AuthenticationTicket as string, _
ByVal xmlcriteria As String, _
ByVal SortBy As String, _
ByVal AscendingOrder As Boolean) as xmldocument
Parameters

AuthenticationTicket

infoRouter Authentication Ticket

xmlcriteria

The xml structure of the criterias.To Details of this parameter see the remarks section.

SortBy

Possible Sort Options :
DOCUMENTNAME, DOCUMENTSIZE, MIMETYPEDESCRIPTION, MODIFICATIONDATE, STATUSCODE, FOLDERNAME, LASTVERSIONNUMBER, PERCENTCOMPLETE, CREATIONDATE, MODIFIEDBYNAME,
DESCRIPTION, OWNERNAME, FLOWNAME, VIEW, CHECKEDOUTBYNAME, COMPLETIONDATE, IMPORTANCE, RETAINUNTIL, CLEVEL, DECLASSIFYON, DOWNGRADEON, DISPOSITIONDATE, LASTISOREVIEW, NEXTISOREVIEW

AscendingOrder

Boolean value can be true or false


Return Value
returns xml fragment.
<response success="true" error="" ranksorted="False">
if success attribute is "true", the search result has been prepared successfully.
if success attribute is "false", the error attribute indicates the encountered error.
if ranksorted attribute is "true" the results are always ordered by rank.
This occurs in cases where keyword criteria are specified.
Remarks
The Search Criteria XML fragment should be as described below.

<SEARCH>
<ITEM NAME="SEARCHSCOPE" VALUE="" />
<ITEM NAME="DOCUMENTNAME" VALUE="" />
<ITEM NAME="KEYWORDS" VALUE="" />
<ITEM NAME="USERNAME" VALUE="" />
<ITEM NAME="FOLDER" VALUE="" />
<ITEM NAME="CHECKOUTSTATUS" VALUE="" />
<ITEM NAME="DATECRITERIA" SUBTYPE="" OPERATOR="" VALUE="" />
<ITEM NAME="SIZEIS" OPERATOR="" VALUE="" />
<ITEM NAME="IMPORTANCE" OPERATOR="" VALUE="" />
<ITEM NAME="CLEVEL" VALUE="" />
<ITEM NAME="DOCUMENTTYPE" VALUE="" />
<ITEM NAME="VIEWCRITERIA" VALUE="" />
<ITEM NAME="PROPERTYSETNAME" VALUE="">
<ATTR NAME="" OPERATOR="" VALUE="" />
</ITEM>
</SEARCH>

criteria details

SEARCHSCOPE

ONLINE - Online Only
ALL - All Documents
ARCHIVE - Archive Only
ONLINE-HIDDENS - Online including Hiddens

if this parameters not specified all documents will be searched.


DOCUMENTNAME : Name of the document. You may use an asterisk (*) to indicate that you have specified a partial document name.
such as
Acc*
*ing.doc
*.doc

KEYWORDS : One or more keywords. This will invole a content (full-text) search.

USERNAME : The name (username) of the user who owns the documents or folders to be returned.

FOLDER : Specify a folder path if you wish to limit your search to a specific path.

CHECKOUTSTATUS :
CHECKEDOUT - Restrict search to the CHECKED OUT documents
NOTCHECKEDOUT - Restrict search to the NOT CHECKED OUT documents

DATECRITERIA : Use this to restrict your search to a date criteria. See types below.

<ITEM NAME="DATECRITERIA" SUBTYPE="" OPERATOR="" VALUE="" />

the SUBTYPE attribute can be

CREATED : Date Created
MODIFIED : Date Modified
CREATED OR MODIFIED : Created Or Modified
RETAIN UNTIL : Retain Until
COMPLETED ON : Completed On
DECLASSIFY ON : Declassify On
DOWNGRADE ON : Downgrade On
LAST ISO REVIEW DATE : Last ISO Review Date
NEXT ISO REVIEW DATE : Next ISO Review Date
DISPOSITION DATE : Destroy Date

The Operator attribute can be
EQ
EQGT
EQLT


The Value attibute must be a date value in the Universal date format like 2005-04-23

- search in to documents created before 1 feb 2005
<ITEM NAME="DATECRITERIA" SUBTYPE="CREATED" OPERATOR="EQLT" VALUE="2005-02-01"/>


SIZEIS: Specify this parameter if you wish to limit your search to documents of a certain size.

OPERATOR can be
EQGT for at least
EQLT for at most

VALUE Attibute can be any integer value in the form of kilobytes

example:

<ITEM NAME="SIZEIS" OPERATOR="EQLT" VALUE="1024" /> searchs the documents smaller than 1 mb
<ITEM NAME="SIZEIS" OPERATOR="EQGT" VALUE="512" /> searchs the documents bigger than 512 kb

IMPORTANCE: Specify this parameter if you wish to limit your search to documents that are marked with a level of importance.

VALUE Attibute can be
LOW
NORMAL
HIGH
VITAL

OPERATOR attribute can be
EQ : Equal
EQGT : At least
EQLT : At most

example:

<ITEM NAME="IMPORTANCE" OPERATOR="EQ" VALUE="HIGH" /> searches the documents exacty set the high importance
<ITEM NAME="IMPORTANCE" OPERATOR="EQGT" VALUE="HIGH" /> searches the high importance or vital documents

CLEVEL: Specify this parameter if you wish to limit your search to documents that have a classification attribute set.

VALUE Attibute can be

NOMARKINGS - No Markings
DECLASSIFIED - Declassified
CONFIDENTIAL - Confidential
SECRET - Secret
TOPSECRET - Top Secret

DOCUMENTTYPE: Document type
example : system wide images such as Bitmap Image,cdf File,Illustrator EPS,GIF Image,ico File,JPEG Image,png File,wmf File

<ITEM NAME="DOCUMENTTYPE" VALUE="Bitmap Image,cdf File,Illustrator EPS,GIF Image,ico File,JPEG Image,png File,wmf File" />

this criteria uses Mime type definitions specified in the inforouter control panel.

VIEWCRITERIA: Specifies the documents view state for the search
Value attribute can be
NOVIEW : Documents the caller has not viewed
UPDATED : Viewed but Updated Documents</option>
SAW : Viewed but Unchanged documents

PROPERTYSETNAME: XML fragment specifies the documents property set values
Value attribute can be any Property set name defined in inforouter
The sub items in this node defines the attribute names, operator and the value.

<ITEM NAME="PROPERTYSETNAME" VALUE="ADDRESS">
<ATTR NAME="ADDRESSTYPE" OP="EQ" VALUE="HOME" />
<ATTR NAME="STATE" OPERATOR="EQ" VALUE="NY" />
</ITEM>
The xml fragment above restrics the search results to the ADDRESS property set applied to documents or folders. And the address type must be HOME address and STATE field must be NY.

The OPERATOR list:

DATE Datatype
ANYTIME,
YESTERDAY,
TODAY,
LAST7DAYS,
NEXT7DAYS,
LASTWEEK,
THISWEEK,
NEXTWEEK,
LASTMONTH,
THISMONTH,
NEXTMONTH,
EQ (requires a date value),
EQGT (requires a date value),
EQLT (requires a date value),
NULL,

NUMBER Data type
EQ (requires a number value)
NOTEQ (requires a number value)
EQLT (requires a number value)
EQGT (requires a number value)
GT (requires a number value)
LT (requires a number value)
NOTNULL,
NULL

CHAR Data type
LIKE (requires a string value)
EQ (requires a string value)
NULL,
NOTNULL,

BOOLEAN data type
EQ (requires a Boolean(TRUE,FALSE) value)
NOTNULL
NULL
Example
Sub Search_sample()
Const IRAuthenticationTicket as string="sid-xxxxxxxxxxxxxxx"
Const Keywords as string="apple and pears"

Dim IR_OBJ As InfoRouter.srv
Dim xmlsearchcriteriadoc As System.Xml.XmlDocument
Dim xmlcriteria As System.Xml.XmlElement
Dim xmlResponse As System.Xml.XmlElement

Try
xmlsearchcriteriadoc = New System.Xml.XmlDocument
xmlsearchcriteriadoc.LoadXml("<search/>")

xmlcriteria = xmlsearchcriteriadoc.CreateElement("ITEM")
xmlcriteria.SetAttribute("NAME", "SEARCHSCOPE")
xmlcriteria.SetAttribute("VALUE", "ONLINE")
xmlsearchcriteriadoc.DocumentElement.AppendChild(xmlcriteria)

xmlcriteria = xmlsearchcriteriadoc.CreateElement("ITEM")
xmlcriteria.SetAttribute("NAME", "KEYWORDS")
xmlcriteria.SetAttribute("VALUE", Keywords)
xmlsearchcriteriadoc.DocumentElement.AppendChild(xmlcriteria)

ClearOutputWindow()
Application.DoEvents()
Me.ActiveForm.Cursor = Cursors.WaitCursor

IR_OBJ = New InfoRouter.srv
IR_OBJ.Url = (txtSrvUrl.Text & "/srv.asmx")

xmlResponse = IR_OBJ.Search(IRAuthenticationTicket , _
xmlsearchcriteriadoc.OuterXml, _
1, True)
If xmlResponse.GetAttribute("success") = "true" Then
WriteOutputLine("The search prepared successfully.")


Else
WriteOutputLine("The search cannot be prepared.")
WriteOutputLine("server response:" & xmlResponse.GetAttribute("error"))
End If
xmlResponse = Nothing

Catch ex As Exception
WriteOutputLine("error:" & ex.Message)
Finally
IR_OBJ = Nothing
Me.ActiveForm.Cursor = Cursors.Default
End Try

End Sub
See Also
GetNextSearchPage | GetPreviousSearchPage

Syntax based on infoRouter Document Management System Web Services API Version 7.0
Copyright() 1998-2003 Active Innovations, Inc.
infoRouter Document Management System