com.liferay.portlet.documentlibrary.store
Class JCRStore

java.lang.Object
  extended by com.liferay.portlet.documentlibrary.store.BaseStore
      extended by com.liferay.portlet.documentlibrary.store.JCRStore
All Implemented Interfaces:
com.liferay.portlet.documentlibrary.store.Store

public class JCRStore
extends com.liferay.portlet.documentlibrary.store.BaseStore

Author:
Michael Young, Brian Wing Shun Chan, Edward Han

Field Summary
 
Fields inherited from interface com.liferay.portlet.documentlibrary.store.Store
VERSION_DEFAULT
 
Constructor Summary
JCRStore()
           
 
Method Summary
 void addDirectory(long companyId, long repositoryId, java.lang.String dirName)
           
 void addFile(long companyId, long repositoryId, java.lang.String fileName, java.io.InputStream is)
           
 void checkRoot(long companyId)
           
 void deleteDirectory(long companyId, long repositoryId, java.lang.String dirName)
           
 void deleteFile(long companyId, long repositoryId, java.lang.String fileName)
           
 void deleteFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
 java.io.InputStream getFileAsStream(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
protected  javax.jcr.Node getFileContentNode(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
protected  javax.jcr.Node getFileContentNode(javax.jcr.Session session, long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
 java.lang.String[] getFileNames(long companyId, long repositoryId)
           
 java.lang.String[] getFileNames(long companyId, long repositoryId, java.lang.String dirName)
           
 long getFileSize(long companyId, long repositoryId, java.lang.String fileName)
           
protected  javax.jcr.Node getFolderNode(javax.jcr.Node node, long name)
           
protected  javax.jcr.Node getFolderNode(javax.jcr.Node node, java.lang.String name)
           
protected  javax.jcr.Node getRootNode(javax.jcr.Session session, long companyId)
           
 boolean hasDirectory(long companyId, long repositoryId, java.lang.String dirName)
           
 boolean hasFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel)
           
 void move(java.lang.String srcDir, java.lang.String destDir)
           
 void updateFile(long companyId, long repositoryId, long newRepositoryId, java.lang.String fileName)
           
 void updateFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String newFileName)
           
 void updateFile(long companyId, long repositoryId, java.lang.String fileName, java.lang.String versionLabel, java.io.InputStream is)
           
 
Methods inherited from class com.liferay.portlet.documentlibrary.store.BaseStore
addFile, addFile, copyFileVersion, getFile, getFile, getFileAsBytes, getFileAsBytes, getFileAsStream, hasFile, updateFile, updateFile, updateFileVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCRStore

public JCRStore()
Method Detail

addDirectory

public void addDirectory(long companyId,
                         long repositoryId,
                         java.lang.String dirName)
                  throws com.liferay.portal.kernel.exception.PortalException,
                         com.liferay.portal.kernel.exception.SystemException
Specified by:
addDirectory in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
addDirectory in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

addFile

public void addFile(long companyId,
                    long repositoryId,
                    java.lang.String fileName,
                    java.io.InputStream is)
             throws com.liferay.portal.kernel.exception.PortalException,
                    com.liferay.portal.kernel.exception.SystemException
Specified by:
addFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
addFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

checkRoot

public void checkRoot(long companyId)
               throws com.liferay.portal.kernel.exception.SystemException
Specified by:
checkRoot in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
checkRoot in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.SystemException

deleteDirectory

public void deleteDirectory(long companyId,
                            long repositoryId,
                            java.lang.String dirName)
                     throws com.liferay.portal.kernel.exception.PortalException
Specified by:
deleteDirectory in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
deleteDirectory in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException

deleteFile

public void deleteFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName)
                throws com.liferay.portal.kernel.exception.PortalException,
                       com.liferay.portal.kernel.exception.SystemException
Specified by:
deleteFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
deleteFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

deleteFile

