Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
How to write a new Repository for DocumentLibrary Robert Kornmesser February 16, 2012 8:07 AM
RE: How to write a new Repository for DocumentLibrary Robert Kornmesser February 18, 2012 4:46 AM
RE: How to write a new Repository for DocumentLibrary Klemens Dickbauer February 18, 2012 5:29 PM
RE: How to write a new Repository for DocumentLibrary Robert Kornmesser February 19, 2012 12:33 PM
RE: How to write a new Repository for DocumentLibrary Klemens Dickbauer February 19, 2012 5:56 PM
RE: How to write a new Repository for DocumentLibrary Mika Koivisto February 22, 2012 3:50 PM
RE: How to write a new Repository for DocumentLibrary Robert Kornmesser February 27, 2012 5:16 AM
RE: How to write a new Repository for DocumentLibrary Klemens Dickbauer March 10, 2012 5:43 PM
RE: How to write a new Repository for DocumentLibrary Chun Wei Ho February 28, 2012 12:14 AM
RE: How to write a new Repository for DocumentLibrary Robert Kornmesser June 28, 2012 1:54 AM
RE: How to write a new Repository for DocumentLibrary Mika Koivisto June 28, 2012 11:45 AM
RE: How to write a new Repository for DocumentLibrary Robert Kornmesser June 28, 2012 11:16 PM
RE: How to write a new Repository for DocumentLibrary santhosh kumar December 12, 2012 10:16 PM
RE: How to write a new Repository for DocumentLibrary Chun Wei Ho December 12, 2012 10:28 PM
RE: How to write a new Repository for DocumentLibrary santhosh kumar December 12, 2012 10:51 PM
RE: How to write a new Repository for DocumentLibrary Chun Wei Ho December 12, 2012 11:15 PM
RE: How to write a new Repository for DocumentLibrary santhosh kumar December 13, 2012 1:24 AM
RE: How to write a new Repository for DocumentLibrary Chun Wei Ho December 13, 2012 1:31 AM
RE: How to write a new Repository for DocumentLibrary Hemant Behera September 10, 2013 12:55 PM
RE: How to write a new Repository for DocumentLibrary Mika Koivisto September 10, 2013 1:02 PM
RE: How to write a new Repository for DocumentLibrary Hemant Behera September 11, 2013 9:29 AM
RE: How to write a new Repository for DocumentLibrary Mika Koivisto September 11, 2013 11:47 AM
RE: How to write a new Repository for DocumentLibrary Hemant Behera September 11, 2013 12:08 PM
Robert Kornmesser
How to write a new Repository for DocumentLibrary
February 16, 2012 8:07 AM
Answer

Robert Kornmesser

Rank: Junior Member

Posts: 39

Join Date: November 3, 2011

Recent Posts

Hi all,

im trying to implement a FTP-Repository for the Document Library.
Therefore i wrote an Ext-Plugin with a class called FtpRepository which extends BaseRepositoryImpl and registered that class in portal-ext.properties.

When creating a new Repository in Liferay i see my new Repository Type. Ive copied a lot from CMIS Repository.

Listing the Root-Dir of my FTP-Server already works.

So far, so good.

My problem is now, that i get a com.liferay.portlet.documentlibrary.NoSuchFolderException, when trying to list the first subfolder level. Indeed I did not find any method, where the cmis guys did add their ids into database (besides the one call for the root-dir).
In fact i do not want to have anything in my database. No caching, nothing! I just want to have a clear view on the actual ftp content on every request.

Is that possible?

I guess, that I did not understand the concept of folderids and the relation to actual filesystem paths.

Can anybode bring some light into the darkness?

Thanks in advance!
Robert Kornmesser
RE: How to write a new Repository for DocumentLibrary
February 18, 2012 4:46 AM
Answer

Robert Kornmesser

Rank: Junior Member

Posts: 39

Join Date: November 3, 2011

Recent Posts

Nobody an idea?
Come on! Besides these very dumb questions i read in this forum, which got answered thousands of times, this is very undocumented problem.
I cannot imagine that the community is satisfied with these 2 Repository types for now?
Klemens Dickbauer
RE: How to write a new Repository for DocumentLibrary
February 18, 2012 5:29 PM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

