cancel
Showing results for 
Search instead for 
Did you mean: 

Import space with module

major_king
Champ in-the-making
Champ in-the-making
Hello everybody,

now i've spend a lot of time to import/create a new space during the insatlling-process of a custom module, but now all my ideas are gone. I studied the "Basic Sample AMP" from the SDK and the RecordsMananagement-AMP. The Module will be installed and started successful. But when i look into the web client, there is no new space Smiley Sad
Perhaps anybody can post a little example or find the error in my files:

module-context.xml
<beans>
   
    <import resource="classpath:alfresco/module/repocon/context/service-context.xml" />
    <import resource="classpath:alfresco/module/repocon/context/bootstrap-context.xml" />
   
    <bean id="org_alfresco_module_repocon_configbootstrap" class="org.alfresco.web.config.WebClientConfigBootstrap" init-method="init">
       <property name="configs">
          <value>classpath:alfresc/module/repocon/ui/web-client-config.xml</value>
       </property>
    </bean>
   
</beans>

bootstrap-context.xml
<beans>

   <!– Registration of new models –>
   <!– <bean id="repocon.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
      <property name="models">
         <list>
            <value>alfresco/module/repocon/model/repoconModel.xml</value>
         </list>
      </property>
   </bean>  –>

   <!– Bootstrap –>
   <bean id="repocon.bootstrapSpaces" class="org.alfresco.repo.module.ImporterModuleComponent" parent="module.baseComponent">
      <property name="moduleId" value="repocon" />
      <property name="name" value="repocon.bootstrapSpaces" />
      <property name="description" value="Initial data requirements" />
      <property name="sinceVersion" value="1.0" />
      <property name="appliesFromVersion" value="1.0" />
      <!– Data properties –>
      <property name="importer" ref="spacesBootstrap"/>
      <property name="bootstrapViews">
         <list>
            <props>
               <prop key="path">/${spaces.company_home.childname}</prop>
               <prop key="location">alfresco/module/repocon/bootstrap/repocon_space.xml</prop>
            </props>
         </list>
      </property>
   </bean>

</beans>

repocon_space.xml
<?xml version="1.0" encoding="UTF-8"?>
<view:view xmlns:view="http://www.alfresco.org/view/repository/1.0">
  <view:metadata>
    <view:exportBy>admin</view:exportBy>
    <view:exportDate>2008-04-10T13:58:09.440+02:00</view:exportDate>
    <view:exporterVersion>2.9.0 (C_dev 813)</view:exporterVersion>
    <view:exportOf>/app:company_home/cm:Repositpry_x0020_Connector</view:exportOf>
  </view:metadata>
  <cm:folder xmlns="" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:rc="http://www.alfresco.org/model/repocon/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:emailserver="http://www.alfresco.org/model/emailserver/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:ia="com.infoaxon.alfresco.calendar" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:wcm="http://www.alfresco.org/model/wcmmodel/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:custom="custom.model" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:module="http://www.alfresco.org/system/modules/1.0" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:blg="http://www.alfresco.org/model/blogintegration/1.0" xmlns:alf="http://www.alfresco.org" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:wca="http://www.alfresco.org/model/wcmappmodel/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:reg="http://www.alfresco.org/system/registry/1.0" xmlns:wcmwf="http://www.alfresco.org/model/wcmworkflow/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" view:childName="cm:alfrescoAmp">
    <view:aspects>
      <sys:referenceable></sys:referenceable>
      <cm:auditable></cm:auditable>
      <app:uifacets></app:uifacets>
    </view:aspects>
    <view:properties>
      <app:icon>space-icon-default</app:icon>
      <cm:name>alfrescoAmp</cm:name>
      <sys:node-dbid>459</sys:node-dbid>
      <sys:store-identifier>SpacesStore</sys:store-identifier>
      <cm:title></cm:title>
      <sys:node-uuid>4a1c5e26-06f5-11dd-bcd6-89760061912f</sys:node-uuid>
      <cm:modified>2008-04-10T13:57:27.158+02:00</cm:modified>
      <cm:created>2008-04-10T13:57:27.143+02:00</cm:created>
      <sys:store-protocol>workspace</sys:store-protocol>
      <cm:creator>admin</cm:creator>
      <cm:description></cm:description>
      <cm:modifier>admin</cm:modifier>
    </view:properties>
  </cm:folder>
  <cm:folder xmlns="" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:rc="http://www.alfresco.org/model/repocon/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:emailserver="http://www.alfresco.org/model/emailserver/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:ia="com.infoaxon.alfresco.calendar" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:wcm="http://www.alfresco.org/model/wcmmodel/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:custom="custom.model" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:module="http://www.alfresco.org/system/modules/1.0" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:blg="http://www.alfresco.org/model/blogintegration/1.0" xmlns:alf="http://www.alfresco.org" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:wca="http://www.alfresco.org/model/wcmappmodel/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:reg="http://www.alfresco.org/system/registry/1.0" xmlns:wcmwf="http://www.alfresco.org/model/wcmworkflow/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" view:childName="cm:salernoTmp">
    <view:aspects>
      <sys:referenceable></sys:referenceable>
      <cm:auditable></cm:auditable>
      <app:uifacets></app:uifacets>
    </view:aspects>
    <view:properties>
      <app:icon>space-icon-default</app:icon>
      <cm:name>salernoTmp</cm:name>
      <sys:node-dbid>460</sys:node-dbid>
      <sys:store-identifier>SpacesStore</sys:store-identifier>
      <cm:title></cm:title>
      <sys:node-uuid>51188ba9-06f5-11dd-bcd6-89760061912f</sys:node-uuid>
      <cm:modified>2008-04-10T13:57:38.877+02:00</cm:modified>
      <cm:created>2008-04-10T13:57:38.861+02:00</cm:created>
      <sys:store-protocol>workspace</sys:store-protocol>
      <cm:creator>admin</cm:creator>
      <cm:description></cm:description>
      <cm:modifier>admin</cm:modifier>
    </view:properties>
  </cm:folder>
