本文整理汇总了Java中org.alfresco.service.cmr.repository.StoreRef.getProtocol方法的典型用法代码示例。如果您正苦于以下问题:Java StoreRef.getProtocol方法的具体用法?Java StoreRef.getProtocol怎么用?Java StoreRef.getProtocol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.repository.StoreRef
的用法示例。
在下文中一共展示了StoreRef.getProtocol方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bootstrapSystemTenantStore
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
private void bootstrapSystemTenantStore(ImporterBootstrap systemImporterBootstrap, String tenantDomain)
{
// Bootstrap Tenant-Specific System Store
StoreRef bootstrapStoreRef = systemImporterBootstrap.getStoreRef();
StoreRef tenantBootstrapStoreRef = new StoreRef(bootstrapStoreRef.getProtocol(), tenantService.getName(bootstrapStoreRef.getIdentifier(), tenantDomain));
systemImporterBootstrap.setStoreUrl(tenantBootstrapStoreRef.toString());
// override default property (workspace://SpacesStore)
List<String> mustNotExistStoreUrls = new ArrayList<String>();
mustNotExistStoreUrls.add(new StoreRef(PROTOCOL_STORE_WORKSPACE, tenantService.getName(STORE_BASE_ID_USER, tenantDomain)).toString());
systemImporterBootstrap.setMustNotExistStoreUrls(mustNotExistStoreUrls);
systemImporterBootstrap.bootstrap();
// reset since systemImporter is singleton (hence reused)
systemImporterBootstrap.setStoreUrl(bootstrapStoreRef.toString());
if (logger.isDebugEnabled())
{
logger.debug("Bootstrapped store: "+tenantService.getBaseName(tenantBootstrapStoreRef)+" (Tenant: "+tenantDomain+")");
}
}
示例2: getName
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
@Override
public StoreRef getName(String username, StoreRef storeRef)
{
if (storeRef == null)
{
return null;
}
if ((username != null) && (AuthenticationUtil.isMtEnabled()))
{
int idx = username.lastIndexOf(SEPARATOR);
if ((idx > 0) && (idx < (username.length() - 1)))
{
String tenantDomain = username.substring(idx + 1);
return new StoreRef(storeRef.getProtocol(), getName(storeRef.getIdentifier(), tenantDomain));
}
}
return storeRef;
}
示例3: ObjectReference
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
ObjectReference(StoreRef ref, String id)
{
String[] relativePath = id.split("/");
// bug fix MNT-16380
// for using a relative path to a node id eg. 18cc-.../folder1/.../folderN/fileA.txt
// if only one slash we don't have a relative path
if (relativePath.length <= 2)
{
if (id.indexOf('/') != -1)
{
id = id.substring(0, id.indexOf('/'));
}
this.ref = new NodeRef(ref, id);
}
else
{
String[] reference = new String[relativePath.length + 2];
reference[0] = ref.getProtocol();
reference[1] = ref.getIdentifier();
System.arraycopy(relativePath, 0, reference, 2, relativePath.length);
this.ref = repository.findNodeRef("node", reference);
}
}
示例4: handleNode
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
@Override
public boolean handleNode(Node node)
{
if (storeRef != null)
{
// MT - since storeRef is not null, filter by store here
StoreRef tenantStoreRef = node.getStore().getStoreRef();
StoreRef baseStoreRef = new StoreRef(tenantStoreRef.getProtocol(), tenantService.getBaseName(tenantStoreRef.getIdentifier(), true));
if (storeRef.equals(baseStoreRef))
{
nodes.add(new NodeRecord(node, qnameDAO, tenantService));
}
}
else
{
nodes.add(new NodeRecord(node, qnameDAO, tenantService));
}
// continue - get next node
return true;
}
示例5: RepositoryLocation
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
/**
* Constructor
*
* @param storeRef the store reference (e.g. 'workspace://SpacesStore' )
* @param path the path (e.g. '/app:company_home/app:dictionary/app:models' )
* @param queryLanguage the query language (e.g. 'xpath' or 'lucence')
*/
public RepositoryLocation(StoreRef storeRef, String path, String queryLanguage)
{
this.storeProtocol = storeRef.getProtocol();
this.storeId = storeRef.getIdentifier();
this.path = path;
setQueryLanguage(queryLanguage);
}
示例6: stringifyRepositoryLocation
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
@Override
public String stringifyRepositoryLocation(RepositoryNodeRef repositoryNodeRef) throws ReferenceEncodingException
{
NodeRef nodeRef = repositoryNodeRef.getNodeRef();
StoreRef storeRef = nodeRef.getStoreRef();
return NODE + DELIMITER + storeRef.getProtocol() + DELIMITER + storeRef.getIdentifier() + DELIMITER
+ nodeRef.getId();
}
示例7: propagateNodeRefMutations
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
@Override
public Reference propagateNodeRefMutations(NodeRef mutatedNodeRef, Reference reference)
{
StoreRef storeRef = mutatedNodeRef.getStoreRef();
String storeId = storeRef.getIdentifier();
String protocol = storeRef.getProtocol();
if (Version2Model.STORE_ID.equals(storeId) || VersionModel.STORE_ID.equals(storeId)
|| VersionBaseModel.STORE_PROTOCOL.equals(protocol))
{
Resource resource = reference.getResource();
if (resource instanceof RepositoryResource)
{
RepositoryResource repositoryResource = (RepositoryResource) resource;
RepositoryLocation location = repositoryResource.getLocation();
if (location instanceof RepositoryNodeRef)
{
RepositoryNodeRef repositoryNodeRef = (RepositoryNodeRef) location;
NodeRef nodeRef = repositoryNodeRef.getNodeRef();
NodeRef nodeRefPropagation = new NodeRef(mutatedNodeRef.getStoreRef(),
nodeRef.getId());
Resource resourcePropagation = new RepositoryResource(new RepositoryNodeRef(nodeRefPropagation));
return new Reference(reference.getEncoding(),
reference.getProtocol(),
resourcePropagation,
reference.getParameters());
}
}
}
// default branch
return reference;
}
示例8: bootstrapSpacesTenantStore
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
private void bootstrapSpacesTenantStore(ImporterBootstrap spacesImporterBootstrap, String tenantDomain)
{
// Bootstrap Tenant-Specific Spaces Store
StoreRef bootstrapStoreRef = spacesImporterBootstrap.getStoreRef();
StoreRef tenantBootstrapStoreRef = new StoreRef(bootstrapStoreRef.getProtocol(), tenantService.getName(bootstrapStoreRef.getIdentifier(), tenantDomain));
spacesImporterBootstrap.setStoreUrl(tenantBootstrapStoreRef.toString());
// override admin username property
Properties props = spacesImporterBootstrap.getConfiguration();
props.put("alfresco_user_store.adminusername", getTenantAdminUser(tenantDomain));
// override guest username property
props.put("alfresco_user_store.guestusername", getTenantGuestUser(tenantDomain));
spacesImporterBootstrap.bootstrap();
// reset since spacesImporterBootstrap is singleton (hence reused)
spacesImporterBootstrap.setStoreUrl(bootstrapStoreRef.toString());
// calculate any missing usages
UserUsageTrackingComponent userUsageTrackingComponent = (UserUsageTrackingComponent)ctx.getBean("userUsageTrackingComponent");
userUsageTrackingComponent.bootstrapInternal();
if (logger.isDebugEnabled())
{
logger.debug("Bootstrapped store: "+tenantService.getBaseName(tenantBootstrapStoreRef)+" (Tenant: "+tenantDomain+")");
}
}
示例9: getBaseName
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
@Override
public StoreRef getBaseName(StoreRef storeRef)
{
if (storeRef == null)
{
return null;
}
return new StoreRef(storeRef.getProtocol(), getBaseName(storeRef.getIdentifier()));
}
示例10: createTenantShare
import org.alfresco.service.cmr.repository.StoreRef; //导入方法依赖的package包/类
/**
* Create a tenant domain specific share
*/
private final DiskSharedDevice createTenantShare(String tenantDomain)
{
logger.debug("create tenant share for domain " + tenantDomain);
StoreRef storeRef = new StoreRef(getStoreName());
NodeRef rootNodeRef = new NodeRef(storeRef.getProtocol(), storeRef.getIdentifier(), "dummy");
// Root nodeRef is required for storeRef part
rootNodeRef = m_alfrescoConfig.getTenantService().getRootNode(
m_alfrescoConfig.getNodeService(),
m_alfrescoConfig.getSearchService(),
m_alfrescoConfig.getNamespaceService(),
getRootPath(),
rootNodeRef);
// Create the disk driver and context
DiskInterface diskDrv = getRepoDiskInterface();
ContentContext diskCtx = new ContentContext(m_tenantShareName, getStoreName(), getRootPath(), rootNodeRef);
// Set a quota manager for the share, if enabled
if ( m_quotaManager != null)
{
diskCtx.setQuotaManager( m_quotaManager);
}
if(m_config instanceof ServerConfigurationBean)
{
ServerConfigurationBean config = (ServerConfigurationBean)m_config;
config.initialiseRuntimeContext("cifs.tenant." + tenantDomain, diskCtx);
}
else
{
throw new AlfrescoRuntimeException("configuration error, unknown configuration bean");
}
// Default the filesystem to look like an 80Gb sized disk with 90% free space
diskCtx.setDiskInformation(new SrvDiskInfo(2560, 64, 512, 2304));
// Create a temporary shared device for the user to access the tenant company home directory
return new DiskSharedDevice(m_tenantShareName, diskDrv, diskCtx);
}