Hi Robert,

i'm trying something quite similar, writing a repository for the local file system. I am new to Liferay, so I'm still gathering some Info:

.) Did you find any Info on how to implement the abstract classes from BaseRepositoryImpl?

.) How did you connect the FolderId with actual cononical paths on the ftp server? I don't have a clue now how to do this...

.) Did you base your implementation on the AtomPub or the WebServices CMIS variant?

thanks for some infos,
klemens
Robert Kornmesser
RE: How to write a new Repository for DocumentLibrary
February 19, 2012 12:33 PM
Answer

Robert Kornmesser

Rank: Junior Member

Posts: 39

Join Date: November 3, 2011

Recent Posts

Klemens Dickbauer:
Hi Robert,

Hi Klemens
Klemens Dickbauer:
i'm trying something quite similar, writing a repository for the local file system. I am new to Liferay, so I'm still gathering some Info:

Sorry for the counter question, but: Why are you writing a Repository Type for the Local File system? Liferay already stores them locally...
Klemens Dickbauer:
.) Did you find any Info on how to implement the abstract classes from BaseRepositoryImpl?

Only info I got, are written down in the Liferay source code ;(
Klemens Dickbauer:
.) How did you connect the FolderId with actual cononical paths on the ftp server? I don't have a clue now how to do this...

Currently: Not a bit! I dont have any clue yet, how to do that.
Klemens Dickbauer:
.) Did you base your implementation on the AtomPub or the WebServices CMIS variant?

AtomPub
Klemens Dickbauer:
thanks for some infos,
klemens


I will try to dive deeper into this mud of code next week and will post my results.

BUT: Getting some more help from Liferay would be great!
Klemens Dickbauer
RE: How to write a new Repository for DocumentLibrary
February 19, 2012 5:56 PM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

Robert:
Klemens Dickbauer:
i'm trying something quite similar, writing a repository for the local file system. I am new to Liferay, so I'm still gathering some Info:

Sorry for the counter question, but: Why are you writing a Repository Type for the Local File system? Liferay already stores them locally...

I have a lot of pictures on my server's file system and want to use them for a gallery in Liferay. I would like to keep them in the current structure (with filenames, own metadata for my photo workflow) without importing them into Liferay's own repository. Maybe it's not worth the effort, but I thought I give it a try - it's a good thing to learn about Liferay anyway. Possibly the hard way. emoticon

Robert:
Klemens Dickbauer:
.) Did you find any Info on how to implement the abstract classes from BaseRepositoryImpl?

