com.liferay.documentlibrary.util
Class JCRHook

java.lang.Object
  extended by com.liferay.documentlibrary.util.BaseHook
      extended by com.liferay.documentlibrary.util.JCRHook
All Implemented Interfaces:
Hook

public class JCRHook
extends BaseHook

View Source

Author:
Michael Young, Brian Wing Shun Chan

Field Summary
 
Fields inherited from interface com.liferay.documentlibrary.util.Hook
DEFAULT_VERSION
 
Constructor Summary
JCRHook()
           
 
Method Summary
 void addDirectory(long companyId, long repositoryId, java.lang.String dirName)
           
 void addFile(long companyId, java.lang.String portletId, long groupId, long repositoryId, java.lang.String fileName, long fileEntryId, java.lang.String properties, java.util.Date modifiedDate, java.lang.String[] tagsEntries, java.io.InputStream is)
           
 void checkRoot(long companyId)
           
protected  void deleteDirectory(long companyId, java.lang.String portletId, long repositoryId, javax.jcr.Node dirNode)
           
 void deleteDirectory(long companyId, java.lang.String portletId, long repositoryId, java.lang.String dirName)
           
 void deleteFile(long companyId, java.lang.String portletId, long repositoryId, java.lang.String fileName)
           
 void deleteFile(long companyId, java.lang.String portletId, long repositoryId, java.lang.String fileName, double versionNumber)
           
 java.io.InputStream getFileAsStream(long companyId, long repositoryId, java.lang.String fileName, double versionNumber)
           
protected  javax.jcr.Node getFileContentNode(long companyId, long repositoryId, java.lang.String fileName, double versionNumber)
           
protected  javax.jcr.Node getFileContentNode(javax.jcr.Session session, long companyId, long repositoryId, java.lang.String fileName, double versionNumber)
           
 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 hasFile(long companyId, long repositoryId, java.lang.String fileName, double versionNumber)
           
 void move(java.lang.String srcDir, java.lang.String destDir)
           
 void reIndex(java.lang.String[] ids)
           
 void updateFile(long companyId, java.lang.String portletId, long groupId, long repositoryId, long newRepositoryId, java.lang.String fileName, long fileEntryId)
           
 void updateFile(long companyId, java.lang.String portletId, long groupId, long repositoryId, java.lang.String fileName, double versionNumber, java.lang.String sourceFileName, long fileEntryId, java.lang.String properties, java.util.Date modifiedDate, java.lang.String[] tagsEntries, java.io.InputStream is)
           
 
Methods inherited from class com.liferay.documentlibrary.util.BaseHook
addFile, addFile, getFile, getFile, getFileAsStream, updateFile, updateFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCRHook

public JCRHook()
Method Detail

addDirectory

public void addDirectory(long companyId,
                         long repositoryId,
                         java.lang.String dirName)
                  throws com.liferay.portal.PortalException,
                         com.liferay.portal.SystemException
Specified by:
addDirectory in interface Hook
Specified by:
addDirectory in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

addFile

public void addFile(long companyId,
                    java.lang.String portletId,
                    long groupId,
                    long repositoryId,
                    java.lang.String fileName,
                    long fileEntryId,
                    java.lang.String properties,
                    java.util.Date modifiedDate,
                    java.lang.String[] tagsEntries,
                    java.io.InputStream is)
             throws com.liferay.portal.PortalException,
                    com.liferay.portal.SystemException
Specified by:
addFile in interface Hook
Specified by:
addFile in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

checkRoot

public void checkRoot(long companyId)
               throws com.liferay.portal.SystemException
Specified by:
checkRoot in interface Hook
Specified by:
checkRoot in class BaseHook
Throws:
com.liferay.portal.SystemException

deleteDirectory

public void deleteDirectory(long companyId,
                            java.lang.String portletId,
                            long repositoryId,
                            java.lang.String dirName)
                     throws com.liferay.portal.PortalException,
                            com.liferay.portal.SystemException
Specified by:
deleteDirectory in interface Hook
Specified by:
deleteDirectory in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

deleteFile

