@Component @Named(value="user") @Singleton public class UserScriptService extends Object implements org.xwiki.script.service.ScriptService
Modifier and Type | Field and Description |
---|---|
static String |
ROLEHINT
The role hint of this component.
|
Constructor and Description |
---|
UserScriptService() |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(UserReference userReference) |
<S extends org.xwiki.script.service.ScriptService> |
get(String serviceName) |
UserProperties |
getAllProperties() |
UserProperties |
getAllProperties(Object... parameters) |
UserProperties |
getAllProperties(UserReference userReference,
Object... parameters) |
UserReference |
getCurrentUserReference() |
UserReference |
getGuestUserReference() |
UserProperties |
getProperties() |
UserProperties |
getProperties(Object... parameters) |
UserProperties |
getProperties(String userReference,
Object... parameters)
Note that we have a
UserReferenceConverter component to automatically convert from
String to UserReference but since in the signature we accept a vararg of Object, the
getProperties(Object...) is called instead when a single string is passed. |
UserProperties |
getProperties(UserReference userReference,
Object... parameters) |
UserReference |
getSuperAdminUserReference() |
String |
serialize(UserReference userReference)
Serialize the given user reference by using the default serializer.
|
public static final String ROLEHINT
public <S extends org.xwiki.script.service.ScriptService> S get(String serviceName)
S
- the type of the ScriptService
serviceName
- the name of the sub ScriptService
ScriptService
or null of none could be found@Unstable public UserProperties getProperties(UserReference userReference, Object... parameters)
userReference
- the reference to the user properties to resolveparameters
- optional parameters that have a meaning only for the specific resolver implementation used@Unstable public UserProperties getProperties(String userReference, Object... parameters)
UserReferenceConverter
component to automatically convert from
String to UserReference
but since in the signature we accept a vararg of Object, the
getProperties(Object...)
is called instead when a single string is passed. This is the reason for this
method, so that it's called when a String is passed.userReference
- the reference to the user properties to resolve.parameters
- optional parameters that have a meaning only for the specific resolver implementation used@Unstable public UserProperties getProperties(Object... parameters)
parameters
- optional parameters that have a meaning only for the specific resolver implementation used@Unstable public UserProperties getProperties()
@Unstable public UserProperties getAllProperties(UserReference userReference, Object... parameters)
userReference
- the reference to the user properties to resolveparameters
- optional parameters that have a meaning only for the specific resolver implementation used@Unstable public UserProperties getAllProperties(Object... parameters)
parameters
- optional parameters that have a meaning only for the specific resolver implementation used@Unstable public UserProperties getAllProperties()
@Unstable public UserReference getGuestUserReference()
@Unstable public UserReference getSuperAdminUserReference()
@Unstable public UserReference getCurrentUserReference()
@Unstable public boolean exists(UserReference userReference)
userReference
- the reference to the user to test for existence (i.e. if the user pointed to by the
reference exists or not - for example the superadmin users or the guest users don't exist,
and a "document"-based User can be constructed and have no profile page and thus not exist)@Unstable public String serialize(UserReference userReference)
userReference
- the user reference to serialize.Copyright © 2004–2021 XWiki. All rights reserved.