C# Class XWiki.Clients.XWikiHTTPClient

Adaptor over System.Net.WebClient Uses plain HTTP calls to send and retrieve data from the XWiki server Service pages on the server are in the MSOffice space
Inheritance: IXWikiClient
Mostrar archivo Open project: xwiki-contrib/xwiki-office Class Usage Examples

Public Methods

Method Description
AddAttachment ( string docName, string filePath ) : bool

Adds an attachment to the wiki.

AddAttachment ( string space, string page, string filePath ) : bool

Attaches a file to the wiki.

AddAttachmentAsync ( string docName, string filePath ) : void

Attaches a file to the wiki by using an async call.

AddAttachmentAsync ( string space, string page, string filePath ) : void

Attaches a file to the wiki by using an async call.

AddObject ( string docName, string ClassName, System fieldsValues ) : int

Adds an object to a wiki page.

GetAttachmentContent ( string pageName, string fileName ) : byte[]

Gets the content of an attachment.

GetAttachmentURL ( string docFullName, string attachmentName ) : string

Gets the url of an attachment.

GetConfiguredSyntaxes ( ) : List

Gets the availbale syntaxes for the server's rendered.

GetDefaultServerSyntax ( ) : String

Gets the default wiki syntax of the server.

GetDocumentAttachmentList ( string docFullName ) : List

Gets a list with the attachmets' names of the specified page.

GetObject ( String pageId, String className, int id ) : XWikiObject

Gets an object from a page.

GetObjects ( String pageId ) : XWiki.XmlRpc.XWikiObjectSummary[]

Gets the objects from a page.

GetPageHistory ( String pageId ) : XWiki.XmlRpc.PageHistorySummary[]
GetPagesNames ( string spaceName ) : List

Gets the pages names for the specified space.

GetRenderedPageContent ( string pageFullName ) : string

Gets the rendered content of a page.

GetRenderedPageContent ( string space, string page ) : string

Gets the rendered page content of a page.

GetSpacesNames ( ) : List

Gets the spaces of a wiki.

GetURL ( string documentFullName ) : string

Gets the url of a wiki page for the view action.

Login ( string username, string password ) : bool

Authenticates the user to the server.

OpenRead ( String address ) : Stream

Starts reading from an address.

OpenRead ( Uri address ) : Stream

Starts reading from an address.

RemoveObject ( String pageId, String className, int id ) : void

Removes an object from a page.

SavePageHTML ( string docName, string content, string syntax ) : bool

Saves the content of the page in the specified syntax.

UpdateObject ( string pageFullName, string className, int objectIndex, System fieldsValues ) : String
UpdateObject ( string pageFullName, string className, System fieldsValues ) : void
UploadData ( Uri address, byte data ) : byte[]

Uploads data to the server.

UploadData ( Uri address, string method, byte data ) : byte[]

Uploads data to the server.

UploadData ( string address, byte data ) : byte[]

Uploads data to the server.

UploadData ( string address, string method, byte data ) : byte[]

Uploads data to the server.

UploadValues ( string address, System values ) : byte[]

Uploads(POSTs) the values to the server.

UploadValues ( string address, string method, System values ) : byte[]

Uploads the values to the server.

Private Methods

Method Description
ConvertEncoding ( string content ) : String

Converts a string to a specified encoding.

DownloadData ( String address ) : byte[]

Downloads data from the server.

DownloadData ( Uri address ) : byte[]

Downloads data from the server.

Encoding ( ) : Encoding

Gets the encoding of the wiki instance.

GetAttachmentContent ( string URL ) : byte[]

Get the content of an attachment.

GetCookie ( String searchedCookie, String cookiesString ) : String

Parses the cookies for the server response and returns the requested value. Returns "" if the searched value is not found.

InsertCookies ( ) : void

Inserts the authetication cookies into the request headers.

Login ( ) : bool

Authenticates the user to the server.

ParseList ( String input ) : List

Parses a velocity response into a list.

XWikiHTTPClient ( String serverURL, String username, String password ) : System

Method Details

AddAttachment() public method

Adds an attachment to the wiki.
public AddAttachment ( string docName, string filePath ) : bool
docName string The full name of the wiki page.
filePath string The path to the file to be attached.
return bool

AddAttachment() public method

Attaches a file to the wiki.
public AddAttachment ( string space, string page, string filePath ) : bool
space string The space name.
page string The short page name.
filePath string The path to the file to be attached.
return bool

AddAttachmentAsync() public method

Attaches a file to the wiki by using an async call.
public AddAttachmentAsync ( string docName, string filePath ) : void
docName string The full name of the wiki page.
filePath string The path to the file to be attached.
return void

AddAttachmentAsync() public method

Attaches a file to the wiki by using an async call.
public AddAttachmentAsync ( string space, string page, string filePath ) : void
space string The space name.
page string The short page name.
filePath string The path to the file to be attached.
return void

AddObject() public method

Adds an object to a wiki page.
Thrown every time. Method is not implemented for XWikiHTTPClient.
public AddObject ( string docName, string ClassName, System fieldsValues ) : int
docName string The fullname of the wiki page.
ClassName string The xwiki class name of the object.
fieldsValues System The values of the object's fields.
return int