Only info I got, are written down in the Liferay source code ;(

Yeah, that's not too much since the code is not commented. I used to know EMC² documentum quote good, so I have an idea how cmis works. Maybe not easy to put this API to file structure without a database though. The problem would be that access always uses object keys, long values in this case. I think about mapping those keys to the pathnames totally in memory and just serializing on disk, it should work for a few thousand files. But maybe something more clever comes the way...

Robert:
I will try to dive deeper into this mud of code next week and will post my results.
BUT: Getting some more help from Liferay would be great!

At least some comments in the source would help indeed, the java doc is pretty blank. Anyway, it's open source, and their rules, since I do not have a support contract. ;) The source code itself seems to follow some complex designs sometimes, but is well readable, as far as I have seen some lines so far.

This week I'm skiing, will continue next week with investigations. Thanks for replying, maybe we can help each other over one or another obstacle...
Mika Koivisto
RE: How to write a new Repository for DocumentLibrary
February 22, 2012 3:50 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1498

Join Date: August 7, 2006

Recent Posts

You can implement a new repository using hook plugins. You don't need to use ext-plugin. Just add liferay-hook.xml with:

1<?xml version="1.0"?>
2<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.1.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_1_0.dtd">
3
4<hook>
5    <portal-properties>portal.properties</portal-properties>
6    <language-properties>content/Language_en.properties</language-properties>
7</hook>


In your WEB-INF/src/portal.properties add

1dl.repository.impl=com.liferay.sample.repository.hook.MyRepositoryImpl


You repository implementation class should extend BaseRepositoryImpl like yours already does. The way we map folderId or fileEntryId or fileVersionId to the actual file in the repository is by creating a RepositoryEntry using RepositoryEntryUtil. You'll probably will also need your own implementation for FileEntry, FileVersion, Folder and Lock interfaces. You will also need to ensure that every single FileEntry your repository implementation returns has a AssetEntry associated with it.

If you have access to EE take a look how we implemented Documentum repository hook. That probably demonstrates it best on how to create a new Repository as a hook.

It is no trivial task to create your own repository implementation.
Robert Kornmesser
RE: How to write a new Repository for DocumentLibrary
February 27, 2012 5:16 AM
Answer

Robert Kornmesser

Rank: Junior Member

Posts: 39

Join Date: November 3, 2011

Recent Posts

Thanks Mika for your answer!

@Klemens: Today I've found a hook, that should exactly do, what you are looking for: https://github.com/topolik/FSRepo
The implementation code is easy readable and works in a first try for me on linux.
Chun Wei Ho
RE: How to write a new Repository for DocumentLibrary
February 28, 2012 12:14 AM
Answer

Chun Wei Ho

Rank: New Member

Posts: 8

Join Date: December 20, 2011

Recent Posts

Hi,

I am trying to do something similar, based off the FSRepo code, but am getting a Hibernate exception when calling BaseRepositoryImpl.getRepositoryEntryIds()

com.liferay.portal.kernel.exception.SystemException: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
at com.liferay.portal.service.persistence.RepositoryEntryPersistenceImpl.fetchByR_M(RepositoryEntryPersistenceImpl.java:1641)
at com.liferay.portal.service.persistence.RepositoryEntryPersistenceImpl.fetchByR_M(RepositoryEntryPersistenceImpl.java:1547)
at com.liferay.portal.service.persistence.RepositoryEntryUtil.fetchByR_M(RepositoryEntryUtil.java:506)
at com.liferay.portal.kernel.repository.BaseRepositoryImpl.getRepositoryEntryIds(BaseRepositoryImpl.java:185)
...
Caused by: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:687)
at com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl.openSession(SessionFactoryImpl.java:73)
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.openSession(BasePersistenceImpl.java:181)
at com.liferay.portal.service.persistence.RepositoryEntryPersistenceImpl.fetchByR_M(RepositoryEntryPersistenceImpl.java:1603)
... 175 more


I'm looking up more on Hibernate on Liferay, but does anyone know of a quick fix? emoticon Thanks!
Klemens Dickbauer
RE: How to write a new Repository for DocumentLibrary
March 10, 2012 5:43 PM
Answer

Klemens Dickbauer

Rank: New Member

Posts: 24

Join Date: February 4, 2012

Recent Posts

Hi Robert,

thanks a lot for that link. Really funcitions quite easily out of the war, great work. I hope I can contribute a little bit. emoticon

bye,
~klemens
Robert Kornmesser
RE: How to write a new Repository for DocumentLibrary
June 28, 2012 1:54 AM
Answer

Robert Kornmesser

Rank: Junior Member

Posts: 39

Join Date: November 3, 2011

Recent Posts

Hi,

