Skip to content

Commit 6a6919b

Browse files
vvgrem@gmail.comvvgrem@gmail.com
authored andcommitted
SharePoint API: publishing, methods types
1 parent 1995df4 commit 6a6919b

22 files changed

+335
-14
lines changed

generator/metadata/SharePoint.xml

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.runtime.client_value import ClientValue
2+
3+
4+
class OrgAssets(ClientValue):
5+
pass

office365/sharepoint/fields/field.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,22 @@ def delete_object(self):
7777
self.remove_from_parent_collection()
7878
return self
7979

80+
@property
81+
def id(self):
82+
"""Gets a value that specifies the field identifier.
83+
84+
:rtype: str or None
85+
"""
86+
return self.properties.get('Id', None)
87+
88+
@property
89+
def title(self):
90+
"""Gets or sets a value that specifies the display name of the field.
91+
92+
:rtype: str or None
93+
"""
94+
return self.properties.get('Title', None)
95+
8096
@property
8197
def internal_name(self):
8298
"""Gets a value that specifies the field internal name.

office365/sharepoint/fields/fieldGeolocationValue.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@
22

33

44
class FieldGeolocationValue(ClientValue):
5-
pass
5+
6+
def __init__(self, latitude, longitude, altitude=None):
7+
"""
8+
:param float latitude: Specifies the latitude value for Geolocation field.
9+
:param float longitude: Specifies the longitude value for Geolocation field.
10+
:param float altitude: Specifies the altitude value for Geolocation field. It is a user defined value
11+
12+
"""
13+
super().__init__()
14+
self.Latitude = latitude
15+
self.Longitude = longitude
16+
self.Altitude = altitude
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.runtime.client_value import ClientValue
2+
3+
4+
class FilePickerOptions(ClientValue):
5+
pass

office365/sharepoint/publishing/navigation/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from office365.sharepoint.base_entity import BaseEntity
2+
3+
4+
class PrimaryCityTime(BaseEntity):
5+
pass

office365/sharepoint/publishing/sitePage.py

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
from office365.runtime.queries.service_operation_query import ServiceOperationQuery
2+
from office365.runtime.queries.update_entity_query import UpdateEntityQuery
3+
from office365.sharepoint.publishing.site_page_metadata import SitePageMetadata
4+
5+
6+
class SitePage(SitePageMetadata):
7+
"""Represents a site Page."""
8+
9+
def checkout_page(self):
10+
"""Checks out the current Site Page if it is available to be checked out."""
11+
site_page = SitePage(self.context)
12+
qry = ServiceOperationQuery(self, "CheckoutPage", None, None, None, site_page)
13+
self.context.add_query(qry)
14+
return site_page
15+
16+
def copy(self):
17+
"""Creates a copy of the current Site Page and returns the resulting new SitePage."""
18+
qry = ServiceOperationQuery(self, "Copy", None, None, None, None)
19+
self.context.add_query(qry)
20+
return self
21+
22+
def discard_page(self):
23+
"""Discards the current checked out version of the Site Page. Returns the resulting SitePage after discard."""
24+
qry = ServiceOperationQuery(self, "DiscardPage", None, None, None, None)
25+
self.context.add_query(qry)
26+
return self
27+
28+
def save_page(self, page_stream):
29+
"""
30+
Updates the current Site Page with the provided pageStream content.
31+
32+
:param str page_stream: The binary stream to save for the current Site Page.
33+
:return:
34+
"""
35+
pass
36+
37+
def save_page_as_draft(self, page_stream):
38+
"""
39+
Updates the Site Page with the provided pageStream content and checks in a minor version if the page library
40+
has minor versions enabled.
41+
42+
:param str page_stream: The binary stream to save for the current Site Page.
43+
:return:
44+
"""
45+
pass
46+
47+
def save_page_as_template(self):
48+
pass
49+
50+
def publish(self):
51+
"""
52+
Publishes a major version of the current Site Page. Returns TRUE on success, FALSE otherwise.
53+
54+
:return:
55+
"""
56+
pass
57+
58+
def share_page_preview_by_email(self, message, recipient_emails):
59+
pass
60+
61+
def update(self):
62+
"""Updates the Site page."""
63+
qry = UpdateEntityQuery(self)
64+
self.context.add_query(qry)
65+
return self

0 commit comments

Comments
 (0)