Beispiel #1
0
 /// <summary>
 /// Retrieves single document from Clusterpoint Server storage. Returned type depends on passed returnType parameter.
 /// If returnType is DOC_TYPE_SIMPLEXML, returns CPS_SimpleXML.
 /// If returnType is DOC_TYPE_ARRAY, returns null - not supported yet.
 /// If returnType is DOC_TYPE_STDCLASS, returns XmlElement.
 /// </summary>
 /// <param name="id">Document ID.</param>
 /// <param name="returnType">Defines used return type.</param>
 /// <returns>Document as CPS_SimpleXml or XmlElement.</returns>
 public Object retrieveSingle(string id, CPS_Response.DOC_TYPE returnType = CPS_Response.DOC_TYPE.DOC_TYPE_STDCLASS)
 {
     CPS_RetrieveRequest request = new CPS_RetrieveRequest(id);
     this.p_lastResponse = this.p_connection.sendRequest(request);
     CPS_LookupResponse response = (CPS_LookupResponse)this.p_lastResponse;
     if (response.getDocuments() == null)
         return null;
     if (returnType == CPS_Response.DOC_TYPE.DOC_TYPE_STDCLASS)
     {
         Dictionary<string, XmlElement> ret1 = (Dictionary<string, XmlElement>)(response.getDocuments(returnType));
         foreach (KeyValuePair<string, XmlElement> pair in ret1)
             return pair.Value;
     }
     if (returnType == CPS_Response.DOC_TYPE.DOC_TYPE_ARRAY)
     {
         return null;
     }
     if (returnType == CPS_Response.DOC_TYPE.DOC_TYPE_SIMPLEXML)
     {
         Dictionary<string, CPS_SimpleXML> ret3 = (Dictionary<string, CPS_SimpleXML>)(response.getDocuments(returnType));
         foreach (KeyValuePair<string, CPS_SimpleXML> pair in ret3)
             return pair.Value;
     }
     return null;
 }
Beispiel #2
0
 /// <summary>
 /// Retrieves multiple documents from Clusterpoint Server storage. returned type depends on passed returnType parameter.
 /// If returnType is DOC_TYPE_SIMPLEXML, returns Dictionary&lt;string, CPS_SimpleXML&gt;.
 /// If returnType is DOC_TYPE_ARRAY, returns null - not supported yet.
 /// If returnType is DOC_TYPE_STDCLASS, returns Dictionary&lt;string, XmlElement&gt;.
 /// </summary>
 /// <param name="ids">List of document IDs.</param>
 /// <param name="returnType">Defines used return type.</param>
 /// <returns>Documents as Dictionary&lt;string, CPS_SimpleXML&gt; or Dictionary&lt;string, XmlElement&gt;.</returns>
 public Object retrieveMultiple(List<string> ids, CPS_Response.DOC_TYPE returnType = CPS_Response.DOC_TYPE.DOC_TYPE_STDCLASS)
 {
     CPS_RetrieveRequest request = new CPS_RetrieveRequest(ids);
     this.p_lastResponse = this.p_connection.sendRequest(request);
     return ((CPS_LookupResponse)this.p_lastResponse).getDocuments(returnType);
 }