long time has passed and im back on this topic. and getting exactly the same problem like Chun.

  110:46:06,280 ERROR [BasePersistenceImpl:186] Caught unexpected exception org.hibernate.HibernateException
  2com.liferay.portal.kernel.exception.SystemException: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
  3        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)
  4        at com.liferay.portal.service.persistence.RepositoryEntryPersistenceImpl.fetchByR_M(RepositoryEntryPersistenceImpl.java:1641)
  5        at com.liferay.portal.service.persistence.RepositoryEntryPersistenceImpl.fetchByR_M(RepositoryEntryPersistenceImpl.java:1547)
  6        at com.liferay.portal.service.persistence.RepositoryEntryUtil.fetchByR_M(RepositoryEntryUtil.java:506)
  7        at com.liferay.portal.kernel.repository.BaseRepositoryImpl.getRepositoryEntryIds(BaseRepositoryImpl.java:185)
  8        at de.gfz.liferay.hooks.mediaRepository.FtpFileSystemRepository.fileToFolder(FtpFileSystemRepository.java:700)
  9        at de.gfz.liferay.hooks.mediaRepository.model.FileSystemFolder.getParentFolder(FileSystemFolder.java:96)
 10        at de.gfz.liferay.hooks.mediaRepository.model.FileSystemFolder.getParentFolderId(FileSystemFolder.java:108)
 11        at sun.reflect.GeneratedMethodAccessor440.invoke(Unknown Source)
 12        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 13        at java.lang.reflect.Method.invoke(Method.java:597)
 14        at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:54)
 15        at $Proxy424.getParentFolderId(Unknown Source)
 16        at com.liferay.portal.repository.proxy.FolderProxyBean.getParentFolderId(FolderProxyBean.java:116)
 17        at com.liferay.portlet.documentlibrary.util.DLUtil.getWebDavURL(DLUtil.java:592)
 18        at org.apache.jsp.html.portlet.document_005flibrary.folder_005faction_jsp._jspService(folder_005faction_jsp.java:2699)
 19        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 20        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 21        at com.liferay.portal.kernel.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:45)
 22        at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:323)
 23        at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:418)
 24        at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:92)
 25        at org.apache.jsp.html.portlet.document_005flibrary.view_005ffolder_005ficon_jsp._jspx_meth_liferay_002dutil_005finclude_005f0(view_005ffolder_005ficon_jsp.java:756)
 26        at org.apache.jsp.html.portlet.document_005flibrary.view_005ffolder_005ficon_jsp._jspService(view_005ffolder_005ficon_jsp.java:703)
 27        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 28        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 29        at com.liferay.portal.kernel.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:45)
 30        at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:323)
 31        at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:418)
 32        at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:92)
 33        at org.apache.jsp.html.portlet.document_005flibrary.view_005fentries_jsp._jspx_meth_liferay_002dutil_005finclude_005f2(view_005fentries_jsp.java:1872)
 34        at org.apache.jsp.html.portlet.document_005flibrary.view_005fentries_jsp._jspService(view_005fentries_jsp.java:1442)
 35        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 36        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 37        at com.liferay.portal.kernel.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:45)
 38        at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:323)
 39        at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:418)
 40        at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:92)
 41        at org.apache.jsp.html.portlet.document_005flibrary.view_005fresources_jsp._jspx_meth_liferay_002dutil_005finclude_005f0(view_005fresources_jsp.java:899)
 42        at org.apache.jsp.html.portlet.document_005flibrary.view_005fresources_jsp._jspService(view_005fresources_jsp.java:701)
 43        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 44        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 45        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
 46        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
 47        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
 48        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 49        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 50        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 51        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 52        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 53        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
 54        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 55        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 56        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
 57        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
 58        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
 59        at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:316)
 60        at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:105)
 61        at com.liferay.portlet.documentlibrary.action.ViewAction.serveResource(ViewAction.java:77)
 62        at com.liferay.portal.struts.PortletAction.execute(PortletAction.java:116)
 63        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
 64        at com.liferay.portal.struts.PortletRequestProcessor.processActionPerform(PortletRequestProcessor.java:447)
 65        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 66        at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:242)
 67        at com.liferay.portlet.StrutsPortlet.serveResource(StrutsPortlet.java:215)
 68        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:118)
 69        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
 70        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:651)
 71        at com.liferay.portlet.InvokerPortletImpl.invokeResource(InvokerPortletImpl.java:746)
 72        at com.liferay.portlet.InvokerPortletImpl.serveResource(InvokerPortletImpl.java:503)
 73        at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:958)
 74        at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:666)
 75        at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:246)
 76        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
 77        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 78        at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:174)
 79        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
 80        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
 81        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
 82        at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:538)
 83        at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:515)
 84        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 85        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 86        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 87        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
 88        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 89        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 90        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 91        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 92        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
 93        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
 94        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:289)
 95        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
 96        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
 97        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
 98        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
 99        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:247)
