[ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-3189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=28162#action_28162
 ] 

Manuel Molaschi commented on MAGNOLIA-3189:
-------------------------------------------

Our module definition file declares repositories as follows
{code:xml}
  <repositories>
    <repository>
      <name>magnolia</name>
      <workspaces>
        <workspace>media</workspace>
      </workspaces>
      <nodeTypeFile>/mgnl-nodetypes/media/magnolia-nodetypes.xml</nodeTypeFile>
    </repository>
    <repository>
      <name>magnolia</name>
      <workspaces>
        <workspace>playlists</workspace>
      </workspaces>
      
<nodeTypeFile>/mgnl-nodetypes/media/magnolia-nodetypes-playlist.xml</nodeTypeFile>
    </repository>
  </repositories>
{code}

Repository mapping is overidden by custom repositories.xml in which:
{code:xml}
<Repository name="shared" provider="info.magnolia.jackrabbit.ProviderImpl" 
loadOnStartup="true">
        <param name="configFile" 
value="${magnolia.repositories.jackrabbit.shared.config}" />
        <param name="repositoryHome" 
value="${magnolia.repositories.home}/shared" />
        <param name="contextFactoryClass" 
value="org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory" />
        <param name="providerURL" value="localhost" />
        <param name="bindName" value="${magnolia.webapp}-shared" />
        <workspace name="media" />
        <workspace name="playlists" />
    </Repository>
{code}

In the class ModuleManagerImpl:

method loadModulesRepositories:
{code:java}
            for (final RepositoryDefinition repDef : def.getRepositories()) {
                final String repositoryName = repDef.getName();

                final String nodetypeFile = repDef.getNodeTypeFile();

                final List<String> wsList = repDef.getWorkspaces();
                String[] workSpaces = wsList.toArray(new String[wsList.size()]);

                loadRepository(repositoryName, nodetypeFile, workSpaces);
            }
{code}
calls loadRepository for each repository (media, playlists) in module 
definition xml.

method loadRepository:
{code:java}
        if (nodeTypeFile != null) {
            // register nodetypes
            Provider provider = 
ContentRepository.getRepositoryProvider(repositoryName);
            try {
                provider.registerNodeTypes(nodeTypeFile);
            }
            catch (RepositoryException e) {
                log.error(e.getMessage(), e);
            }
        }
{code}
registers nodetypes just for declared repositories (repository shared)

> "NoSuchNodetypeException" in RecieveFilter when activating already published 
> nodes for a separate repository
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MAGNOLIA-3189
>                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3189
>             Project: Magnolia
>          Issue Type: Bug
>          Components: activation
>    Affects Versions: 4.3.1
>            Reporter: Manuel Molaschi
>            Assignee: Jan Haderka
>
> We have two jcr repositories, the default one and a repository for media(with 
> custom nodetypes). I am publishing some medias (custom nodetype) from the 
> author instance of a staging env  (in the separated jcr repository) to the 
> author instance of a production env.
> When i publish new contents everything goes fine, but when i publish modified 
> contents i get an exception on the destination server:
> {{[gest-srv] ERROR 03.05.2010 12:44:06 
> info.magnolia.module.exchangesimple.ReceiveFilter 
> ReceiveFilter.java(importOnExisting:444) -- Exception caught}}
> {{javax.jcr.nodetype.NoSuchNodeTypeException: 
> {http://www.magnolia.info/jcr/mgnl}media}}
> Looking at source code, there is a temporary import to the mgnlSystem 
> workspace that resides in the default repository which have not the custom 
> nodetypes declarations (registered in the media repository).
> Possible solutions?
> - getting the SystemContext hierarchyManager for the destination workspace 
> instead of mgnlSystem
> - have a mgnlSystem ws in every repository mapped as mgnlSystem[repository 
> name]
> - register custom nodetypes also on default repository

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to