org.alfresco.util.registry.NamedObjectRegistry Java Examples

The following examples show how to use org.alfresco.util.registry.NamedObjectRegistry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CannedQueryTest.java    From alfresco-core with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void setUp() throws Exception
{
    // Create the registry
    namedQueryFactoryRegistry = new NamedObjectRegistry<CannedQueryFactory>();
    namedQueryFactoryRegistry.setStorageType(CannedQueryFactory.class);
    namedQueryFactoryRegistry.setNamePattern("test\\.query\\..*");
    // Registry the query factories
    // ONE
    TestCannedQueryFactory<String> namedQueryFactoryOne = new TestCannedQueryFactory(RESULTS_ONE);
    namedQueryFactoryOne.setBeanName(QUERY_TEST_ONE);
    namedQueryFactoryOne.setRegistry(namedQueryFactoryRegistry);
    namedQueryFactoryOne.afterPropertiesSet();
    // TWO
    TestCannedQueryFactory<Long> namedQueryFactoryTwo = new TestCannedQueryFactory(RESULTS_TWO);
    namedQueryFactoryTwo.setBeanName(QUERY_TEST_TWO);
    namedQueryFactoryTwo.setRegistry(namedQueryFactoryRegistry);
    namedQueryFactoryTwo.afterPropertiesSet();
}
 
Example #2
Source File: CalendarServiceImplTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@BeforeClass public static void initTestsContext() throws Exception
{
    AUTHENTICATION_SERVICE = (MutableAuthenticationService)testContext.getBean("authenticationService");
    BEHAVIOUR_FILTER       = (BehaviourFilter)testContext.getBean("policyBehaviourFilter");
    CALENDAR_SERVICE       = (CalendarService)testContext.getBean("CalendarService");
    DICTIONARY_SERVICE     = (DictionaryService)testContext.getBean("dictionaryService");
    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");
    // Get the canned query registry, and from that the factory
    @SuppressWarnings("unchecked")
    NamedObjectRegistry<CannedQueryFactory<? extends Object>> calendarCannedQueryRegistry =
       (NamedObjectRegistry<CannedQueryFactory<? extends Object>>)testContext.getBean("calendarCannedQueryRegistry");
    CALENDAR_CQ_FACTORY = (GetCalendarEntriesCannedQueryFactory)
       calendarCannedQueryRegistry.getNamedObject(CalendarServiceImpl.CANNED_QUERY_GET_ENTRIES);
    
    // 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();
}
 
