本文整理汇总了Java中org.alfresco.service.cmr.model.FileFolderService类的典型用法代码示例。如果您正苦于以下问题:Java FileFolderService类的具体用法?Java FileFolderService怎么用?Java FileFolderService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FileFolderService类属于org.alfresco.service.cmr.model包,在下文中一共展示了FileFolderService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMimeMessageInFolder
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
/**
* Creates the EML message in the specified folder.
*
* @param folderFileInfo The folder to create message in.
* @param message The original MimeMessage.
* @return ID of the new message created
* @throws FileNotFoundException
* @throws FileExistsException
* @throws MessagingException
* @throws IOException
*/
private long createMimeMessageInFolder(
FileInfo folderFileInfo,
MimeMessage message,
Flags flags)
throws FileExistsException, FileNotFoundException, IOException, MessagingException
{
String name = AlfrescoImapConst.MESSAGE_PREFIX + GUID.generate();
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
FileInfo messageFile = fileFolderService.create(folderFileInfo.getNodeRef(), name, ContentModel.TYPE_CONTENT);
final long newMessageUid = (Long) messageFile.getProperties().get(ContentModel.PROP_NODE_DBID);
name = AlfrescoImapConst.MESSAGE_PREFIX + newMessageUid + AlfrescoImapConst.EML_EXTENSION;
fileFolderService.rename(messageFile.getNodeRef(), name);
Flags newFlags = new Flags(flags);
newFlags.add(Flag.RECENT);
imapService.setFlags(messageFile, newFlags, true);
if (extractAttachmentsEnabled)
{
imapService.extractAttachments(messageFile.getNodeRef(), message);
}
// Force persistence of the message to the repository
new IncomingImapMessage(messageFile, serviceRegistry, message);
return newMessageUid;
}
示例2: NodeMonitor
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
/**
* Class constructor
*
* @param filesysCtx ContentContext
* @param nodeService NodeService
* @param policyComponent PolicyComponent
* @param fileFolderService FileFolderService
* @param permissionService PermissionService
* @param transService TransactionService
*/
protected NodeMonitor(ContentContext filesysCtx, NodeService nodeService, PolicyComponent policyComponent,
FileFolderService fileFolderService, PermissionService permissionService, TransactionService transService) {
m_filesysCtx = filesysCtx;
// Set various services
m_nodeService = nodeService;
m_policyComponent = policyComponent;
m_fileFolderService = fileFolderService;
m_permissionService = permissionService;
m_transService = transService;
// Initialize the node monitor
init();
}
示例3: FileFolderLoader
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
/**
* @param repoState keep track of repository readiness
* @param transactionService ensure proper rollback, where required
* @param repositoryHelper access standard repository paths
* @param fileFolderService perform actual file-folder manipulation
*/
public FileFolderLoader(
RepositoryState repoState,
TransactionService transactionService,
Repository repositoryHelper,
FileFolderService fileFolderService,
NodeService nodeService,
ContentService contentService,
BehaviourFilter policyBehaviourFilter)
{
this.repoState = repoState;
this.transactionService = transactionService;
this.repositoryHelper = repositoryHelper;
this.fileFolderService = fileFolderService;
this.nodeService = nodeService;
this.contentService = contentService;
this.policyBehaviourFilter = policyBehaviourFilter;
this.normalDistribution = new NormalDistributionHelper();
}
示例4: setUp
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
@Before
public void setUp()
{
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
webDAVHelper = (WebDAVHelper) ctx.getBean("webDAVHelper");
fileFolderService = (FileFolderService) ctx.getBean("FileFolderService");
nodeService = (NodeService) ctx.getBean("NodeService");
StoreRef storeRef = nodeService.createStore("workspace", "WebDAVHelperTest-"+UUID.randomUUID());
rootNodeRef = nodeService.getRootNode(storeRef);
rootFolder = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN,
ContentModel.ASSOC_CHILDREN, ContentModel.TYPE_FOLDER).getChildRef();
//eventPublisher = (EventPublisherForTestingOnly) ctx.getBean("eventPublisher");
}
示例5: setUp
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
ctx = ApplicationContextHelper.getApplicationContext();
this.modelValidator = (ModelValidator)ctx.getBean("modelValidator");
this.dictionaryDAO = (DictionaryDAO)ctx.getBean("dictionaryDAO");
this.qnameDAO = (QNameDAO)ctx.getBean("qnameDAO");
this.namespaceDAO = (NamespaceDAO)ctx.getBean("namespaceDAO");
this.nodeService = (NodeService)ctx.getBean("NodeService");
this.fileFolderService = (FileFolderService)ctx.getBean("FileFolderService");
this.contentService = (ContentService)ctx.getBean("contentService");
this.versionService = (VersionService)ctx.getBean("VersionService");
this.transactionService = (TransactionService)ctx.getBean("TransactionService");
this.nodeArchiveService = (NodeArchiveService)ctx.getBean("nodeArchiveService");
this.modelName = "modelvalidatortest" + System.currentTimeMillis();
addModel();
}
示例6: copyContentOnly
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
private void copyContentOnly(FileInfo sourceFileInfo, FileInfo destFileInfo, FileFolderService fileFolderService) throws WebDAVServerException
{
ContentService contentService = getContentService();
ContentReader reader = contentService.getReader(sourceFileInfo.getNodeRef(), ContentModel.PROP_CONTENT);
if (reader == null)
{
// There is no content for the node if it is a folder
if (!sourceFileInfo.isFolder())
{
// Non-folders should have content available.
logger.error("Unable to get ContentReader for source node " + sourceFileInfo.getNodeRef());
throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND);
}
}
else
{
ContentWriter contentWriter = contentService.getWriter(destFileInfo.getNodeRef(), ContentModel.PROP_CONTENT, true);
contentWriter.putContent(reader);
}
}
示例7: copyOrMoveNode
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
/**
* Moves the node <code>sourceNodeRef</code> extracted from the message id.
* A part of a complex move operation.
*
* @param folderInfo FileInfo
* @param message MimeMessage
* @param flags Flags
* @param sourceNodeRef NodeRef
* @return UUID of the moved node
* @throws FileExistsException
* @throws FileNotFoundException
*/
@SuppressWarnings("deprecation")
private long copyOrMoveNode(FileInfo folderInfo, MimeMessage message, Flags flags, NodeRef sourceNodeRef, boolean move)
throws FileExistsException, FileNotFoundException
{
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
FileFilterMode.setClient(FileFilterMode.Client.imap);
FileInfo messageFile = null;
if (move)
{
fileFolderService.setHidden(sourceNodeRef, false);
messageFile = fileFolderService.move(sourceNodeRef, folderInfo.getNodeRef(), null);
}
else
{
NodeRef newNodeRef = serviceRegistry.getCopyService().copyAndRename(sourceNodeRef, folderInfo.getNodeRef(), ContentModel.ASSOC_CONTAINS, null, false);
fileFolderService.setHidden(newNodeRef, false);
messageFile = fileFolderService.getFileInfo(newNodeRef);
}
final long newMessageUid = (Long) messageFile.getProperties().get(ContentModel.PROP_NODE_DBID);
imapService.persistMessageHeaders(messageFile.getNodeRef(), message);
Flags newFlags = new Flags(flags);
newFlags.add(Flag.RECENT);
imapService.setFlags(messageFile, newFlags, true);
imapService.setFlag(messageFile, Flag.DELETED, false);
return newMessageUid;
}
示例8: checkEncoding
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
protected void checkEncoding(FileFolderService ffs, AuthenticationComponent authenticationComponent,
final ObjectData objectData, String expectedEncoding)
{
// Authenticate as system to check the properties in alfresco
authenticationComponent.setSystemUserAsCurrentUser();
try
{
NodeRef doc1NodeRef = cmisIdToNodeRef(objectData.getId());
doc1NodeRef.getId();
FileInfo fileInfo = ffs.getFileInfo(doc1NodeRef);
Map<QName, Serializable> properties2 = fileInfo.getProperties();
ContentDataWithId contentData = (ContentDataWithId) properties2
.get(QName.createQName("{http://www.alfresco.org/model/content/1.0}content"));
String encoding = contentData.getEncoding();
assertEquals(expectedEncoding, encoding);
}
finally
{
authenticationComponent.clearCurrentSecurityContext();
}
}
示例9: onSetUpInTransaction
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
@Override
protected void onSetUpInTransaction() throws Exception
{
nodeService = (NodeService)applicationContext.getBean(ServiceRegistry.NODE_SERVICE.getLocalName());
exporterService = (ExporterService)applicationContext.getBean("exporterComponent");
importerService = (ImporterService)applicationContext.getBean("importerComponent");
fileFolderService = (FileFolderService) applicationContext.getBean("fileFolderService");
categoryService = (CategoryService) applicationContext.getBean("categoryService");
transactionService = (TransactionService) applicationContext.getBean("transactionService");
permissionService = (PermissionServiceSPI) applicationContext.getBean("permissionService");
this.authenticationService = (MutableAuthenticationService) applicationContext.getBean("AuthenticationService");
this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
this.authenticationComponent.setSystemUserAsCurrentUser();
this.storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis());
}
示例10: mockServices
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
/**
* @return ServiceRegistry
*/
private ServiceRegistry mockServices()
{
ActionService mockActionService = mockActionService();
NodeService mockNodeService = mockNodeService();
PersonService mockPersonService = mockPersonService();
SearchService mockSearchService = mockSearchService();
SiteService mockSiteService = mockSiteService();
FileFolderService mockFileFolderService = mockFileFolderService();
RepoAdminService mockRepoAdminService = mockRepoAdminService();
SysAdminParams sysAdminParams = new SysAdminParamsImpl();
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);
when(services.getSysAdminParams()).thenReturn(sysAdminParams);
when(services.getRepoAdminService()).thenReturn(mockRepoAdminService);
return services;
}
示例11: mockFileFolderService
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
/**
* Mocks up a FileFolderService that claims there are
* no localised templates available
*/
private FileFolderService mockFileFolderService()
{
FileFolderService fileFolderService = mock(FileFolderService.class);
when(fileFolderService.getLocalizedSibling( (NodeRef)null )).thenAnswer(
new Answer<NodeRef>()
{
public NodeRef answer(InvocationOnMock invocation) throws Throwable
{
Object[] o = invocation.getArguments();
if(o == null || o.length == 0) return null;
return (NodeRef)o[0];
}
}
);
return fileFolderService;
}
示例12: setUp
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的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");
}
示例13: setUp
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
@Override
public void setUp() throws Exception
{
ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
transactionService = serviceRegistry.getTransactionService();
txnHelper = transactionService.getRetryingTransactionHelper();
solrTrackingComponent = (SOLRTrackingComponent) ctx.getBean("solrTrackingComponent");
nodeDAO = (NodeDAO)ctx.getBean("nodeDAO");
qnameDAO = (QNameDAO) ctx.getBean("qnameDAO");
dictionaryDAO = (DictionaryDAO)ctx.getBean("dictionaryDAO");
nodeService = (NodeService)ctx.getBean("NodeService");
fileFolderService = (FileFolderService)ctx.getBean("FileFolderService");
dictionaryService = serviceRegistry.getDictionaryService();
namespaceService = serviceRegistry.getNamespaceService();
authenticationComponent = (AuthenticationComponent)ctx.getBean("authenticationComponent");
dbNodeService = (DbNodeServiceImpl)ctx.getBean("dbNodeService");
dbNodeService.setEnableTimestampPropagation(false);
authenticationComponent.setSystemUserAsCurrentUser();
storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, getName() + System.currentTimeMillis());
rootNodeRef = nodeService.getRootNode(storeRef);
}
示例14: SOLRTest
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
SOLRTest(
RetryingTransactionHelper txnHelper, FileFolderService fileFolderService,
NodeDAO nodeDAO, QNameDAO qnameDAO, NodeService nodeService, DictionaryService dictionaryService,
NodeRef rootNodeRef, String containerName, boolean doNodeChecks, boolean doMetaDataChecks)
{
this.txnHelper = txnHelper;
this.nodeService = nodeService;
this.rootNodeRef = rootNodeRef;
this.fileFolderService = fileFolderService;
this.nodeDAO = nodeDAO;
this.qnameDAO = qnameDAO;
this.dictionaryService = dictionaryService;
this.containerName = containerName;
this.nodeAssertions = new HashMap<NodeRef, NodeAssertions>();
this.nodeIds = new ArrayList<Long>(getExpectedNumNodes());
this.doNodeChecks = doNodeChecks;
this.doMetaDataChecks = doMetaDataChecks;
this.doChecks = doNodeChecks || doMetaDataChecks;
}
示例15: SOLRTestResidualProperties
import org.alfresco.service.cmr.model.FileFolderService; //导入依赖的package包/类
SOLRTestResidualProperties(
RetryingTransactionHelper txnHelper, FileFolderService fileFolderService,
NodeDAO nodeDAO, QNameDAO qnameDAO, NodeService nodeService, DictionaryService dictionaryService,
NodeRef rootNodeRef, String containerName, boolean doNodeChecks, boolean doMetaDataChecks)
{
super(txnHelper, fileFolderService, nodeDAO, qnameDAO, nodeService, dictionaryService,rootNodeRef, containerName, doNodeChecks, doMetaDataChecks);
}