本文整理汇总了Java中org.alfresco.repo.tenant.TenantService类的典型用法代码示例。如果您正苦于以下问题:Java TenantService类的具体用法?Java TenantService怎么用?Java TenantService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TenantService类属于org.alfresco.repo.tenant包,在下文中一共展示了TenantService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onSetUpBeforeTransaction
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void onSetUpBeforeTransaction() throws Exception
{
super.onSetUpBeforeTransaction();
this.serviceRegistry = (ServiceRegistry) applicationContext.getBean(ServiceRegistry.SERVICE_REGISTRY);
this.tenantService= (TenantService) applicationContext.getBean("tenantService");
this.tenantAdminService= (TenantAdminService) applicationContext.getBean("tenantAdminService");
this.workflowService = serviceRegistry.getWorkflowService();
this.personService = serviceRegistry.getPersonService();
WorkflowAdminServiceImpl workflowAdminService = (WorkflowAdminServiceImpl)applicationContext.getBean(WorkflowAdminServiceImpl.NAME);
this.wfTestHelper = new WorkflowTestHelper(workflowAdminService, getEngine(), true);
AuthenticationUtil.clearCurrentSecurityContext();
this.user1 = createTenant(tenant1);
this.user2 = createTenant(tenant2);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:AbstractMultitenantWorkflowTest.java
示例2: validateDeleteProperty
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
private void validateDeleteProperty(QName modelName, QName propertyQName, boolean sharedModel)
{
String tenantDomain = TenantService.DEFAULT_DOMAIN;
if (sharedModel)
{
tenantDomain = " for tenant [" + tenantService.getCurrentUserDomain() + "]";
}
PropertyDefinition prop = dictionaryDAO.getProperty(propertyQName);
if(prop != null && prop.getName().equals(propertyQName) && prop.getModel().getName().equals(modelName))
{
validateDeleteProperty(tenantDomain, prop);
}
else
{
throw new AlfrescoRuntimeException("Cannot delete model " + modelName + " in tenant " + tenantDomain
+ " - property definition '" + propertyQName + "' not defined in model '" + modelName + "'");
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:ModelValidatorImpl.java
示例3: getUsersHomeTenant
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
private static String getUsersHomeTenant(String userName)
{
boolean thisIsCloud = false;
try
{
thisIsCloud = (Class.forName("org.alfresco.module.org_alfresco_module_cloud.registration.RegistrationService") != null);
}
catch (ClassNotFoundException ignoreIfThrown)
{
// Intentionally empty
}
String result = TenantService.DEFAULT_DOMAIN;
// Even if we get email address-style user names in an enterprise system, those are not to be given home tenants.
if (thisIsCloud)
{
String[] elems = userName.split("@");
result = elems[1];
}
return result;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:AbstractMailActionExecuterTest.java
示例4: getRepositoryInfo
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
private RepositoryInfo getRepositoryInfo(final Network network)
{
final String networkId = network.getTenantDomain();
final String tenantDomain = (networkId.equals(TenantUtil.SYSTEM_TENANT) || networkId.equals(TenantUtil.DEFAULT_TENANT)) ? TenantService.DEFAULT_DOMAIN : networkId;
return TenantUtil.runAsSystemTenant(new TenantRunAsWork<RepositoryInfo>()
{
public RepositoryInfo doWork()
{
RepositoryInfoImpl repoInfo = (RepositoryInfoImpl)connector.getRepositoryInfo(getContext().getCmisVersion());
repoInfo.setId(!networkId.equals("") ? networkId : TenantUtil.SYSTEM_TENANT);
repoInfo.setName(tenantDomain);
repoInfo.setDescription(tenantDomain);
return repoInfo;
}
}, tenantDomain);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:PublicApiAlfrescoCmisService.java
示例5: setUpApplicationContext
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
protected void setUpApplicationContext()
{
ApplicationContext appContext = ApplicationContextHelper.getApplicationContext(new String[]
{
"classpath:alfresco/application-context.xml", "classpath:alfresco/web-scripts-application-context.xml",
"classpath:alfresco/remote-api-context.xml"
});
this.nodeService = (NodeService) appContext.getBean("NodeService");
this.searchService = (SearchService) appContext.getBean("SearchService");
this.namespaceService = (NamespaceService) appContext.getBean("NamespaceService");
this.tenantService = (TenantService) appContext.getBean("tenantService");
this.transactionService = (TransactionService) appContext.getBean("transactionService");
this.webDAVHelper = (WebDAVHelper) appContext.getBean("webDAVHelper");
this.tenantAdminService = (TenantAdminService) appContext.getBean("tenantAdminService");
// Authenticate as system to create initial test data set
AuthenticationComponent authenticationComponent = (AuthenticationComponent) appContext.getBean("authenticationComponent");
authenticationComponent.setSystemUserAsCurrentUser();
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:21,代码来源:WebDAVMethodTest.java
示例6: deleteUser
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
/**
* TODO implement as remote api call
*/
protected String deleteUser(final String username, final TestNetwork network)
{
final String tenantDomain = (network != null ? network.getId() : TenantService.DEFAULT_DOMAIN);
return AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<String>()
{
@Override
public String doWork() throws Exception
{
return TenantUtil.runAsTenant(new TenantUtil.TenantRunAsWork<String>()
{
public String doWork() throws Exception
{
repoService.deleteUser(username, network);
return null;
}
}, tenantDomain);
}
}, networkAdmin);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:AbstractBaseApiTest.java
示例7: initDictionaryCaches
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception
{
CompiledModelsCache compiledModelsCache = new CompiledModelsCache();
compiledModelsCache.setDictionaryDAO(dictionaryDAO);
compiledModelsCache.setTenantService(tenantService);
compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry());
TraceableThreadFactory threadFactory = new TraceableThreadFactory();
threadFactory.setThreadDaemon(true);
threadFactory.setThreadPriority(Thread.NORM_PRIORITY);
ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor(20, 20, 90, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory,
new ThreadPoolExecutor.CallerRunsPolicy());
compiledModelsCache.setThreadPoolExecutor(threadPoolExecutor);
dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache);
dictionaryDAO.init();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:DictionaryLoadDAOTest.java
示例8: prepare
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
@Override
public void prepare(NamespaceService namespaceService, DictionaryService dictionaryService, QNameDAO qnameDAO, NodeDAO nodeDAO, TenantService tenantService, Set<String> selectors, Map<String, Argument> functionArgs, FunctionEvaluationContext functionContext, boolean supportBooleanFloatAndDouble)
{
Function function = getFunction();
if(function != null)
{
if(function instanceof DBQueryBuilderComponent)
{
DBQueryBuilderComponent dbQueryBuilderComponent = (DBQueryBuilderComponent)function;
dbQueryBuilderComponent.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectors, getFunctionArguments(), functionContext, supportBooleanFloatAndDouble);
}
else
{
throw new UnsupportedOperationException();
}
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:DBFunctionalConstraint.java
示例9: initDictionaryCaches
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
private void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService)
{
CompiledModelsCache compiledModelsCache = new CompiledModelsCache();
compiledModelsCache.setDictionaryDAO(dictionaryDAO);
compiledModelsCache.setTenantService(tenantService);
compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry());
TraceableThreadFactory threadFactory = new TraceableThreadFactory();
threadFactory.setThreadDaemon(true);
threadFactory.setThreadPriority(Thread.NORM_PRIORITY);
ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor(20, 20, 90, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory,
new ThreadPoolExecutor.CallerRunsPolicy());
compiledModelsCache.setThreadPoolExecutor(threadPoolExecutor);
dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache);
dictionaryDAO.init();
}
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:17,代码来源:DictionaryDAOTest.java
示例10: initDictionaryCaches
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService)
{
CompiledModelsCache compiledModelsCache = new CompiledModelsCache();
compiledModelsCache.setDictionaryDAO(dictionaryDAO);
compiledModelsCache.setTenantService(tenantService);
compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry());
TraceableThreadFactory threadFactory = new TraceableThreadFactory();
threadFactory.setThreadDaemon(true);
threadFactory.setThreadPriority(Thread.NORM_PRIORITY);
ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor(20, 20, 90, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory,
new ThreadPoolExecutor.CallerRunsPolicy());
compiledModelsCache.setThreadPoolExecutor(threadPoolExecutor);
dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache);
dictionaryDAO.init();
}
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:17,代码来源:AbstractModelTest.java
示例11: LazyActivitiWorkflowTask
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public LazyActivitiWorkflowTask(HistoricTaskInstance historicTask, ActivitiTypeConverter typeConverter, TenantService tenantService)
{
super(BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, historicTask.getId()), null, null, null, null, null, null, null);
this.historicTask = historicTask;
this.activitiTypeConverter = typeConverter;
this.lazyPropertiesMap = new LazyPropertiesMap();
// Fetch task-definition and a partially-initialized WorkflowTask (not including properties and path)
WorkflowTaskDefinition taskDefinition = activitiTypeConverter.getTaskDefinition(historicTask.getTaskDefinitionKey(), historicTask.getProcessDefinitionId());
String workflowDefinitionName = activitiTypeConverter.getWorkflowDefinitionName(historicTask.getProcessDefinitionId());
workflowDefinitionName = tenantService.getBaseName(workflowDefinitionName);
WorkflowTask partiallyInitialized = typeConverter.getWorkflowObjectFactory().createTask(historicTask.getId(), taskDefinition, taskDefinition.getId(), historicTask.getName(),
historicTask.getDescription(), WorkflowTaskState.COMPLETED, null, workflowDefinitionName , lazyPropertiesMap);
this.definition = taskDefinition;
this.name = taskDefinition.getId();
this.title = partiallyInitialized.getTitle();
this.description = partiallyInitialized.getDescription();
this.state = partiallyInitialized.getState();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:LazyActivitiWorkflowTask.java
示例12: testBootstrap
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
public void testBootstrap() throws Exception
{
TenantService tenantService = new SingleTServiceImpl();
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService);
initDictionaryCaches(dictionaryDAO, tenantService);
DictionaryBootstrap bootstrap = new DictionaryBootstrap();
List<String> bootstrapModels = new ArrayList<String>();
bootstrapModels.add("alfresco/model/dictionaryModel.xml");
bootstrapModels.add("alfresco/model/systemModel.xml");
bootstrapModels.add("alfresco/model/contentModel.xml");
bootstrapModels.add("alfresco/model/applicationModel.xml");
bootstrapModels.add("org/alfresco/repo/security/authentication/userModel.xml");
bootstrapModels.add("org/alfresco/repo/action/actionModel.xml");
bootstrapModels.add("org/alfresco/repo/rule/ruleModel.xml");
bootstrapModels.add("org/alfresco/repo/version/version_model.xml");
bootstrap.setModels(bootstrapModels);
bootstrap.setDictionaryDAO(dictionaryDAO);
bootstrap.setTenantService(tenantService);
bootstrap.bootstrap();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:RepoDictionaryDAOTest.java
示例13: prepare
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
@Override
public void prepare(NamespaceService namespaceService, DictionaryService dictionaryService, QNameDAO qnameDAO, NodeDAO nodeDAO, TenantService tenantService, Set<String> selectors,
Map<String, Argument> functionArgs, FunctionEvaluationContext functionContext, boolean supportBooleanFloatAndDouble)
{
//throw new QueryModelException("Disjunctions are not suported");
for (Constraint constraint : getConstraints())
{
if (constraint instanceof DBQueryBuilderComponent)
{
DBQueryBuilderComponent dbQueryBuilderComponent = (DBQueryBuilderComponent) constraint;
dbQueryBuilderComponent.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectors, functionArgs, functionContext, supportBooleanFloatAndDouble);
}
else
{
throw new UnsupportedOperationException();
}
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:DBDisjunction.java
示例14: setUp
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
// Instantiate Dictionary Service
TenantService tenantService = new SingleTServiceImpl();
DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
dictionaryDAO.setTenantService(tenantService);
initDictionaryCaches(dictionaryDAO, tenantService);
DictionaryBootstrap bootstrap = new DictionaryBootstrap();
List<String> bootstrapModels = new ArrayList<String>();
bootstrapModels.add("alfresco/model/dictionaryModel.xml");
bootstrapModels.add("alfresco/model/systemModel.xml");
bootstrapModels.add("org/alfresco/repo/policy/policycomponenttest_model.xml");
bootstrapModels.add(TEST_MODEL);
bootstrap.setModels(bootstrapModels);
bootstrap.setDictionaryDAO(dictionaryDAO);
bootstrap.setTenantService(new SingleTServiceImpl());
bootstrap.bootstrap();
DictionaryComponent dictionary = new DictionaryComponent();
dictionary.setDictionaryDAO(dictionaryDAO);
// Instantiate Policy Component
policyComponent = new PolicyComponentImpl(dictionary);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:PolicyComponentTest.java
示例15: tenantExists
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
/**
* Determine whether tenant exists and enabled
*
* @param tenant String
* @return true => it exists, no it doesn't
*/
public boolean tenantExists(final String tenant)
{
if (tenant == null || TenantService.DEFAULT_DOMAIN.equalsIgnoreCase(tenant))
{
return true;
}
return AuthenticationUtil.runAsSystem(new RunAsWork<Boolean>()
{
public Boolean doWork() throws Exception
{
return tenantAdminService.existsTenant(tenant) && tenantAdminService.isEnabled();
}
});
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:22,代码来源:PublicApiTenantAuthentication.java
示例16: isRunAsUserTheSystemUser
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
public static boolean isRunAsUserTheSystemUser()
{
String runAsUser = getRunAsUser();
if ((runAsUser != null) && isMtEnabled())
{
// get base username
int idx = runAsUser.indexOf(TenantService.SEPARATOR);
if (idx != -1)
{
runAsUser = runAsUser.substring(0, idx);
}
}
return EqualsHelper.nullSafeEquals(runAsUser, AuthenticationUtil.SYSTEM_USER_NAME);
}
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:15,代码来源:AuthenticationUtil.java
示例17: getCurrentTenantDomain
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
private String getCurrentTenantDomain()
{
String tenantDomain = tenantService.getCurrentUserDomain();
if (tenantDomain == null)
{
return TenantService.DEFAULT_DOMAIN;
}
return tenantDomain;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:ActivityPosterImpl.java
示例18: initDictionaryCaches
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
private static void initDictionaryCaches(DictionaryDAOImpl dictionaryDAO, TenantService tenantService) throws Exception
{
CompiledModelsCache compiledModelsCache = new CompiledModelsCache();
compiledModelsCache.setDictionaryDAO(dictionaryDAO);
compiledModelsCache.setTenantService(tenantService);
compiledModelsCache.setRegistry(new DefaultAsynchronouslyRefreshedCacheRegistry());
ThreadPoolExecutorFactoryBean threadPoolfactory = new ThreadPoolExecutorFactoryBean();
threadPoolfactory.afterPropertiesSet();
compiledModelsCache.setThreadPoolExecutor((ThreadPoolExecutor) threadPoolfactory.getObject());
dictionaryDAO.setDictionaryRegistryCache(compiledModelsCache);
dictionaryDAO.init();
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:TestModel.java
示例19: create
import org.alfresco.repo.tenant.TenantService; //导入依赖的package包/类
public void create()
{
if(!getId().equals(TenantService.DEFAULT_DOMAIN) && !tenantAdminService.existsTenant(getId()))
{
tenantAdminService.createTenant(getId(), DEFAULT_ADMIN_PWD.toCharArray());
numNetworks++;
log("Created network " + getId());
}
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:10,代码来源:RepoService.java
示例20: before
import org.alfresco.repo.tenant.TenantService; //导入依赖的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
注:本文中的org.alfresco.repo.tenant.TenantService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论