Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/doc #1

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
925cd3b
Release 0.1.0
ghoullier Apr 27, 2017
306539b
chore(git) Update gitignore file structure
ghoullier Apr 27, 2017
3465e25
first commit for contexts/workflows
Apr 27, 2017
60a9d96
Merge branch 'develop' of github.com:zetapush/zetapush-recipies into …
Apr 27, 2017
4505e97
Test recipe for contexts
May 2, 2017
1b41c3d
fix(api) Move public api macros with service reference to impl
ghoullier May 4, 2017
8c4e0e7
feat(context) Expose workflow template
ghoullier May 5, 2017
6313a62
feat(syntax-benefits/utils) Support new syntax benfits class and async
ghoullier May 9, 2017
3e7055f
feat(syntax-benefits/config) Support new syntax benfits class and async
ghoullier May 9, 2017
67d4da2
feat(syntax-benefits/group) Support new syntax benfits class and async
ghoullier May 9, 2017
8c5b86b
feat(syntax-benefits/file) Support new syntax benefits class and async
ghoullier May 11, 2017
4a4dcc5
feat(syntax-benefits/user) Support new syntax benefits class and async
ghoullier May 11, 2017
58714b5
feat(syntax-benefits/role) Support new syntax benefits class and async
ghoullier May 15, 2017
bb19185
feat(syntax-benefits/user) Support new syntax benefits class and async
ghoullier May 15, 2017
60078e6
feat(syntax-benefits/organization) Support new syntax benefits class …
ghoullier May 15, 2017
497c62a
feat(syntax-benefits/conversation) Support new syntax benefits class …
ghoullier May 15, 2017
7d08431
feat(syntax-benefits/whiteboard) Support new syntax benefits class an…
ghoullier May 15, 2017
36285b4
feat(syntax-benefits/plugin/email) Support new syntax benefits class …
ghoullier May 15, 2017
bac836c
Finish syntax-benefits
ghoullier May 15, 2017
f6dd9f8
fix(user) Change update by service
ghoullier May 18, 2017
6cc5bf5
feat(config) Update StringConfig type
ghoullier Jun 15, 2017
4455c63
feat(user) Add update user test
ghoullier Jun 15, 2017
8a6542e
chore(room) Rename public api conversation by room
ghoullier Jun 20, 2017
936efbf
chore(version) Bump to 1.0.0
ghoullier Jun 20, 2017
41cedfe
feat(room) Add data message type
ghoullier Jun 20, 2017
ebee921
feat(room) Update memebership behavior
ghoullier Jun 20, 2017
e4dfed9
feat(room/invitation) Add initial support for invitation room
ghoullier Jun 20, 2017
87cf891
chore(git) Add *.zmar to ignore list
ghoullier Jun 20, 2017
f8fac8c
doc(copyright) Update copyright
ghoullier Jun 21, 2017
7e51153
doc(utils/targets) Add minimal doc for targets storage
ghoullier Jun 21, 2017
5ccae3d
feat(room/invitation) Update invitation model
ghoullier Jun 21, 2017
63ed5aa
feat(room/invitation) Update events handlers
ghoullier Jun 21, 2017
24b8e4a
doc(events) Update doc for high level api events
ghoullier Jun 21, 2017
34fce73
fix(room) Change targets definition from string to string[]
ghoullier Jun 22, 2017
9c690b8
fix(room) Update Room grants property
ghoullier Jun 23, 2017
1fe8e7d
chore(git) Update gitignore file structure
ghoullier Apr 27, 2017
edc81ae
first commit for contexts/workflows
Apr 27, 2017
b94829f
Test recipe for contexts
May 2, 2017
286b6b0
fix(api) Move public api macros with service reference to impl
ghoullier May 4, 2017
71a6861
feat(context) Expose workflow template
ghoullier May 5, 2017
40ef2c1
feat(syntax-benefits/utils) Support new syntax benfits class and async
ghoullier May 9, 2017
217aef5
feat(syntax-benefits/config) Support new syntax benfits class and async
ghoullier May 9, 2017
cae8765
feat(syntax-benefits/group) Support new syntax benfits class and async
ghoullier May 9, 2017
cd7ee9d
feat(syntax-benefits/file) Support new syntax benefits class and async
ghoullier May 11, 2017
3c14d3d
feat(syntax-benefits/user) Support new syntax benefits class and async
ghoullier May 11, 2017
16afa32
feat(syntax-benefits/role) Support new syntax benefits class and async
ghoullier May 15, 2017
edb7954
feat(syntax-benefits/user) Support new syntax benefits class and async
ghoullier May 15, 2017
4878cf3
feat(syntax-benefits/organization) Support new syntax benefits class …
ghoullier May 15, 2017
dc2ad5d
feat(syntax-benefits/conversation) Support new syntax benefits class …
ghoullier May 15, 2017
277ecdd
feat(syntax-benefits/whiteboard) Support new syntax benefits class an…
ghoullier May 15, 2017
1cfdd58
feat(syntax-benefits/plugin/email) Support new syntax benefits class …
ghoullier May 15, 2017
cc45761
fix(user) Change update by service
ghoullier May 18, 2017
66a982e
feat(config) Update StringConfig type
ghoullier Jun 15, 2017
ed86f3a
feat(user) Add update user test
ghoullier Jun 15, 2017
ba81313
chore(room) Rename public api conversation by room
ghoullier Jun 20, 2017
bce6571
chore(version) Bump to 1.0.0
ghoullier Jun 20, 2017
3c5536d
feat(room) Add data message type
ghoullier Jun 20, 2017
9737e2d
feat(room) Update memebership behavior
ghoullier Jun 20, 2017
141fbe4
feat(room/invitation) Add initial support for invitation room
ghoullier Jun 20, 2017
009a360
chore(git) Add *.zmar to ignore list
ghoullier Jun 20, 2017
a7e095c
doc(copyright) Update copyright
ghoullier Jun 21, 2017
3566b3e
doc(utils/targets) Add minimal doc for targets storage
ghoullier Jun 21, 2017
a4ed64f
feat(room/invitation) Update invitation model
ghoullier Jun 21, 2017
29c03db
feat(room/invitation) Update events handlers
ghoullier Jun 21, 2017
60b7cfa
doc(events) Update doc for high level api events
ghoullier Jun 21, 2017
c08431d
fix(room) Change targets definition from string to string[]
ghoullier Jun 22, 2017
ad7713b
fix(room) Update Room grants property
ghoullier Jun 23, 2017
4af6a1b
Merge remote-tracking branch 'origin/develop' into develop
ghoullier Jul 17, 2017
9e94dbb
feat(doc)
aGautrain Jul 17, 2017
f1e3369
feat(doc)
aGautrain Jul 17, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
src-gen/
target/
.settings/

