use of org.alfresco.service.cmr.site.SiteService in project alfresco-repository by Alfresco.
the class SiteTitleDisplayHandler method getDisplayLabel.
@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);
}
use of org.alfresco.service.cmr.site.SiteService in project alfresco-repository by Alfresco.
the class SiteServiceImplMoreTest method initStaticData.
@BeforeClass
public static void initStaticData() throws Exception {
AUTHORITY_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("AuthorityService", AuthorityService.class);
NAMESPACE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("namespaceService", NamespaceService.class);
NODE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("NodeService", NodeService.class);
NODE_ARCHIVE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("nodeArchiveService", NodeArchiveService.class);
SITE_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("siteService", SiteService.class);
COCI_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("checkOutCheckInService", CheckOutCheckInService.class);
TRANSACTION_HELPER = APP_CONTEXT_INIT.getApplicationContext().getBean("retryingTransactionHelper", RetryingTransactionHelper.class);
PERMISSION_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("permissionServiceImpl", PermissionService.class);
AUTHENTICATION_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("authenticationService", MutableAuthenticationService.class);
PERSON_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("PersonService", PersonService.class);
FILE_FOLDER_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("FileFolderService", FileFolderService.class);
AUTHENTICATION_COMPONENT = APP_CONTEXT_INIT.getApplicationContext().getBean("authenticationComponent", AuthenticationComponent.class);
LOCK_SERVICE = APP_CONTEXT_INIT.getApplicationContext().getBean("lockService", LockService.class);
// We'll create this test content as admin.
final String admin = AuthenticationUtil.getAdminUserName();
TEST_SITE_NAME = GUID.generate();
TEST_SUB_SITE_NAME = GUID.generate();
final QName subSiteType = QName.createQName("testsite", "testSubsite", NAMESPACE_SERVICE);
STATIC_TEST_SITES.createSite("sitePreset", TEST_SITE_NAME, "siteTitle", "siteDescription", SiteVisibility.PUBLIC, admin);
STATIC_TEST_SITES.createSite("sitePreset", TEST_SUB_SITE_NAME, "siteTitle", "siteDescription", SiteVisibility.PUBLIC, subSiteType, admin);
TEST_SITE_WITH_MEMBERS = STATIC_TEST_SITES.createTestSiteWithUserPerRole(SiteServiceImplMoreTest.class.getSimpleName(), "sitePreset", SiteVisibility.PUBLIC, admin);
}
use of org.alfresco.service.cmr.site.SiteService in project alfresco-repository by Alfresco.
the class InviteModeratedSenderTest method mockServices.
/**
* @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;
}
use of org.alfresco.service.cmr.site.SiteService in project alfresco-repository by Alfresco.
the class InviteModeratedSenderTest method mockSiteService.
/**
* Mocks up a SiteService that returns appropriate SiteInfo.
*
* @return SiteService
*/
private SiteService mockSiteService() {
SiteService siteService = mock(SiteService.class);
when(siteInfo.getTitle()).thenReturn(fullSiteName);
when(siteService.getSite(shortSiteName)).thenReturn(siteInfo);
return siteService;
}
use of org.alfresco.service.cmr.site.SiteService in project alfresco-remote-api by Alfresco.
the class WebDAVHelper method determineSiteId.
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;
}
Aggregations