Example #3
Source File: BlogServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<BlogPostInfo>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #4
Source File: RepoService.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public RepoService(ApplicationContext applicationContext) throws Exception
   {
   	this.applicationContext = applicationContext;
   	this.publicApiContext = new PublicApiTestContext(applicationContext);
   	this.authenticationService = (MutableAuthenticationService)applicationContext.getBean("AuthenticationService");
   	this.siteService = (SiteService)applicationContext.getBean("SiteService");
   	this.activityService = (ActivityService)applicationContext.getBean("activityService");
   	this.fileFolderService = (FileFolderService)applicationContext.getBean("FileFolderService");
   	this.contentService = (ContentService)applicationContext.getBean("ContentService");
   	this.commentService = (CommentService)applicationContext.getBean("CommentService");
   	this.nodeService = (NodeService)applicationContext.getBean("NodeService");
   	this.preferenceService = (PreferenceService)applicationContext.getBean("PreferenceService");
   	this.taggingService = (TaggingService)applicationContext.getBean("TaggingService");
   	this.ratingService = (RatingService)applicationContext.getBean("RatingService");
   	this.tenantService = (TenantService)applicationContext.getBean("tenantService");
   	this.tenantAdminService = (TenantAdminService)applicationContext.getBean("tenantAdminService");
   	this.personService = (PersonService)applicationContext.getBean("PersonService");
   	this.contentStoreCleaner = (ContentStoreCleaner)applicationContext.getBean("contentStoreCleaner");
   	this.postDAO = (ActivityPostDAO)applicationContext.getBean("postDAO");
   	this.nodeRatingSchemeRegistry = (NamedObjectRegistry<RatingScheme>)applicationContext.getBean("nodeRatingSchemeRegistry");
   	this.cociService = (CheckOutCheckInService)applicationContext.getBean("CheckoutCheckinService");
   	this.favouritesService = (FavouritesService)applicationContext.getBean("FavouritesService");
   	this.dictionaryService =  (DictionaryService)applicationContext.getBean("dictionaryService");
   	this.invitationService = (InvitationService)applicationContext.getBean("InvitationService");
   	this.lockService = (LockService)applicationContext.getBean("LockService");
   	this.cmisConnector = (CMISConnector)applicationContext.getBean("CMISConnector");
   	this.activities = (Activities)applicationContext.getBean("activities");
   	this.hiddenAspect = (HiddenAspect)applicationContext.getBean("hiddenAspect");
   	this.networksService = (NetworksService)applicationContext.getBean("networksService");
   	this.namespaceService = (NamespaceService)applicationContext.getBean("namespaceService"); 
   	this.transactionHelper = (RetryingTransactionHelper)applicationContext.getBean("retryingTransactionHelper");

       Scheduler scheduler = (Scheduler)applicationContext.getBean("schedulerFactory");

       CronTrigger contentStoreCleanerTrigger = (CronTrigger)applicationContext.getBean("contentStoreCleanerTrigger");
       scheduler.pauseJob(contentStoreCleanerTrigger.getJobKey());

       ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory)applicationContext.getBean("ActivitiesFeed");
       ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext();
       this.postLookup = (PostLookup)activitiesFeedCtx.getBean("postLookup");
       this.feedGenerator = (FeedGenerator)activitiesFeedCtx.getBean("feedGenerator");
       this.feedGeneratorJobDetail = (JobDetail)activitiesFeedCtx.getBean("feedGeneratorJobDetail");
       this.postLookupJobDetail = (JobDetail)activitiesFeedCtx.getBean("postLookupJobDetail");
       this.feedCleanerJobDetail = (JobDetail)activitiesFeedCtx.getBean("feedCleanerJobDetail");
       this.postCleanerJobDetail = (JobDetail)activitiesFeedCtx.getBean("postCleanerJobDetail");
       this.feedNotifierJobDetail = (JobDetail)activitiesFeedCtx.getBean("feedNotifierJobDetail");
   	this.feedCleaner = (FeedCleaner)activitiesFeedCtx.getBean("feedCleaner");

       // Pause activities jobs so that we aren't competing with their scheduled versions
       scheduler.pauseJob(feedGeneratorJobDetail.getKey());
       scheduler.pauseJob(postLookupJobDetail.getKey());
       scheduler.pauseJob(feedCleanerJobDetail.getKey());
       scheduler.pauseJob(postCleanerJobDetail.getKey());
       scheduler.pauseJob(feedNotifierJobDetail.getKey());

       this.systemNetwork = new TestNetwork(TenantService.DEFAULT_DOMAIN, true);
}
 
Example #5
Source File: AbstractRatingScheme.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setNodeRatingSchemeRegistry(NamedObjectRegistry<RatingScheme> nodeRatingSchemeRegistry)
   {
	this.nodeRatingSchemeRegistry = nodeRatingSchemeRegistry;
}
 
Example #6
Source File: NodeRatingsImpl.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setNodeRatingSchemeRegistry(NamedObjectRegistry<RatingScheme> nodeRatingSchemeRegistry)
   {
	this.nodeRatingSchemeRegistry = nodeRatingSchemeRegistry;
}
 
Example #7
Source File: ActivitySummaryParser.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setProcessors(NamedObjectRegistry<ActivitySummaryProcessor> processors)
{
	this.processors = processors;
}
 
Example #8
Source File: AbstractCannedQueryFactory.java    From alfresco-core with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry with which to register
 */
@SuppressWarnings("rawtypes")
public void setRegistry(NamedObjectRegistry<CannedQueryFactory> registry)
{
    this.registry = registry;
}
 
