Esempio n. 1
0
 /// <summary>
 /// Lists all pages within a given namespace.
 /// </summary>
 /// <example>
 /// example foreach all page in namespace "wiki:*"
 /// </example>
 /// <code>
 ///    XMLMethodPageList dokuList = xml.DokuPageList("wiki:") as XMLMethodPageList;
 ///    foreach (var items in dokuList.Params.Param.Value.Array.Data.Value)
 ///    {
 ///        foreach (var item in items.Struct.Member)
 ///        {
 ///            Console.WriteLine(
 ///                item.Name +
 ///                ((string.IsNullOrWhiteSpace(item.Value.Int)) ? " " : " [" + item.Value.Int + "] ") +
 ///                ((string.IsNullOrWhiteSpace(item.Value.String)) ? "" : item.Value.String)
 ///            );
 ///        }
 ///    }
 /// </code>
 /// <param name="namesspace"></param>
 /// <param name="opt"></param>
 /// <returns>class <see cref="Data.XMLMethodPageList"/>Data.XMLMethodPageList</returns>
 public object DokuPageList(string namesspace = null, string opt = null)
 {
     try
     {
         this._CheckAuth();
         Data.XMLMethodPageList pl = this.Get <Data.XMLMethodPageList>(
             XmlRpcRequest.dokuwiki_getPagelist,
             ((string.IsNullOrWhiteSpace(namesspace)) ?
              ((string.IsNullOrWhiteSpace(this._namespace)) ? _defaultns : this._namespace) : namesspace),
             opt
             );
         if (pl == null)
         {
             throw new ArgumentNullException();
         }
         return(pl);
     }
     catch (Exception e)
     {
         throw new RpcXmlException(
                   className + e.Message,
                   5009
                   );
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Search return associative array with matching pages similar to what is returned by dokuwiki.getPagelist, snippets are provided for the first 15 results.
 /// </summary>
 /// <param name="query"></param>
 /// <returns>class <see cref="Data.XMLMethodPageList"/>Data.XMLMethodPageList</returns>
 public Data.XMLMethodPageList DokuSearch(string query = null)
 {
     try
     {
         this._CheckAuth();
         Data.XMLMethodPageList pl = this.Get <Data.XMLMethodPageList>(
             XmlRpcRequest.dokuwiki_search,
             ((string.IsNullOrWhiteSpace(query)) ? "*" : query)
             );
         if (pl == null)
         {
             throw new ArgumentNullException();
         }
         return(pl);
     }
     catch (Exception e)
     {
         throw new RpcXmlException(
                   className + e.Message,
                   5010
                   );
     }
 }