ColdFusion 9.0 Resources |
cfsharepointDescriptionInvokes a feature that SharePoint exposes as a web service action, such as the Document Workspace getdwsdata action. Syntax<cfsharepoint action="webservice action" params="parameter structure" domain="domain name" name ="result variable name" password="connection password" userName="user ID" wsdl="WSDL file path"> or <cfsharepoint action="webservice action" params="parameter structure" login = "credentials structure" name ="result variable name" wsdl="WSDL file path"> Note: You
can specify this tag’s attributes in an attributeCollection attribute
whose value is a structure. Specify the structure name in the attributeCollection attribute
and use the tag’s attribute names as structure keys.
Attributes
UsageThe cfsharepoint tag invokes a Microsoft SharePoint web service. You call many SharePoint web service actions by specifying the action name in the action attribute and passing the web service parameters in the params attribute. You access the services and methods that the cfsharepoint tag does not support directly by specifying the service WSDL URLs in the wsdl attribute. Note: You can use the cfsharepoint tag with servers
that use basic authentication only.
You request a service
and action by specifying the action attribute values
listed in the following tables. In nearly all cases, these are identical
to the SharePoint action names. Notes indicate where the attribute
values differ from the action names because multiple services have
the same action name.Note: The web service action
parameters are documented at http://msdn.microsoft.com/en-us/library/ms445292.aspx.
You can also determine the parameters from the web service WSDL,
at http://server_name/_vti_bin/WebServiceName?wsdl.
When the cfsharepoint tag receives the results from the SharePoint server and completes, the structure specified by the name attribute contains the response. This structure also has a ResultFlag entry containing the value Success or Failure. The entry value is Success if there is no Axis Fault or an error is returned in the response, otherwise, the value is Failure. Document Workspace
Note: The createdwsfolder and deletedwsfolder action
attribute values correspond to the createfolder and deletefolder actions
of the Document Workspace service.
Imaging
Note: The getimaginglistitems action
attribute value correspond to the getlistitems action
of the Imaging service.
Lists
Search or spsearch Note: spsearch/search is not present in Windows Sharepoint
Services 2.0.
In Windows SharePoint Services 3.0, if the action attribute specifies any of the following actions, the spsearch.asmx web service is used to perform the search. In SharePoint Portal 2003 or 2007, search.asmx is used to perform the search. In Windows Sharepoint Services 2.0, an exception is thrown.
UserGroup
Views
Data type conversionSome web service actions require parameters in a Microsoft data type that does not correspond directly to a ColdFusion data type. The cfsharepoint tag automatically converts between the Microsoft data types and the most appropriate Java data types, which ColdFusion uses internally. The following table lists the conversions, and indicates the corresponding ColdFusion data type.
ExampleThe following example shows how you can manipulate lists and views. It requires resources on the SharePoint server that are not specified here. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>cfsharepoint Views Example</title> </head> <body> <cfoutput> Getting the list collection<br /> <!--- All login information is defined using variables in the Application.cfc file. ---> <cfsharepoint action="getlistcollection" login="#login#" name="result"/> result.ResultFlag: #result.ResultFlag#<br><br> Deleting mycustomlist from the collection, if it exists.<br> <cfloop array=#result.lists# index="list"> <cfif list.Title EQ "mycustomlist"> <cfsharepoint action="deletelist" login="#login#" name="result1" params="#{listname="mycustomlist"}#"/> </cfif> </cfloop> Was anything deleted? <cfif IsDefined("result1")> <b>YES.</b> The result is:</b><br> <cfdump var="#result1#"><br> <cfelse> <b>NO</b> </cfif> Adding a mycustomlist list<br /> <cfsharepoint action="addlist" login="#login#" name="result1" params="#{listname="mycustomlist", description="Adding a list via cfsharepoint", templateid=100}#"/> addlist result.ResultFlag: #result1.ResultFlag#<br><br> <cfset viewFields = xmlparse("<ViewFields> <FieldRef Name='Title'/> <FieldRef Name='ID'/> </ViewFields>")> <cfset query = xmlparse("<Query> <Where> <Lt> <FieldRef Name='ID'/> <Value Type='Counter'>10</Value> </Lt> </Where> <OrderBy> <FieldRef Name='ID'/> </OrderBy> </Query>")> <cfset rowlimit = xmlparse("<RowLimit Paged='True'>50</RowLimit>")> Adding a myview1 view for the mycustomlist list<br /> <cfsharepoint action="addview" login="#login#" name="result" params="#{listName="mycustomlist",viewname="myview1", viewFields="#viewFields#", query="#query#",rowlimit="#rowlimit#", type="grid",makeViewDefault=false}#"/> addview result.ResultFlag: #result.ResultFlag#<br><br> Adding a myview3 view for the mycustomlist list<br /> <cfsharepoint action="addview" login="#login#" name="result" params="#{listName="mycustomlist",viewname="myview3",viewFields="#viewFields#", query="#query#",rowlimit="#rowlimit#",type="grid",makeViewDefault=false}#"/> addview result.ResultFlag: #result.ResultFlag#<br><br> Getting the updated mycustomlist view collection<br> <cfsharepoint action="getviewcollection" login="#login#" name="result" params="#{listName="mycustomlist"}#"/> <b>getviewcollection result</b><br> <cfdump var="#result#"><br /> The names of the collection's views:<br> <cfloop array=#result.views# index=v> <cfoutput>#v.displayname#<br></cfoutput> </cfloop> <br> Deleting the list<br> <cfsharepoint action="deletelist" login="#login#" name="result1" params="#{listname="mycustomlist"}#"/> deletelist result.ResultFlag: #result1.ResultFlag# </cfoutput> </body> </html> |