public void deleteFile(long companyId,
                       java.lang.String portletId,
                       long repositoryId,
                       java.lang.String fileName)
                throws com.liferay.portal.PortalException,
                       com.liferay.portal.SystemException
Specified by:
deleteFile in interface Hook
Specified by:
deleteFile in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

deleteFile

public void deleteFile(long companyId,
                       java.lang.String portletId,
                       long repositoryId,
                       java.lang.String fileName,
                       double versionNumber)
                throws com.liferay.portal.PortalException,
                       com.liferay.portal.SystemException
Specified by:
deleteFile in interface Hook
Specified by:
deleteFile in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

getFileAsStream

public java.io.InputStream getFileAsStream(long companyId,
                                           long repositoryId,
                                           java.lang.String fileName,
                                           double versionNumber)
                                    throws com.liferay.portal.PortalException,
                                           com.liferay.portal.SystemException
Specified by:
getFileAsStream in interface Hook
Specified by:
getFileAsStream in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

getFileNames

public java.lang.String[] getFileNames(long companyId,
                                       long repositoryId,
                                       java.lang.String dirName)
                                throws com.liferay.portal.PortalException,
                                       com.liferay.portal.SystemException
Specified by:
getFileNames in interface Hook
Specified by:
getFileNames in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

getFileSize

public long getFileSize(long companyId,
                        long repositoryId,
                        java.lang.String fileName)
                 throws com.liferay.portal.PortalException,
                        com.liferay.portal.SystemException
Specified by:
getFileSize in interface Hook
Specified by:
getFileSize in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

hasFile

public boolean hasFile(long companyId,
                       long repositoryId,
                       java.lang.String fileName,
                       double versionNumber)
                throws com.liferay.portal.PortalException,
                       com.liferay.portal.SystemException
Specified by:
hasFile in interface Hook
Specified by:
hasFile in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

move

public void move(java.lang.String srcDir,
                 java.lang.String destDir)
          throws com.liferay.portal.SystemException
Specified by:
move in interface Hook
Specified by:
move in class BaseHook
Throws:
com.liferay.portal.SystemException

reIndex

public void reIndex(java.lang.String[] ids)
             throws com.liferay.portal.kernel.search.SearchException
Specified by:
reIndex in interface Hook
Specified by:
reIndex in class BaseHook
Throws:
com.liferay.portal.kernel.search.SearchException

updateFile

public void updateFile(long companyId,
                       java.lang.String portletId,
                       long groupId,
                       long repositoryId,
                       java.lang.String fileName,
                       double versionNumber,
                       java.lang.String sourceFileName,
                       long fileEntryId,
                       java.lang.String properties,
                       java.util.Date modifiedDate,
                       java.lang.String[] tagsEntries,
                       java.io.InputStream is)
                throws com.liferay.portal.PortalException,
                       com.liferay.portal.SystemException
Specified by:
updateFile in interface Hook
Specified by:
updateFile in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

updateFile

public void updateFile(long companyId,
                       java.lang.String portletId,
                       long groupId,
                       long repositoryId,
                       long newRepositoryId,
                       java.lang.String fileName,
                       long fileEntryId)
                throws com.liferay.portal.PortalException,
                       com.liferay.portal.SystemException
Specified by:
updateFile in interface Hook
Specified by:
updateFile in class BaseHook
Throws:
com.liferay.portal.PortalException
com.liferay.portal.SystemException

deleteDirectory

protected void deleteDirectory(long companyId,
                               java.lang.String portletId,
                               long repositoryId,
                               javax.jcr.Node dirNode)
                        throws com.liferay.portal.kernel.search.SearchException
Throws:
com.liferay.portal.kernel.search.SearchException

getFileContentNode

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

getFileContentNode

protected javax.jcr.Node getFileContentNode(javax.jcr.Session session,
                                            long companyId,
                                            long repositoryId,
                                            java.lang.String fileName,
                                            double versionNumber)
                                     throws com.liferay.portal.PortalException,
                                            com.liferay.portal.SystemException
Throws:
com.liferay.portal.PortalException
com.liferay.portal.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