GetAttachmentContent() public method

Gets the content of an attachment.
public GetAttachmentContent ( string pageName, string fileName ) : byte[]
pageName string The full name of the wiki page.
fileName string The name of the attachment.
return byte[]

GetAttachmentURL() public method

Gets the url of an attachment.
public GetAttachmentURL ( string docFullName, string attachmentName ) : string
docFullName string The full name of the wiki page.
attachmentName string The name of the attachment.
return string

GetConfiguredSyntaxes() public method

Gets the availbale syntaxes for the server's rendered.
public GetConfiguredSyntaxes ( ) : List
return List

GetDefaultServerSyntax() public method

Gets the default wiki syntax of the server.
public GetDefaultServerSyntax ( ) : String
return String

GetDocumentAttachmentList() public method

Gets a list with the attachmets' names of the specified page.
public GetDocumentAttachmentList ( string docFullName ) : List
docFullName string THe full name of the wiki page.
return List

GetObject() public method

Gets an object from a page.
Thrown every time. Method is not implemented for XWikiHTTPClient.
public GetObject ( String pageId, String className, int id ) : XWikiObject
pageId String Page name - SpaceName.PageName.
className String XWiki class name.
id int Index number of the object.
return XWiki.XmlRpc.XWikiObject

GetObjects() public method

Gets the objects from a page.
Thrown every time. Method is not implemented for XWikiHTTPClient.
public GetObjects ( String pageId ) : XWiki.XmlRpc.XWikiObjectSummary[]
pageId String Full page name - SpanceName.PageName
return XWiki.XmlRpc.XWikiObjectSummary[]

GetPageHistory() public method

public GetPageHistory ( String pageId ) : XWiki.XmlRpc.PageHistorySummary[]
pageId String
return XWiki.XmlRpc.PageHistorySummary[]

GetPagesNames() public method

Gets the pages names for the specified space.
public GetPagesNames ( string spaceName ) : List
spaceName string The name of the space.
return List

GetRenderedPageContent() public method

Gets the rendered content of a page.
public GetRenderedPageContent ( string pageFullName ) : string
pageFullName string The full name of the wiki page.
return string

GetRenderedPageContent() public method

Gets the rendered page content of a page.
public GetRenderedPageContent ( string space, string page ) : string
space string The space name.
page string The page name.
return string

GetSpacesNames() public method

Gets the spaces of a wiki.
public GetSpacesNames ( ) : List
return List

GetURL() public method

Gets the url of a wiki page for the view action.
public GetURL ( string documentFullName ) : string
documentFullName string The full name of the wiki page.
return string

Login() public method

Authenticates the user to the server.
public Login ( string username, string password ) : bool
username string The username.
password string The password.
return bool

OpenRead() public method

Starts reading from an address.
public OpenRead ( String address ) : Stream
address String The adress.
return Stream

OpenRead() public method

Starts reading from an address.
public OpenRead ( Uri address ) : Stream
address System.Uri The adress.
return Stream

RemoveObject() public method

Removes an object from a page.
Thrown every time. Method is not implemented for XWikiHTTPClient.
public RemoveObject ( String pageId, String className, int id ) : void
pageId String Full page name - SpaceName.PageName.
className String XWiki class name.
id int Index number of the object.
return void

SavePageHTML() public method

Saves the content of the page in the specified syntax.
public SavePageHTML ( string docName, string content, string syntax ) : bool
docName string The full name of the page.
content string The html content to be converted.
syntax string The syntax in wich the html code will be converted.
return bool

UpdateObject() public method

public UpdateObject ( string pageFullName, string className, int objectIndex, System fieldsValues ) : String
pageFullName string
className string
objectIndex int
fieldsValues System
return String

UpdateObject() public method

public UpdateObject ( string pageFullName, string className, System fieldsValues ) : void
pageFullName string
className string
fieldsValues System
return void

UploadData() public method

Uploads data to the server.
public UploadData ( Uri address, byte data ) : byte[]
address System.Uri The adress where the data will be uploaded.
data byte The data that will be uploaded.
return byte[]

UploadData() public method

Uploads data to the server.
public UploadData ( Uri address, string method, byte data ) : byte[]
address System.Uri The adress where the data will be uploaded.
method string The web method used to upload the data.
data byte The data that will be uploaded.
return byte[]

UploadData() public method

Uploads data to the server.
public UploadData ( string address, byte data ) : byte[]
address string The adress where the data will be uploaded.
data byte The data that will be uploaded.
return byte[]

UploadData() public method

Uploads data to the server.
public UploadData ( string address, string method, byte data ) : byte[]
address string The adress where the data will be uploaded.
method string The web method used to upload the data.
data byte The data that will be uploaded.
return byte[]

UploadValues() public method

Uploads(POSTs) the values to the server.
public UploadValues ( string address, System values ) : byte[]
address string The adress where the values are uploaded.
values System Name value collection with the upload data.
return byte[]

UploadValues() public method

Uploads the values to the server.
public UploadValues ( string address, string method, System values ) : byte[]
address string The adress where the values are uploaded.
method string The mothod used to send data to the server.
values System Name value collection with the upload data.
return byte[]