0

I'm still new to Liferay and using Liferay 6.2

what i'm doing: I am trying to add a document manually into my database using insert statement. I inserted into dlfileentry, dlfileversion and AssertEntry. Also, i created a folder with the valid name and file.

The issue: upon entering the Documents and Media portlet, i can see the document name there but when i click on checkout, it will prompt a error saying that Documents and Media is temporarily unavailable. however i am still able to download the valid document.

Am i doing something wrong? Personally, i feel that i am missing one more table for the database but i'm not sure .

Thanks!

1 Answers1

1

Yes, you're doing something wrong: You should never write to Liferay's database with SQL, as there might be more data required than what's directly visible to you. Obviously, you're running into exactly such an issue.

Liferay has an API which you can use locally, from within the same application server, or remotely as JSON or SOAP service. You should exclusively use this for write access to the database.

Alternatively, you might consider WebDAV access to your document repository as the way to add more documents to the document library.

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • indeed, i ran into `NullPointerException` upon checking the log as suggested by Pankaj. i was just curious about the tables it inserts, but seems like it's really deep down. – user3706963 Jun 09 '14 at 13:21
  • Yes, it's deep down. Don't go there, don't try to understand the tables involved: Rather use the API and let the implementation do the rest. Your life is easier this way. Trust me. I've seen weird side-effects when people have manually manipulated the database and missed certain entries or relationships. When you run into such issues in a few months, you'll not remember that you manually inserted data into the tables and blame Liferay that it can't work with your data... – Olaf Kock Jun 09 '14 at 15:46