This changes the AVM service to use ContentService for storage. This gives us,

in theory, AVM working underneath (more or less) NodeService and ContentService.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3481 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-08-10 21:50:34 +00:00
parent 9a2a67605c
commit 06df2021c8
28 changed files with 744 additions and 865 deletions

View File

@@ -3,12 +3,18 @@
*/
package org.alfresco.repo.avm;
import org.alfresco.repo.content.ContentStore;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.MimetypeService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
* This is the (shudder) global context for AVM. It a rendezvous
* point for access to needed global instances.
* @author britt
*/
class AVMContext
class AVMContext implements ApplicationContextAware
{
/**
* The single instance of an AVMContext.
@@ -40,11 +46,6 @@ class AVMContext
*/
public VersionRootDAO fVersionRootDAO;
/**
* The FileContentDAO.
*/
public FileContentDAO fFileContentDAO;
/**
* The ChildEntryDAO.
*/
@@ -80,6 +81,36 @@ class AVMContext
*/
public AVMStorePropertyDAO fAVMStorePropertyDAO;
/**
* The ContentService.
*/
private ContentService fContentService;
/**
* The Mimetype Service.
*/
private MimetypeService fMimetypeService;
/**
* The AVMService.
*/
private AVMService fAVMService;
/**
* The Content Store.
*/
private ContentStore fContentStore;
/**
* The application context.
*/
public ApplicationContext fAppContext;
public void setApplicationContext(ApplicationContext context)
{
fAppContext = context;
}
/**
* @param nodeDAO the fAVMNodeDAO to set
*/
@@ -104,14 +135,6 @@ class AVMContext
fDeletedChildDAO = deletedChildDAO;
}
/**
* @param fileContentDAO the fFileContentDAO to set
*/
public void setFileContentDAO(FileContentDAO fileContentDAO)
{
fFileContentDAO = fileContentDAO;
}
/**
* @param historyLinkDAO the fHistoryLinkDAO to set
*/
@@ -169,4 +192,56 @@ class AVMContext
{
fAVMStorePropertyDAO = avmStorePropertyDAO;
}
/**
* Get the Content Service.
* @return The ContentService object.
*/
public ContentService getContentService()
{
if (fContentService == null)
{
fContentService = (ContentService)fAppContext.getBean("contentService");
}
return fContentService;
}
/**
* Get the mime type service.
* @return The mime type service.
*/
public MimetypeService getMimetypeService()
{
if (fMimetypeService == null)
{
fMimetypeService = (MimetypeService)fAppContext.getBean("mimetypeService");
}
return fMimetypeService;
}
/**
* Get the AVM Service.
* @return The AVMService instance.
*/
public AVMService getAVMService()
{
if (fAVMService == null)
{
fAVMService = (AVMService)fAppContext.getBean("AVMService");
}
return fAVMService;
}
/**
* Get the ContentStore.
* @return The content store.
*/
public ContentStore getContentStore()
{
if (fContentStore == null)
{
fContentStore = (ContentStore)fAppContext.getBean("fileContentStore");
}
return fContentStore;
}
}