@ExperimentalApi public class RelationResource extends Object
Constructor and Description |
---|
RelationResource(RelationService relationService,
PersonService personService) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
create(String sourceType,
String sourceKey,
String relationName,
String targetType,
String targetKey)
Add a relationship between two user, space, or content entities.
|
javax.ws.rs.core.Response |
delete(String sourceType,
String sourceKey,
String relationName,
String targetType,
String targetKey)
Remove a relationship between two user, space, or content entities.
|
javax.ws.rs.core.Response |
isRelated(String sourceType,
String sourceKey,
String relationName,
String targetType,
String targetKey)
Determines whether a relationship exists between two user, space or content entities.
|
public RelationResource(RelationService relationService, PersonService personService)
public javax.ws.rs.core.Response isRelated(String sourceType, String sourceKey, String relationName, String targetType, String targetKey) throws NotFoundException, PermissionException
Determines whether a relationship exists between two user, space or content entities.
Example request URI(s):
GET http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toSpace/SPC
GET http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toContent/1234
sourceType
- the source type of the relationship - possible values are user, space or content
for favourites, only 'user' is permittedsourceKey
- the identifier of the source of the relationship -
possible values are a user key, 'current' (logged in user), space key or content identifierrelationName
- the name of the relationship type (must be 'favourite')targetType
- the target type of the relationship -
possible values are user, space or contenttargetKey
- the identifier of the target of the relationship -
possible values are a user key, 'current' (logged in user), space key or content identifier
for favourites, only a space key or content identifier is permittedNotFoundException
PermissionException
public javax.ws.rs.core.Response create(String sourceType, String sourceKey, String relationName, String targetType, String targetKey) throws NotFoundException, PermissionException
Add a relationship between two user, space, or content entities.
Favourite relationships between users and space, page or blog posts are supported. More relationship types will become available as development progresses.
For favourites, the current user can create a favourite relationship between themselves and a space, page or blog post. A space administrator can add a favourite relationship for any user.
Example request URI(s):
PUT http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toSpace/SPC
PUT http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toContent/1234
sourceType
- the source type of the relationship - possible values are user, space or content
for favourites, only 'user' is permittedsourceKey
- the identifier of the source of the relationship -
possible values are a user key, 'current' (logged in user), space key or content identifierrelationName
- the name of the relationship type (must be 'favourite')targetType
- the target type of the relationship -
possible values are user, space or contenttargetKey
- the identifier of the target of the relationship -
possible values are a user key, 'current' (logged in user), space key or content identifier
for favourites, only a space key or content identifier is permittedNotFoundException
PermissionException
public javax.ws.rs.core.Response delete(String sourceType, String sourceKey, String relationName, String targetType, String targetKey) throws NotFoundException, PermissionException
Remove a relationship between two user, space, or content entities.
For favourites, the current user can delete their own favourite relationships. A space administrator can delete a favourite relationship for any user.
Example request URI(s):
DELETE http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toSpace/SPC
DELETE http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toContent/1234
sourceType
- the source type of the relationship - possible values are user, space or content
for favourites, only 'user' is permittedsourceKey
- the identifier of the source of the relationship -
possible values are a user key, 'current' (logged in user), space key or content identifierrelationName
- the name of the relationship type (must be 'favourite')targetType
- the target type of the relationship -
possible values are user, space or contenttargetKey
- the identifier of the target of the relationship -
possible values are a user key, 'current' (logged in user), space key or content identifier
for favourites, only a space key or content identifier is permittedNotFoundException
PermissionException
Copyright © 2003–2016 Atlassian. All rights reserved.