</view:view>

Thank's a lot for helping.

Best Regards,
Christian
5 REPLIES 5

jbarmash
Champ in-the-making
Champ in-the-making
one thing that jumped out at me:
  module-context.xml has a wrong value for classpath -
   
<value>classpath:alfresc/module/repocon/ui/web-client-config.xml</value
>
  should point to "classpath:alfresco" instead of "classpath:alfresc"

I am assuming you are making sure that the bootstrap-context.xml is included in the amp file and gets installed into the right location, i.e.
     alfresco/module/repocon/context/bootstrap-context.xml

Are you getting any messages about attempting to bootstrap?

Lastly, keep in mind that after the module got first bootstrapped, it will not go through the bootstrapping process again, so to continue testing this, you need to either recreate db / file system every time, or to keep renaming your module file.   So if you have already installed the module before, maybe it's just not re-bootstrapping it because it thinks the module is already installed.

major_king
Champ in-the-making
Champ in-the-making
Hi,

the bootstrap-context.xml is included and installed to "alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\repocon\context"

I develope on an VM, so everytime I changed the module I reset the VM.

When I start the alfresco-server, I get this message:
16:02:06,315 INFO  [org.alfresco.repo.module.ModuleServiceImpl] Found 1 module(s).
16:02:06,502 INFO  [org.alfresco.repo.module.ModuleServiceImpl] Installing module 'repocon' version 0.1.

I also take a look on the other modules in the svn-repositroy and tried a lot, but there will be no custom space after booting the alfresco-server Smiley Sad

Perhaps anybody has another little sample, which only imports a new space in company_home…

Thanks a lot!

Regards.
Christian

jbarmash
Champ in-the-making
Champ in-the-making
You said you looked at Records Management AMP already.  I'd suggest to try rip out functionality until all it has is the code that creates the spaces.  Perhaps that will get you closer.

rosemaryl
Champ in-the-making
Champ in-the-making
Hi major_king,

I'm not 100% sure about this as I haven't tested it, but from your log messages it says that your repocon AMP is version 0.1, while in your bootstrap-context.xml file you have your "sinceVersion" value set to 1.0.  From what I've read, this means that bootstrapping will only work on modules versions 1.0 and higher (which might be your 0.1 isn't working).

The only way I could get this to work was by working with an AMP that did bootstrap data correctly, then slowly modified it to suit my needs.  I'm also now an expert at clearing out my database as a result. Smiley Wink

Please let me know if this helps, it's a hunch that I haven't had a chance to test myself.

~Rosemary

major_king
Champ in-the-making
Champ in-the-making
Hi rosemaryl,

i have already fixed the problem last week after a lot of try&error. I can't spezify my fault exactly, but now it works and that makes me very happy Smiley Very Happy But thanks for answering.

If somebody has the same problems, send me a pm for my files.

Regards,
Christian
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.