Hi, I have been playing with the 2.1 source code for 3 days and I wanted to
do some tests before deciding to use this product.
In particular I wanted to access the repository to create new objects
outside the authoring tool.
I have used the following code to obtain a HierarchyManager:
--CODE--
SimpleCredentials sc = new SimpleCredentials(
ContentRepository.SYSTEM_USER, ContentRepository.SYSTEM_PSWD ) ;
Provider handlerClass = (Provider)
Class.forName("info.magnolia.jackrabbit.ProviderImpl").newInstance();
RepositoryMapping map = new RepositoryMapping() ;
map.setID( "users" ) ;
map.setName( "users" ) ;
map.setProvider( "info.magnolia.jackrabbit.ProviderImpl" ) ;
map.setLoadOnStartup( true ) ;
Map parameters = new Hashtable();
parameters.put( "configFile",
"WEB-INF/config/repo-conf/jackrabbit-file-nosearch.xml" ) ;
parameters.put( "repositoryHome", "repositories/users" ) ;
parameters.put( "contextFactoryClass",
"org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory" )
;
parameters.put( "providerURL", "localhost" );
parameters.put( "bindName", "usersPublic" );
map.setParameters( parameters );
handlerClass.init( map );
Repository repository = handlerClass.getUnderlineRepository();
Session session = repository.login( sc, DEFAULT_WORKSPACE ) ;
handlerClass.registerNamespace( NAMESPACE_PREFIX, NAMESPACE_URI,
session.getWorkspace() ) ;
List acl = getSystemPermissions() ;
AccessManagerImpl accessManager = new AccessManagerImpl();
accessManager.setPermissionList( acl ) ;
hierarchyManager = new HierarchyManager( ContentRepository.SYSTEM_USER )
;
hierarchyManager.init( session.getRootNode() ) ;
hierarchyManager.setAccessManager( accessManager ) ;
--End of CODE--
then I used it to create a new node in the users repository. ( calling the
save method )
After running the program I loaded the authoring tool wondering if I could
see the new user. I pressed the refresh menu a hundred times, but the user
did not appear.
The only way I found to make it reload the whole list with the new user,
was stopping the application and restarting again.
And now the problem...
What do I have to do to inform the authoring tool that que users repository
has changed?
Browsing the code I discovered that there is an ObservationManager that
should do that when something changes, but I don't know how to use it.
Thanks in advanced
José Alfonso
___________________________________________________________________________
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si no es vd. el destinatario
indicado, queda notificado de que la lectura, utilización, divulgación y/o
copia sin autorización está prohibida en virtud de la legislación vigente.
Si ha recibido este mensaje por error, le rogamos que nos lo comunique
inmediatamente por esta misma vía y proceda a su destrucción.
El correo electrónico vía Internet no permite asegurar la confidencialidad
de los mensajes que se transmiten ni su integridad o correcta recepción.
Telefónica no asume ninguna responsabilidad por estas circunstancias.
This message is intended exclusively for its addressee and may contain
information that is CONFIDENTIAL and protected by a professional privilege
or whose disclosure is prohibited by law.If you are not the intended
recipient you are hereby notified that any read, dissemination, copy or
disclosure of this communication is strictly prohibited by law. If this
message has been received in error, please immediately notify us via e-mail
and delete it.
Internet e-mail neither guarantees the confidentiality nor the integrity or
proper receipt of the messages sent. Telefónica does not assume any
liability for those circumstances.
___________________________________________________________________________
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------