# LogicInterface

interface LogicInterface implements PostsLogicInterface, UsersLogicInterface, GroupsLogicInterface, TagsLogicInterface

LogicInterface – main Interface for RESTClient

## Methods

RESTClient
getPosts(string $resourceType = Config\Resourcetype::BIBTEX, string $grouping = Config\Grouping::USER, string $groupingName = '', array $tags = array(), string $resourceHash = '', string $search = '', string $format = 'xml', int $start, int $end = 20)

No description

from PostsLogicInterface
RESTClient
getPostDetails($userName, $resourceHash)

Returns details to a post. A post is uniquely identified by a hash of the corresponding resource and a username.

from PostsLogicInterface
RESTClient
deletePosts(string $userName, string $resourceHash)

Removes the given post - identified by the connected resource's hash - from the user.

from PostsLogicInterface
RESTClient
createPosts(Post|Posts $posts, string $userName)

POST /api/users/[username]/posts

from PostsLogicInterface
RESTClient
updatePosts(ModelObject $posts, string $userName, string $resourceHash)

Updates the post(s) in the database.

from PostsLogicInterface
RESTClient
createDocument(string $filePath, string $resourceHash, string $userName)

Adds a document to a post.

from PostsLogicInterface
RESTClient
changeDocumentName(string $filePath, string $resourceHash, string $userName, Document $document)

Adds a document to a post.

from PostsLogicInterface
RESTClient
getDocumentFile(string $userName, string $resourceHash, string $fileName, string $type = Config\DocumentType::FILE)

No description

from PostsLogicInterface
RESTClient
deleteDocument(string $userName, string $resourceHash, string $fileName)

Deletes an existing document. If the resourceHash is given, the document is assumed to be connected to the corresponding resource (identified by the user name in the document). Otherwise the document is independent of any post.

from PostsLogicInterface
RESTClient
getUsers(int $start, int $end)

URL: /users

from UsersLogicInterface
RESTClient
getUserDetails(string $userName)

/users/[username]

from UsersLogicInterface
RESTClient
createUserRelationship(User $sourceUser, User $targetUser)

We create a UserRelation of the form (sourceUser, targetUser)\in relation sourceUser should be logged in for this

from UsersLogicInterface
RESTClient
getGroups(int $start, int $end)

/groups

from GroupsLogicInterface
RESTClient
getGroupDetails(string $groupName)

/groups/[groupName]

from GroupsLogicInterface
RESTClient
getUserListOfGroup(string $groupName, int $start, int $end)

GET /groups/[groupName]/users

from GroupsLogicInterface
RESTClient
getTags(string $grouping, string $groupingName, string $regex, string $order, int $start, int $end)

/tags ?filter=[regex] ?(user|group|viewable)=[username/groupname] ?order=(frequency|alph)

from TagsLogicInterface
RESTClient
getTagDetails(string $tagName)

/tags/[tag]

from TagsLogicInterface
RESTClient
getTagRelation(int $start, int $end, string $relation, string $tagName)

No description

from TagsLogicInterface
RESTClient
getConcepts(string $resourceType, string $grouping, string $groupingName, string $regex, array $tags, string $status, int $start, int $end)

/concepts

from TagsLogicInterface
RESTClient
getConceptDetails(string $conceptName, string $userName)

GET /users/[userName]/concepts/[conceptName] GET /concepts/[conceptName]

from TagsLogicInterface
RESTClient
createConcept(Tag $concept, string $conceptName, string $userName)

POST /users/[userName]/concepts/[conceptName]

from TagsLogicInterface
RESTClient
updateConcept(Tag $concept, string $userName, string $operation)

PUT /users/[username]/concepts/[conceptname]

from TagsLogicInterface
RESTClient
deleteConcept(string $conceptName, string $userName)

DELETE /users/[username]/concepts/[conceptName]

from TagsLogicInterface

## Details

###
in PostsLogicInterface at line 65
`RESTClient getPosts(string $resourceType = Config\Resourcetype::BIBTEX, string $grouping = Config\Grouping::USER, string $groupingName = '', array $tags = array(), string $resourceHash = '', string $search = '', string $format = 'xml', int $start, int $end = 20)`

