def add(self, web_creation_information):
     web = Web(self.context)
     qry = ServiceOperationQuery(self, "add", None,
                                 web_creation_information)
     self.context.add_query(qry, web)
     self.add_child(web)
     return web
예제 #2
0
 def rootWeb(self):
     """Get root web"""
     if self.is_property_available('RootWeb'):
         return self.properties['RootWeb']
     else:
         return Web(self.context, ResourcePath("RootWeb",
                                               self.resource_path))
 def add(self, web_creation_information):
     web = Web(self.context)
     qry = ClientQuery(self.resource_url + "/add", ActionType.PostMethod,
                       web_creation_information)
     self.context.add_query(qry, web)
     self.add_child(web)
     return web
예제 #4
0
 def add(self, web_creation_information):
     web = Web(self.context)
     qry = ClientQuery(self.resourceUrl + "/add", HttpMethod.Post,
                       web_creation_information)
     self.context.add_query(qry, web)
     self.add_child(web)
     return web
    def from_url(abs_url):
        """
        Constructs ClientContext from absolute Url

        :param str abs_url: Absolute Url to resource
        :return: ClientContext
        """
        base_url = resolve_base_url(abs_url)
        ctx = ClientContext(base_url)
        Web.get_web_url_from_page_url(ctx, abs_url)

        def _init_context_for_web(result):
            ctx._base_url = result.value

        ctx.afterExecuteOnce += _init_context_for_web
        return ctx
 def add(self, web_creation_information):
     web_creation_information._include_metadata = self.include_metadata
     payload = web_creation_information.payload
     web = Web(self.context)
     qry = ClientQuery(self.url + "/add", ActionType.PostMethod, payload)
     self.context.add_query(qry, web)
     self.add_child(web)
     return web
 def web(self):
     """Get Web client object"""
     if not self.__web:
         self.__web = Web(self)
     return self.__web
 def test5_create_file_anon_link(self):
     file_url = self.__class__.target_file.serverRelativeUrl
     result = Web.create_anonymous_link(self.client, file_url, False)
     self.client.execute_query()
     self.assertIsNotNone(result.value)
예제 #9
0
 def add(self, web_creation_information):
     target_web = Web(self.context)
     self.add_child(target_web)
     qry = ServiceOperationQuery(self, "add", None, web_creation_information, "parameters", target_web)
     self.context.add_query(qry)
     return target_web
예제 #10
0
 def test2_get_web_from_page_url(self):
     page_url = "{site_url}SitePages/Home.aspx".format(site_url=settings['url'])
     result = Web.get_web_url_from_page_url(self.client, page_url)
     self.client.execute_query()
     self.assertIsNotNone(result.value)