本文整理汇总了Java中org.alfresco.service.cmr.lock.LockService类的典型用法代码示例。如果您正苦于以下问题:Java LockService类的具体用法?Java LockService怎么用?Java LockService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LockService类属于org.alfresco.service.cmr.lock包,在下文中一共展示了LockService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initBasicServices
import org.alfresco.service.cmr.lock.LockService; //导入依赖的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();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:CommentsTest.java
示例2: setUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void setUp()
{
appCtx = ApplicationContextHelper.getApplicationContext();
// The user that will create locks, this should be different from the user that queries them (ALF-19465)
lockOwner = "jbloggs";
// The 'current' user.
userName = AuthenticationUtil.getAdminUserName();
AuthenticationUtil.setFullyAuthenticatedUser(userName);
transactionService = (TransactionService) appCtx.getBean("TransactionService");
nodeService = (NodeService) appCtx.getBean("NodeService");
rawNodeService = (NodeService) appCtx.getBean("dbNodeService");
lockStore = (LockStore) appCtx.getBean("lockStore");
rootNode = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
interceptor = (LockableAspectInterceptor) appCtx.getBean("lockableAspectInterceptor");
lockService = (LockService)appCtx.getBean("lockService");
fileFolderService = (FileFolderService) appCtx.getBean("FileFolderService");
actionService = (ActionService) appCtx.getBean("ActionService");
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:LockableAspectInterceptorTest.java
示例3: before
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void before() throws Exception
{
ctx = getTestFixture().getApplicationContext();
this.dictionaryDAO = (DictionaryDAO)ctx.getBean("dictionaryDAO");
this.lockService = (LockService) ctx.getBean("lockService");
this.tenantService = (TenantService)ctx.getBean("tenantService");
this.cmisDictionary = (CMISStrictDictionaryService)ctx.getBean("OpenCMISDictionaryService");
this.cmisTypeExclusions = (QNameFilter)ctx.getBean("cmisTypeExclusions");
this.nodeService = (NodeService) ctx.getBean("NodeService");
this.fileFolderService = (FileFolderService) ctx.getBean("FileFolderService");
this.contentService = (ContentService)applicationContext.getBean("ContentService");
this.permissionService = (PermissionService) ctx.getBean("permissionService");
this.globalProperties = (Properties) ctx.getBean("global-properties");
this.globalProperties.setProperty(VersionableAspectTest.AUTO_VERSION_PROPS_KEY, "true");
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:18,代码来源:TestCMIS.java
示例4: setUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void setUp()
{
// The user that will create locks, this should be different from the user that queries them (ALF-19465)
lockOwner = "jbloggs";
// The 'current' user.
userName = AuthenticationUtil.getAdminUserName();
AuthenticationUtil.setFullyAuthenticatedUser(userName);
transactionService = (TransactionService) appCtx.getBean("TransactionService");
nodeService = (NodeService) appCtx.getBean("NodeService");
rawNodeService = (NodeService) appCtx.getBean("dbNodeService");
lockStore = (LockStore) appCtx.getBean("lockStore");
rootNode = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
interceptor = (LockableAspectInterceptor) appCtx.getBean("lockableAspectInterceptor");
lockService = (LockService)appCtx.getBean("lockService");
fileFolderService = (FileFolderService) appCtx.getBean("FileFolderService");
actionService = (ActionService) appCtx.getBean("ActionService");
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:19,代码来源:LockableAspectInterceptorTest.java
示例5: isNodeLocked
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* Return whether a Node is currently locked
*
* @param node The Node wrapper to test against
* @param lockService The LockService to use
*
* @return whether a Node is currently locked
*/
public static Boolean isNodeLocked(Node node, LockService lockService)
{
Boolean locked = Boolean.FALSE;
if (node.hasAspect(ContentModel.ASPECT_LOCKABLE))
{
LockStatus lockStatus = lockService.getLockStatus(node.getNodeRef());
if (lockStatus == LockStatus.LOCKED || lockStatus == LockStatus.LOCK_OWNER)
{
locked = Boolean.TRUE;
}
}
return locked;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:24,代码来源:Repository.java
示例6: onSetUpInTransaction
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* Called during the transaction setup
*/
@SuppressWarnings("deprecation")
@Override
protected void onSetUpInTransaction() throws Exception
{
super.onSetUpInTransaction();
// Get the required services
this.secureNodeService = (NodeService) this.applicationContext.getBean("NodeService");
this.renditionService = (RenditionService) this.applicationContext.getBean("RenditionService");
this.thumbnailService = (ThumbnailService) this.applicationContext.getBean("ThumbnailService");
this.scriptThumbnailService = (ScriptThumbnailService) this.applicationContext.getBean("thumbnailServiceScript");
this.mimetypeMap = (MimetypeMap) this.applicationContext.getBean("mimetypeService");
this.scriptService = (ScriptService) this.applicationContext.getBean("ScriptService");
this.services = (ServiceRegistry) this.applicationContext.getBean("ServiceRegistry");
this.transactionService = (TransactionService) this.applicationContext.getBean("transactionService");
this.failureHandlingOptions = (FailureHandlingOptions) this.applicationContext.getBean("standardFailureOptions");
this.repositoryHelper = (Repository) this.applicationContext.getBean("repositoryHelper");
this.permissionService = (PermissionService) applicationContext.getBean("PermissionService");
this.lockService = (LockService) applicationContext.getBean("lockService");
this.copyService = (CopyService) applicationContext.getBean("CopyService");
// Create a folder and some content
Map<QName, Serializable> folderProps = new HashMap<QName, Serializable>(1);
folderProps.put(ContentModel.PROP_NAME, "testFolder");
this.folder = this.secureNodeService.createNode(this.rootNodeRef, ContentModel.ASSOC_CHILDREN,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "testFolder"), ContentModel.TYPE_FOLDER)
.getChildRef();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:ThumbnailServiceImplTest.java
示例7: initStaticData
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@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);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:30,代码来源:SiteServiceImplMoreTest.java
示例8: onSetUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* Called during the transaction setup
*/
protected void onSetUp() throws Exception
{
// Catch transactions left dangling by inadequate transaction handling during test failures
if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
{
fail("Dangling transaction at start of test.");
}
super.onSetUp();
// Get the required services
this.transferService = (TransferService)this.applicationContext.getBean("TransferService");
this.contentService = (ContentService)this.applicationContext.getBean("ContentService");
this.transferServiceImpl = (TransferServiceImpl2)this.applicationContext.getBean("transferService2");
this.searchService = (SearchService)this.applicationContext.getBean("SearchService");
this.transactionService = (TransactionService)this.applicationContext.getBean("TransactionService");
this.nodeService = (NodeService) this.applicationContext.getBean("nodeService");
this.contentService = (ContentService) this.applicationContext.getBean("contentService");
this.authenticationService = (MutableAuthenticationService) this.applicationContext.getBean("authenticationService");
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
this.receiver = (TransferReceiver)this.applicationContext.getBean("transferReceiver");
this.transferManifestNodeFactory = (TransferManifestNodeFactory)this.applicationContext.getBean("transferManifestNodeFactory");
this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationComponent");
this.lockService = (LockService) this.applicationContext.getBean("lockService");
this.personService = (PersonService)this.applicationContext.getBean("PersonService");
this.descriptorService = (DescriptorService)this.applicationContext.getBean("DescriptorService");
this.copyService = (CopyService)this.applicationContext.getBean("CopyService");
this.serverDescriptor = descriptorService.getServerDescriptor();
this.repositoryHelper = (Repository) this.applicationContext.getBean("repositoryHelper");
REPO_ID_B = descriptorService.getCurrentRepositoryDescriptor().getId();
authenticationComponent.setSystemUserAsCurrentUser();
setTransactionDefinition(new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRES_NEW));
assertNotNull("receiver is null", this.receiver);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:TransferServiceToBeRefactoredTest.java
示例9: onSetUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* Called during the transaction setup
*/
protected void onSetUp() throws Exception
{
super.onSetUp();
// Get the required services
this.transferService = (TransferService)this.applicationContext.getBean("TransferService");
this.contentService = (ContentService)this.applicationContext.getBean("ContentService");
this.transferServiceImpl = (TransferServiceImpl2)this.applicationContext.getBean("transferService2");
this.searchService = (SearchService)this.applicationContext.getBean("SearchService");
this.transactionService = (TransactionService)this.applicationContext.getBean("TransactionService");
this.nodeService = (NodeService) this.applicationContext.getBean("nodeService");
this.contentService = (ContentService) this.applicationContext.getBean("contentService");
this.authenticationService = (MutableAuthenticationService) this.applicationContext.getBean("authenticationService");
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
this.receiver = (TransferReceiver)this.applicationContext.getBean("transferReceiver");
this.transferManifestNodeFactory = (TransferManifestNodeFactory)this.applicationContext.getBean("transferManifestNodeFactory");
this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationComponent");
this.lockService = (LockService) this.applicationContext.getBean("lockService");
this.personService = (PersonService)this.applicationContext.getBean("PersonService");
this.descriptorService = (DescriptorService)this.applicationContext.getBean("DescriptorService");
this.copyService = (CopyService)this.applicationContext.getBean("CopyService");
this.taggingService = ((TaggingService)this.applicationContext.getBean("TaggingService"));
this.categoryService = (CategoryService)this.applicationContext.getBean("CategoryService");
this.repositoryHelper = (Repository) this.applicationContext.getBean("repositoryHelper");
this.serverDescriptor = descriptorService.getServerDescriptor();
REPO_ID_B = descriptorService.getCurrentRepositoryDescriptor().getId();
authenticationComponent.setSystemUserAsCurrentUser();
assertNotNull("receiver is null", this.receiver);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:38,代码来源:TransferServiceImplTest.java
示例10: setUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
super.setUp();
lockService = ctx.getBean("lockService",
LockService.class);
NodeRef node = nodeService.getChildByName(virtualFolder1NodeRef,
ContentModel.ASSOC_CONTAINS,
"Node1");
originalContentNodeRef = createContent(node,
"originalContentName",
"0",
MimetypeMap.MIMETYPE_TEXT_PLAIN,
"UTF-8").getChildRef();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:16,代码来源:VirtualLockableAspectInterceptorExtensionTest.java
示例11: onSetUpInTransaction
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* On setup in transaction implementation
*/
@Override
protected void onSetUpInTransaction()
throws Exception
{
// Set the services
this.cociService = (CheckOutCheckInService)this.applicationContext.getBean("checkOutCheckInService");
this.contentService = (ContentService)this.applicationContext.getBean("contentService");
this.versionService = (VersionService)this.applicationContext.getBean("versionService");
this.authenticationService = (MutableAuthenticationService)this.applicationContext.getBean("authenticationService");
this.lockService = (LockService)this.applicationContext.getBean("lockService");
this.transactionService = (TransactionService)this.applicationContext.getBean("transactionComponent");
this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
this.copyService = (CopyService)this.applicationContext.getBean("copyService");
this.personService = (PersonService) this.applicationContext.getBean("PersonService");
ServiceRegistry serviceRegistry = (ServiceRegistry) this.applicationContext.getBean("ServiceRegistry");
this.fileFolderService = serviceRegistry.getFileFolderService();
this.nodeService = serviceRegistry.getNodeService();
// Authenticate as system to create initial test data set
this.authenticationComponent = (AuthenticationComponent)this.applicationContext.getBean("authenticationComponent");
authenticationComponent.setSystemUserAsCurrentUser();
RetryingTransactionCallback<Void> processInitWork = new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
initTestData();
return null;
}
};
// do the init test data in a new retrying transaction because
// there may be problems with the DB that needs to be retried;
// That is how Alfresco works, it relies on optimistic locking and retries
transactionService.getRetryingTransactionHelper().doInTransaction(processInitWork, false, true);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:40,代码来源:CheckOutCheckInServiceImplTest.java
示例12: testIncompleteLockedNode
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* <a href="http://issues.alfresco.com/jira/browse/ETHREEOH-3983">ETHREEOH-3983</a>
*/
public void testIncompleteLockedNode() throws Exception
{
LockService lockService = serviceRegistry.getLockService();
NodeRef nodeRef = createNode("abc", IntegrityTest.TEST_TYPE_WITH_PROPERTIES, null);
checkTagging(nodeRef, true);
// Now remove the aspect, lock the node and check again
nodeService.removeAspect(nodeRef, ContentModel.ASPECT_INCOMPLETE);
lockService.lock(nodeRef, LockType.READ_ONLY_LOCK);
// Authenticate as someone else - someone not able to do anything
final String user = "someuser";
RunAsWork<Void> createUserWork = new RunAsWork<Void>()
{
public Void doWork() throws Exception
{
if (!authenticationService.authenticationExists(user))
{
authenticationService.createAuthentication(user, user.toCharArray());
}
return null;
}
};
AuthenticationUtil.runAs(createUserWork, AuthenticationUtil.getSystemUserName());
authenticationComponent.setCurrentUser(user);
// Tag
checkTagging(nodeRef, true);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:IncompleteNodeTaggerTest.java
示例13: before
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void before()
{
this.actionService = (ActionService)ctx.getBean("actionService");
this.ruleService = (RuleService)ctx.getBean("ruleService");
this.fileFolderService = (FileFolderService)ctx.getBean("FileFolderService");
this.transactionService = (TransactionService)ctx.getBean("transactionService");
this.nodeService = (NodeService)ctx.getBean("NodeService");
this.contentService = (ContentService)ctx.getBean("ContentService");
this.versionService = (VersionService) ctx.getBean("versionService");
this.lockService = (LockService) ctx.getBean("lockService");
this.taggingService = (TaggingService) ctx.getBean("TaggingService");
this.namespaceService = (NamespaceService) ctx.getBean("namespaceService");
this.repositoryHelper = (Repository)ctx.getBean("repositoryHelper");
this.factory = (AlfrescoCmisServiceFactory)ctx.getBean("CMISServiceFactory");
this.versionService = (VersionService) ctx.getBean("versionService");
this.cmisConnector = (CMISConnector) ctx.getBean("CMISConnector");
this.nodeDAO = (NodeDAO) ctx.getBean("nodeDAO");
this.authorityService = (AuthorityService)ctx.getBean("AuthorityService");
this.auditSubsystem = (AuditModelRegistryImpl) ctx.getBean("Audit");
this.permissionService = (PermissionService) ctx.getBean("permissionService");
this.dictionaryDAO = (DictionaryDAO)ctx.getBean("dictionaryDAO");
this.cmisDictionaryService = (CMISDictionaryService)ctx.getBean("OpenCMISDictionaryService1.1");
this.auditDAO = (AuditDAO) ctx.getBean("auditDAO");
this.nodeArchiveService = (NodeArchiveService) ctx.getBean("nodeArchiveService");
this.dictionaryService = (DictionaryService) ctx.getBean("dictionaryService");
this.workflowService = (WorkflowService) ctx.getBean("WorkflowService");
this.workflowAdminService = (WorkflowAdminService) ctx.getBean("workflowAdminService");
this.authenticationContext = (AuthenticationContext) ctx.getBean("authenticationContext");
this.tenantAdminService = (TenantAdminService) ctx.getBean("tenantAdminService");
this.tenantService = (TenantService) ctx.getBean("tenantService");
this.searchService = (SearchService) ctx.getBean("SearchService");
this.auditComponent = (AuditComponentImpl) ctx.getBean("auditComponent");
this.globalProperties = (java.util.Properties) ctx.getBean("global-properties");
this.globalProperties.setProperty(VersionableAspectTest.AUTO_VERSION_PROPS_KEY, "true");
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:38,代码来源:CMISTest.java
示例14: setUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
searchService = ctx.getBean("SearchService", SearchService.class);
fileFolderService = ctx.getBean("FileFolderService", FileFolderService.class);
nodeService = ctx.getBean("NodeService", NodeService.class);
transactionService = ctx.getBean("transactionService", TransactionService.class);
webDAVHelper = ctx.getBean("webDAVHelper", WebDAVHelper.class);
lockService = ctx.getBean("LockService", LockService.class);
policyComponent = ctx.getBean("policyComponent", PolicyComponent.class);
namespaceService = ctx.getBean("namespaceService", NamespaceService.class);
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
repositoryHelper = (Repository)ctx.getBean("repositoryHelper");
companyHomeNodeRef = repositoryHelper.getCompanyHome();
InputStream testDataIS = getClass().getClassLoader().getResourceAsStream(TEST_DATA_FILE_NAME);
InputStream davLockInfoIS = getClass().getClassLoader().getResourceAsStream(DAV_LOCK_INFO_XML);
testDataFile = IOUtils.toByteArray(testDataIS);
davLockInfoFile = IOUtils.toByteArray(davLockInfoIS);
testDataIS.close();
davLockInfoIS.close();
txn = transactionService.getUserTransaction();
txn.begin();
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:28,代码来源:WebDAVonContentUpdateTest.java
示例15: RepoService
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@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.nodeIndexer = (NodeIndexer)applicationContext.getBean("nodeIndexer");
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");
JobDetailBean contentStoreCleanerJobDetail = (JobDetailBean)applicationContext.getBean("contentStoreCleanerJobDetail");
scheduler.pauseJob(contentStoreCleanerJobDetail.getName(), contentStoreCleanerJobDetail.getGroup());
ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory)applicationContext.getBean("ActivitiesFeed");
ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext();
this.postLookup = (PostLookup)activitiesFeedCtx.getBean("postLookup");
this.feedGenerator = (FeedGenerator)activitiesFeedCtx.getBean("feedGenerator");
this.feedGeneratorJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("feedGeneratorJobDetail");
this.postLookupJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("postLookupJobDetail");
this.feedCleanerJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("feedCleanerJobDetail");
this.postCleanerJobDetail = (JobDetailBean)activitiesFeedCtx.getBean("postCleanerJobDetail");
this.feedNotifierJobDetail = (JobDetailBean)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.getName(), feedGeneratorJobDetail.getGroup());
scheduler.pauseJob(postLookupJobDetail.getName(), postLookupJobDetail.getGroup());
scheduler.pauseJob(feedCleanerJobDetail.getName(), feedCleanerJobDetail.getGroup());
scheduler.pauseJob(postCleanerJobDetail.getName(), postCleanerJobDetail.getGroup());
scheduler.pauseJob(feedNotifierJobDetail.getName(), feedNotifierJobDetail.getGroup());
this.systemNetwork = new TestNetwork(TenantService.DEFAULT_DOMAIN, true);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:60,代码来源:RepoService.java
示例16: setUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
searchService = ctx.getBean("SearchService", SearchService.class);
fileFolderService = ctx.getBean("FileFolderService", FileFolderService.class);
nodeService = ctx.getBean("NodeService", NodeService.class);
transactionService = ctx.getBean("transactionService", TransactionService.class);
webDAVHelper = ctx.getBean("webDAVHelper", WebDAVHelper.class);
lockService = ctx.getBean("LockService", LockService.class);
policyComponent = ctx.getBean("policyComponent", PolicyComponent.class);
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
companyHomeNodeRef = transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
{
@Override
public NodeRef execute() throws Throwable
{
// find "Company Home"
ResultSet resultSet = searchService.query(storeRef, SearchService.LANGUAGE_LUCENE, "PATH:\"/app:company_home\"");
NodeRef result = resultSet.getNodeRef(0);
resultSet.close();
return result;
}
});
InputStream testDataIS = getClass().getClassLoader().getResourceAsStream(TEST_DATA_FILE_NAME);
InputStream davLockInfoIS = getClass().getClassLoader().getResourceAsStream(DAV_LOCK_INFO_XML);
testDataFile = IOUtils.toByteArray(testDataIS);
davLockInfoFile = IOUtils.toByteArray(davLockInfoIS);
testDataIS.close();
davLockInfoIS.close();
txn = transactionService.getUserTransaction();
txn.begin();
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:38,代码来源:WebDAVonContentUpdateTest.java
示例17: before
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
@Before
public void before() throws Exception
{
ApplicationContext ctx = getTestFixture().getApplicationContext();
this.dictionaryDAO = (DictionaryDAO)ctx.getBean("dictionaryDAO");
this.lockService = (LockService) ctx.getBean("lockService");
this.tenantService = (TenantService)ctx.getBean("tenantService");
this.cmisDictionary = (CMISStrictDictionaryService)ctx.getBean("OpenCMISDictionaryService");
this.cmisTypeExclusions = (QNameFilter)ctx.getBean("cmisTypeExclusions");
this.nodeService = (NodeService) ctx.getBean("NodeService");
this.globalProperties = (Properties) ctx.getBean("global-properties");
this.globalProperties.setProperty(VersionableAspectTest.AUTO_VERSION_PROPS_KEY, "true");
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:15,代码来源:TestCMIS.java
示例18: onSetUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* Called during the transaction setup
*/
protected void onSetUp() throws Exception
{
// Catch transactions left dangling by inadequate transaction handling during test failures
if (AlfrescoTransactionSupport.getTransactionReadState() != TxnReadState.TXN_NONE)
{
fail("Dangling transaction at start of test.");
}
super.onSetUp();
// Get the required services
this.transferService = (TransferService)this.applicationContext.getBean("TransferService");
this.contentService = (ContentService)this.applicationContext.getBean("ContentService");
this.transferServiceImpl = (TransferServiceImpl2)this.applicationContext.getBean("transferService2");
this.searchService = (SearchService)this.applicationContext.getBean("SearchService");
this.transactionService = (TransactionService)this.applicationContext.getBean("TransactionService");
this.nodeService = (NodeService) this.applicationContext.getBean("nodeService");
this.contentService = (ContentService) this.applicationContext.getBean("contentService");
this.authenticationService = (MutableAuthenticationService) this.applicationContext.getBean("authenticationService");
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
this.receiver = (TransferReceiver)this.applicationContext.getBean("transferReceiver");
this.transferManifestNodeFactory = (TransferManifestNodeFactory)this.applicationContext.getBean("transferManifestNodeFactory");
this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationComponent");
this.lockService = (LockService) this.applicationContext.getBean("lockService");
this.personService = (PersonService)this.applicationContext.getBean("PersonService");
this.descriptorService = (DescriptorService)this.applicationContext.getBean("DescriptorService");
this.copyService = (CopyService)this.applicationContext.getBean("CopyService");
this.serverDescriptor = descriptorService.getServerDescriptor();
REPO_ID_B = descriptorService.getCurrentRepositoryDescriptor().getId();
authenticationComponent.setSystemUserAsCurrentUser();
setTransactionDefinition(new DefaultTransactionDefinition(TransactionDefinition.PROPAGATION_REQUIRES_NEW));
assertNotNull("receiver is null", this.receiver);
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:40,代码来源:TransferServiceToBeRefactoredTest.java
示例19: onSetUp
import org.alfresco.service.cmr.lock.LockService; //导入依赖的package包/类
/**
* Called during the transaction setup
*/
protected void onSetUp() throws Exception
{
super.onSetUp();
// Get the required services
this.transferService = (TransferService)this.applicationContext.getBean("TransferService");
this.contentService = (ContentService)this.applicationContext.getBean("ContentService");
this.transferServiceImpl = (TransferServiceImpl2)this.applicationContext.getBean("transferService2");
this.searchService = (SearchService)this.applicationContext.getBean("SearchService");
this.transactionService = (TransactionService)this.applicationContext.getBean("TransactionService");
this.nodeService = (NodeService) this.applicationContext.getBean("nodeService");
this.contentService = (ContentService) this.applicationContext.getBean("contentService");
this.authenticationService = (MutableAuthenticationService) this.applicationContext.getBean("authenticationService");
this.actionService = (ActionService)this.applicationContext.getBean("actionService");
this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
this.receiver = (TransferReceiver)this.applicationContext.getBean("transferReceiver");
this.transferManifestNodeFactory = (TransferManifestNodeFactory)this.applicationContext.getBean("transferManifestNodeFactory");
this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationCom
|
请发表评论