#### Parameters

string | $resourceType | resource type (bookmark|bibtex)
string | $grouping | grouping tells whom posts are to be shown: the posts of a user, of a group or of the viewables.
string | $groupingName | name of the grouping. if grouping is user, then its the username. if grouping is set to {@link GroupingEntity#ALL}, then its an empty string!
array | $tags | a set of tags
string | $resourceHash | intraHash value of a resource, if one would like to get a list of all posts belonging to a given resource.
string | $search | free text search
string | $format | Format of received post (xml|json|csl|bibtex|endnote). Default value is 'xml'. If you want to use the model or any ModelRenderer, please keep it empty or use 'xml'.
int | $start | inclusive start index of the view window
int | $end | exclusive end index of the view window

#### Return Value

RESTClient |

###
in PostsLogicInterface at line 77
`RESTClient getPostDetails($userName, $resourceHash)`

Returns details to a post. A post is uniquely identified by a hash of the corresponding resource and a username.

#### Parameters

| $userName |
| $resourceHash |

#### Return Value

RESTClient |

#### Exceptions

ResourceNotFoundException | if the resource of a given resourceHash could not be found

###
in PostsLogicInterface at line 88
`RESTClient deletePosts(string $userName, string $resourceHash)`

Removes the given post - identified by the connected resource's hash - from the user.

#### Parameters

string | $userName | user who's posts are to be removed
string | $resourceHash | hash of the resource, which is connected to the post to delete

#### Return Value

RESTClient |

###
in PostsLogicInterface at line 100
`RESTClient createPosts(Post|Posts $posts, string $userName)`

POST /api/users/[username]/posts

Add post(s) to an user's collection.

#### Parameters

Post|Posts | $posts | the post(s) to add
string | $userName | The username under which the posts will be added

#### Return Value

RESTClient |

###
in PostsLogicInterface at line 112
`RESTClient updatePosts(ModelObject $posts, string $userName, string $resourceHash)`

Updates the post(s) in the database.

#### Parameters

ModelObject | $posts |
string | $userName | user name of the post owner
string | $resourceHash | of the post

#### Return Value

RESTClient |

###
in PostsLogicInterface at line 124
`RESTClient createDocument(string $filePath, string $resourceHash, string $userName)`

Adds a document to a post.

#### Parameters

string | $filePath |
string | $resourceHash |
string | $userName |

#### Return Value

RESTClient |

###
in PostsLogicInterface at line 137
`RESTClient changeDocumentName(string $filePath, string $resourceHash, string $userName, Document $document)`

Adds a document to a post.

#### Parameters

string | $filePath |
string | $resourceHash |
string | $userName |
Document | $document |

#### Return Value

RESTClient |

###
in PostsLogicInterface at line 149
`RESTClient getDocumentFile(string $userName, string $resourceHash, string $fileName, string $type = Config\DocumentType::FILE)`

#### Parameters

string | $userName |
string | $resourceHash |
string | $fileName |
string | $type | (file|SMALL|MIDDLE|LARGE). 'file' returns the considered file (e.g. pdf), SMALL, MEDIUM, LARGE return a png preview image. All options in `\AcademicPuma\RestClient\Config\DocumentType`

#### Return Value

RESTClient |

###
in PostsLogicInterface at line 164
`RESTClient deleteDocument(string $userName, string $resourceHash, string $fileName)`

Deletes an existing document. If the resourceHash is given, the document is assumed to be connected to the corresponding resource (identified by the user name in the document). Otherwise the document is independent of any post.

#### Parameters

string | $userName | user name of the post/document owner
string | $resourceHash | the intraHash of the post the document belongs to
string | $fileName | fileName of the document which should be deleted

#### Return Value

RESTClient |

###
in UsersLogicInterface at line 55
`RESTClient getUsers(int $start, int $end)`

URL: /users

Generic method to retrieve lists of users

#### Parameters

int | $start | start position
int | $end | end position

#### Return Value

RESTClient |

###
in UsersLogicInterface at line 67
`RESTClient getUserDetails(string $userName)`

/users/[username]

Returns details about a specified user

#### Parameters

string | $userName | name of the user we want to get details from

#### Return Value

RESTClient |

###
in UsersLogicInterface at line 79
`RESTClient createUserRelationship(User $sourceUser, User $targetUser)`

We create a UserRelation of the form (sourceUser, targetUser)\in relation sourceUser should be logged in for this

#### Parameters

User | $sourceUser | leftHandSide of the relation
User | $targetUser | rightHandSie of the relation

#### Return Value

RESTClient |

###
in GroupsLogicInterface at line 55
`RESTClient getGroups(int $start, int $end)`

/groups

Returns all groups of the system.

#### Parameters

int | $start | start index
int | $end | end index

#### Return Value

RESTClient |

###
in GroupsLogicInterface at line 67
`RESTClient getGroupDetails(string $groupName)`

/groups/[groupName]

Returns details of one group.

#### Parameters

string | $groupName | name of the group

#### Return Value

RESTClient |

###
in GroupsLogicInterface at line 79
`RESTClient getUserListOfGroup(string $groupName, int $start, int $end)`

GET /groups/[groupName]/users

#### Parameters

string | $groupName | name of the group
int | $start | start index
int | $end | end index

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 64
`RESTClient getTags(string $grouping, string $groupingName, string $regex, string $order, int $start, int $end)`

/tags ?filter=[regex] ?(user|group|viewable)=[username/groupname] ?order=(frequency|alph)

Returns a list of tags which can be filtered.

#### Parameters

string | $grouping | grouping tells whom tags are to be shown: the tags of a user, of a group or of the viewables.
string | $groupingName | name of the grouping. if grouping is user, then its the username. if grouping is set to {@link GroupingEntity#ALL}, then its an empty string!
string | $regex | a regular expression used to filter the tagnames
string | $order | (frequency|alph)
int | $start |
int | $end |

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 82
`RESTClient getTagDetails(string $tagName)`

/tags/[tag]

Returns details about a tag. Those details are:

- details about the tag itself, like number of occurrences etc
- list of subtags
- list of supertags
- list of correlated tags

#### Parameters

string | $tagName | name of the tag

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 93
`RESTClient getTagRelation(int $start, int $end, string $relation, string $tagName)`

#### Parameters

int | $start |
int | $end |
string | $relation |
string | $tagName |

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 111
`RESTClient getConcepts(string $resourceType, string $grouping, string $groupingName, string $regex, array $tags, string $status, int $start, int $end)`

/concepts

Retrieve relations

#### Parameters

string | $resourceType | the reqtested resourcetype
string | $grouping | grouping entity
string | $groupingName | the grouping name
string | $regex | a regex to possibly filter the relatons retrieved
array | $tags | a list of tags which shall be part of the relations
string | $status | the conceptstatus, i.e. all, picked or unpicked
int | $start | start index
int | $end | end index

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 126
`RESTClient getConceptDetails(string $conceptName, string $userName)`

GET /users/[userName]/concepts/[conceptName] GET /concepts/[conceptName]

Retrieve Details for a concept, containing the belonging subTags.

#### Parameters

string | $conceptName | the supertag of the concept
string | $userName | the user name of the user the concept belongs to. If null, system-wide relations will be returned.

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 142
`RESTClient createConcept(Tag $concept, string $conceptName, string $userName)`

POST /users/[userName]/concepts/[conceptName]

Create a new relation/concept note: if a concept already exists with the given name it will be replaced

#### Parameters

Tag | $concept | the tag containing subTags
string | $conceptName | the name of the super tag of the concept
string | $userName | the user name of the user the concept belongs to.

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 155
`RESTClient updateConcept(Tag $concept, string $userName, string $operation)`

PUT /users/[username]/concepts/[conceptname]

Update an existing relation/concept

#### Parameters

Tag | $concept | the concept to update
string | $userName | name of the user who created the concept
string | $operation |

#### Return Value

RESTClient |

###
in TagsLogicInterface at line 168
`RESTClient deleteConcept(string $conceptName, string $userName)`

DELETE /users/[username]/concepts/[conceptName]

Delete an existing concept

#### Parameters

string | $conceptName | name of the concept to delete
string | $userName | name of user holding the concept

#### Return Value

RESTClient |