/**
 *
 * @method Delete all DWS Document Versions
 *
 * @name deleteDWSAllDocumentVersion
 * @label Delete all DWS Document Versions
 *
 * @param string | $sharepointServer | Server name and port whre DWS wsdl exists, including protocol | http://server:port/_vti_bin/Dws.asmx?WSDL
 * @param string | $auth | Valid Auth string to connect to server | user:password
 * @param string | $newFileName | Name of File
 * @param string | $dwsname | Name of DWS
 *
 * @return string | $result | Response
 *
 */
function deleteDWSAllDocumentVersion($sharepointServer, $auth, $newFileName, $dwsname)
{
    require_once PATH_CORE . 'classes' . PATH_SEP . 'triggers' . PATH_SEP . 'class.pmTrSharepoint.php';
    $pmTrSharepoint = new pmTrSharepointClass($sharepointServer, $auth);
    $result = $pmTrSharepoint->deleteAllDWSDocVersion($newFileName, $dwsname);
    return $result;
}
Пример #2
0
 function getDWSFolderItems($dwsname, $strFolderUrl)
 {
     $pmTrSharepointClassObj = new pmTrSharepointClass();
     //print "<br>- Method getDWSFolderItems";
     $url = $this->server . "/" . $dwsname . "/_vti_bin/SiteData.asmx?WSDL";
     $this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/SiteData.asmx?WSDL");
     $this->dwsObj->loadSOAPClient();
     #$doc = "Shared Documents/$newFileName";
     $paramArray = array('strFolderUrl' => $strFolderUrl);
     $methodName = 'EnumerateFolder';
     $result = $this->dwsObj->callWsMethod($methodName, $paramArray);
     //$newResult = $result->vUrls->_sFPUrl->Url;
     if (isset($result->vUrls->_sFPUrl->Url)) {
         $returnContent = $pmTrSharepointClassObj->getFolderUrlContent($result->vUrls->_sFPUrl->Url);
         $serializeResult = serialize($returnContent);
         return $serializeResult;
     } else {
         if (isset($result->vUrls->_sFPUrl)) {
             $itemCount = count($result->vUrls->_sFPUrl);
             for ($i = 0; $i < $itemCount; $i++) {
                 $aObjects = $result->vUrls->_sFPUrl[$i]->IsFolder;
                 //$booleanStatus = $aObjects[$i]->IsFolder;
                 if ($aObjects) {
                     $listArr = $result->vUrls->_sFPUrl[$i]->Url;
                     $returnContent[] = $pmTrSharepointClassObj->getFolderUrlContent($listArr) . "(Is a Folder)";
                 } else {
                     $listArr = $result->vUrls->_sFPUrl[$i]->Url;
                     $returnContent[] = $pmTrSharepointClassObj->getFolderUrlContent($listArr) . "(Is a File)";
                 }
             }
             $serializeResult = serialize($returnContent);
             return $serializeResult;
         }
     }
     return "There is some error";
 }