Exemplo n.º 1
0
 def items(self):
     """All items contained in the list."""
     if self.is_property_available('items'):
         return self.properties['items']
     else:
         return ListItemCollection(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "items"))
Exemplo n.º 2
0
 def fields(self):
     """Gets a value that specifies the collection of all fields in the list."""
     if self.is_property_available('Fields'):
         return self.properties['Fields']
     else:
         return FieldCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path, "Fields"))
Exemplo n.º 3
0
 def lists(self):
     """Get web list collection"""
     if self.is_property_available('Lists'):
         return self.properties['Lists']
     else:
         return ListCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path, "lists"))
Exemplo n.º 4
0
 def attachmentFiles(self):
     """Get attachment files"""
     if self.is_property_available('AttachmentFiles'):
         return self.properties["AttachmentFiles"]
     else:
         from office365.sharepoint.attachmentfile_collection import AttachmentfileCollection
         return AttachmentfileCollection(self.context,
                                         ResourcePathEntity(self.context, self.resourcePath, "AttachmentFiles"))
Exemplo n.º 5
0
 def columns(self):
     """The collection of columns under this site."""
     if self.is_property_available('columns'):
         return self.properties['columns']
     else:
         return ColumnDefinitionCollection(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "columns"))
Exemplo n.º 6
0
 def lists(self):
     """The collection of lists under this site."""
     if self.is_property_available('lists'):
         return self.properties['lists']
     else:
         return ListCollection(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "lists"))
Exemplo n.º 7
0
 def drive(self):
     """The default drive (document library) for this site."""
     if self.is_property_available('drive'):
         return self.properties['drive']
     else:
         return Drive(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "drive"))
 def children(self):
     """Collection containing Item objects for the immediate children of Item. Only items representing folders
     have children."""
     if self.is_property_available('children'):
         return self.properties['children']
     else:
         from office365.onedrive.driveItemCollection import DriveItemCollection
         return DriveItemCollection(self.context, ResourcePathEntity(self.context, self.resourcePath, "children"))
Exemplo n.º 9
0
 def contacts(self):
     """Get a contact collection from the default Contacts folder of the signed-in user (.../me/contacts),
     or from the specified contact folder."""
     if self.is_property_available('contacts'):
         return self.properties['contacts']
     else:
         return ContactCollection(
             self.context,
             ResourcePathEntity(self, self._resource_path, "contacts"))
Exemplo n.º 10
0
 def parent_web(self):
     """Gets the parent website of the specified website."""
     if self.is_property_available('ParentWeb'):
         return self.properties['ParentWeb']
     else:
         return User(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "ParentWeb"))
 def set_property(self, name, value, serializable=True):
     super(Group, self).set_property(name, value, serializable)
     # fallback: create a new resource path
     if self._resource_path is None:
         if name == "id":
             self._resource_path = ResourcePathEntity(
                 self.context,
                 self._parent_collection.resourcePath,
                 value)
Exemplo n.º 12
0
 def content_types(self):
     """Gets the content types that are associated with the list."""
     if self.is_property_available('ContentTypes'):
         return self.properties['ContentTypes']
     else:
         return ContentTypeCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "contenttypes"))
Exemplo n.º 13
0
 def root_folder(self):
     """Get a root folder"""
     if self.is_property_available('RootFolder'):
         return self.properties["RootFolder"]
     else:
         return Folder(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "RootFolder"))
Exemplo n.º 14
0
 def groups(self):
     """Gets a collection of group objects that represents all of the groups for the user."""
     if self.is_property_available('Groups'):
         return self.properties['Groups']
     else:
         from office365.sharepoint.group_collection import GroupCollection
         return GroupCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path, "Groups"))
Exemplo n.º 15
0
 def drive(self):
     """Only present on document libraries. Allows access to the list as a drive resource with driveItems."""
     if self.is_property_available('drive'):
         return self.properties['drive']
     else:
         from office365.onedrive.drive import Drive
         return Drive(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "drive"))
Exemplo n.º 16
0
 def site_users(self):
     """Get site users"""
     if self.is_property_available('SiteUsers'):
         return self.properties['SiteUsers']
     else:
         return UserCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "siteusers"))