100        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
101        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
102        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
103        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
104        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
105        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
106        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
107        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
108        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
109        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
110        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
111        at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:135)
112        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
113        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
114        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
115        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
116        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
117        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
118        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
119        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
120        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
121        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
122        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
123        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
124        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
125        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
126        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:289)
127        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
128        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
129        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
130        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
131        at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:241)
132        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
133        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
134        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
135        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
136        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
137        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
138        at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:55)
139        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
140        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
141        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
142        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
143        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:247)
144        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
145        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
146        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
147        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
148        at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
149        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
150        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
151        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
152        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
153        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
154        at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:80)
155        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
156        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
157        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
158        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:158)
159        at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:216)
160        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:55)
161        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
162        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
163        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
164        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
165        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
166        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
167        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
168        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
169        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
170        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:206)
171        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:108)
172        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
173        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
174        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
175        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:167)
176        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
177        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
178        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:187)
179        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:95)
180        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:71)
181        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
182        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
183        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
184        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
185        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
186        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
187        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
188        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
189        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
190        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
191        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
192        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
193        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1805)
194        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
195        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
196        at java.lang.Thread.run(Thread.java:662)
197Caused by: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
198        at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
199        at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:687)
200        at com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl.openSession(SessionFactoryImpl.java:73)
201        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.openSession(BasePersistenceImpl.java:181)
202        at com.liferay.portal.service.persistence.RepositoryEntryPersistenceImpl.fetchByR_M(RepositoryEntryPersistenceImpl.java:1603)
203        ... 192 more


Anyone has any idea?
Mika Koivisto
RE: How to write a new Repository for DocumentLibrary
June 28, 2012 11:45 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1498

Join Date: August 7, 2006

Recent Posts

This is because you are calling RepositoryEntryUtil outside XXXService or XXXLocalService. When you are implementing your own repository hook you can't implement it exactly like CMISRepository is implemented. I ran into this exact same issue while I implemented one for Documentum. The way I got around it was to get the parent folderId when I constructed the FileEntry object and then I called DLAppServiceUtil.getFolder(parentFolderId) in getParentFolder() method.
Robert Kornmesser
RE: How to write a new Repository for DocumentLibrary
June 28, 2012 11:16 PM
Answer

Robert Kornmesser

Rank: Junior Member

Posts: 39

Join Date: November 3, 2011

Recent Posts

Hi Mika and thanks for your answeser.
I'm implementing an abstract Repository Hook using Apache VFS2 in general and one implementation using ftp.
I've got the hibernate Problem in one of my own methods.
 1public Folder fileToFolder(FileObject fileObject) throws SystemException, PortalException {
 2    if (fileObject.getName().getDepth() == 0) {
 3        Folder mountFolder = DLAppLocalServiceUtil.getMountFolder(getRepositoryId());
 4        return mountFolder;
 5    }
 6
 7    Object[] ids = getRepositoryEntryIds(environment.getMapper().fileToMappedId(fileObject));
 8    long folderId = (Long) ids[0];
 9    String uuid = (String) ids[1];
10
11    return new FileSystemFolder(this, uuid, folderId, fileObject);
12}


However, without the "root folder check" i get this exception. Adding the check for the root folder, seems to open the hibernate session successfully for further sub directory scanning. I dont know the internals, but it seems to fix the problem the way you described it.
santhosh kumar
RE: How to write a new Repository for DocumentLibrary
December 12, 2012 10:16 PM
Answer

santhosh kumar

Rank: New Member

Posts: 19

Join Date: April 10, 2011

Recent Posts

Hi Mika,

As per your suggestion i included the DL hook in portal-ext.properties,but it throws class not found exception.



dl.hook.impl=com.doc.action.DocuementEntryFile



Regards
Santhosh
Chun Wei Ho
RE: How to write a new Repository for DocumentLibrary
December 12, 2012 10:28 PM
Answer

Chun Wei Ho

Rank: New Member

Posts: 8

Join Date: December 20, 2011

Recent Posts

Hi Santhosh,

You need to have that entry in the portal.properties file that is bundled with your hook war that has the class files, and not in the generic portal-ext.properties that Liferay loads when it starts.

Cheers.
santhosh kumar
RE: How to write a new Repository for DocumentLibrary
December 12, 2012 10:51 PM
Answer

santhosh kumar

Rank: New Member

Posts: 19

