incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evangelos Vlachogiannis <evl...@aegean.gr>
Subject Re: create graffito folder when a j2 user created
Date Fri, 03 Nov 2006 09:20:36 GMT
Hi Christophe and thnx for immediate reply once again,

Find below the jetspeed log.

Also you can check 
http://e-university.gunet.gr/svn/guportal-cms/jetspeed2-deploy/src/assembly_head/ 
  my assembly additions (See for userfolder)

and also the service implementation: 
http://e-university.gunet.gr/svn/guportal-cms/components/src/java/org/apache/portals/graffito/services/userfolder/impl/UserFolderServiceImpl.java



2006-11-02 21:44:33,869 [http-9090-3] ERROR 
org.apache.portals.graffito.services.core.impl.ContentModelServiceImpl - 
Failed to get folder object in ContentModelServiceImpl
org.apache.portals.graffito.exception.CmsPermissionException: Not 
sufficient permission to get the object by query
	at 
org.apache.portals.graffito.store.impl.ojb.GraffitoOJBStore.getObjectByQuery(GraffitoOJBStore.java:291)
	at 
org.apache.portals.graffito.persistence.impl.ContentPersistenceServiceImpl.getCmsObject(ContentPersistenceServiceImpl.java:248)
	at 
org.apache.portals.graffito.services.core.impl.ContentModelServiceImpl.getFolder(ContentModelServiceImpl.java:168)
	at 
org.apache.portals.graffito.services.userfolder.impl.UserFolderServiceImpl.initializeUser(UserFolderServiceImpl.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at 
org.apache.jetspeed.login.LoginRedirectorServlet.doGet(LoginRedirectorServlet.java:64)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
	at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at 
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:831)
	at 
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
	at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1203)
	at java.lang.Thread.run(Thread.java:595)






Christophe Lombart wrote:
> Are you using the default graffito permission ?

I guess so... could you check also?

> Are you using the admin user to create the new user folder ?

yes, I use that grant method? isnt that correct? also when new user is 
created isnt also an admin action anyway?

> Can you send me the complete stack trace ?

see above

> 
> I'm interesting to receive the patch for this feature (even if there
> are some bugs). It will be easier to check your error.
> 
> br,
> Christophe
> 
> 
> 
> On 11/3/06, Evangelos Vlachogiannis <evlach@aegean.gr> wrote:
>> Hi,
>>
>> I would like to create a graffito folder when a new user is created. So
>> I have created a graffito service and call it from inside jetspeed
>> PortalAdministrationImpl.java as you can see in attachment. Could you
>> please tell me if I am doing something wrong as I get a graffito
>> permission (not sufficent perm) exception?
>>
>> thnx,
>> Vangelis
>> -- 
>> ---------------------------------------------------------------
>> Evangelos Vlachogiannis
>> Researcher - PhD. Candidate
>> Contact: http://www.syros.aegean.gr/users/evlach/contactme.php
>> ---------------------------------------------------------------
>>
>>
>> Index: PortalAdministrationImpl.java
>> ===================================================================
>> --- PortalAdministrationImpl.java       (revision 344)
>> +++ PortalAdministrationImpl.java       (revision 345)
>> @@ -17,6 +17,7 @@
>>
>>  import java.io.FileReader;
>>  import java.io.StringWriter;
>> +import java.lang.reflect.Method;
>>  import java.security.Principal;
>>  import java.security.PrivilegedAction;
>>  import java.util.Collection;
>> @@ -53,6 +54,8 @@
>>  import org.apache.jetspeed.security.User;
>>  import org.apache.jetspeed.security.UserManager;
>>  import org.apache.jetspeed.security.UserPrincipal;
>> +import org.apache.jetspeed.services.JetspeedPortletServices;
>> +import org.apache.jetspeed.services.PortletServices;
>>  import org.apache.velocity.VelocityContext;
>>  import org.apache.velocity.app.VelocityEngine;
>>  import org.springframework.mail.MailException;
>> @@ -259,8 +262,7 @@
>>                               // deep copy from the default folder 
>> template tree, creating a deep-copy of the template
>>                               // in the new user's folder tree
>>                              Folder source = 
>> innerPageManager.getFolder(innerFolderTemplate);
>> -                            innerPageManager.deepCopyFolder(source, 
>> Folder.USER_FOLDER + innerUserName, innerUser);
>> -
>> +                            innerPageManager.deepCopyFolder(source, 
>> Folder.USER_FOLDER + innerUserName, innerUser);
>>                              return null;
>>                          }
>>                           catch (FolderNotFoundException e1) {
>> @@ -290,13 +292,49 @@
>>                  log.error("Registration Error: Failed to create user 
>> folders for " + userName + ", " + pe.toString());
>>                  throw pe;
>>              }
>> -
>> +
>> +            try
>> +            {
>> +               User theAdminUser = userManager.getUser("admin");
>> +                JetspeedException pe1 = (JetspeedException) 
>> Subject.doAsPrivileged(theAdminUser.getSubject(), new PrivilegedAction()
>> +                    {
>> +                        public Object run()
>> +                        {
>> +                                try
>> +                               {
>> +                                       System.out.print("login fix 
>> start");
>> +                                    PortletServices services = 
>> JetspeedPortletServices.getSingleton();
>> +                                    Object userFolderService = 
>> services.getService("UserFolderService");
>> +                                       String className = 
>> userFolderService.getClass().getName();
>> +                                       Class userFolderManagerClass = 
>> Class.forName(className);
>> +                                       Class[] argClasses = 
>> {String.class};
>> +                                       Object[] args = {innerUserName};
>> +                                       Method method = 
>> userFolderManagerClass.getMethod("initializeUser", argClasses);
>> +                                       
>> method.invoke(userFolderService, args);
>> +                                       System.out.print("login fix 
>> end");
>> +                               }
>> +                               catch(Exception e)
>> +                               {
>> +                                       //e.printStackTrace();
>> +                                       System.out.print("login fix 
>> failed"+ e.getMessage());
>> +                               }
>> +
>> +                                return null;
>> +                        }
>> +                    }, null);
>> +            }
>> +            catch(Exception e)
>> +            {
>> +
>> +            }
>> +
>>          }
>>          catch (Exception e)
>>          {
>>              log.error("Registration Error: Failed to create 
>> registered user " + userName + ", " + e.toString());
>>              throw new RegistrationException(e);
>> -        }
>> +        }
>> +
>>      }
>>
>>
>>
>>
>>

-- 
---------------------------------------------------------------
Evangelos Vlachogiannis
Researcher - PhD. Candidate
Contact: http://www.syros.aegean.gr/users/evlach/contactme.php
---------------------------------------------------------------

Mime
View raw message