Exemplo n.º 17
0
 def list_item_all_fields(self):
     """Specifies the list item field (2) values for the list item corresponding to the folder."""
     if self.is_property_available('ListItemAllFields'):
         return self.properties["ListItemAllFields"]
     else:
         return ListItem(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "ListItemAllFields"))
Exemplo n.º 18
0
 def folder(self):
     """Get folder"""
     if self.is_property_available("Folder"):
         return self.properties["Folder"]
     else:
         from office365.sharepoint.folder import Folder
         return Folder(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "Folder"))
Exemplo n.º 19
0
 def files(self):
     """Get a file collection"""
     if self.is_property_available('Files'):
         return self.properties["Files"]
     else:
         from office365.sharepoint.file_collection import FileCollection
         return FileCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path, "Files"))
Exemplo n.º 20
0
 def folders(self):
     """Get folder resources"""
     if self.is_property_available('Folders'):
         return self.properties['Folders']
     else:
         return FolderCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "folders"))
Exemplo n.º 21
0
 def file(self):
     """Get file"""
     if self.is_property_available("File"):
         return self.properties["File"]
     else:
         from office365.sharepoint.file import File
         return File(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "File"))
Exemplo n.º 22
0
 def listItem(self):
     """For drives in SharePoint, the associated document library list item."""
     if self.is_property_available('listItem'):
         return self.properties['listItem']
     else:
         return ListItem(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath,
                                "listItem"))
Exemplo n.º 23
0
 def listitem_allfields(self):
     """Gets a value that specifies the list item field values for the list item corresponding to the file."""
     if self.is_property_available('ListItemAllFields'):
         return self.properties['ListItemAllFields']
     else:
         return ListItem(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "listItemAllFields"))
Exemplo n.º 24
0
 def folders(self):
     """Get a folder collection"""
     if self.is_property_available('Folders'):
         return self.properties["Folders"]
     else:
         from office365.sharepoint.folder_collection import FolderCollection
         return FolderCollection(
             self.context,
             ResourcePathEntity(self.context, self.resourcePath, "Folders"))
Exemplo n.º 25
0
 def views(self):
     """Gets a value that specifies the collection of all public views on the list and personal views
     of the current user on the list."""
     if self.is_property_available('Views'):
         return self.properties['Views']
     else:
         return ViewCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path, "views"))
Exemplo n.º 26
0
 def root_web(self):
     """Get root web"""
     if self.is_property_available('RootWeb'):
         return self.properties['RootWeb']
     else:
         return Web(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "RootWeb"))
Exemplo n.º 27
0
    def resource_path(self):
        resource_path = super(List, self).resource_path
        if resource_path:
            return resource_path

        # fallback: create a new resource path
        if self.is_property_available("Id"):
            self._resource_path = ResourcePathEntity(
                self.context, self._parent_collection.resource_path,
                ODataPathParser.from_method("GetById",
                                            [self.properties["Id"]]))
        elif self.is_property_available("Title"):
            self._resource_path = ResourcePathEntity(
                self.context, self._parent_collection.resource_path,
                ODataPathParser.from_method("GetByTitle",
                                            [self.properties["Title"]]))

        return self._resource_path
Exemplo n.º 28
0
 def resource_path(self):
     resource_path = super(BaseItem, self).resource_path
     if resource_path:
         return resource_path
     if self.is_property_available("Id"):
         return ResourcePathEntity(
             self.context,
             self._parent_collection.resource_path,
             self.properties["Id"])
Exemplo n.º 29
0
 def users(self):
     """Gets a collection of user objects that represents all of the users in the group."""
     from office365.sharepoint.user_collection import UserCollection
     if self.is_property_available('Users'):
         return self.properties['Users']
     else:
         return UserCollection(
             self.context,
             ResourcePathEntity(self.context, self.resource_path, "Users"))
Exemplo n.º 30
0
 def current_user(self):
     """Gets the current user."""
     if self.is_property_available('CurrentUser'):
         return self.properties['CurrentUser']
     else:
         return User(
             self.context,
             ResourcePathEntity(self.context, self.resource_path,
                                "CurrentUser"))