Added the notion of a ContentContext to select the content store to write to.

Added AbstractRoutingContentStore as a start base implementation.
Added warnings to drive config away from disused setTransactionService towards setRetryingTransactionHelper.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5734 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-05-21 09:16:31 +00:00
parent 8ee3f781f4
commit 6f4ab835fe
14 changed files with 631 additions and 56 deletions

View File

@@ -32,6 +32,7 @@ import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.content.AbstractContentStore;
import org.alfresco.repo.content.ContentContext;
import org.alfresco.service.cmr.repository.ContentIOException;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
@@ -39,10 +40,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Provides a store of node content directly to the file system.
* Provides a store of node content directly to the file system. The writers
* are generated using information from the {@link ContentContext simple content context}.
* <p>
* The file names obey, as they must, the URL naming convention
* as specified in the {@link org.alfresco.repo.content.ContentStore}.
* as specified in the {@link org.alfresco.repo.content.ContentStore ContentStore interface}.
*
* @author Derek Hulley
*/
@@ -241,8 +243,10 @@ public class FileContentStore extends AbstractContentStore
/**
* @return Returns a writer onto a location based on the date
*/
public ContentWriter getWriter(ContentReader existingContentReader, String newContentUrl)
public ContentWriter getWriter(ContentContext ctx)
{
ContentReader existingContentReader = ctx.getExistingContentReader();
String newContentUrl = ctx.getContentUrl();
try
{
File file = null;