def ensure_site_assets_library(self):
     """Gets a list that is the default asset location for images or other files, which the users
     upload to their wiki pages."""
     list_site_assets = List(self.context)
     qry = ClientQuery.service_operation_query(self, ActionType.PostMethod, "ensuresiteassetslibrary")
     self.context.add_query(qry, list_site_assets)
     return list_site_assets
Example #2
0
 def undocheckout(self):
     """Reverts an existing checkout for the file."""
     qry = ClientQuery.service_operation_query(self,
                                               ActionType.PostMethod,
                                               "undocheckout",
                                               )
     self.context.add_query(qry)
Example #3
0
 def checkout(self):
     """Checks out the file from a document library based on the check-out type."""
     qry = ClientQuery.service_operation_query(self,
                                               ActionType.PostMethod,
                                               "checkout",
                                               )
     self.context.add_query(qry)
Example #4
0
 def checkin(self, comment, checkin_type):
     """Checks the file in to a document library based on the check-in type."""
     qry = ClientQuery.service_operation_query(self,
                                               ActionType.PostMethod,
                                               "checkin",
                                               {
                                                   "comment": comment,
                                                   "checkInType": checkin_type
                                               }
                                               )
     self.context.add_query(qry)
 def add_template_file(self, url_of_file, template_file_type):
     """Adds a ghosted file to an existing list or document library."""
     file_new = File(self.context)
     qry = ClientQuery.service_operation_query(
         self, ActionType.PostMethod, "addTemplateFile", {
             "urlOfFile": url_of_file,
             "templateFileType": template_file_type
         })
     self.context.add_query(qry, file_new)
     self.add_child(file_new)
     return file_new
 def add(self, file_creation_information):
     """Creates a File resource"""
     file_new = File(self.context)
     qry = ClientQuery.service_operation_query(
         self, ActionType.PostMethod, "add", {
             "overwrite": file_creation_information.overwrite,
             "url": file_creation_information.url
         }, file_creation_information.content)
     self.context.add_query(qry, file_new)
     self.add_child(file_new)
     return file_new
Example #7
0
    def add(self, attachment_file_information):
        """Creates an attachment"""
        if isinstance(attachment_file_information, dict):
            attachment_file_information = AttachmentfileCreationInformation(
                attachment_file_information.get('filename'),
                attachment_file_information.get('content'))

        file_new = File(self.context)
        qry = ClientQuery.service_operation_query(
            self, ActionType.PostMethod, "add", {
                "filename": attachment_file_information.filename,
            }, attachment_file_information.content)
        self.context.add_query(qry, file_new)
        self.add_child(file_new)
        return file_new
 def remove_by_login_name(self, group_name):
     """Removes the cross-site group with the specified name from the collection."""
     qry = ClientQuery.service_operation_query(self, ActionType.PostMethod,
                                               "removebyloginname",
                                               [group_name])
     self.context.add_query(qry)
 def remove_by_id(self, group_id):
     """Removes the group with the specified member ID from the collection."""
     qry = ClientQuery.service_operation_query(self, ActionType.PostMethod,
                                               "removebyid", [group_id])
     self.context.add_query(qry)
 def ensure_site_pages_library(self):
     """Gets a list that is the default location for wiki pages."""
     list_site_pages = List(self.context)
     qry = ClientQuery.service_operation_query(self, ActionType.PostMethod, "ensuresitepageslibrary")
     self.context.add_query(qry, list_site_pages)
     return list_site_pages
Example #11
0
 def ensure_user(self, login_name):
     user = User(self.context)
     qry = ClientQuery.service_operation_query(self, ActionType.PostMethod, "ensureuser", [login_name])
     self.context.add_query(qry, user)
     return user