|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.social.service.rest.Util
public final class Util
Util.java: utility class for rest
.
| Method Summary | |
|---|---|
static String |
buildAbsoluteAvatarURL(org.exoplatform.social.core.identity.model.Identity resultIdentity)
Build absolute AvatarURL from in IndentityRestOut if avatar == null or "" use default avatar base on Identity's type |
static void |
buildAbsoluteAvatarURL(IdentityRestOut resultIdentity)
Build absolute AvatarURL from in IndentityRestOut if avatar == null or "" use default avatar base on Identity's type |
static String |
convertTimestampToTimeString(long timestamp)
Converts a timestamp string to time string by the pattern: EEE MMM d HH:mm:ss Z yyyy. |
static org.exoplatform.social.core.manager.ActivityManager |
getActivityManager()
Deprecated. Use getActivityManager(String) instead.
Will be removed by 1.3.x |
static org.exoplatform.social.core.manager.ActivityManager |
getActivityManager(String portalContainerName)
Gets ActivityManager with specified portal container name. |
static org.exoplatform.social.core.identity.model.Identity |
getAuthenticatedUserIdentity(String portalContainerName)
Gets UserIdentity of authenticated user. |
static String |
getBaseUrl()
Gets base url (host + post) from a context uriInfo. |
static org.exoplatform.social.core.manager.IdentityManager |
getIdentityManager()
Deprecated. Use getIdentityManager(String) instead.
Will be removed by 1.3.x |
static org.exoplatform.social.core.manager.IdentityManager |
getIdentityManager(String portalContainerName)
Gets IdentityManager with specified portal container name. |
static javax.ws.rs.core.MediaType |
getMediaType(String format)
Deprecated. User getMediaType(String, String[]) instead.
Will be removed by 1.3.x |
static javax.ws.rs.core.MediaType |
getMediaType(String expectedFormat,
String[] supportedFormats)
Gets the media type from an expected format string (usually the input) and an array of supported format strings. |
static String |
getMimeTypeOfURL(String urlString)
Try to guess the mime type of url using the Content-Type from header, the extension of filename or some bytes of content. |
static org.exoplatform.social.core.identity.model.Identity |
getOwnerIdentityIdFromActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
Deprecated. Use getOwnerIdentityIdFromActivity(String, ExoSocialActivity) instead.
Will be removed by 1.3.x |
static org.exoplatform.social.core.identity.model.Identity |
getOwnerIdentityIdFromActivity(String portalContainerName,
org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
Gets a owner identity Id from a provided activity. |
static org.exoplatform.container.PortalContainer |
getPortalContainerByName(String portalContainerName)
Gets a portal container by its name. |
static org.exoplatform.social.core.manager.RelationshipManager |
getRelationshipManager()
Deprecated. Use getRelationshipManager(String) instead.
Will be removed by 1.3.x |
static org.exoplatform.social.core.manager.RelationshipManager |
getRelationshipManager(String portalContainerName)
Gets RelationshipManager with specified portal container name. |
static javax.ws.rs.core.Response |
getResponse(Object entity,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.Response.Status status)
Gets the response object constructed from the provided params. |
static org.exoplatform.social.core.space.spi.SpaceService |
getSpaceService()
Deprecated. Use getSpaceService(String) instead.
Will be removed by 1.3.x |
static org.exoplatform.social.core.space.spi.SpaceService |
getSpaceService(String portalContainerName)
Gets SpaceService with specified portal container name. |
static org.exoplatform.social.core.identity.model.Identity |
getUserIdentity(String userName,
boolean loadProfile)
Deprecated. Use getUserIdentity(String, String, boolean) instead.
Will be removed by 1.3.x |
static org.exoplatform.social.core.identity.model.Identity |
getUserIdentity(String portalContainerName,
String userName,
boolean loadProfile)
Gets identity from the remote id (user name) |
static String |
getViewerId(javax.ws.rs.core.UriInfo uriInfo)
Get viewerId from servlet request data information provided by OpenSocial signed request. |
static org.exoplatform.social.core.identity.model.Identity |
getViewerIdentity(String viewerId)
Deprecated. Use getViewerIdentity(String, String) instead.
Will be removed by 1.3.x |
static org.exoplatform.social.core.identity.model.Identity |
getViewerIdentity(String portalContainerName,
String viewerId)
Gets identity of viewer user (logged-in user). |
static boolean |
isLikedByIdentity(String identityID,
org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
Check if identityId contained in liked Identity, if yes return true else return false. |
static boolean |
isValidURL(String link)
Checks a url is in a valid form or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean isValidURL(String link)
link -
public static javax.ws.rs.core.Response getResponse(Object entity,
javax.ws.rs.core.UriInfo uriInfo,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.Response.Status status)
entity - the identityuriInfo - the uri request infomediaType - the media type to be returnedstatus - the status code
@Deprecated
public static javax.ws.rs.core.MediaType getMediaType(String format)
throws javax.ws.rs.WebApplicationException
getMediaType(String, String[]) instead.
Will be removed by 1.3.x
format -
javax.ws.rs.WebApplicationException
public static javax.ws.rs.core.MediaType getMediaType(String expectedFormat,
String[] supportedFormats)
expectedFormat - the expected input formatsupportedFormats - the supported format array
public static String getViewerId(javax.ws.rs.core.UriInfo uriInfo)
uriInfo -
@Deprecated public static org.exoplatform.social.core.identity.model.Identity getViewerIdentity(String viewerId)
getViewerIdentity(String, String) instead.
Will be removed by 1.3.x
public static org.exoplatform.social.core.identity.model.Identity getViewerIdentity(String portalContainerName,
String viewerId)
@Deprecated
public static org.exoplatform.social.core.identity.model.Identity getUserIdentity(String userName,
boolean loadProfile)
getUserIdentity(String, String, boolean) instead.
Will be removed by 1.3.x
userName - loadProfile -
public static org.exoplatform.social.core.identity.model.Identity getUserIdentity(String portalContainerName,
String userName,
boolean loadProfile)
portalContainerName - userName - loadProfile -
@Deprecated public static final org.exoplatform.social.core.manager.IdentityManager getIdentityManager()
getIdentityManager(String) instead.
Will be removed by 1.3.x
public static final org.exoplatform.social.core.manager.IdentityManager getIdentityManager(String portalContainerName)
IdentityManager with specified portal container name.
portalContainerName - the specified portal container name
@Deprecated public static final org.exoplatform.social.core.space.spi.SpaceService getSpaceService()
getSpaceService(String) instead.
Will be removed by 1.3.x
SpaceService with default portal container.
public static final org.exoplatform.social.core.space.spi.SpaceService getSpaceService(String portalContainerName)
SpaceService with specified portal container name.
portalContainerName - the specified portal container name
@Deprecated public static final org.exoplatform.social.core.manager.ActivityManager getActivityManager()
getActivityManager(String) instead.
Will be removed by 1.3.x
ActivityManager with default portal container.
public static final org.exoplatform.social.core.manager.ActivityManager getActivityManager(String portalContainerName)
ActivityManager with specified portal container name.
portalContainerName - the specified portal container
@Deprecated public static final org.exoplatform.social.core.manager.RelationshipManager getRelationshipManager()
getRelationshipManager(String) instead.
Will be removed by 1.3.x
RelationshipManager with default portal container.
public static final org.exoplatform.social.core.manager.RelationshipManager getRelationshipManager(String portalContainerName)
RelationshipManager with specified portal container name.
portalContainerName - the specified portal container name
public static final org.exoplatform.container.PortalContainer getPortalContainerByName(String portalContainerName)
portalContainerName - the specified portal container name
public static final String convertTimestampToTimeString(long timestamp)
timestamp - the timestamp to convert
@Deprecated public static org.exoplatform.social.core.identity.model.Identity getOwnerIdentityIdFromActivity(org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
getOwnerIdentityIdFromActivity(String, ExoSocialActivity) instead.
Will be removed by 1.3.x
activity - the activity to gets its owner identity
public static org.exoplatform.social.core.identity.model.Identity getOwnerIdentityIdFromActivity(String portalContainerName,
org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
portalContainerName - the portal container nameactivity - the activity to gets its owner identity
public static final String getBaseUrl()
public static void buildAbsoluteAvatarURL(IdentityRestOut resultIdentity)
resultIdentity - public static String buildAbsoluteAvatarURL(org.exoplatform.social.core.identity.model.Identity resultIdentity)
resultIdentity - public static org.exoplatform.social.core.identity.model.Identity getAuthenticatedUserIdentity(String portalContainerName)
portalContainerName - current portal container name
public static boolean isLikedByIdentity(String identityID,
org.exoplatform.social.core.activity.model.ExoSocialActivity activity)
identityID - activity -
public static String getMimeTypeOfURL(String urlString)
urlString -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||