本文整理汇总了Java中org.alfresco.service.cmr.site.SiteService类的典型用法代码示例。如果您正苦于以下问题:Java SiteService类的具体用法?Java SiteService怎么用?Java SiteService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SiteService类属于org.alfresco.service.cmr.site包,在下文中一共展示了SiteService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findServices
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
private static void findServices()
{
ApplicationContext ctx = testContext.getApplicationContext();
copyService = ctx.getBean("CopyService", CopyService.class);
nodeService = ctx.getBean("NodeService", NodeService.class);
directQuickShareService = ctx.getBean("quickShareService", QuickShareService.class);
quickShareService = ctx.getBean("QuickShareService", QuickShareService.class);
repository = ctx.getBean("repositoryHelper", Repository.class);
attributeService = ctx.getBean("AttributeService", AttributeService.class);
permissionService = ctx.getBean("PermissionService", PermissionService.class);
nodeArchiveService = ctx.getBean("nodeArchiveService", NodeArchiveService.class);
scheduledPersistedActionService = ctx.getBean("scheduledPersistedActionService", ScheduledPersistedActionService.class);
quickShareLinkExpiryActionPersister = ctx.getBean("quickShareLinkExpiryActionPersister", QuickShareLinkExpiryActionPersister.class);
transactionHelper = ctx.getBean("retryingTransactionHelper", RetryingTransactionHelper.class);
globalProperties = ctx.getBean("global-properties", Properties.class);
siteService = (SiteService) ctx.getBean("SiteService");
}
示例2: getNode
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
/**
* Finds the site in which the source {@link NodeRef} resides and returns the Document Library container for that site.
* If no site can be found or the site does not have a Document Library then the Company Home is returned.
*
* @param source the starting point for locating the site Document Library.
* @param params Not used.
* @return the Document Library or the Company Home.
*/
@Override
public NodeRef getNode(NodeRef source, Map<String, Serializable> params)
{
NodeRef docLib = null;
if (source != null)
{
String siteName = siteService.getSiteShortName(source);
if (siteName != null)
{
String containerId = SiteService.DOCUMENT_LIBRARY;
docLib = siteService.getContainer(siteName, containerId);
}
}
if (docLib == null)
{
docLib = repositoryHelper.getCompanyHome();
}
return docLib;
}
示例3: listMembersPaged
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
public PagingResults<SiteMembership> listMembersPaged(String shortName, boolean collapseGroups, List<Pair<SiteService.SortFields, Boolean>> sortProps, PagingRequest pagingRequest)
{
CannedQueryPageDetails pageDetails = new CannedQueryPageDetails(pagingRequest.getSkipCount(), pagingRequest.getMaxItems());
// sort details
CannedQuerySortDetails sortDetails = null;
if(sortProps != null)
{
List<Pair<? extends Object, SortOrder>> sortPairs = new ArrayList<Pair<? extends Object, SortOrder>>(sortProps.size());
for (Pair<SiteService.SortFields, Boolean> sortProp : sortProps)
{
sortPairs.add(new Pair<SiteService.SortFields, SortOrder>(sortProp.getFirst(), (sortProp.getSecond() ? SortOrder.ASCENDING : SortOrder.DESCENDING)));
}
sortDetails = new CannedQuerySortDetails(sortPairs);
}
SiteMembersCannedQueryParams parameterBean = new SiteMembersCannedQueryParams(shortName, collapseGroups);
CannedQueryParameters params = new CannedQueryParameters(parameterBean, pageDetails, sortDetails, pagingRequest.getRequestTotalCountMax(), pagingRequest.getQueryExecutionId());
CannedQuery<SiteMembership> query = new SiteMembersCannedQuery(this, personService, nodeService, params);
CannedQueryResults<SiteMembership> results = query.execute();
return getPagingResults(pagingRequest, results);
}
示例4: setUp
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
this.nodeService = (NodeService)getServer().getApplicationContext().getBean("NodeService");
this.permissionService = (PermissionService)getServer().getApplicationContext().getBean("PermissionService");
this.authorityService = (AuthorityService)getServer().getApplicationContext().getBean("AuthorityService");
this.fileFolderService = (FileFolderService)getServer().getApplicationContext().getBean("FileFolderService");
// Create users
createUser(USER_ONE);
createUser(USER_TWO);
createUser(USER_THREE);
createUser(USER_NUMERIC);
createUser(USER_FOUR_AS_SITE_ADMIN);
// Add user four as a member of the site admins group
authorityService.addAuthority("GROUP_SITE_ADMINISTRATORS", USER_FOUR_AS_SITE_ADMIN);
// Do tests as user one
this.authenticationComponent.setCurrentUser(USER_ONE);
}
示例5: getDisplayLabel
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@Override
public FacetLabel getDisplayLabel(String value)
{
// Solr returns the site short name encoded
value = ISO9075.decode(value);
String title = null;
if (nonSiteLocationsLabels.containsKey(value))
{
title = nonSiteLocationsLabels.get(value);
}
else
{
SiteService siteService = serviceRegistry.getSiteService();
SiteInfo siteInfo = siteService.getSite(value);
title = siteInfo != null ? siteInfo.getTitle() : value;
}
return new FacetLabel(value, title, -1);
}
示例6: testSiteMembersPaged
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@Test public void testSiteMembersPaged()
{
// Choose a site name that will link back to this test case...
final String siteShortName = testName.getMethodName();
log.debug("Creating test site called: " + siteShortName);
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
// ...and create the site
final TestSiteAndMemberInfo testSiteAndMemberInfo = perMethodTestSites.createTestSiteWithUserPerRole(siteShortName, "sitePreset", SiteVisibility.PUBLIC, AuthenticationUtil.getAdminUserName());
List<Pair<SiteService.SortFields, Boolean>> sortProps = new ArrayList<Pair<SiteService.SortFields, Boolean>>(1);
sortProps.add(new Pair<SiteService.SortFields, Boolean>(SiteService.SortFields.FirstName, true));
PagingResults<SiteMembership> pagedMembers = SITE_SERVICE.listMembersPaged(siteShortName, true, sortProps, new PagingRequest(100));
assertNotNull(pagedMembers);
assertNotNull(pagedMembers.getPage());
assertNotNull(pagedMembers.getQueryExecutionId());
assertFalse(pagedMembers.hasMoreItems());
log.debug("About to delete site completely.");
SITE_SERVICE.deleteSite(siteShortName);
return null;
}
});
}
示例7: onSetUpInTransaction
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void onSetUpInTransaction() throws Exception
{
super.onSetUpInTransaction();
// Get the required services
this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationComponent");
this.siteService = (SiteService) this.applicationContext.getBean("SiteService");
this.personService = (PersonService) this.applicationContext.getBean("PersonService");
// Create the test users
createUser(USER_ONE, "UserOne");
createUser(USER_TWO, "UserTwo");
// Set the current authentication
this.authenticationComponent.setCurrentUser(USER_ONE);
}
示例8: testCustomRole
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
public void testCustomRole()
{
try
{
// Create a site
siteService.createSite("customrolessite", "customrolessite", "Test custom role", "Test custom role", SiteVisibility.PUBLIC);
this.siteService.setMembership("customrolessite", USER_TWO, "SiteCoordinator");
// Get the members of the site
final List<Pair<SiteService.SortFields, Boolean>> sort = new ArrayList<Pair<SiteService.SortFields, Boolean>>();
sort.add(new Pair<SiteService.SortFields, Boolean>(SiteService.SortFields.SiteTitle, Boolean.TRUE));
sort.add(new Pair<SiteService.SortFields, Boolean>(SiteService.SortFields.Role, Boolean.TRUE));
PagingResults<SiteMembership> sites = siteService.listSitesPaged(USER_TWO, sort, new PagingRequest(0, 100));
assertNotNull(sites);
assertEquals(sites.getPage().size(), 1);
}
catch (Exception ex)
{
fail("Custom role breaks sites API. Take a look on MNT-12873\n" + ex.getMessage());
}
}
示例9: initBasicServices
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@BeforeClass public static void initBasicServices() throws Exception
{
behaviourFilter = (BehaviourFilter)APP_CONTEXT_INIT.getApplicationContext().getBean("policyBehaviourFilter");
contentService = (ContentService)APP_CONTEXT_INIT.getApplicationContext().getBean("ContentService");
nodeService = (NodeService)APP_CONTEXT_INIT.getApplicationContext().getBean("NodeService");
repositoryHelper = (Repository)APP_CONTEXT_INIT.getApplicationContext().getBean("repositoryHelper");
siteService = (SiteService)APP_CONTEXT_INIT.getApplicationContext().getBean("SiteService");
transactionHelper = (RetryingTransactionHelper)APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper");
authenticationComponent = (AuthenticationComponent)APP_CONTEXT_INIT.getApplicationContext().getBean("authenticationComponent");
commentService = (CommentService)APP_CONTEXT_INIT.getApplicationContext().getBean("commentService");
authenticationService = (MutableAuthenticationService)APP_CONTEXT_INIT.getApplicationContext().getBean("AuthenticationService");
personService = (PersonService)APP_CONTEXT_INIT.getApplicationContext().getBean("PersonService");
postDAO = (ActivityPostDAO)APP_CONTEXT_INIT.getApplicationContext().getBean("postDAO");
permissionServiceImpl = (PermissionServiceImpl)APP_CONTEXT_INIT.getApplicationContext().getBean("permissionServiceImpl");
permissionModelDAO = (ModelDAO)APP_CONTEXT_INIT.getApplicationContext().getBean("permissionsModelDAO");
lockService = (LockService)APP_CONTEXT_INIT.getApplicationContext().getBean("lockService");
COMPANY_HOME = repositoryHelper.getCompanyHome();
}
示例10: initTestsContext
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@BeforeClass public static void initTestsContext() throws Exception
{
AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
BEHAVIOUR_FILTER = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
BLOG_SERVICE = (BlogService)testContext.getBean("blogService");
DICTIONARY_SERVICE = (DictionaryService)testContext.getBean("dictionaryService");
NODE_SERVICE = (NodeService)testContext.getBean("nodeService");
PERSON_SERVICE = (PersonService)testContext.getBean("personService");
TRANSACTION_HELPER = (RetryingTransactionHelper)testContext.getBean("retryingTransactionHelper");
SITE_SERVICE = (SiteService)testContext.getBean("siteService");
TAGGING_SERVICE = (TaggingService)testContext.getBean("TaggingService");
AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER);
createUser(TEST_USER);
// We need to create the test site as the test user so that they can contribute content to it in tests below.
AuthenticationUtil.setFullyAuthenticatedUser(TEST_USER);
createTestSiteWithBlogContainer();
}
示例11: setUp
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@BeforeClass public static void setUp() throws Exception
{
final ApplicationContext ctx = APP_CONTEXT_INIT.getApplicationContext();
// Let's shut down the scheduler so that we aren't competing with the
// scheduled versions of the post lookup and
// feed generator jobs
// Note that to ensure this test class can be run within a suite, that we do not want to actually 'shutdown' the scheduler.
// It may be needed by other test classes and must be restored to life after this class has run.
QUARTZ_SCHEDULER = ctx.getBean("schedulerFactory", Scheduler.class);
QUARTZ_SCHEDULER.standby();
// Get the required services
subscriptionService = (SubscriptionService) ctx.getBean("SubscriptionService");
personService = (PersonService) ctx.getBean("PersonService");
siteService = (SiteService) ctx.getBean("SiteService");
activityService = (ActivityService) ctx.getBean("activityService");
nodeService = (NodeService) ctx.getBean("NodeService");
contentService = (ContentService) ctx.getBean("ContentService");
nodeArchiveService = (NodeArchiveService)ctx.getBean("nodeArchiveService");
transactionHelper = (RetryingTransactionHelper) ctx.getBean("retryingTransactionHelper");
ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory) ctx.getBean("ActivitiesFeed");
ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext();
postLookup = (PostLookup) activitiesFeedCtx.getBean("postLookup");
feedGenerator = (FeedGenerator) activitiesFeedCtx.getBean("feedGenerator");
LocalFeedTaskProcessor feedProcessor = (LocalFeedTaskProcessor) activitiesFeedCtx.getBean("feedTaskProcessor");
List<String> templateSearchPaths = new ArrayList<String>(1);
templateSearchPaths.add(TEST_TEMPLATES_LOCATION);
feedProcessor.setTemplateSearchPaths(templateSearchPaths);
feedProcessor.setUseRemoteCallbacks(false);
}
示例12: initTestsContext
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
@BeforeClass public static void initTestsContext() throws Exception
{
AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
BEHAVIOUR_FILTER = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
LINKS_SERVICE = (LinksService)testContext.getBean("LinksService");
NODE_SERVICE = (NodeService)testContext.getBean("nodeService");
PUBLIC_NODE_SERVICE = (NodeService)testContext.getBean("NodeService");
PERSON_SERVICE = (PersonService)testContext.getBean("personService");
TRANSACTION_HELPER = (RetryingTransactionHelper)testContext.getBean("retryingTransactionHelper");
PERMISSION_SERVICE = (PermissionService)testContext.getBean("permissionService");
SITE_SERVICE = (SiteService)testContext.getBean("siteService");
CONTENT_SERVICE = (ContentService)testContext.getBean("ContentService");
// Do the setup as admin
AuthenticationUtil.setFullyAuthenticatedUser(ADMIN_USER);
createUser(TEST_USER);
// We need to create the test site as the test user so that they can contribute content to it in tests below.
AuthenticationUtil.setFullyAuthenticatedUser(TEST_USER);
createTestSites();
}
示例13: mockServices
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
/**
* @return ServiceRegistry
*/
private ServiceRegistry mockServices()
{
ActionService mockActionService = mockActionService();
NodeService mockNodeService = mockNodeService();
PersonService mockPersonService = mockPersonService();
SearchService mockSearchService = mockSearchService();
SiteService mockSiteService = mockSiteService();
FileFolderService mockFileFolderService = mockFileFolderService();
ServiceRegistry services = mock(ServiceRegistry.class);
when(services.getActionService()).thenReturn(mockActionService);
when(services.getNodeService()).thenReturn(mockNodeService);
when(services.getPersonService()).thenReturn(mockPersonService);
when(services.getSearchService()).thenReturn(mockSearchService);
when(services.getSiteService()).thenReturn(mockSiteService);
when(services.getFileFolderService()).thenReturn(mockFileFolderService);
return services;
}
示例14: createSite
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
private SiteInfo createSite(final String shortName)
{
return transactionHelper.doInTransaction(new RetryingTransactionCallback<SiteInfo>()
{
@Override
public SiteInfo execute() throws Throwable
{
SiteInfo siteInfo = siteService.getSite(shortName);
if (siteInfo != null)
{
// Tidy up after failed earlier run
siteService.deleteSite(shortName);
}
// Do the create
SiteInfo site = siteService.createSite("Testing", shortName, shortName, "myDescription", SiteVisibility.PUBLIC);
// Ensure we have a doclib
siteService.createContainer(shortName, SiteService.DOCUMENT_LIBRARY, ContentModel.TYPE_FOLDER, null);
// All done
return site;
}
}, false, true
);
}
示例15: determineSiteId
import org.alfresco.service.cmr.site.SiteService; //导入依赖的package包/类
public String determineSiteId(NodeRef rootNodeRef, String path)
{
SiteService siteService = getServiceRegistry().getSiteService();
String siteId;
try
{
FileInfo fileInfo = getNodeForPath(rootNodeRef, path);
siteId = siteService.getSiteShortName(fileInfo.getNodeRef());
if (siteId == null)
{
throw new RuntimeException("Node is not contained by a site: " + path);
}
}
catch (Exception error)
{
siteId = EMPTY_SITE_ID;
}
return siteId;
}