BUG 0000 Adjustment for the standardization of code. CODE_STYLE

This commit is contained in:
Hector Cortez
2013-03-14 15:50:49 -04:00
parent 229c49e9ef
commit 3a3c09dabd
7 changed files with 960 additions and 1021 deletions

View File

@@ -24,12 +24,15 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
if (! defined( 'JAVA_BRIDGE_PATH' ))
if (! defined( 'JAVA_BRIDGE_PATH' )) {
define( 'JAVA_BRIDGE_PATH', 'JavaBridgePM' );
if (! defined( 'JAVA_BRIDGE_PORT' ))
}
if (! defined( 'JAVA_BRIDGE_PORT' )) {
define( 'JAVA_BRIDGE_PORT', '8080' );
if (! defined( 'JAVA_BRIDGE_HOST' ))
}
if (! defined( 'JAVA_BRIDGE_HOST' )) {
define( 'JAVA_BRIDGE_HOST', '127.0.0.1' );
}
/**
*
@@ -37,9 +40,9 @@ if (! defined( 'JAVA_BRIDGE_HOST' ))
*/
class JavaBridgePM
{
var $JavaBridgeDir = JAVA_BRIDGE_PATH;
var $JavaBridgePort = JAVA_BRIDGE_PORT;
var $JavaBridgeHost = JAVA_BRIDGE_HOST;
public $JavaBridgeDir = JAVA_BRIDGE_PATH;
public $JavaBridgePort = JAVA_BRIDGE_PORT;
public $JavaBridgeHost = JAVA_BRIDGE_HOST;
/**
* checkJavaExtension
@@ -48,7 +51,7 @@ class JavaBridgePM
*
* @return true or false
*/
function checkJavaExtension ()
public function checkJavaExtension ()
{
try {
if (! extension_loaded( 'java' )) {
@@ -58,8 +61,9 @@ class JavaBridgePM
$includedFiles = get_included_files();
$found = false;
foreach ($includedFiles as $filename) {
if ($urlJavaInc == $filename)
if ($urlJavaInc == $filename) {
$found = true;
}
}
if (! $found) {
throw new Exception( 'The PHP/Java Bridge is not defined' );
@@ -86,7 +90,7 @@ class JavaBridgePM
* @param string $className
* @return s boolean success
*/
function convertValue ($value, $className)
public function convertValue ($value, $className)
{
// if we are a string, just use the normal conversion
// methods from the java extension...
@@ -94,10 +98,10 @@ class JavaBridgePM
if ($className == 'java.lang.String') {
$temp = new Java( 'java.lang.String', $value );
return $temp;
} else if ($className == 'java.lang.Boolean' || $className == 'java.lang.Integer' || $className == 'java.lang.Long' || $className == 'java.lang.Short' || $className == 'java.lang.Double' || $className == 'java.math.BigDecimal') {
} elseif ($className == 'java.lang.Boolean' || $className == 'java.lang.Integer' || $className == 'java.lang.Long' || $className == 'java.lang.Short' || $className == 'java.lang.Double' || $className == 'java.math.BigDecimal') {
$temp = new Java( $className, $value );
return $temp;
} else if ($className == 'java.sql.Timestamp' || $className == 'java.sql.Time') {
} elseif ($className == 'java.sql.Timestamp' || $className == 'java.sql.Time') {
$temp = new Java( $className );
$javaObject = $temp->valueOf( $value );
return $javaObject;
@@ -119,7 +123,7 @@ class JavaBridgePM
* @param object $template
* @return void
*/
function generateJrxmlFromDynaform ($outDocUid, $dynaformUid, $template)
public function generateJrxmlFromDynaform ($outDocUid, $dynaformUid, $template)
{
require_once 'classes/model/Dynaform.php';
$dyn = new Dynaform();
@@ -129,8 +133,9 @@ class JavaBridgePM
$reportTpl = PATH_TPL . 'javaBridgePM/classic.xml';
$reportFilename = PATH_DYNAFORM . $aFields['PRO_UID'] . PATH_SEP . $outDocUid . '.jrxml';
foreach ($xmlFields as $key => $val) {
if ($val->type == 'submit' || $val->type == 'button' || $val->type == 'title' || $val->type == 'subtitle')
if ($val->type == 'submit' || $val->type == 'button' || $val->type == 'title' || $val->type == 'subtitle') {
unset( $xmlFields[$key] );
}
}
//$sqlSentence = 'SELECT * from ' . $tableName;
@@ -168,6 +173,5 @@ class JavaBridgePM
$iSize = file_put_contents( $reportFilename, $content );
printf( "saved %s bytes in file %s \n", $iSize, $reportFilename );
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
/**
* class.pmTrSharepoint.php
*/
G::LoadSystem( "soapNtlm" );
G::LoadSystem("soapNtlm");
class wscaller
{
@@ -14,33 +14,32 @@ class wscaller
private $auth;
private $clientStream;
function setAuthUser ($auth)
public function setAuthUser($auth)
{
//print "<br>- auth Setup";
$this->auth = $auth;
}
function setwsdlurl ($wsdl)
public function setwsdlurl($wsdl)
{
//print "<br>- wsdl Setup";
$this->wsdlurl = $wsdl;
//var_dump($wsdl);
}
function loadSOAPClient ()
public function loadSOAPClient()
{
try {
// we unregister the current HTTP wrapper
stream_wrapper_unregister( 'http' );
stream_wrapper_unregister('http');
// we register the new HTTP wrapper
//$client = new PMServiceProviderNTLMStream($this->auth);
PMServiceProviderNTLMStream::setAuthStream( $this->auth );
stream_wrapper_register( 'http', 'PMServiceProviderNTLMStream' ) or die( "Failed to register protocol" );
PMServiceProviderNTLMStream::setAuthStream($this->auth);
stream_wrapper_register('http', 'PMServiceProviderNTLMStream') or die("Failed to register protocol");
// $this->client = new PMServiceNTLMSoapClient($this->wsdlurl, array('trace' => 1, 'auth' => $this->auth));// Hugo's code
$this->client = new PMServiceNTLMSoapClient( $this->wsdlurl, array ('trace' => 1
) ); // Ankit's Code
$this->client->setAuthClient( $this->auth );
$this->client = new PMServiceNTLMSoapClient($this->wsdlurl, array('trace' => 1)); // Ankit's Code
$this->client->setAuthClient($this->auth);
return true;
} catch (Exception $e) {
echo $e;
@@ -48,30 +47,29 @@ class wscaller
}
}
function callWsMethod ($methodName, $paramArray)
public function callWsMethod($methodName, $paramArray)
{
try {
if ($methodName == 'DeleteDws' || $methodName == 'GetListCollection') {
$strResult = "";
$strResult = $this->client->$methodName( $paramArray = "" );
$strResult = $this->client->$methodName($paramArray = "");
return $strResult;
} else {
$strResult = "";
$strResult = $this->client->$methodName( $paramArray );
$strResult = $this->client->$methodName($paramArray);
return $strResult;
}
} catch (SoapFault $fault) {
echo 'Fault code: ' . $fault->faultcode;
echo 'Fault string: ' . $fault->faultstring;
}
stream_wrapper_restore( 'http' );
stream_wrapper_restore('http');
}
}
class DestinationUrlCollection
{
public $string;
}
@@ -88,146 +86,141 @@ class FieldInformationCollection
class pmTrSharepointClass
{
function __construct ($server, $auth)
public function __construct($server, $auth)
{
set_include_path( PATH_PLUGINS . 'pmTrSharepoint' . PATH_SEPARATOR . get_include_path() );
set_include_path(PATH_PLUGINS . 'pmTrSharepoint' . PATH_SEPARATOR . get_include_path());
$this->server = $server;
$this->auth = $auth;
$this->dwsObj = new wscaller();
$this->dwsObj->setAuthUser( $this->auth );
$this->dwsObj->setAuthUser($this->auth);
}
function createDWS ($name, $users, $title, $documents)
public function createDWS($name, $users, $title, $documents)
{
//print "<br>- Method createDWS";
$this->dwsObj->setwsdlurl( $this->server . "/_vti_bin/Dws.asmx?WSDL" );
$this->dwsObj->setwsdlurl($this->server . "/_vti_bin/Dws.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
$paramArray = array ('name' => '','users' => '','title' => $name,'documents' => ''
);
$paramArray = array('name' => '', 'users' => '', 'title' => $name, 'documents' => '');
$methodName = 'CreateDws';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
$xml = $result->CreateDwsResult; // in Result we get string in Xml format
$xmlNew = simplexml_load_string( $xml ); // used to parse string to xml
$xmlArray = @G::json_decode( @G::json_encode( $xmlNew ), 1 ); // used to convert Objects to array
$xmlNew = simplexml_load_string($xml); // used to parse string to xml
$xmlArray = @G::json_decode(@G::json_encode($xmlNew), 1); // used to convert Objects to array
$dwsUrl = $xmlArray['Url'];
return "Dws with following Url is created:$dwsUrl";
/* $newResult = $result->CreateDwsResult;
$needleStart='<Url>';
$urlStartPos = strpos($newResult, $needleStart);
$urlStart = $urlStartPos + 5;
$needleEnd='</Url>';
$urlEndPos = strpos($newResult, $needleEnd);
$length = $urlEndPos - $urlStart;
$result = substr($newResult, $urlStart, $length);
return $result; */
$needleStart='<Url>';
$urlStartPos = strpos($newResult, $needleStart);
$urlStart = $urlStartPos + 5;
$needleEnd='</Url>';
$urlEndPos = strpos($newResult, $needleEnd);
$length = $urlEndPos - $urlStart;
$result = substr($newResult, $urlStart, $length);
return $result; */
}
function deleteDWS ($dwsname)
public function deleteDWS($dwsname)
{
//print "<br>- Method createDWS";
$url = $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL";
$this->dwsObj->setwsdlurl( $url );
$this->dwsObj->setwsdlurl($url);
$this->dwsObj->loadSOAPClient();
$paramArray = null;
$methodName = 'DeleteDws';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray = null );
var_dump( $result );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray = null);
var_dump($result);
return $result;
}
function createFolderDWS ($dwsname, $dwsFolderName)
public function createFolderDWS($dwsname, $dwsFolderName)
{
//print "<br>- Method createDWS";
$this->dwsObj->setwsdlurl( $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL" );
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
$url = "Shared Documents/$dwsFolderName";
$paramArray = array ('url' => $url
);
$paramArray = array('url' => $url);
# $paramArray = array('name' => '', 'users' => '', 'title' => $name, 'documents' => '');
$methodName = 'CreateFolder';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
var_dump( $result );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
var_dump($result);
return $result;
}
function deleteFolderDWS ($dwsname, $folderName)
public function deleteFolderDWS($dwsname, $folderName)
{
//print "<br>- Method createDWS";
$this->dwsObj->setwsdlurl( $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL" );
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
$url = "Shared Documents/$folderName";
$paramArray = array ('url' => $url
);
$paramArray = array('url' => $url);
# $paramArray = array('name' => '', 'users' => '', 'title' => $name, 'documents' => '');
$methodName = 'DeleteFolder';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
var_dump( $result );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
var_dump($result);
return $result;
}
function findDWSdoc ($dwsname, $guid)
public function findDWSdoc($dwsname, $guid)
{
//print "<br>- Method createDWS";
$this->dwsObj->setwsdlurl( $this->server . $dwsName . "/_vti_bin/Dws.asmx?WSDL" );
$this->dwsObj->setwsdlurl($this->server . $dwsName . "/_vti_bin/Dws.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
$paramArray = array ('id' => '$guid'
);
$paramArray = array('id' => '$guid');
$methodName = 'FindDwsDoc';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
var_dump( $result );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
var_dump($result);
}
function getDWSData ($newFileName, $dwsname, $lastUpdate)
public function getDWSData($newFileName, $dwsname, $lastUpdate)
{
//print "<br>- Method getDWSData<br />";
$url = $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL";
$this->dwsObj->setwsdlurl( $url );
$this->dwsObj->setwsdlurl($url);
if ($this->dwsObj->loadSOAPClient()) {
$doc = "Shared Documents";
$paramArray = array ('document' => '','lastUpdate' => ''
);
$paramArray = array('document' => '', 'lastUpdate' => '');
$methodName = 'GetDwsData';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
var_dump( $result );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
var_dump($result);
$sResult = $result->GetDwsDataResult;
/* $xmlNew = simplexml_load_string($sResult);// used to parse string to xml
$xmlArray = @G::json_decode(@G::json_encode($xmlNew),1);// used to convert Objects to array */
$serializeResult = serialize( $sResult ); // serializing the Array for Returning.
var_dump( $serializeResult );
$serializeResult = serialize($sResult); // serializing the Array for Returning.
var_dump($serializeResult);
return $serializeResult;
} else {
return "The enter the Correct Dws Name";
}
}
function uploadDocumentDWS ($dwsname, $folderName, $sourceUrl, $filename)
public function uploadDocumentDWS($dwsname, $folderName, $sourceUrl, $filename)
{
//print "<br>- Method createDWS";
$url = $this->server . "/" . $dwsname . "/_vti_bin/Copy.asmx?WSDL";
$this->dwsObj->setwsdlurl( $url );
$this->dwsObj->setwsdlurl($url);
$this->dwsObj->loadSOAPClient();
$destUrlObj = new DestinationUrlCollection();
@@ -244,17 +237,17 @@ class pmTrSharepointClass
$fieldInfoCollObj->FieldInformation = $fieldInfoObj;
$imgfile = $sourceUrl . "/" . $filename;
$filep = fopen( $imgfile, "r" );
$fileLength = filesize( $imgfile );
$content = fread( $filep, $fileLength );
$filep = fopen($imgfile, "r");
$fileLength = filesize($imgfile);
$content = fread($filep, $fileLength);
//$content = base64_encode($content);
$paramArray = array ('SourceUrl' => $imgfile,'DestinationUrls' => $destUrlObj,'Fields' => $fieldInfoCollObj,'Stream' => $content
$paramArray = array('SourceUrl' => $imgfile, 'DestinationUrls' => $destUrlObj, 'Fields' => $fieldInfoCollObj, 'Stream' => $content
);
$methodName = 'CopyIntoItems';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
var_dump( $result );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
var_dump($result);
$newResult = $result->Results->CopyResult->ErrorCode;
if ($newResult == 'Success') {
return "The document has been uploaded Successfully";
@@ -263,104 +256,100 @@ class pmTrSharepointClass
}
}
function getDWSMetaData ($newFileName, $dwsname, $id)
public function getDWSMetaData($newFileName, $dwsname, $id)
{
//print "<br>- Method createDWS";
$url = $this->server . "/" . $dwsname . "/_vti_bin/Dws.asmx?WSDL";
$this->dwsObj->setwsdlurl( $url );
$this->dwsObj->setwsdlurl($url);
$this->dwsObj->loadSOAPClient();
$doc = "Shared Documents/$newFileName";
$paramArray = array ('document' => $doc,'id' => '','minimal' => false
);
$paramArray = array('document' => $doc, 'id' => '', 'minimal' => false);
$methodName = 'GetDwsMetaData';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
$sResult = $result->GetDwsMetaDataResult;
$errorReturn = strpos( $sResult, "Error" );
if (isset( $sResult ) && ! $errorReturn) {
$serializeResult = serialize( $sResult ); // serializing the Array for Returning.
var_dump( $serializeResult );
$errorReturn = strpos($sResult, "Error");
if (isset($sResult) && !$errorReturn) {
$serializeResult = serialize($sResult); // serializing the Array for Returning.
var_dump($serializeResult);
return $serializeResult;
} else {
return $sResult;
}
}
function getDWSDocumentVersions ($newFileName, $dwsname)
public function getDWSDocumentVersions($newFileName, $dwsname)
{
//print "<br>- Method createDWS";
$this->dwsObj->setwsdlurl( $this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL" );
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
$doc = "Shared Documents/$newFileName";
$paramArray = array ('fileName' => $doc
);
$paramArray = array('fileName' => $doc);
$methodName = 'GetVersions';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
var_dump( $result );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
var_dump($result);
return $result;
}
function deleteDWSDocVersion ($newFileName, $dwsname, $versionNum)
public function deleteDWSDocVersion($newFileName, $dwsname, $versionNum)
{
//print "<br>- Method createDWS";
$this->dwsObj->setwsdlurl( $this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL" );
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
$doc = "Shared Documents/$newFileName";
$paramArray = array ('fileName' => $doc,'fileVersion' => $versionNum
);
$paramArray = array('fileName' => $doc, 'fileVersion' => $versionNum);
$methodName = 'DeleteVersion';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
if ($result) {
$sResult = $result->DeleteVersionResult->any;
$xmlNew = simplexml_load_string( $sResult ); // used to parse string to xml
$xmlArray = @G::json_decode( @G::json_encode( $xmlNew ), 1 ); // used to convert Objects to array
$versionCount = count( $xmlArray['result'] );
$xmlNew = simplexml_load_string($sResult); // used to parse string to xml
$xmlArray = @G::json_decode(@G::json_encode($xmlNew), 1); // used to convert Objects to array
$versionCount = count($xmlArray['result']);
if ($versionCount > 1) {
for ($i = 0; $i < $versionCount; $i ++) {
for ($i = 0; $i < $versionCount; $i++) {
$version[] = $xmlArray['result'][$i]['@attributes']['version'];
}
} else {
$version[] = $xmlArray['result']['@attributes']['version'];
}
$serializeResult = serialize( $version ); // serializing the Array for Returning.
var_dump( $serializeResult );
$serializeResult = serialize($version); // serializing the Array for Returning.
var_dump($serializeResult);
return $serializeResult;
} else {
return "The given Version could not be deleted.";
}
}
function deleteAllDWSDocVersion ($newFileName, $dwsname)
public function deleteAllDWSDocVersion($newFileName, $dwsname)
{
//print "<br>- Method createDWS";
$this->dwsObj->setwsdlurl( $this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL" );
$this->dwsObj->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/Versions.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
$doc = "Shared Documents/$newFileName";
$paramArray = array ('fileName' => $doc
);
$paramArray = array('fileName' => $doc);
$methodName = 'DeleteAllVersions';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
if ($result) {
$xml = $result->DeleteAllVersionsResult->any; // in Result we get string in Xml format
$xmlNew = simplexml_load_string( $xml ); // used to parse string to xml
$xmlArray = @G::json_decode( @G::json_encode( $xmlNew ), 1 ); // used to convert Objects to array
$xmlNew = simplexml_load_string($xml); // used to parse string to xml
$xmlArray = @G::json_decode(@G::json_encode($xmlNew), 1); // used to convert Objects to array
$latestVersion = $xmlArray['result']['@attributes']['version'];
return "All Versions are Deleted, except the latest i.e $latestVersion";
} else {
@@ -368,61 +357,59 @@ class pmTrSharepointClass
}
}
function getDWSFolderItems ($dwsname, $strFolderUrl)
public 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->setwsdlurl($this->server . "/" . $dwsname . "/_vti_bin/SiteData.asmx?WSDL");
$this->dwsObj->loadSOAPClient();
#$doc = "Shared Documents/$newFileName";
$paramArray = array ('strFolderUrl' => $strFolderUrl
);
$paramArray = array('strFolderUrl' => $strFolderUrl);
$methodName = 'EnumerateFolder';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
$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 );
if (isset($result->vUrls->_sFPUrl->Url)) {
$returnContent = $pmTrSharepointClassObj->getFolderUrlContent($result->vUrls->_sFPUrl->Url);
$serializeResult = serialize($returnContent);
return $serializeResult;
} elseif (isset( $result->vUrls->_sFPUrl )) {
$itemCount = count( $result->vUrls->_sFPUrl );
for ($i = 0; $i < $itemCount; $i ++) {
} elseif (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)";
$returnContent[] = $pmTrSharepointClassObj->getFolderUrlContent($listArr) . "(Is a Folder)";
} else {
$listArr = $result->vUrls->_sFPUrl[$i]->Url;
$returnContent[] = $pmTrSharepointClassObj->getFolderUrlContent( $listArr ) . "(Is a File)";
$returnContent[] = $pmTrSharepointClassObj->getFolderUrlContent($listArr) . "(Is a File)";
}
}
$serializeResult = serialize( $returnContent );
$serializeResult = serialize($returnContent);
return $serializeResult;
}
return "There is some error";
}
function downloadDocumentDWS ($dwsname, $fileName, $fileLocation)
public function downloadDocumentDWS($dwsname, $fileName, $fileLocation)
{
//print "<br>- Method createDWS";
$url = $this->server . "/" . $dwsname . "/_vti_bin/Copy.asmx?WSDL";
$this->dwsObj->setwsdlurl( $url );
$this->dwsObj->setwsdlurl($url);
$this->dwsObj->loadSOAPClient();
$CompleteUrl = $this->server . "/" . $dwsname . "/Shared Documents/" . $fileName;
$paramArray = array ('Url' => $CompleteUrl
);
$paramArray = array('Url' => $CompleteUrl);
$methodName = 'GetItem';
$result = $this->dwsObj->callWsMethod( $methodName, $paramArray );
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
$newResult = $result->Stream;
//$latestResult = base64_decode($newResult);
@@ -431,27 +418,27 @@ class pmTrSharepointClass
* In the Below line of code, we are coping the files at our local Directory using the php file methods.
*/
$imgfile = $fileLocation . "/" . $fileName;
$filep = fopen( $imgfile, 'w' );
$filep = fopen($imgfile, 'w');
//$content = fwrite($filep, $latestResult);
$content = fwrite( $filep, $newResult );
$content = fwrite($filep, $newResult);
return $content;
}
function getFolderUrlContent ($newResult)
public function getFolderUrlContent($newResult)
{
$needleStart = '/';
$needleCount = substr_count( $newResult, $needleStart );
$needleCount = substr_count($newResult, $needleStart);
$urlStartPos = strpos( $newResult, $needleStart );
$urlStartPos ++;
$urlStartPos = strpos($newResult, $needleStart);
$urlStartPos++;
if ($needleCount == '2') {
$newResultPos = strpos( $newResult, $needleStart, $urlStartPos );
$newResultPos ++;
$actualResult = substr( $newResult, $newResultPos );
$newResultPos = strpos($newResult, $needleStart, $urlStartPos);
$newResultPos++;
$actualResult = substr($newResult, $newResultPos);
return $actualResult;
} else {
$actualResult = substr( $newResult, $urlStartPos );
$actualResult = substr($newResult, $urlStartPos);
return $actualResult;
}
}