public void deleteFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String versionLabel)
                throws com.liferay.portal.kernel.exception.PortalException,
                       com.liferay.portal.kernel.exception.SystemException
Specified by:
deleteFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
deleteFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

getFileAsStream

public java.io.InputStream getFileAsStream(long companyId,
                                           long repositoryId,
                                           java.lang.String fileName,
                                           java.lang.String versionLabel)
                                    throws com.liferay.portal.kernel.exception.PortalException,
                                           com.liferay.portal.kernel.exception.SystemException
Specified by:
getFileAsStream in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
getFileAsStream in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

getFileNames

public java.lang.String[] getFileNames(long companyId,
                                       long repositoryId)
                                throws com.liferay.portal.kernel.exception.SystemException
Throws:
com.liferay.portal.kernel.exception.SystemException

getFileNames

public java.lang.String[] getFileNames(long companyId,
                                       long repositoryId,
                                       java.lang.String dirName)
                                throws com.liferay.portal.kernel.exception.PortalException,
                                       com.liferay.portal.kernel.exception.SystemException
Specified by:
getFileNames in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
getFileNames in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

getFileSize

public long getFileSize(long companyId,
                        long repositoryId,
                        java.lang.String fileName)
                 throws com.liferay.portal.kernel.exception.PortalException,
                        com.liferay.portal.kernel.exception.SystemException
Specified by:
getFileSize in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
getFileSize in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

hasDirectory

public boolean hasDirectory(long companyId,
                            long repositoryId,
                            java.lang.String dirName)
                     throws com.liferay.portal.kernel.exception.SystemException
Specified by:
hasDirectory in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
hasDirectory in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.SystemException

hasFile

public boolean hasFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String versionLabel)
                throws com.liferay.portal.kernel.exception.PortalException,
                       com.liferay.portal.kernel.exception.SystemException
Specified by:
hasFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
hasFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

move

public void move(java.lang.String srcDir,
                 java.lang.String destDir)
          throws com.liferay.portal.kernel.exception.SystemException
Specified by:
move in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
move in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.SystemException

updateFile

public void updateFile(long companyId,
                       long repositoryId,
                       long newRepositoryId,
                       java.lang.String fileName)
                throws com.liferay.portal.kernel.exception.PortalException,
                       com.liferay.portal.kernel.exception.SystemException
Specified by:
updateFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
updateFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

updateFile

public void updateFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String newFileName)
                throws com.liferay.portal.kernel.exception.PortalException,
                       com.liferay.portal.kernel.exception.SystemException
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

updateFile

public void updateFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       java.lang.String versionLabel,
                       java.io.InputStream is)
                throws com.liferay.portal.kernel.exception.PortalException,
                       com.liferay.portal.kernel.exception.SystemException
Specified by:
updateFile in interface com.liferay.portlet.documentlibrary.store.Store
Specified by:
updateFile in class com.liferay.portlet.documentlibrary.store.BaseStore
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

getFileContentNode

protected javax.jcr.Node getFileContentNode(long companyId,
                                            long repositoryId,
                                            java.lang.String fileName,
                                            java.lang.String versionLabel)
                                     throws com.liferay.portal.kernel.exception.PortalException,
                                            com.liferay.portal.kernel.exception.SystemException
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

getFileContentNode

protected javax.jcr.Node getFileContentNode(javax.jcr.Session session,
                                            long companyId,
                                            long repositoryId,
                                            java.lang.String fileName,
                                            java.lang.String versionLabel)
                                     throws com.liferay.portal.kernel.exception.PortalException,
                                            com.liferay.portal.kernel.exception.SystemException
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException

getFolderNode

protected javax.jcr.Node getFolderNode(javax.jcr.Node node,
                                       long name)
                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getFolderNode

protected javax.jcr.Node getFolderNode(javax.jcr.Node node,
                                       java.lang.String name)
                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getRootNode

protected javax.jcr.Node getRootNode(javax.jcr.Session session,
                                     long companyId)
                              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException