public class ShareUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_TYPE_FORM_URLENCODED |
static String |
CONTENT_TYPE_JSON |
static String |
CONTENT_TYPE_TEXT_PLAIN |
static String |
HEADER_CONTENT_TYPE |
static String |
HEADER_REFERER |
static String |
HEADER_SET_COOKIE |
static String |
UTF_8 |
Constructor and Description |
---|
ShareUtils() |
Modifier and Type | Method and Description |
---|---|
void |
createSite(SessionUser user,
String sitePreset,
String shortName,
String title,
String description,
boolean isPublic)
Creates new site using REST API, http method is sent to appropriate web script
|
void |
createSiteDashboard(org.apache.commons.httpclient.HttpClient httpClient,
String siteName,
SessionUser user,
String sitePreset)
Creates site dashboard
|
void |
deleteSite(SessionUser user,
String shortName)
Deletes site using REST API, http method is sent to appropriate web script
|
static String |
encode(String value)
encode string to share specific manner (all characters with code > 127 will be encoded in %u0...
|
String |
getShareContext()
Get share context name
|
String |
getShareHostWithPort()
Get share host with port
|
void |
setSysAdminParams(SysAdminParams sysAdminParams) |
public static final String HEADER_SET_COOKIE
public static final String HEADER_CONTENT_TYPE
public static final String HEADER_REFERER
public static final String CONTENT_TYPE_JSON
public static final String CONTENT_TYPE_FORM_URLENCODED
public static final String CONTENT_TYPE_TEXT_PLAIN
public static final String UTF_8
public void setSysAdminParams(SysAdminParams sysAdminParams)
public String getShareHostWithPort()
public void createSite(SessionUser user, String sitePreset, String shortName, String title, String description, boolean isPublic) throws org.apache.commons.httpclient.HttpException, IOException
user
- current usersitePreset
- sitePreset for new siteshortName
- shortName for new sitetitle
- title for new sitedescription
- description for new siteisPublic
- is new site public?org.apache.commons.httpclient.HttpException
IOException
public void createSiteDashboard(org.apache.commons.httpclient.HttpClient httpClient, String siteName, SessionUser user, String sitePreset) throws UnsupportedEncodingException
httpClient
- HTTP clientsiteName
- name of the siteuser
- current userUnsupportedEncodingException
public void deleteSite(SessionUser user, String shortName) throws org.apache.commons.httpclient.HttpException, IOException
user
- current usershortName
- shortName of site we are going to deleteorg.apache.commons.httpclient.HttpException
IOException
public String getShareContext()
public static String encode(String value) throws UnsupportedEncodingException
encode string to share specific manner (all characters with code > 127 will be encoded in %u0... format)
value
- to encodeUnsupportedEncodingException
Copyright © 2005–2017 Alfresco Software. All rights reserved.