*.zmapp
*.zmar
151 changes: 148 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# ZetaPush Official Recipes

> This monorepo contains all official recipes
> This monorepo contains all official recipes

## Overview

*High level recipes abstracting the use of Zetapush services*

Core recipes

- Config
- Conversation
- Room
- File
- Group
- Notification
Expand All @@ -23,4 +25,147 @@ Plugin recipes

## Documentation

Coming Soon
Recipes propose API verbs contained in the folder `src/api/`, the one you may call in your macros. Additionally, some recipes contain a folder `src/impl` which you might need if you want to create your own API verbs.

*No documentation will be provided for these particular macros as using them probably means you're advanced enough with the use of ZetaPush services.*

### Config ###

Config recipe has been created to easily store a global string or object. That's why the api is separated into two parts, `src/api/object` and `src/api/string`. The api verbs are the same for both part, and they consist of :

* get<Type>Config
* list<Type>Config
* remove<Type>Config
* set<Type>Config

Where <Type> is Object or String, depending on the type you want to manipulate. The config recipe will manipulate a Gda table impersonating a global user, and simplify you the use of a shared storage.


### Conversation ###

Conversation recipe, as the name suggests it, is designed for creating a conversation (= a list of messages shared between defined users) and adding/modifying messages in an existing conversation.

* addConversationMessage
* createConversation
* createOneToOneConversation
* getConversation
* getConversationMessageList
* getUserConversationList
* purgeConversationMessageList
* purgeConversationMessage

By using this recipe you will overpass the system of permissions and storage access which will be delegated to the macros listed above.

### File ###

File upload is a specificity of the HDFS storage. When uploading you first need the url where to upload the file. Then the upload is handled by the client, by example with an AJAX request.

* confirmFileUpload
* deleteFileEntry
* getFileEntry
* getFileEntryList
* requestFileUpload

### Group ###

Group recipe offers high level macros to interact with groups, and implements metadata to them. If you need a global group (global means public in this context), you may need Organization recipe.

* createGroup
* deleteGroup
* getGroup
* getGroupList
* getUserGroupList

* addGroupMember
* isMemberOf
* removeGroupMember

### Notification ###

TODO

### Organization ###

An organization is exactly what you need when you would like to have a "global" group where all users are in by default.
On their creation, users will be auto-addded to the organization set as default. You can visualize organizations as specific groups, attributed to a global user.

* createOrganization
* getDefaultOrganization
* setDefaultOrganization
* getOrganization
* getOrganizationList
* getUserOrganizationList

* addOrganizationMember
* removeOrganizationMember

* getUserContactList

### Role ###

Three entities : Member, Permission, Role

TODO

### User ###

Users can be managed from the user recipe. This recipe gives an access to several methods allowing creation of new user and modification of user informations such as the password, the avatar, or custom ones.

