Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Marina Glebova
FileSystemHook (improving performance)
2 de marzo de 2012 7:33
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

Hello!I'm beginner in programming and developing under the Liferay.
And I really need your help.I have a site developed under the Liferay.
There is used FileSystemHook for uploading files.I was told that avoiding
the using the Java Virtual Machine may improve the perfomance of the site
during downloading from the server.I'm not sure this is good idea to integrate
JVM processes with other.Any ideas?
Hitoshi Ozawa
RE: FileSystemHook (improving performance)
3 de marzo de 2012 5:33
Respuesta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensajes: 7949

Fecha de incorporación: 23 de marzo de 2010

Mensajes recientes

I was told that avoiding the using the Java Virtual Machine may improve the perfomance of the site during downloading from the server.


Do you mean downloading directly from the file system instead of using Liferay?
Marina Glebova
RE: FileSystemHook (improving performance)
4 de marzo de 2012 2:19
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

Hitoshi,thank you very much for your reply.It's really important for me.
Yes,that's what I mean.I mean implementing
file downloads without using of java.io package and Java at all,if it is possible.
But even if it is good idea,I don't know how to do this.
I'll describe you my problem.I have a portlet with an article(web content is
stored in the "journalarticle" table in the database).There is a few links
in that article,that provide downloads for users.Download should be provided
without Liferay,if it is possible and if it may improve performance. When
the user clicks on link,before the downloading process starts,some logic should
be provided(verifying if the user is signed in and so on).So I wanted to create
my own portlet with this logic,but I don't know how to bind click action in the
static article with my portlet.Can you help me, please?I'm beginner.Any idea or hint
will help me.

I have described this problem in article How to provide actions on pressing links from web content.As I understood the similar problem described in article Web Content - structure to add links to files in external server

Thank you very much for your replies.
Jan Geißler
RE: FileSystemHook (improving performance)
4 de marzo de 2012 3:09
Respuesta

Jan Geißler

Community Moderator

Ranking: Liferay Master

Mensajes: 735

Fecha de incorporación: 5 de julio de 2011

Mensajes recientes

After 2.nd reading:
As fas as I remember, all JournalArticles are managed by the permission System, so you dont have to do all the permission Checking stuff. Liferay will do that for you. Try experimenting around whith the Permission of the Article and you will see.
Same thing you can do with your resources. Give the resources the appropriate permissions and everything you want will work out of the box.

Regards
Jan
Marina Glebova
RE: FileSystemHook (improving performance)
4 de marzo de 2012 4:56
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

Ok,thank you for reply.But I was interested,what if I had more power business logic,than just verifying permission, how to bind link-click with business logic?
I have one portlet, that manages all articles.I should set up permissions only for one.So, setting up permissions for whole portlet is not my point.How to do this? I have read that there two types of permissions-portlet permissions and entity permissions (Service Builder).With entity permissions you can set up permissions for separate objects,that are stored in the database.But there is no model, that Service Builder generates in the site. I can't understand the way Liferay manages this articles,that are stored in the Liferay's standard database.Any ideas?And what about avoiding Liferay when downloading?
Jan Geißler
RE: FileSystemHook (improving performance)
4 de marzo de 2012 5:44
Respuesta

Jan Geißler

Community Moderator

Ranking: Liferay Master

Mensajes: 735

Fecha de incorporación: 5 de julio de 2011

Mensajes recientes

Well, what more "powerfull" business logic do mean? Can u explain that a little bit in more detail?

As for your question. Yes, there are 2 different kinds of permission.
For the portlet-permissions:
Here you define permission on the "Portal view layer" as for example:
User with Role "User" and "Power-USer" may not see a portlet on a specific page, but user with role "MyPowerfulCustomRole" my see that specific portlet.
Also you can define wich Actions he may perform on the Portlet Level. Like "edit permissions", "configure".

Within your Portlet (which a user may or may not see, depending on the portlet permissions) he is allowed to do Actions on the Resources controlled by your portlet.

The resources a portlet displays depend on several parameters.
1. The companyId (The INSTANCE! of the portal)
2. the groupId (on what Site[6.1] | Community [pre 6.1] or Organisation am I? An Organization is just an extension of a "normal" group)
3. the userId (specifies the creator / owner)

The DB-Model for the permission system is found in:
resourceaction
resourcepermission

hope this helps.
Marina Glebova
RE: FileSystemHook (improving performance)
4 de marzo de 2012 6:29
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

