You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Ling Kok Choon <ko...@yahoo.com> on 2001/10/02 02:51:56 UTC

User, Group, Role mapping slow performance ?

Hi ,

   I am a new user in Turbine, I have installed
turbine version 2.1 in my server Windows 2000 with
Apache web server and tomcat servlet container. From
the example application, the code to map a user to a
group with a role is :

    #foreach ($group in $flux.Groups)
    <tr>
    <td bgcolor="$ui.labelColor">
      <font face="$ui.sansSerifFonts">
        <b>$group.Name</b>
      </font>
    </td>

    #foreach ($role in $flux.Roles)
    #if ($acl.hasRole($role, $group))
      #set ($checked = "checked")
    #else
      #set ($checked = "")
    #end
    
    <td align="center" bgcolor="$ui.dataColor">
      <input type="checkbox" name="${group.Name}
${role.Name}" $checked>
      <input type="hidden" name="username"
value="$flux.User.UserName">
    </td>
    #end    
  </tr>
  #end

from the code above, we have 2 loops, the first loop
get all the groups and the inner loop get all the
role, and then use turbine api hasRole to check
whether a user have role in a group. 

I extend the application by add 400 plus groups and 10
roles, and i found that the system performance
drop....
because total loop is 400 x 10 = 4000. Besides it, i
found the turbine api TurbineSecurity.getACL ( User )
also will become slow when the groups and roles data
growing.

Note: Please correct me if any information above is
wrong or incorrect.



Thank you.


regards,

Kok Choon

__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


FileItem (write method) Error - Turbine Version 2.1

Posted by Ling Kok Choon <ko...@yahoo.com>.
Hi All,

   I use turbine version 2.1 to build a web
application, and use FileItem class for file upload. I
found a error / bug when using the method write(
String path ). 

  When i code like:

  FileItem fi =
data.getParameters().getFileItem("file1");
  .....
  .....
  fi.write("C:\download");

  It work !

  When i code like:

  FileItem fi =
data.getParameters().getFileItem("file1");
  .....
  .....
  String path = "C:\download"
  fi.write(path);

  It also work !
  
  but when the code is like :

  FileItem fi =
data.getParameters().getFileItem("file1");
  .....
  .....
  String path = "C:\downloed"
  fi.write( path.replace('e','a'));
  
  Turbine will copy the file to the location
C:\download but size = 0.


is it a bug ?


regards,

Kok Choon.

__________________________________________________
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: User, Group, Role mapping slow performance ?

Posted by John McNally <jm...@collab.net>.
It does not appear the template was written with that high a number of
groups in mind.  I think an ui that allows the user to narrow down (type
in a group name) and edit them individually would be more appropriate in
such a case.

Please submit a patch to the ACL code, if you find a better method.  And
if you come up with a better ui for large group numbers and it can be
plugged into flux easily, submit that as well.

thanks,

john mcnally

Ling Kok Choon wrote:
> 
> Hi ,
> 
>    I am a new user in Turbine, I have installed
> turbine version 2.1 in my server Windows 2000 with
> Apache web server and tomcat servlet container. From
> the example application, the code to map a user to a
> group with a role is :
> 
>     #foreach ($group in $flux.Groups)
>     <tr>
>     <td bgcolor="$ui.labelColor">
>       <font face="$ui.sansSerifFonts">
>         <b>$group.Name</b>
>       </font>
>     </td>
> 
>     #foreach ($role in $flux.Roles)
>     #if ($acl.hasRole($role, $group))
>       #set ($checked = "checked")
>     #else
>       #set ($checked = "")
>     #end
> 
>     <td align="center" bgcolor="$ui.dataColor">
>       <input type="checkbox" name="${group.Name}
> ${role.Name}" $checked>
>       <input type="hidden" name="username"
> value="$flux.User.UserName">
>     </td>
>     #end
>   </tr>
>   #end
> 
> from the code above, we have 2 loops, the first loop
> get all the groups and the inner loop get all the
> role, and then use turbine api hasRole to check
> whether a user have role in a group.
> 
> I extend the application by add 400 plus groups and 10
> roles, and i found that the system performance
> drop....
> because total loop is 400 x 10 = 4000. Besides it, i
> found the turbine api TurbineSecurity.getACL ( User )
> also will become slow when the groups and roles data
> growing.
> 
> Note: Please correct me if any information above is
> wrong or incorrect.
> 
> Thank you.
> 
> regards,
> 
> Kok Choon
> 
> __________________________________________________
> Do You Yahoo!?
> Listen to your Yahoo! Mail messages from any phone.
> http://phone.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org