Example #9
Source File: DiscussionServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link CannedQueryFactory canned queries}
 */
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #10
Source File: NodeArchiveServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<ArchivedNodeEntity>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #11
Source File: CopyServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<CopyInfo>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #12
Source File: LinksServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link CannedQueryFactory canned queries}
 */
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #13
Source File: AuthorityDAOImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<?>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #14
Source File: FileFolderServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link CannedQueryFactory canned queries}
 */
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<NodeRef>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #15
Source File: AuditModelRegistryImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link DataGenerator data generators}.
 */
public void setDataGenerators(NamedObjectRegistry<DataGenerator> dataGenerators)
{
    this.dataGenerators = dataGenerators;
}
 
Example #16
Source File: AuditModelRegistryImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link DataExtractor data extractors}.
 */
public void setDataExtractors(NamedObjectRegistry<DataExtractor> dataExtractors)
{
    this.dataExtractors = dataExtractors;
}
 
Example #17
Source File: AbstractDataExtractor.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry with which to register
 */
public void setRegistry(NamedObjectRegistry<DataExtractor> registry)
{
    this.registry = registry;
}
 
Example #18
Source File: AbstractDataGenerator.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry with which to register
 */
public void setRegistry(NamedObjectRegistry<DataGenerator> registry)
{
    this.registry = registry;
}
 
Example #19
Source File: DownloadStorage.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> queryRegistry) 
{
    this.queryRegistry = queryRegistry;
}
 
Example #20
Source File: CalendarServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link CannedQueryFactory canned queries}
 */
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #21
Source File: CommentServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
protected void onBootstrap(ApplicationEvent event)
{
    // belts-and-braces (in case of broken spring-bean override)
    ApplicationContext ctx = getApplicationContext();
    if (ctx != null)
    {
        if (this.nodeService == null)
        {
            this.nodeService = (NodeService)ctx.getBean("NodeService");
        }
        if (this.contentService == null)
        {
            this.contentService = (ContentService)ctx.getBean("ContentService");
        }
        if (this.siteService == null)
        {
            this.siteService = (SiteService)ctx.getBean("SiteService");
        }
        if (this.activityService == null)
        {
            this.activityService = (ActivityService)ctx.getBean("activityService");
        }
        if (this.cannedQueryRegistry == null)
        {
            this.cannedQueryRegistry = (NamedObjectRegistry<CannedQueryFactory<? extends Object>>)ctx.getBean("commentsCannedQueryRegistry");
        }
        if (this.policyComponent == null)
        {
            this.policyComponent = (PolicyComponent)ctx.getBean("policyComponent");
        }
        if (this.behaviourFilter == null)
        {
            this.behaviourFilter = (BehaviourFilter)ctx.getBean("policyBehaviourFilter");
        }
        if (this.permissionService == null)
        {
            this.permissionService = (PermissionService)ctx.getBean("PermissionService");
        }
        if (this.lockService == null)
        {
            this.lockService = (LockService)ctx.getBean("LockService");
        }
        if (this.dictionaryService == null)
        {
            this.dictionaryService = (DictionaryService)ctx.getBean("DictionaryService");
        }
    }
    
    this.policyComponent.bindClassBehaviour(
            NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
            ForumModel.TYPE_POST,
            new JavaBehaviour(this, "onUpdateProperties"));
    this.policyComponent.bindClassBehaviour(
            NodeServicePolicies.BeforeDeleteNodePolicy.QNAME,
            ForumModel.TYPE_POST,
            new JavaBehaviour(this, "beforeDeleteNode"));
}
 
Example #22
Source File: CommentServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry)
   {
	this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #23
Source File: SiteServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link CannedQueryFactory canned queries}
 */
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}
 
Example #24
Source File: PersonServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Set the registry of {@link CannedQueryFactory canned queries}
 */
public void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<NodeRef>> cannedQueryRegistry)
{
    this.cannedQueryRegistry = cannedQueryRegistry;
}