@Path(value="/user") public class UserWebService extends Object
Constructor and Description |
---|
UserWebService() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
get()
Provide Account information about the currently logged in user (account)
|
javax.ws.rs.core.Response |
getUser(String login,
String types)
Resolve/Redirect access to /user/* uris.
|
void |
initialize() |
javax.ws.rs.core.Response |
login(String ref,
boolean logout,
String login)
Throws a
AccessDeniedException if currently no user is logged in (aka: current user
is anonymous). |
javax.ws.rs.core.Response |
passwd(String oldPwd,
String newPwd)
Update/change the password for the current user.
|
javax.ws.rs.core.Response |
post()
Dummy to avoid exceptions if post body is empty.
|
javax.ws.rs.core.Response |
post(javax.ws.rs.core.MultivaluedMap<String,String> formParams)
Update/Set the profile information (foaf) for the current user.
|
@PostConstruct public void initialize()
@GET @Path(value="/me") @Produces(value="application/json") public javax.ws.rs.core.Response get()
AccountPoJo
of the current user in JSONAccountPoJo
@POST @Path(value="/me") @Consumes(value="application/x-www-form-urlencoded") public javax.ws.rs.core.Response post(javax.ws.rs.core.MultivaluedMap<String,String> formParams)
formParams
- the user profile (foaf, without prefix) in AccountPoJo
after the update in JSONanonymous
., 500 If a RepositoryException
occurs (which should not happen as no
namespaces are used here)@POST @Path(value="/me") public javax.ws.rs.core.Response post()
AccountPoJo
of the current user in JSONpost(MultivaluedMap)
@POST @Path(value="/me/passwd") public javax.ws.rs.core.Response passwd(@FormParam(value="oldPasswd") String oldPwd, @FormParam(value="newPasswd") String newPwd)
oldPwd
- the old (current) password.newPwd
- the new password@GET @Path(value="/{login:[^#?]+}") public javax.ws.rs.core.Response getUser(@PathParam(value="login") String login, @HeaderParam(value="Accept") String types)
login
- the login of the user to redirect totypes
- header param of accepted mime-types@GET @Path(value="/login") public javax.ws.rs.core.Response login(@HeaderParam(value="Referer") String ref, @QueryParam(value="logout")@DefaultValue(value="false") boolean logout, @QueryParam(value="user") String login)
AccessDeniedException
if currently no user is logged in (aka: current user
is anonymous).ref
- the referer to redirect tologout
- set to true to log out (does currently nothing)org.apache.marmotta.platform.core.exception.security.AccessDeniedException
- if currently no user is logged in.logout == true
)Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.