From c5e0101acd936edaa3853e826e723c4f5539fe66 Mon Sep 17 00:00:00 2001 From: vgrem Date: Fri, 29 Jun 2018 23:31:44 +0300 Subject: [PATCH] New methods have been introduced for Web object --- examples/Settings.php | 8 +-- .../data/SharePoint User Guide - 2007.docx | Bin 18530 -> 0 bytes .../data/SharePoint User Guide - 2010.docx | Bin 18530 -> 0 bytes src/OutlookServices/Message.php | 8 +-- src/OutlookServices/User.php | 2 +- src/Runtime/Auth/SamlTokenProvider.php | 5 +- src/Runtime/ContextResourcePath.php | 23 ++++++++ src/Runtime/CreateEntityQuery.php | 2 +- src/Runtime/DeleteEntityQuery.php | 2 +- src/Runtime/InvokeMethodQuery.php | 8 +-- src/Runtime/InvokePostMethodQuery.php | 7 ++- src/Runtime/OData/ODataRequest.php | 2 + src/Runtime/ResourcePath.php | 3 +- src/Runtime/ResourcePathServiceOperation.php | 4 +- src/Runtime/UpdateEntityQuery.php | 2 +- src/SharePoint/AttachmentCollection.php | 2 +- src/SharePoint/ContentTypeCollection.php | 2 +- src/SharePoint/Field.php | 2 +- src/SharePoint/FieldCollection.php | 2 +- src/SharePoint/File.php | 20 +++---- src/SharePoint/FileCollection.php | 4 +- src/SharePoint/Folder.php | 2 +- src/SharePoint/GroupCollection.php | 6 +-- src/SharePoint/ListCollection.php | 2 +- src/SharePoint/Portal/GroupSiteManager.php | 2 +- src/SharePoint/SPList.php | 8 +-- src/SharePoint/SecurableObject.php | 2 +- src/SharePoint/Site.php | 2 +- src/SharePoint/UserCollection.php | 4 +- src/SharePoint/UserProfiles/PeopleManager.php | 10 ++-- src/SharePoint/UserProfiles/UserProfile.php | 2 +- src/SharePoint/View.php | 2 +- src/SharePoint/ViewCollection.php | 2 +- src/SharePoint/Web.php | 49 +++++++++++++++++- src/SharePoint/WebCollection.php | 2 +- .../WebParts/LimitedWebPartManager.php | 2 +- src/SharePoint/WebParts/WebPartDefinition.php | 4 +- tests/FileTest.php | 28 +++++++++- tests/PeopleManagerTest.php | 2 +- tests/WebTest.php | 1 - 40 files changed, 169 insertions(+), 71 deletions(-) delete mode 100644 examples/data/SharePoint User Guide - 2007.docx delete mode 100644 examples/data/SharePoint User Guide - 2010.docx create mode 100644 src/Runtime/ContextResourcePath.php diff --git a/examples/Settings.php b/examples/Settings.php index 44459806..be8bfc3a 100644 --- a/examples/Settings.php +++ b/examples/Settings.php @@ -1,14 +1,14 @@ "https://mediadev23.sharepoint.com", - 'OneDriveUrl' => "https://mediadev23-my.SharePoint.com", + 'Url' => "https://mediadev88.sharepoint.com", + 'OneDriveUrl' => "https://mediadev88-my.SharePoint.com", 'Password' => "P@ssw0rd", - 'UserName' => "mattim@mediadev23.onmicrosoft.com" + 'UserName' => "mattim@mediadev88.onmicrosoft.com" ); $AppSettings = array( - 'TenantName' => "mediadev23.onmicrosoft.com", + 'TenantName' => "mediadev88.onmicrosoft.com", 'ClientId' => "d426369e-c84b-47db-b6b1-b9c824ac2ea2", 'ClientSecret' => "wrizJBW41]|=@govNEDR059", 'Title' => "Office365 Graph explorer", diff --git a/examples/data/SharePoint User Guide - 2007.docx b/examples/data/SharePoint User Guide - 2007.docx deleted file mode 100644 index 9875097732076b23ab3856695b82cd6c662ed874..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18530 zcmeHvby!vH()Xs3ZjkP7q@=qWq`SMj1f;v9yHi0rqy(h9B}EWLI#lZ0;PDX8bIy6s z_5JgH-}BtpHR9T9&Fpp0J!{t7Gr!sLQefaPfM0_Ma0MLez=LZ-0+ObagTAAgHUlFg zBNM%mzSH&jU)TQs`>#AuBWM6sNUovn>+oao)GtqKx` zqS6?VdUw5H);&R;RLjul=A=rA)~r7U}` ztnP1#^sRS}!Hkmi)jyVKFp-B{e7S!1aUOZe>EVS*}|q8OpU zM4!RxV6?{k;TcOV{cY*ybDArWzB$_lvabL&9Ppls;{bVw{<7jxSn?4YGY-3#(2i0Y z*jszlpLPRr$?eJJ`C_CVYwC)oFD0(IyPpKPekoq1sqiNF1}kW5l4?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;%t60oGuWx-F`3%hD*Td5$Szor0?P zcGx*a0PKYA~T7S67J zS>RV@9R!pPa6kKW_eTkUm)#i;f1*HM>YDpk1OIhj+TB*}>%Pz1fdULH|Ip6=ko|6d zEwChfXAlF!`5X4z?(bjB_wRfa$Z}2B*`eDp2+SAVx$~Qb+=pL%x6kwboi6~>s=vPa zPXFpd_Pd>o*Ug}}qYapMy}^KEm^m`0KgM?zyoO34Upxbfcv=Ky8;-2 z9eV#B<@-?9eQ@YqS?rJhT-GgA^r5W#5W~B&cyR8@y6!x?1spzz%BIcmz4W!d>0;eD@PXp-WuP4#U9?neT>pAF8}~V_^0>q zrwe@_*K=3OW1_oKZsFXwD4#!@&s}iHtu#WCd-J)0iu@V(U2w!Lw+`t&?i;AYLv7rz z@89wQ0CQw_=kZU&xY<8Hlybisepkvq`Q3;1pSAIa0`8YV?+W0gx_cY9>bxzA{+9LI zgFLLI-Ad!9xmQ_x$oR0lbjxT$3)JKvi%q`-+&9d-<&IkcnDqCS;->iVXWVy70=L{u z4EMNi3Iq>t{$aA{mRp7OA71-kq>g?|`t1bo=TC0s000qech}vPI?&k~c3Rq-+ cDBvc0ATI?0d@)^jLf``$f$x}j{_CUv1JYdd-2eap diff --git a/examples/data/SharePoint User Guide - 2010.docx b/examples/data/SharePoint User Guide - 2010.docx deleted file mode 100644 index 90b32b32fa48c65761ada1dda65d3d0946a51bb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18530 zcmeHvby$_%()Xs3ZjkP7q@=qWq`SMj1f;v98>CT?4k-cYZb=aYkq(vmHh4V5^PF?u zbAA83-}gN0x<Z`x zgHdUWNIkpWFl(NmPO7D7bhA*Wz>P_Tf7hbNN{WvrcL-|@%Q4BsP#q1!Jc|w36oC`TcQ=z^3 zXbwX@4&PZ{y$8JphYZU73?Dq<7Y~p6n|?4F|lt{5U|~p|7-P1eSc*#*D-6CA6c| zI`-xs_2=C{TylG|IldUF$C|pL>5GZ0?(Qc+u3JSbH09m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8t|Zh@={cQBN-IlkfS!5jha>m0mGz_)LRBYi{7 zuLnL!Rnv<)0nwF~T;DY_-{G@46XV-E+ddncz6fof1=2i_7J#%gjmp=bD7i~aR@`J8 z%`jPnzpn~Af>}Zuz)*#)on^YU^BrXchg6-!knf6(%dw7GrI$9caILI0`$x|u(frx< zFAMyt(13u_0q$p??*1qN@MCwz!=EUSm%8Tu)xdw3;^>*ckcYAA@|`|-|h3ff9LbSwCb;~ zzSF<@ko|5a<8?FW?Pvw&U2oX$wT3?AzuW3}|K@QY{jvM;H}~&D&;545+wTSdxPbck zLv!FS_WPQ<+wyiR;3e>|a7S}D4RF7|{5LH3eoNLZF97fa9`FE~bpvF1DBwP>_pSg& zV29qnNBKUKbsrphR~Gx@KbLh26@4h{KE&{@EFPS@vaUPNZUKi6rQ8SQ-IbyMJfGgq z?pn$XsO6!6`(U@b0-oYM6mScD`z7W68sCM7-O7>0zqiIWV6lhya37;|%L@QN5&r2t z{OLm9$MxKm@|ftZlv_CWEz0N5=5rSuax0CHY%dJCtkNXBH@lYH0 z>-)F70KhES-Ff`eFmBGz52f6%hToO4PkwjP{N#K^7 ziQyjiO@ZLy%|A>Q-Eyn2{=;kki`3C?Nxz-o{rt(T8~`AK?e1D!o5Y`5!~J~0T>%U1 d4+Y$059FmFfDfkYP6&KJ1MnFW&wqXOe*m-u@Yw(W diff --git a/src/OutlookServices/Message.php b/src/OutlookServices/Message.php index aeddd9d5..b7e47176 100644 --- a/src/OutlookServices/Message.php +++ b/src/OutlookServices/Message.php @@ -21,7 +21,7 @@ public function reply($comment) { $parameter = new ClientValueObject(); $parameter->setProperty("Comment",$comment); - $qry = new InvokePostMethodQuery($this,"Reply",null,$parameter); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"Reply",null,$parameter); $this->getContext()->addQuery($qry); } @@ -34,7 +34,7 @@ public function replyAll($comment) { $parameter = new ClientValueObject(); $parameter->setProperty("Comment",$comment); - $qry = new InvokePostMethodQuery($this,"ReplyAll",null,$parameter); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"ReplyAll",null,$parameter); $this->getContext()->addQuery($qry); } @@ -49,7 +49,7 @@ public function forward($comment,$toRecipients) $parameter = new ClientValueObject(); $parameter->setProperty("Comment",$comment); $parameter->setProperty("ToRecipients",$toRecipients); - $qry = new InvokePostMethodQuery($this,"Forward",null,$parameter); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"Forward",null,$parameter); $this->getContext()->addQuery($qry); } @@ -62,7 +62,7 @@ public function forward($comment,$toRecipients) public function move($destinationId){ $parameter = new ClientValueObject(); $parameter->setProperty("DestinationId",$destinationId); - $qry = new InvokePostMethodQuery($this,"Move",null,$parameter); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"Move",null,$parameter); $this->getContext()->addQuery($qry); } diff --git a/src/OutlookServices/User.php b/src/OutlookServices/User.php index 49311e77..b93bbade 100644 --- a/src/OutlookServices/User.php +++ b/src/OutlookServices/User.php @@ -75,7 +75,7 @@ public function sendEmail(Message $message, $saveToSentItems) $payload = new ClientValueObject(); $payload->setProperty("Message", $message); $payload->setProperty("SaveToSentItems", $saveToSentItems); - $action = new InvokePostMethodQuery($this, "SendMail",null,$payload); + $action = new InvokePostMethodQuery($this->getResourcePath(), "SendMail",null,$payload); $this->getContext()->addQuery($action); } diff --git a/src/Runtime/Auth/SamlTokenProvider.php b/src/Runtime/Auth/SamlTokenProvider.php index 8b6f27e1..183db0f7 100644 --- a/src/Runtime/Auth/SamlTokenProvider.php +++ b/src/Runtime/Auth/SamlTokenProvider.php @@ -53,8 +53,11 @@ public function getAuthenticationCookie() return 'FedAuth=' . $this->FedAuth . '; rtFa=' . $this->rtFa; } - + /** + * @param $parameters + * @throws Exception + */ public function acquireToken($parameters) { $token = $this->acquireSecurityToken($parameters['username'], $parameters['password']); diff --git a/src/Runtime/ContextResourcePath.php b/src/Runtime/ContextResourcePath.php new file mode 100644 index 00000000..b07ef9e8 --- /dev/null +++ b/src/Runtime/ContextResourcePath.php @@ -0,0 +1,23 @@ +getResourcePath(),null,null,$entity); } } \ No newline at end of file diff --git a/src/Runtime/DeleteEntityQuery.php b/src/Runtime/DeleteEntityQuery.php index 4ce3c9e8..aac1bf8f 100644 --- a/src/Runtime/DeleteEntityQuery.php +++ b/src/Runtime/DeleteEntityQuery.php @@ -13,6 +13,6 @@ class DeleteEntityQuery extends InvokePostMethodQuery */ public function __construct(ClientObject $clientObject) { - parent::__construct($clientObject); + parent::__construct($clientObject->getResourcePath()); } } \ No newline at end of file diff --git a/src/Runtime/InvokeMethodQuery.php b/src/Runtime/InvokeMethodQuery.php index 6ce28d45..b4815d9b 100644 --- a/src/Runtime/InvokeMethodQuery.php +++ b/src/Runtime/InvokeMethodQuery.php @@ -11,16 +11,16 @@ class InvokeMethodQuery extends ClientAction /** * InvokeMethodQuery constructor. - * @param ClientObject $parentClientObject + * @param ResourcePath $resourcePath * @param string $methodName * @param array|ISchemaType $methodParameters */ - public function __construct(ClientObject $parentClientObject, $methodName=null, $methodParameters=null) + public function __construct(ResourcePath $resourcePath, $methodName=null, $methodParameters=null) { $path = new ResourcePathServiceOperation( - $parentClientObject->getContext(), - $parentClientObject->getResourcePath(), + $resourcePath->getContext(), + $resourcePath, $methodName, $methodParameters ); diff --git a/src/Runtime/InvokePostMethodQuery.php b/src/Runtime/InvokePostMethodQuery.php index 02828aed..208eb3dd 100644 --- a/src/Runtime/InvokePostMethodQuery.php +++ b/src/Runtime/InvokePostMethodQuery.php @@ -7,18 +7,17 @@ class InvokePostMethodQuery extends InvokeMethodQuery { - /** * ClientActionUpdateMethod constructor. - * @param ClientObject $parentClientObject + * @param ResourcePath $resourcePath * @param string $methodName * @param array $methodParameters * @param string|ISchemaType $methodPayload */ - public function __construct(ClientObject $parentClientObject, $methodName = null,$methodParameters=null,$methodPayload=null) + public function __construct(ResourcePath $resourcePath, $methodName = null,$methodParameters=null,$methodPayload=null) { $this->MethodPayload = $methodPayload; - parent::__construct($parentClientObject,$methodName, $methodParameters); + parent::__construct($resourcePath,$methodName, $methodParameters); } diff --git a/src/Runtime/OData/ODataRequest.php b/src/Runtime/OData/ODataRequest.php index a8c57783..6efa99e9 100644 --- a/src/Runtime/OData/ODataRequest.php +++ b/src/Runtime/OData/ODataRequest.php @@ -260,6 +260,8 @@ public function buildRequest(ClientAction $query) $request->Method = HttpMethod::Post; if (is_string($query->MethodPayload)) $request->Data = $query->MethodPayload; + if (is_array($query->MethodPayload)) + $request->Data = json_encode($query->MethodPayload); else if ($query->MethodPayload instanceof ISchemaType) { //build request payload $payload = $this->normalizePayload($query->MethodPayload); diff --git a/src/Runtime/ResourcePath.php b/src/Runtime/ResourcePath.php index 3984f438..a728e531 100644 --- a/src/Runtime/ResourcePath.php +++ b/src/Runtime/ResourcePath.php @@ -43,7 +43,8 @@ public function toUrl() $paths = array(); $current = clone $this; while (isset($current)) { - array_unshift($paths, $current->toString()); + if(!is_null($current->toString())) + array_unshift($paths, $current->toString()); $current = $current->parent; } return implode("/", $paths); diff --git a/src/Runtime/ResourcePathServiceOperation.php b/src/Runtime/ResourcePathServiceOperation.php index 5ba9c8a1..5b34d8ba 100644 --- a/src/Runtime/ResourcePathServiceOperation.php +++ b/src/Runtime/ResourcePathServiceOperation.php @@ -13,11 +13,11 @@ class ResourcePathServiceOperation extends ResourcePath implements ICSOMCallable /** * ResourcePathMethod constructor. * @param ClientRuntimeContext $context - * @param ResourcePath $parent + * @param ResourcePath|null $parent * @param string $methodName * @param array $methodParameters */ - public function __construct(ClientRuntimeContext $context, ResourcePath $parent, $methodName, $methodParameters = null) + public function __construct(ClientRuntimeContext $context, ResourcePath $parent=null, $methodName, $methodParameters = null) { parent::__construct($context, $parent); $this->methodName = $methodName; diff --git a/src/Runtime/UpdateEntityQuery.php b/src/Runtime/UpdateEntityQuery.php index ca5a9dba..1eceab40 100644 --- a/src/Runtime/UpdateEntityQuery.php +++ b/src/Runtime/UpdateEntityQuery.php @@ -13,7 +13,7 @@ class UpdateEntityQuery extends InvokePostMethodQuery */ public function __construct(ClientObject $entity) { - parent::__construct($entity,null,null,$entity); + parent::__construct($entity->getResourcePath(),null,null,$entity); } diff --git a/src/SharePoint/AttachmentCollection.php b/src/SharePoint/AttachmentCollection.php index f39f79bb..3529f045 100644 --- a/src/SharePoint/AttachmentCollection.php +++ b/src/SharePoint/AttachmentCollection.php @@ -18,7 +18,7 @@ public function add(AttachmentCreationInformation $information) { $attachment = new Attachment($this->getContext(),$this->getResourcePath()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "add", array("FileName" =>rawurlencode($information->FileName)), $information->ContentStream); diff --git a/src/SharePoint/ContentTypeCollection.php b/src/SharePoint/ContentTypeCollection.php index e76e4cf1..3d47afe1 100644 --- a/src/SharePoint/ContentTypeCollection.php +++ b/src/SharePoint/ContentTypeCollection.php @@ -33,7 +33,7 @@ public function getById($id) public function add(ContentTypeCreationInformation $information) { $contentType = new ContentType($this->getContext()); - $qry = new InvokePostMethodQuery($this,null,null,$information); + $qry = new InvokePostMethodQuery($this->getResourcePath(),null,null,$information); $this->getContext()->addQuery($qry,$contentType); $this->addChild($contentType); return $contentType; diff --git a/src/SharePoint/Field.php b/src/SharePoint/Field.php index 566f6de8..745374e9 100644 --- a/src/SharePoint/Field.php +++ b/src/SharePoint/Field.php @@ -31,7 +31,7 @@ public function deleteObject() */ public function setShowInDisplayForm($value){ $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "setShowInDisplayForm", array($value) ); diff --git a/src/SharePoint/FieldCollection.php b/src/SharePoint/FieldCollection.php index 843aa5b5..c6609461 100644 --- a/src/SharePoint/FieldCollection.php +++ b/src/SharePoint/FieldCollection.php @@ -20,7 +20,7 @@ class FieldCollection extends ClientObjectCollection public function add(FieldCreationInformation $parameters) { $field = new Field($this->getContext(),$this->getResourcePath()); - $qry = new InvokePostMethodQuery($this,null,null,$parameters); + $qry = new InvokePostMethodQuery($this->getResourcePath(),null,null,$parameters); $this->getContext()->addQuery($qry,$field); $this->addChild($field); return $field; diff --git a/src/SharePoint/File.php b/src/SharePoint/File.php index a1e98aa4..218188ee 100644 --- a/src/SharePoint/File.php +++ b/src/SharePoint/File.php @@ -21,7 +21,7 @@ class File extends SecurableObject * Checks out the file from a document library based on the check-out type. */ public function checkOut(){ - $qry = new InvokePostMethodQuery($this,"checkout"); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"checkout"); $this->getContext()->addQuery($qry); } @@ -30,7 +30,7 @@ public function checkOut(){ * Reverts an existing checkout for the file. */ public function undoCheckout(){ - $qry = new InvokePostMethodQuery($this,"undocheckout"); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"undocheckout"); $this->getContext()->addQuery($qry); } @@ -40,7 +40,7 @@ public function undoCheckout(){ * @param string $comment A comment for the check-in. Its length must be <= 1023. */ public function checkIn($comment){ - $qry = new InvokePostMethodQuery($this,"checkIn",array( + $qry = new InvokePostMethodQuery($this->getResourcePath(),"checkIn",array( "comment" =>$comment, "checkintype" =>0 )); @@ -53,7 +53,7 @@ public function checkIn($comment){ * @param string $comment The comment for the approval. */ public function approve($comment){ - $qry = new InvokePostMethodQuery($this,"approve",array( + $qry = new InvokePostMethodQuery($this->getResourcePath(),"approve",array( "comment" =>$comment )); $this->getContext()->addQuery($qry); @@ -64,7 +64,7 @@ public function approve($comment){ * @param string $comment The comment for the denial. */ public function deny($comment){ - $qry = new InvokePostMethodQuery($this, "deny",array( + $qry = new InvokePostMethodQuery($this->getResourcePath(), "deny",array( "comment" =>$comment )); $this->getContext()->addQuery($qry); @@ -75,7 +75,7 @@ public function deny($comment){ * @param string $comment The comment for the published file. Its length must be <= 1023. */ public function publish($comment){ - $qry = new InvokePostMethodQuery($this, "publish",array( + $qry = new InvokePostMethodQuery($this->getResourcePath(), "publish",array( "comment" =>$comment )); $this->getContext()->addQuery($qry); @@ -87,7 +87,7 @@ public function publish($comment){ * @param string $comment The comment for the unpublish operation. Its length must be <= 1023. */ public function unpublish($comment){ - $qry = new InvokePostMethodQuery($this,"unpublish", array( + $qry = new InvokePostMethodQuery($this->getResourcePath(),"unpublish", array( "comment" => $comment )); $this->getContext()->addQuery($qry); @@ -100,7 +100,7 @@ public function unpublish($comment){ * @param bool $bOverWrite true to overwrite a file with the same name in the same location; otherwise false. */ public function copyTo($strNewUrl,$bOverWrite){ - $qry = new InvokePostMethodQuery($this, "copyto", array( + $qry = new InvokePostMethodQuery($this->getResourcePath(), "copyto", array( "strnewurl"=>$strNewUrl, "boverwrite"=>$bOverWrite )); @@ -113,7 +113,7 @@ public function copyTo($strNewUrl,$bOverWrite){ * @param int $flags The bitwise SP.MoveOperations value for how to move the file. Overwrite = 1; AllowBrokenThickets (move even if supporting files are separated from the file) = 8. */ public function moveTo($newUrl,$flags){ - $qry = new InvokePostMethodQuery($this, "moveto", array( + $qry = new InvokePostMethodQuery($this->getResourcePath(), "moveto", array( "newurl"=>$newUrl, "flags"=>$flags )); @@ -125,7 +125,7 @@ public function moveTo($newUrl,$flags){ * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item. */ public function recycle(){ - $qry = new InvokePostMethodQuery($this, "recycle"); + $qry = new InvokePostMethodQuery($this->getResourcePath(), "recycle"); $this->getContext()->addQuery($qry); } diff --git a/src/SharePoint/FileCollection.php b/src/SharePoint/FileCollection.php index ccd10212..900884d7 100644 --- a/src/SharePoint/FileCollection.php +++ b/src/SharePoint/FileCollection.php @@ -22,7 +22,7 @@ public function add(FileCreationInformation $fileCreationInformation) { $file = new File($this->getContext(),$this->getResourcePath()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "add", array("overwrite"=>$fileCreationInformation->Overwrite,"url"=>rawurlencode($fileCreationInformation->Url)), $fileCreationInformation->Content @@ -43,7 +43,7 @@ public function addTemplateFile($urlOfFile,$templateFileType) { $file = new File($this->getContext(),$this->getResourcePath()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "addTemplateFile", array( "urlOfFile" => $urlOfFile, diff --git a/src/SharePoint/Folder.php b/src/SharePoint/Folder.php index e7cec1e0..0d242b93 100644 --- a/src/SharePoint/Folder.php +++ b/src/SharePoint/Folder.php @@ -39,7 +39,7 @@ public function rename($name){ * Moves the list folder to the Recycle Bin and returns the identifier of the new Recycle Bin item. */ public function recycle(){ - $qry = new InvokePostMethodQuery($this,"recycle"); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"recycle"); $this->getContext()->addQuery($qry); } diff --git a/src/SharePoint/GroupCollection.php b/src/SharePoint/GroupCollection.php index 9de097b6..884a50d0 100644 --- a/src/SharePoint/GroupCollection.php +++ b/src/SharePoint/GroupCollection.php @@ -23,7 +23,7 @@ class GroupCollection extends ClientObjectCollection public function add(GroupCreationInformation $parameters) { $group = new Group($this->getContext(), $this->getResourcePath()); - $qry = new InvokePostMethodQuery($this,null,null, $parameters); + $qry = new InvokePostMethodQuery($this->getResourcePath(),null,null, $parameters); $this->getContext()->addQuery($qry, $group); $this->addChild($group); return $group; @@ -66,7 +66,7 @@ public function getByName($name) */ public function removeById($id) { - $qry = new InvokePostMethodQuery($this, "removebyid", array($id)); + $qry = new InvokePostMethodQuery($this->getResourcePath(), "removebyid", array($id)); $this->getContext()->addQuery($qry); } @@ -77,7 +77,7 @@ public function removeById($id) */ public function removeByLoginName($groupName) { - $qry = new InvokePostMethodQuery($this, "removeByLoginName", array($groupName)); + $qry = new InvokePostMethodQuery($this->getResourcePath(), "removeByLoginName", array($groupName)); $this->getContext()->addQuery($qry); } } diff --git a/src/SharePoint/ListCollection.php b/src/SharePoint/ListCollection.php index 794da253..26b60306 100644 --- a/src/SharePoint/ListCollection.php +++ b/src/SharePoint/ListCollection.php @@ -46,7 +46,7 @@ public function getById($id) public function add(ListCreationInformation $properties) { $list = new SPList($this->getContext()); - $qry = new InvokePostMethodQuery($this,null,null,$properties); + $qry = new InvokePostMethodQuery($this->getResourcePath(),null,null,$properties); $this->getContext()->addQuery($qry,$list); $this->addChild($list); return $list; diff --git a/src/SharePoint/Portal/GroupSiteManager.php b/src/SharePoint/Portal/GroupSiteManager.php index 46340188..b277b99b 100644 --- a/src/SharePoint/Portal/GroupSiteManager.php +++ b/src/SharePoint/Portal/GroupSiteManager.php @@ -42,7 +42,7 @@ public function createGroupEx($displayName,$alias,$isPublic,$description="",$add } $info = new GroupSiteInfo(); - $qry = new InvokePostMethodQuery($this,"CreateGroupEx",null,$payload); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"CreateGroupEx",null,$payload); $this->getContext()->addQuery($qry,$info); return $info; } diff --git a/src/SharePoint/SPList.php b/src/SharePoint/SPList.php index 42b80b2a..ab271f2c 100644 --- a/src/SharePoint/SPList.php +++ b/src/SharePoint/SPList.php @@ -61,7 +61,7 @@ public function getItems(CamlQuery $camlQuery = null) $items = new ListItemCollection($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(),"items")); if(isset($camlQuery)){ $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "GetItems", null, $camlQuery @@ -101,7 +101,7 @@ public function getUserEffectivePermissions($loginName) { $permissions = new BasePermissions(); $qry = new InvokeMethodQuery( - $this, + $this->getResourcePath(), "GetUserEffectivePermissions", array(rawurlencode($loginName)) ); @@ -118,7 +118,7 @@ public function getListItemChangesSinceToken(ChangeLogItemQuery $query) { $result = new ListItemCollection($this->getContext()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "getListItemChangesSinceToken", null, $query @@ -136,7 +136,7 @@ public function getChanges(ChangeQuery $query) { $changes = new ChangeCollection($this->getContext()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "GetChanges", null, $query diff --git a/src/SharePoint/SecurableObject.php b/src/SharePoint/SecurableObject.php index 41badc5d..85a0ddf7 100644 --- a/src/SharePoint/SecurableObject.php +++ b/src/SharePoint/SecurableObject.php @@ -17,7 +17,7 @@ class SecurableObject extends ClientObject */ public function breakRoleInheritance($copyRoleAssignments) { - $qry = new InvokePostMethodQuery($this,"breakroleinheritance",array( + $qry = new InvokePostMethodQuery($this->getResourcePath(),"breakroleinheritance",array( $copyRoleAssignments )); $this->getContext()->addQuery($qry); diff --git a/src/SharePoint/Site.php b/src/SharePoint/Site.php index 59b9429b..00d2a7d2 100644 --- a/src/SharePoint/Site.php +++ b/src/SharePoint/Site.php @@ -18,7 +18,7 @@ class Site extends ClientObject public function openWebById($webId) { $web = new Web($this->getContext(),$this->getResourcePath()); - $qry = new InvokePostMethodQuery($this,"openWebById",array($webId)); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"openWebById",array($webId)); $this->getContext()->addQuery($qry,$web); return $web; } diff --git a/src/SharePoint/UserCollection.php b/src/SharePoint/UserCollection.php index 2380608c..85c042f4 100644 --- a/src/SharePoint/UserCollection.php +++ b/src/SharePoint/UserCollection.php @@ -52,7 +52,7 @@ public function getByLoginName($loginName) */ public function removeById($id) { - $qry = new InvokePostMethodQuery($this,"removebyid",array($id)); + $qry = new InvokePostMethodQuery($this->getResourcePath(),"removebyid",array($id)); $this->getContext()->addQuery($qry); } @@ -63,7 +63,7 @@ public function removeById($id) public function removeByLoginName($loginName) { $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "removebyloginname", array(rawurlencode($loginName))); $this->getContext()->addQuery($qry); diff --git a/src/SharePoint/UserProfiles/PeopleManager.php b/src/SharePoint/UserProfiles/PeopleManager.php index df4225b6..8a0f2c38 100644 --- a/src/SharePoint/UserProfiles/PeopleManager.php +++ b/src/SharePoint/UserProfiles/PeopleManager.php @@ -30,7 +30,7 @@ public function __construct(ClientRuntimeContext $ctx) */ public function amIFollowedBy ($accountName){ $result = new ClientResult("AmIFollowedBy"); - $qry = new InvokeMethodQuery($this, "AmIFollowedBy",array(rawurlencode($accountName))); + $qry = new InvokeMethodQuery($this->getResourcePath(), "AmIFollowedBy",array(rawurlencode($accountName))); $this->getContext()->addQuery($qry,$result); return $result; } @@ -64,7 +64,7 @@ public function getMyFollowers(){ * @param string $accountName */ public function follow($accountName){ - $qry = new InvokePostMethodQuery($this, "follow",array(rawurlencode($accountName))); + $qry = new InvokePostMethodQuery($this->getResourcePath(), "follow",array(rawurlencode($accountName))); $this->getContext()->addQuery($qry); } @@ -76,7 +76,7 @@ public function follow($accountName){ */ public function stopFollowing ($accountName){ $result = new ClientResult("StopFollowing"); - $qry = new InvokePostMethodQuery($this, "StopFollowing",array(rawurlencode($accountName))); + $qry = new InvokePostMethodQuery($this->getResourcePath(), "StopFollowing",array(rawurlencode($accountName))); $this->getContext()->addQuery($qry,$result); return $result; } @@ -90,7 +90,7 @@ public function stopFollowing ($accountName){ public function amIFollowing ($accountName){ $result = new ClientResult("AmIFollowing"); $qry = new InvokeMethodQuery( - $this, + $this->getResourcePath(), "AmIFollowing", array(rawurlencode($accountName)) ); @@ -122,7 +122,7 @@ public function getUserProfilePropertyFor ($accountName,$propertyName) { $clientResult = new ClientResult("GetUserProfilePropertyFor"); $qry = new InvokeMethodQuery( - $this, + $this->getResourcePath(), "GetUserProfilePropertyFor", array( "accountname" => rawurlencode($accountName), diff --git a/src/SharePoint/UserProfiles/UserProfile.php b/src/SharePoint/UserProfiles/UserProfile.php index a48839ce..0bb5a94c 100644 --- a/src/SharePoint/UserProfiles/UserProfile.php +++ b/src/SharePoint/UserProfiles/UserProfile.php @@ -21,7 +21,7 @@ public function __construct(ClientRuntimeContext $ctx) */ public function createPersonalSiteEnque(){ $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "createpersonalsiteenque", array(false) ); diff --git a/src/SharePoint/View.php b/src/SharePoint/View.php index 0e41b6aa..86ca243f 100644 --- a/src/SharePoint/View.php +++ b/src/SharePoint/View.php @@ -51,7 +51,7 @@ public function deleteObject() */ public function renderAsHtml(){ $qry = new InvokeMethodQuery( - $this, + $this->getResourcePath(), "renderashtml" ); $this->getContext()->addQuery($qry); diff --git a/src/SharePoint/ViewCollection.php b/src/SharePoint/ViewCollection.php index 5f36e6d0..3dffe29c 100644 --- a/src/SharePoint/ViewCollection.php +++ b/src/SharePoint/ViewCollection.php @@ -46,7 +46,7 @@ public function getById($id) public function add(ViewCreationInformation $properties) { $view = new View($this->getContext(),$this->getResourcePath()); - $qry = new InvokePostMethodQuery($this,null,null,$properties); + $qry = new InvokePostMethodQuery($this->getResourcePath(),null,null,$properties); $this->getContext()->addQuery($qry,$view); $this->addChild($view); return $view; diff --git a/src/SharePoint/Web.php b/src/SharePoint/Web.php index f02bbe87..06306876 100644 --- a/src/SharePoint/Web.php +++ b/src/SharePoint/Web.php @@ -3,6 +3,9 @@ namespace Office365\PHP\Client\SharePoint; use Office365\PHP\Client\Runtime\ClientAction; use Office365\PHP\Client\Runtime\ClientResult; +use Office365\PHP\Client\Runtime\ClientRuntimeContext; +use Office365\PHP\Client\Runtime\ClientValueObject; +use Office365\PHP\Client\Runtime\ContextResourcePath; use Office365\PHP\Client\Runtime\DeleteEntityQuery; use Office365\PHP\Client\Runtime\InvokePostMethodQuery; use Office365\PHP\Client\Runtime\UpdateEntityQuery; @@ -20,6 +23,50 @@ class Web extends SecurableObject { + /** + * @param ClientRuntimeContext $context + * @param string $url + * @param boolean $isEditLink + * @return ClientResult + */ + public static function createAnonymousLink($context, $url, $isEditLink) + { + $result = new ClientResult("CreateAnonymousLink"); + $rootPath = new ContextResourcePath($context); + $qry = new InvokePostMethodQuery($rootPath, + "SP.Web.CreateAnonymousLink", + null, + array( + "url" => $url, + "isEditLink" => $isEditLink + )); + $context->addQuery($qry,$result); + return $result; + } + + /** + * @param ClientRuntimeContext $context + * @param string $url + * @param boolean $isEditLink + * @param string $expirationString + * @return ClientResult + */ + public static function createAnonymousLinkWithExpiration($context, $url, $isEditLink,$expirationString) + { + $result = new ClientResult("CreateAnonymousLinkWithExpiration"); + $rootPath = new ContextResourcePath($context); + $qry = new InvokePostMethodQuery($rootPath, + "SP.Web.CreateAnonymousLinkWithExpiration", + null, + array( + "url" => $url, + "isEditLink" => $isEditLink, + "expirationString" => $expirationString + )); + $context->addQuery($qry,$result); + return $result; + } + public function update() { $qry = new UpdateEntityQuery($this); @@ -43,7 +90,7 @@ public function getChanges(ChangeQuery $query) { $changes = new ChangeCollection($this->getContext()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "GetChanges", null, $query diff --git a/src/SharePoint/WebCollection.php b/src/SharePoint/WebCollection.php index b44ba1ee..658a87d7 100644 --- a/src/SharePoint/WebCollection.php +++ b/src/SharePoint/WebCollection.php @@ -20,7 +20,7 @@ public function add(WebCreationInformation $webCreationInformation) { $web = new Web($this->getContext(),$this->getResourcePath()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "Add", null, $webCreationInformation diff --git a/src/SharePoint/WebParts/LimitedWebPartManager.php b/src/SharePoint/WebParts/LimitedWebPartManager.php index 47d9b68c..f3c4a1f9 100644 --- a/src/SharePoint/WebParts/LimitedWebPartManager.php +++ b/src/SharePoint/WebParts/LimitedWebPartManager.php @@ -23,7 +23,7 @@ public function importWebPart($webPartXml) $payload->setProperty("webPartXml",$webPartXml); $webPartDefinition = new WebPartDefinition($this->getContext()); $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "ImportWebPart", null, $payload diff --git a/src/SharePoint/WebParts/WebPartDefinition.php b/src/SharePoint/WebParts/WebPartDefinition.php index 0d11986a..ef6d132e 100644 --- a/src/SharePoint/WebParts/WebPartDefinition.php +++ b/src/SharePoint/WebParts/WebPartDefinition.php @@ -12,7 +12,7 @@ class WebPartDefinition extends ClientObject public function saveWebPartChanges(){ $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "SaveWebPartChanges" ); $this->getContext()->addQuery($qry); @@ -21,7 +21,7 @@ public function saveWebPartChanges(){ public function closeWebPart() { $qry = new InvokePostMethodQuery( - $this, + $this->getResourcePath(), "CloseWebPart" ); $this->getContext()->addQuery($qry); diff --git a/tests/FileTest.php b/tests/FileTest.php index 05b45819..15782f60 100644 --- a/tests/FileTest.php +++ b/tests/FileTest.php @@ -1,6 +1,8 @@ Content = file_get_contents($filename); @@ -37,11 +40,32 @@ public function testUploadFiles(){ $uploadFile = self::$targetList->getRootFolder()->getFiles()->add($fileCreationInformation); self::$context->executeQuery(); $this->assertEquals($uploadFile->getProperty("Name"),$fileCreationInformation->Url); - + $results[] = $uploadFile; } self::assertTrue(true); + return $results[0]; } + /** + * @depends testUploadFiles + * @param $uploadFile + */ + public function testUploadedFileCreateAnonymousLink(\Office365\PHP\Client\SharePoint\File $uploadFile) + { + $listItem = $uploadFile->getListItemAllFields(); + self::$context->load($listItem,array("EncodedAbsUrl")); + self::$context->executeQuery(); + + $fileUrl = $listItem->getProperty("EncodedAbsUrl"); + $result = Web::createAnonymousLink(self::$context,$fileUrl,false); + self::$context->executeQuery(); + self::assertNotEmpty($result->Value); + + $expireDate = new \DateTime('now +1 day'); + $result = Web::createAnonymousLinkWithExpiration(self::$context,$fileUrl,false,$expireDate->format(DateTime::ATOM)); + self::$context->executeQuery(); + self::assertNotEmpty($result->Value); + } public function testGetFileVersions() { diff --git a/tests/PeopleManagerTest.php b/tests/PeopleManagerTest.php index ee7ad878..453c4b5f 100644 --- a/tests/PeopleManagerTest.php +++ b/tests/PeopleManagerTest.php @@ -11,7 +11,7 @@ class PeopleManagerTest extends SharePointTestCase { - private static $accountName = "i:0#.f|membership|vgrem@mediadev20.onmicrosoft.com"; + private static $accountName = "i:0#.f|membership|vgrem@mediadev88.onmicrosoft.com"; public function testGetMyProperties(){ $peopleManager = new PeopleManager(self::$context); diff --git a/tests/WebTest.php b/tests/WebTest.php index c7180486..53a8d097 100644 --- a/tests/WebTest.php +++ b/tests/WebTest.php @@ -11,7 +11,6 @@ class WebTest extends SharePointTestCase { - public function testGetWebProperties() { $result = self::$context->getWeb()->getSupportedUILanguageIds();