cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic models - no restart required ...

janv
Employee
Employee
We have recently added a new feature to the Alfresco Repository that allows custom models to be updated dynamically without requiring a server restart. Additionally, the Web Client UI can also be customised without a restart. This means for example that new types, aspects and properties can now be added dynamically. Also, new workflow task models can be deployed at runtime.

Here's a first-cut wiki page with more details:

http://wiki.alfresco.com/wiki/Dynamic_Models

This feature is available on HEAD and via nightly builds:

http://dev.alfresco.com/downloads/nightly/dist/

We would appreciate your feedback on this new feature. Please raise any bugs via JIRA.

Thanks,
Jan
22 REPLIES 22

rivarola
Champ on-the-rise
Champ on-the-rise
Congratulation Jan, this is a GREAT (r)evolution  Smiley Very Happy

kbonnet
Champ in-the-making
Champ in-the-making
I wanted to see this bahavior and downloaded version 2.2dev.I managed to get a custom content type activated via the new Models space in the datadictionary. I checked the activation via the repoadmin-console with the "show models" command.

However, i dont succeed in making my new content type visible in the user interface. For this to achieve i have put the following XML file in the Web Client Extension space:


<alfresco-config>

<config evaluator="string-compare" condition="Content Wizards">
      <content-types>
            <type name="sc:doc" display-label="General document (KB)" />
            <type name="sc:whitepaper" display-label="Whitepaper (KB)" />
      </content-types>
   </config>

</alfresco-config>

Having done this, and reloaded the webclient configuration via the webclientconfig-console, i would have expected my two new content type to appear in the Create Content Wizard. But nothing shows up there.

Any suggestions? Did i forget something?

Kind regards,

Koen Bonnet

janv
Employee
Employee
Hi Koen,

Thanks for the feedback. It sounds as if you have followed the right steps.

Can you confirm that your custom web client config is called 'web-client-config-custom.xml' ? (… for your reference, the config source list is defined in web-client-application-context.xml)

Also, if you haven't already, can you also please try the example model (wiki example 1) and make sure that this works OK in your environment.

If you're still having problems, then would it possible for you to send a copy of your custom model.

Thanks,
Jan

kbonnet
Champ in-the-making
Champ in-the-making
Hi Jan! Your push was in the right direction! I didnt realize the file had to have the same name as it would have on the file system. I renamed my web client config, reloaded, and now i can create my own content types.

I didnt realize the name was so important, because for the content models it doest matter. Maybe we should emphasize this in the Wiki?

Thanks a lot!

Koen Bonnet

kbonnet
Champ in-the-making
Champ in-the-making
Now i got myself really in trouble Smiley Very Happy. I edited my web client config file but saved invalid XML. After reloading the config i couldnt do anything in Alfresco, because the web client hadnt initialised or something. I solved the problem by editing my file with vi in my content store on the filesystem.

Maybe build in some validation before these config files can be activated?

Koen

janv
Employee
Employee
Agreed, invalid config should not be loaded. This has been fixed on HEAD. The wiki page has also been updated.

Thanks for the feedback.

Jan

kbonnet
Champ in-the-making
Champ in-the-making
I'm still glad that dynamic models are being developed, but i ran into a new problem while working with a custom workflow model and proces definition.

I'm not able to deactivate my custom workflow model. When i try to deactivate it via the web client or do anything via the workflow-console, i get the error message


Namespace prefix cntz is not mapped to a namespace URI

I must have created this situation by copying the model. I was able the deactivate the original, but not this copy. I undeployed the proces definition and commented-out the web client extensions for it, but so far nothing helps.

Any clues or directions?

Thanks for your time and help.

Koen

janv
Employee
Employee
Thanks again for the feedback.

It sounds as if the first deactivation caused the model instance to be removed, hence giving a namespace error … for reference, please post a stacktrace from the server console/log, if available.

We should not allow multiple active model definitions with the same model name (even if the file names are different) since these effectively point to the same model instance.

I have fixed HEAD so that it is no longer possible to create / copy / activate separate copies of existing active models.

Hope this helps.

Jan

kbonnet
Champ in-the-making
Champ in-the-making
This is the output in the logging when the error occurs.


15:30:17,024 User:admin ERROR [ui.common.Utils] A system error happened during the operation: Namespace prefix cntz is not mapped to a namespace URI
org.alfresco.service.namespace.NamespaceException: Namespace prefix cntz is not mapped to a namespace URI
        at org.alfresco.service.namespace.QName.createQName(QName.java:103)
        at org.alfresco.service.namespace.QName.createQName(QName.java:125)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.getTaskDefinition(JBPMEngine.java:1827)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.createWorkflowTaskDefinition(JBPMEngine.java:2836)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.createWorkflowDefinition(JBPMEngine.java:2774)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine$4.doInJbpm(JBPMEngine.java:417)
        at org.springmodules.workflow.jbpm31.JbpmTemplate$1.doInHibernate(JbpmTemplate.java:87)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
        at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:333)
        at org.springmodules.workflow.jbpm31.JbpmTemplate.execute(JbpmTemplate.java:80)
        at org.alfresco.repo.workflow.jbpm.JBPMEngine.getDefinitions(JBPMEngine.java:395)
        at org.alfresco.repo.workflow.WorkflowServiceImpl.getDefinitions(WorkflowServiceImpl.java:192)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:241)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
        at $Proxy43.getDefinitions(Unknown Source)
        at org.alfresco.repo.dictionary.DictionaryModelType.validateModelDelete(DictionaryModelType.java:483)
        at org.alfresco.repo.dictionary.DictionaryModelType.access$500(DictionaryModelType.java:72)
        at org.alfresco.repo.dictionary.DictionaryModelType$DictionaryModelTypeTransactionListener$1.doWork(DictionaryModelType.java:403)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:298)
        at org.alfresco.repo.dictionary.DictionaryModelType$DictionaryModelTypeTransactionListener.beforeCommit(DictionaryModelType.java:352)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:632)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.doBeforeCommit(AlfrescoTransactionSupport.java:614)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport$TransactionSynchronizationImpl.beforeCommit(AlfrescoTransactionSupport.java:592)
        at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:48)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:821)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:637)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:624)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:307)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.commit(SpringAwareUserTransaction.java:420)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:244)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:160)
        at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:124)
        at org.alfresco.web.bean.dialog.DialogManager.finish(DialogManager.java:409)
        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.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
        at javax.faces.component.UICommand.broadcast(UICommand.java:109)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
        at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
        at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
        at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)