Thank you. "resourceaction,resourcepermission" are they tables in database or properties?Did you mean files have to be downloaded is resources?
Jan Geißler
RE: FileSystemHook (improving performance)
4 de marzo de 2012 6:55
Respuesta

Jan Geißler

Community Moderator

Ranking: Liferay Master

Mensajes: 735

Fecha de incorporación: 5 de julio de 2011

Mensajes recientes

Well, what i mean is:

The files you want the users to download are documents stored in the Liferay Document-Library. They get uploaded either via Control-Panel/Document Library or any corresponding portlet from the pages.
You reference those documents from within your Article.

Now you may set up permissions like:
Everybody can see the Article, but the only logged-in user with a specific role may see the document and download it.

And yes, "resourceaction,resourcepermission" are the DB-Tables.
Marina Glebova
RE: FileSystemHook (improving performance)
4 de marzo de 2012 7:19
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

Thank you very much for answer! And what do you think about avoiding Liferay Library to improve performance?Everything began from the idea to generate on the downloads page some external links to download files without using the Liferay Document Library (Why without Liferay Document Library?Because it needs too much resources)...So I was recommended to write some external script for downloading files.This problem has to be related with Liferay architecture. Maybe you can give me a piece of avdice.
Jan Geißler
RE: FileSystemHook (improving performance)
4 de marzo de 2012 7:24
Respuesta

Jan Geißler

Community Moderator

Ranking: Liferay Master

Mensajes: 735

Fecha de incorporación: 5 de julio de 2011

Mensajes recientes

Enlighten my, how the Document Library needs to much Resources, and what kind of resources?
Ram? Disk-Space? I really dont get the point here, so i can't give any qualified answer.

Please provide some more details.
Marina Glebova
RE: FileSystemHook (improving performance)
4 de marzo de 2012 7:50
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

RAM is a first reason and the second reason is "not friendly" file structure on the server (system administrator told me this).You see, I can't define to what extent it is a real problem and if it is impossible to solve this problem without Document Library.
Thank you very much for answers
Jan Geißler
RE: FileSystemHook (improving performance)
4 de marzo de 2012 8:08
Respuesta

Jan Geißler

Community Moderator

Ranking: Liferay Master

Mensajes: 735

Fecha de incorporación: 5 de julio de 2011

Mensajes recientes

Honestly:
Tell your Sysadmins they will have to live with this. (My 2 cents)

The kind of work you will have to do will definetly superseed their "inconveniece".

But just out of curiosity:
How does the DocumentLibrary uses RAM?
in what way is the way liferay stores it documents "unfriendly"?
What kind of storage do you have in mind?

Should the files be on a different machine behind a different server? Apache or NGINX for example?
Or shall they just be stored on a different location on the server?
Marina Glebova
RE: FileSystemHook (improving performance)
5 de marzo de 2012 7:12
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

Hi,Jan! Again,thank you very much for your answers.
Well, admin says that downloading with Liferay takes many CPU time.So there should be 2 machines and 2 servers.One-with the Liferay and one more-with nothing)) (I mean with no software as I understood).So when the user clicks on the document-link he should be redirected to this second server. And download files from it.Uploading system should stay the same,with Document Library structure,but files should be downloaded from another server,so they should be there too.So it would be duplicate file structure.I told them,that the idea of Liferay Document Library is one single repository to download and upload with the help of it...Maybe,we may store the files of the Document Library on the other machine and download directly from it some way?
Jan Geißler
RE: FileSystemHook (improving performance)
5 de marzo de 2012 23:11
Respuesta

Jan Geißler

Community Moderator

Ranking: Liferay Master

Mensajes: 735

Fecha de incorporación: 5 de julio de 2011

Mensajes recientes

Maybe,we may store the files of the Document Library on the other machine and download directly from it some way?

(I mean with no software as I understood)


Well at least you need a way of exposing the files to the internet. If there is no software running on the machine, how are you going to do the permission checks?
Marina Glebova
RE: FileSystemHook (improving performance)
6 de marzo de 2012 1:57
Respuesta

Marina Glebova

Ranking: New Member

Mensajes: 15

Fecha de incorporación: 27 de febrero de 2012

Mensajes recientes

Permissions check should be provided under Liferay on server 1 but then user should be redirected to server2 and download from it directly,without Java
Jan Geißler
RE: FileSystemHook (improving performance)
7 de marzo de 2012 1:21
Respuesta

Jan Geißler

Community Moderator

Ranking: Liferay Master

Mensajes: 735

Fecha de incorporación: 5 de julio de 2011

Mensajes recientes

And what if someone knows the link? No permission checks, when directly trying to download? This doesnt seem save for me....