From ee262ee343cab047af1a14f38ce46db1591b9801 Mon Sep 17 00:00:00 2001
From: Andy Stark <30621568+therealandeeee@users.noreply.github.com>
Date: Tue, 31 Oct 2017 14:53:30 +0000
Subject: [PATCH] [ADF-1586] Added Core services docs (#2580)
---
docs/README.md | 8 ++++--
docs/seeAlsoGraph.json | 2 ++
docs/site.model.md | 48 ++++++++++++++++++++++++++++++++++++
docs/sites-api.service.md | 51 +++++++++++++++++++++++++++++++++++++++
4 files changed, 107 insertions(+), 2 deletions(-)
create mode 100644 docs/site.model.md
create mode 100644 docs/sites-api.service.md
diff --git a/docs/README.md b/docs/README.md
index 325d03aa75..a987da2322 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -336,6 +336,10 @@ for more information about installing and using the source code.
- [Node restore directive](node-restore.directive.md)
- [Upload directive](upload.directive.md)
+### Models
+
+- [Site model](site.model.md)
+
### Pipes
- [File size pipe](file-size.pipe.md)
@@ -357,6 +361,7 @@ for more information about installing and using the source code.
- [Nodes api service](nodes-api.service.md)
- [Notification service](notification.service.md)
- [Renditions service](renditions.service.md)
+- [Sites api service](sites-api.service.md)
- [Thumbnail service](thumbnail.service.md)
- [Translation service](translation.service.md)
- [Upload service](upload.service.md)
@@ -379,7 +384,6 @@ for more information about installing and using the source code.
- [*Search api service](../ng2-components/ng2-alfresco-core/src/services/search-api.service.ts)
- [*Search service](../ng2-components/ng2-alfresco-core/src/services/search.service.ts)
- [*Shared links api service](../ng2-components/ng2-alfresco-core/src/services/shared-links-api.service.ts)
-- [*Sites api service](../ng2-components/ng2-alfresco-core/src/services/sites-api.service.ts)
- [*Storage service](../ng2-components/ng2-alfresco-core/src/services/storage.service.ts)
- [*Translate loader service](../ng2-components/ng2-alfresco-core/src/services/translate-loader.service.ts)
@@ -575,7 +579,7 @@ for more information about installing and using the source code.
### Directives
-- [*Extension viewer directive](../ng2-components/ng2-alfresco-viewer/src/directives/extension-viewer.directive.ts)
+- [*Viewer extension directive](../ng2-components/ng2-alfresco-viewer/src/directives/viewer-extension.directive.ts)
[(Back to Contents)](#contents)
diff --git a/docs/seeAlsoGraph.json b/docs/seeAlsoGraph.json
index 4d65492e22..c6aaf73ab1 100644
--- a/docs/seeAlsoGraph.json
+++ b/docs/seeAlsoGraph.json
@@ -82,6 +82,8 @@
"renditions.service": [],
"search-control.component": ["search.component"],
"search.component": [],
+ "site.model": [],
+ "sites-api.service": ["site.model"],
"sites-dropdown.component": [],
"start-process.component": [],
"start-task.component": [],
diff --git a/docs/site.model.md b/docs/site.model.md
new file mode 100644
index 0000000000..a832fa65d9
--- /dev/null
+++ b/docs/site.model.md
@@ -0,0 +1,48 @@
+# Site model
+
+Provides information about a site in a Content Services repository.
+
+## Details
+
+`SiteModel` is returned by methods from the [Sites Api service](sites-api.service.md).
+Also, the
+[`getSite`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitesApi.md#getSite)
+and
+[`getSites`](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitesApi.md#getSites) pages in the Alfresco JS API docs have further information about this API.
+
+```ts
+class SiteModel {
+ role: string;
+ visibility: string;
+ guid: string;
+ description: string;
+ id: string;
+ preset: string;
+ title: string;
+ contents: SiteContentsModel[] = [];
+ members: SiteMembersModel[] = [];
+ pagination: Pagination;
+}
+
+class SiteContentsModel {
+ id: string;
+ folderId: string;
+}
+
+class SiteMembersModel {
+ role: string;
+ firstName: string;
+ emailNotificationsEnabled: boolean = false;
+ company: any;
+ id: string;
+ enable: boolean = false;
+ email: string;
+}
+```
+
+
+
+## See also
+
+- [Sites api service](sites-api.service.md)
+
\ No newline at end of file
diff --git a/docs/sites-api.service.md b/docs/sites-api.service.md
new file mode 100644
index 0000000000..3b45e94842
--- /dev/null
+++ b/docs/sites-api.service.md
@@ -0,0 +1,51 @@
+# Sites Api service
+
+Accesses and manipulates sites from a Content Services repository.
+
+## Methods
+
+`getSites(opts: any = {}): any`
+Gets a list of all sites in the repository.
+
+`getSite(siteId: string, opts?: any): any`
+Gets the details for a site.
+
+`deleteSite(siteId: string, permanentFlag: boolean = true): any`
+Deletes a site.
+
+`getSiteContent(siteId: string): Observable`
+Gets a site's content.
+
+`getSiteMembers(siteId: string): Observable`
+Gets a list of all a site's members.
+
+## Details
+
+You can use `getSites` to get a list of all sites in the repository.
+The sites are returned as `Observable` (see
+[Site Model](site.model.md) for more information about this class).
+If you are only interested in a single site and you have its ID, you
+can use `getSite` to access it. Alternatively, you can use `getSiteContent`
+or `getSiteMembers` to extract just the `contents` and `members` properties
+of the site.
+
+You can also delete a site using `deleteSite`. If the `permanentFlag` parameter
+is set to false then the site will be moved to the trash rather than being
+deleted immediately.
+
+Both `getSite` and `getSites` have an `opts` parameter to supply extra
+options. See the Alfresco JS API docs about
+[getSites](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitesApi.md#getSites)
+and
+[getSite](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/SitesApi.md#getSite)
+for more information about the available options.
+
+
+
+## See also
+
+- [Site model](site.model.md)
+
+
+
+