`> src/api/avatar`
* updateUserAvatar

`> src/api/password`
* confirmUserPassword
* resetUserPassword
* resetUserPasswordByLogin

`> src/api/user`
* createUser
* getUser
* getUserByLogin
* getUserList
* updateUser

*Without the ByLogin suffix, the current user key (matching __userKey) is used. ByLogin permits to chose the user to impersonate.*

### Utils ###

The utils recipe (used by most of the other recipes) include gestion of three entities : metadata, tags, targets. For each entity, get, remove and set are proposed.
Moreover utils recipe brings common macros and constants you may need such as hashing, mapping, generating uuid, global user, etc...

`> src/api/utils`
* explode
* hash
* implode
* map
* pagination
* reduce
* string
* uuid

`> src/api/<Type>`
* get<Type>
* remove<Type>
* set<Type>

Where <Type> is Metadata, Tags or Targets.

### Whiteboard ###

Whiteboard recipe is closely related to conversation recipe. It brings possibility to attribute a whiteboard to a conversation, which is just a set of objects added and linked to the conversation. Then you will be able to modify or remove these objects with the following methods.

* createWhiteboard

* addWhiteboardObject
* getWhiteboardObjectList
* purgeWhiteboardObjectList
* updateWhiteboardObject


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas besoin de mettre 2 sauts de lignes à la fin de ton fichier








3 changes: 0 additions & 3 deletions com.zetapush.core.config/.gitignore

This file was deleted.

10 changes: 10 additions & 0 deletions com.zetapush.core.config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Config Recipe ###

Config recipe has been created to easily store a global string or object. That's why the api is separated into two parts, `src/api/object` and `src/api/string`. The api verbs are the same for both part, and they consist of :

* get<Type>Config
* list<Type>Config
* remove<Type>Config
* set<Type>Config

Where <Type> is Object or String, depending on the type you want to manipulate. The config recipe will manipulate a Gda table impersonating a global user, and simplify you the use of a shared storage.
7 changes: 5 additions & 2 deletions com.zetapush.core.config/recipe.zms
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/**
* ZetaPush Official Core Recipe
* Provide config APIs
*
* Licence MIT
* Copyright ZetaPush SAS © 2016-2017
*/
recipe com.zetapush.core.config 2.0.0;
recipe com.zetapush.core.config 1.0.0;

import recipe com.zetapush.core.utils 2.0.0 in zpRecipeUtils;
import recipe com.zetapush.core.utils 1.0.0 in zpRecipeUtils;

// Constants

Expand Down
7 changes: 7 additions & 0 deletions com.zetapush.core.config/src/api/object/__types__.zms
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class ObjectConfigPaginatedList extends zpRecipeUtils::PaginatedList {
ObjectConfig[] content;
}

class ObjectConfig extends zpRecipeUtils::Storable {
/** Value */ map value;
}
6 changes: 3 additions & 3 deletions com.zetapush.core.config/src/api/object/getObjectConfig.zms
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ macroscript getObjectConfig(
/** Config id */ @NotNull string id
) {
/** Get stored config entry */
var { result: { revision, update, value: { value } } } = sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__getStoredObject({
const stored = sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__getStoredObject({
id, table: TABLE_OBJECT_CONFIG, zpService: zpServiceGda
}) hardFail;
} broadcast { id, value, revision, update } on channel __selfName
});
} broadcast new ObjectConfig(stored.id, stored.revision, stored.update, stored.value.wrapper) on channel __selfName
11 changes: 4 additions & 7 deletions com.zetapush.core.config/src/api/object/listObjectConfig.zms
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
macroscript listObjectConfig(
/** Pagination query */ map page
class zpRecipeUtils::Pagination page
) {
/** List stored objects */
var { result } = sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__listStoredObject({
const list = sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__listStoredObject({
table: TABLE_OBJECT_CONFIG, page, zpService: zpServiceGda
}) hardFail;
/** Destructure result properties */
var content = coll:map(result.content, entry -> zpRecipeUtils::map_entry_key_value(entry));
page = result.page;
} broadcast { content, page } on channel __selfName
});
} broadcast new ObjectConfigPaginatedList(list.page, list.content) on channel __selfName
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
macroscript removeObjectConfig(
/** Config id */ @NotNull string id
) {
sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__removeStoredObject({
/** Remove stored object */
sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__removeStoredObject({
id, table: TABLE_OBJECT_CONFIG, zpService: zpServiceGda
}) hardFail;
} broadcast { id } on channel __selfName
});
} broadcast { string id } on channel __selfName
8 changes: 4 additions & 4 deletions com.zetapush.core.config/src/api/object/setObjectConfig.zms
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ macroscript setObjectConfig(
/** Config Id */ @NotNull string id,
/** Config Value */ @NotNull value
) {
var { result: { revision, update } } = sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__setStoredObject({
id, value: { value }, table: TABLE_OBJECT_CONFIG, zpService: zpServiceGda
}) hardFail;
} broadcast { id, value, revision, update } on channel __selfName
const stored = sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__setStoredObject({
id, value: { wrapper: value }, table: TABLE_OBJECT_CONFIG, zpService: zpServiceGda
});
} broadcast new ObjectConfig(stored.id, stored.revision, stored.update, stored.value.wrapper) on channel __selfName
7 changes: 7 additions & 0 deletions com.zetapush.core.config/src/api/string/__types__.zms
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class StringConfigPaginatedList extends zpRecipeUtils::PaginatedList {
StringConfig[] content;
}