Join Date: April 10, 2011

Recent Posts

Hi Chun,

AS per your suggestion i included in My custom Hook war file.But while deploying it throws below error.Please help me on this issue.

Loading file:/D:/liferay-portal-6.0.5/tomcat-6.0.26/webapps/DocHook-hook/WEB-INF/classes/portal.properties
06:45:51,962 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for DocHook-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for DocHook-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1345)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: com/liferay/documentlibrary/util/FileSystemHook
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2527)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1010)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1483)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:52)
at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:27)
at com.liferay.portal.kernel.util.ProxyFactory.newInstance(ProxyFactory.java:40)
at com.liferay.portal.kernel.util.ProxyFactory.newInstance(ProxyFactory.java:31)
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.newInstance(BaseHotDeployListener.java:53)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initPortalProperties(HookHotDeployListener.java:1224)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:443)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:218)
... 20 more
Caused by: java.lang.ClassNotFoundException: com.liferay.documentlibrary.util.FileSystemHook
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
... 36 more

Regards
Santhosh
Chun Wei Ho
RE: How to write a new Repository for DocumentLibrary
December 12, 2012 11:15 PM
Answer

Chun Wei Ho

Rank: New Member

Posts: 8

Join Date: December 20, 2011

Recent Posts

Hi Santhosh,

Ignore my deleted response (the thread was originally about writing repository implementation in 6.1, but you are looking for a repository store hook in 6.0 - hence my confusion).
santhosh kumar
RE: How to write a new Repository for DocumentLibrary
December 13, 2012 1:24 AM
Answer

santhosh kumar

Rank: New Member

Posts: 19

Join Date: April 10, 2011

Recent Posts

Hi Chun,

I have an requirement in which i have to make an entry in user defined table after every deletion of document.
It will be very thankfull if u help me out on this.


Regards
Santhosh
Chun Wei Ho
RE: How to write a new Repository for DocumentLibrary
December 13, 2012 1:31 AM
Answer

Chun Wei Ho

Rank: New Member

Posts: 8

Join Date: December 20, 2011

Recent Posts

It sounds like you want a model listener:
http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins#section-Portal+Hook+Plugins-Model+Listeners

The model to listen for in 6.0 I think is com.liferay.documentlibrary.model.FileModel
Hemant Behera
RE: How to write a new Repository for DocumentLibrary
September 10, 2013 12:55 PM
Answer

Hemant Behera

Rank: Junior Member

Posts: 34

Join Date: December 1, 2009

Recent Posts

Can any one please help me out on this. I have to integrate to create a new repository through web service. Is it a good way to create a new hook on Document Liferay in Liferay Portal or Is it good to create a new Liferay MVC Portlet and consume Web Service and create functionalities. It is not CMIS Web Service.

Quick Response is highly appriciated?

Thanks
Hemant
Mika Koivisto
RE: How to write a new Repository for DocumentLibrary
September 10, 2013 1:02 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1498

Join Date: August 7, 2006

Recent Posts

Tomas has written a filesystem repository and it's publicly available so that's a good example. See https://github.com/topolik/FSRepo
Hemant Behera
RE: How to write a new Repository for DocumentLibrary
September 11, 2013 9:29 AM
Answer

Hemant Behera

Rank: Junior Member

Posts: 34

Join Date: December 1, 2009

Recent Posts

Can we use this hook across multiple portlets?
Mika Koivisto
RE: How to write a new Repository for DocumentLibrary
September 11, 2013 11:47 AM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1498

Join Date: August 7, 2006

Recent Posts

Repository is doclib thing and has nothing to do with individual portlets. In Doclib you can mount different repositories as folders and those are scoped at site level.
Hemant Behera
RE: How to write a new Repository for DocumentLibrary
September 11, 2013 12:08 PM
Answer

Hemant Behera

Rank: Junior Member

Posts: 34

Join Date: December 1, 2009

Recent Posts

Thanks Mika for the response.
We want to store/retrieve the files metadata and actual file through web service in another doclib source and would like to use that in other custom portlet.
Will it be a good idea use hook to develop this or we should use EXT plugin for this?

Appriciate your help on this.
Thanks
Hemant