Index: xword/Connectivity/Clients/IXWikiClient.cs
===================================================================
--- xword/Connectivity/Clients/IXWikiClient.cs (revision 21884)
+++ xword/Connectivity/Clients/IXWikiClient.cs (working copy)
@@ -5,6 +5,7 @@
using System.Text;
using System.IO;
using XWiki;
+using XWiki.XmlRpc;
namespace XWiki.Clients
{
@@ -139,6 +140,16 @@
int AddObject(String docName, String className, NameValueCollection fieldsValues);
///
+ /// Gets an object from a page.
+ ///
+ /// Page name - SpaceName.PageName.
+ /// XWiki class name.
+ /// Index number of the object.
+ /// An XWikiObject of type 'className' from the specified page.
+ XWikiObject GetObject(String pageId, String className, int id);
+
+
+ ///
/// Gets the binary data of the attached file.
///
/// Wiki page name - SpaceName.PageName
Index: xword/Connectivity/Clients/XWikiHTTPClient.cs
===================================================================
--- xword/Connectivity/Clients/XWikiHTTPClient.cs (revision 21884)
+++ xword/Connectivity/Clients/XWikiHTTPClient.cs (working copy)
@@ -5,6 +5,7 @@
using System.Net;
using System.Collections;
using System.IO;
+using XWiki.XmlRpc;
namespace XWiki.Clients
@@ -479,12 +480,26 @@
/// The xwiki class name of the object.
/// The values of the object's fields.
/// The index of the inserted object.
+ /// Thrown every time. Method is not implemented for XWikiHTTPClient.
public int AddObject(string docName, string ClassName, System.Collections.Specialized.NameValueCollection fieldsValues)
{
- throw new NotImplementedException();
+ throw new NotImplementedException("Operation not implemented for Velocity Services. Please use XML-RPC connectivity option!");
}
///
+ /// Gets an object from a page.
+ ///
+ /// Page name - SpaceName.PageName.
+ /// XWiki class name.
+ /// Index number of the object.
+ /// An XWikiObject of type 'className' from the specified page.
+ /// Thrown every time. Method is not implemented for XWikiHTTPClient.
+ public XWikiObject GetObject(String pageId, String className, int id)
+ {
+ throw new NotImplementedException("Operation not implemented for Velocity Services. Please use XML-RPC connectivity option!");
+ }
+
+ ///
/// Gets a list with the attachmets' names of the specified page.
///
/// THe full name of the wiki page.
Index: xword/Connectivity/Clients/XWikiXMLRPCClient.cs
===================================================================
--- xword/Connectivity/Clients/XWikiXMLRPCClient.cs (revision 21884)
+++ xword/Connectivity/Clients/XWikiXMLRPCClient.cs (working copy)
@@ -235,12 +235,37 @@
/// The class name of the XWiki object.
/// The values of the object's properties.
/// The index/id of the added object.
- public int AddObject(string docName, string ClassName, System.Collections.Specialized.NameValueCollection fieldsValues)
+ public int AddObject(string docName, string className, System.Collections.Specialized.NameValueCollection fieldsValues)
{
- throw new NotImplementedException();
+ XmlRpcStruct objectDictionary = new XmlRpcStruct();
+ foreach (string key in fieldsValues.Keys)
+ {
+ objectDictionary.Add(key, fieldsValues[key]);
+ }
+ XWikiObject obj = new XWikiObject();
+ obj.className = className;
+ obj.objectDictionary = objectDictionary;
+ obj.pageId = docName;
+ obj.guid = string.Empty;
+ obj.prettyName = fieldsValues["name"];
+ obj = proxy.StoreObject(token, obj);
+ return obj.id;
}
///
+ /// Gets an object from a page.
+ ///
+ /// Page name - SpaceName.PageName.
+ /// XWiki class name.
+ /// Index number of the object.
+ /// An XWikiObject of type 'className' from the specified page.
+ public XWikiObject GetObject(String pageId, String className, int id)
+ {
+ return proxy.GetObject(token, pageId, className, id);
+ }
+
+
+ ///
/// Gets the names of the attached files of a wiki page.
///
/// The full name of the wiki page.