class StringConfig extends zpRecipeUtils::Storable {
/** Value */ string value;
}
8 changes: 3 additions & 5 deletions com.zetapush.core.config/src/api/string/getStringConfig.zms
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ macroscript getStringConfig(
/** String Config Id */ @NotNull string id
) {
/** Get stored config entry */
var { result: { revision, update, value } } = sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__getStoredObject({
const stored = sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__getStoredObject({
id, table: TABLE_STRING_CONFIG, zpService: zpServiceGda
}) hardFail;
/** Implode stored value */
value = zpRecipeUtils::implode(value);
} broadcast { id, value, revision, update } on channel __selfName
});
} broadcast new StringConfig(stored.id, stored.revision, stored.update, zpRecipeUtils::implode(stored.value)) on channel __selfName
11 changes: 4 additions & 7 deletions com.zetapush.core.config/src/api/string/listStringConfig.zms
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
macroscript listStringConfig(
/** Pagination query */ map page
class zpRecipeUtils::Pagination page
) {
/** List stored objects */
var { result } = sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__listStoredObject({
const list = sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__listStoredObject({
table: TABLE_STRING_CONFIG, page, zpService: zpServiceGda
}) hardFail;
/** Destructure result properties */
var content = coll:map(result.content, entry -> zpRecipeUtils::map_entry_key_value(entry));
page = result.page;
} broadcast { content, page } on channel __selfName
});
} broadcast new StringConfigPaginatedList(list.page, list.content) on channel __selfName
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
macroscript removeStringConfig(
/** Config id */ @NotNull string id
) {
sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__removeStoredObject({
sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__removeStoredObject({
id, table: TABLE_STRING_CONFIG, zpService: zpServiceGda
}) hardFail;
} broadcast { id } on channel __selfName
});
} broadcast { string id } on channel __selfName
7 changes: 4 additions & 3 deletions com.zetapush.core.config/src/api/string/setStringConfig.zms
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ macroscript setStringConfig(
/** Config Id */ @NotNull string id,
/** Config Value */ @NotNull string value
) {
var { result: { revision, update } } = sudo zpRecipeUtils::GLOBAL_OWNER call zpRecipeUtils::core_utils__setStoredObject({
/** Set stored config entry */
const stored = sudo zpRecipeUtils::GLOBAL_OWNER await zpRecipeUtils::core_utils__setStoredObject({
id, value: zpRecipeUtils::explode(value, CONFIG_VALUE_CELL_LIMIT), table: TABLE_STRING_CONFIG, zpService: zpServiceGda
}) hardFail;
} broadcast { id, value, revision, update } on channel __selfName
});
} broadcast new StringConfig(stored.id, stored.revision, stored.update, zpRecipeUtils::implode(stored.value)) on channel __selfName
4 changes: 4 additions & 0 deletions com.zetapush.core.context.tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# generated by the ZMS compilation process
target/

zms.user.properties
38 changes: 38 additions & 0 deletions com.zetapush.core.context.tests/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.zetapush.core.context.tests</name>
<comment></comment>
<projects>
<project>com.zetapush.core.context</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
<filteredResources>
<filter>
<id>1490884040025</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-true-false-target</arguments>
</matcher>
</filter>
<filter>
<id>1490884040026</id>
<name></name>
<type>6</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-true-false-com.zetapush.core.context.tests-*.zmapp</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
3 changes: 3 additions & 0 deletions com.zetapush.core.context.tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### README for com.zetapush.core.context.tests

Documentation in markdown format for a comprehensive description
8 changes: 8 additions & 0 deletions com.zetapush.core.context.tests/init.zms
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sudo contexts::CONTEXT_TEMPLATES_VIRTUAL_USER call contexts::createContextTemplate({
contextTemplateId : TEMPLATE_CTX_VENTES,
contextTemplateName : 'Ventes immobilières',
workflowTemplateName : TEMPLATE_WF_VENTES,
fields : [],
groups : [contexts::CONTEXT_MANAGERS_GROUP_FQN],
defaultWorkflowState : VENTES_STATE_CREATED
});