public class TemporarySites extends AbstractPersonRule
| Modifier and Type | Class and Description |
|---|---|
static class |
TemporarySites.TestSiteAndMemberInfo
A simple POJO class to store the
SiteInfo for this site and its initial, automatically created members' usernames. |
appContext, appContextRule, EMAIL, FIRST_NAME, JOB_TITLE, LAST_NAME, PASSWORD| Constructor and Description |
|---|
TemporarySites(ApplicationContextInit appContextRule)
Constructs the rule with a reference to a
rule which can be used to retrieve the ApplicationContext. |
| Modifier and Type | Method and Description |
|---|---|
void |
addSite(SiteInfo temporarySite)
Add a specified site to the list of SiteInfos to be deleted by this rule.
|
protected void |
after() |
protected void |
before() |
SiteInfo |
createSite(java.lang.String sitePreset,
java.lang.String siteShortName,
java.lang.String siteTitle,
java.lang.String siteDescription,
SiteVisibility visibility,
org.alfresco.service.namespace.QName siteType,
java.lang.String siteCreator)
This method creates a Share Site (or subtype) and adds it to the internal list of NodeRefs to be tidied up by the rule.
|
SiteInfo |
createSite(java.lang.String sitePreset,
java.lang.String siteShortName,
java.lang.String siteTitle,
java.lang.String siteDescription,
SiteVisibility visibility,
java.lang.String siteCreator)
This method creates a Share Site and adds it to the internal list of NodeRefs to be tidied up by the rule.
|
TemporarySites.TestSiteAndMemberInfo |
createTestSiteWithUserPerRole(java.lang.String siteShortName,
java.lang.String sitePreset,
SiteVisibility visibility,
java.lang.String siteCreator)
This method creates a test site (of Alfresco type
st:site) and one user for each of the Share Site Roles. |
createPerson, deletePerson, getApplicationContextpublic TemporarySites(ApplicationContextInit appContextRule)
rule which can be used to retrieve the ApplicationContext.appContextRule - a rule which can be used to retrieve the spring app context.protected void before()
throws java.lang.Throwable
before in class org.junit.rules.ExternalResourcejava.lang.Throwableprotected void after()
after in class org.junit.rules.ExternalResourcepublic void addSite(SiteInfo temporarySite)
temporarySite - a SiteInfopublic SiteInfo createSite(java.lang.String sitePreset, java.lang.String siteShortName, java.lang.String siteTitle, java.lang.String siteDescription, SiteVisibility visibility, java.lang.String siteCreator)
sitePreset - the site presetsiteShortName - the short name of the new sitesiteTitle - the title of the new sitesiteDescription - the description of the new sitevisibility - the visibilitysiteCreator - the username of the person who will create the sitepublic SiteInfo createSite(java.lang.String sitePreset, java.lang.String siteShortName, java.lang.String siteTitle, java.lang.String siteDescription, SiteVisibility visibility, org.alfresco.service.namespace.QName siteType, java.lang.String siteCreator)
sitePreset - the site presetsiteShortName - the short name of the new sitesiteTitle - the title of the new sitesiteDescription - the description of the new sitevisibility - the visibilitynode - type the node type of the site (must be st:site or subtype)siteCreator - the username of the person who will create the sitepublic TemporarySites.TestSiteAndMemberInfo createTestSiteWithUserPerRole(java.lang.String siteShortName, java.lang.String sitePreset, SiteVisibility visibility, java.lang.String siteCreator)
st:site) and one user for each of the Share Site Roles.
This method will be run in its own transaction and will be run with the specified user as the fully authenticated user,
thus ensuring the named user is the creator of the new site.
The site and its users will be deleted automatically by the rule.sitePreset - the site preset.visibility - the Site visibility.siteCreator - the username of a user who will be used to create the site (user must exist of course).SiteInfo object for the newly created site.Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.