Custom content model with mandatory aspects.

cancel
Showing results for 
Search instead for 
Did you mean: 
jurahf
Active Member

Custom content model with mandatory aspects.

Hello.
I am working with Alfresco Community 201702.

I have created custom content model with xml:

<?xml version="1.0" encoding="UTF-8"?>
<model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="lolpu:DocumentTest">
    <description>Document Model for Repo Extension X</description>
    <author>Jura</author>
    <imports>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
    </imports>
    <namespaces>
        <namespace uri="http://www.lolpu.ru/model/content/1.0" prefix="lolpu"/>
    </namespaces>
    <data-types/>
    <constraints/>
    <types>
        <type name="lolpu:MyDocument">
            <title>Document card</title>
            <parent>cm:content</parent>
            <properties>
                <property name="lolpu:MyNumber">
                    <title>Registration number</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <tokenised>TRUE</tokenised>
                        <facetable>false</facetable>
                    </index>
                </property>
                <property name="lolpu:MyDate">
                    <title>Registration date</title>
                    <type>d:date</type>
                    <mandatory>false</mandatory>
                    <index enabled="true">
                        <tokenised>TRUE</tokenised>
                    </index>
                </property>
            </properties>
            <associations/>
            <overrides/>
            <mandatory-aspects>
                    <aspect>lolpu:MyComment</aspect>
               </mandatory-aspects>
        </type>
    </types>
    <aspects>
        <aspect name="lolpu:MyComment">
            <title>My comment</title>
            <properties>
                <property name="lolpu:MyCommentText">
                    <title>My comment text</title>
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                    <index enabled="true">
                        <tokenised>TRUE</tokenised>
                        <facetable>false</facetable>
                    </index>
                </property>
            </properties>
            <associations/>
            <overrides/>
            <mandatory-aspects/>
        </aspect>
    </aspects>
</model>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

I am try to import this model, but get an error:

There was a problem importing the file.
Try removing the existing model before importing another.
The custom model doesn't support the 'mandatory-aspects' element.

If I delete a line:

40| <aspect>lolpu:MyComment</aspect>

, then the import is successful.

Does this mean that there is no way to create a custom model with mandatory aspects? What about custom model with associations?

8 Replies
douglascrp
Advanced II

Re: Custom content model with mandatory aspects.

Usually the log file will show to you what exactly is wrong with your model.

You said

There was a problem importing the file.

Just that line will not help us to understand the problem, so please, share the full log file here if you still need help trying to fix your problem.

jurahf
Active Member

Re: Custom content model with mandatory aspects.

There is only the same error in the log ("The custom model doesn't support the 'mandatory-aspects' element."): 

2017-06-01 17:38:07,271 INFO [org.alfresco.repo.admin] [alf-test.pstu.ru-startStop-1] Using database URL 'jdbcSmiley Tongueostgresql://localhost:5432/alfresco' with user 'alfresco'.
2017-06-01 17:38:07,274 INFO [org.alfresco.repo.admin] [alf-test.pstu.ru-startStop-1] Connected to database PostgreSQL version 9.4.4
2017-06-01 17:38:13,778 INFO [org.alfresco.repo.domain.schema.SchemaBootstrap] [alf-test.pstu.ru-startStop-1] Ignoring script patch (post-Hibernate): patch.db-V4.2-metadata-query-indexes
2017-06-01 17:38:13,778 INFO [org.alfresco.repo.domain.schema.SchemaBootstrap] [alf-test.pstu.ru-startStop-1] Ignoring script patch (post-Hibernate): patch.db-V5.1-metadata-query-indexes
2017-06-01 17:38:13,778 INFO [org.alfresco.repo.domain.schema.SchemaBootstrap] [alf-test.pstu.ru-startStop-1] Ignoring script patch (post-Hibernate): patch.db-V5.2-remove-jbpm-tables-from-db
2017-06-01 17:38:21,539 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'Authentication' subsystem, ID: [Authentication, managed, external1]
2017-06-01 17:38:21,657 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'Authentication' subsystem, ID: [Authentication, managed, external1] complete
2017-06-01 17:38:21,657 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'Authentication' subsystem, ID: [Authentication, managed, ldap1]
2017-06-01 17:38:21,918 WARN [org.alfresco.repo.security.authentication.ldap.LDAPInitialDirContextFactoryImpl] [alf-test.pstu.ru-startStop-1] LDAP server supports anonymous bind ldap://10.56.30.2:389
2017-06-01 17:38:21,988 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'Authentication' subsystem, ID: [Authentication, managed, ldap1] complete
2017-06-01 17:38:25,516 INFO [org.springframework.extensions.webscripts.TemplateProcessorRegistry] [alf-test.pstu.ru-startStop-1] Registered template processor Repository Template Processor for extension ftl
2017-06-01 17:38:25,519 INFO [org.springframework.extensions.webscripts.ScriptProcessorRegistry] [alf-test.pstu.ru-startStop-1] Registered script processor Repository Script Processor for extension js
2017-06-01 17:38:29,497 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'ContentStore' subsystem, ID: [ContentStore, managed, unencrypted]
2017-06-01 17:38:29,592 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'ContentStore' subsystem, ID: [ContentStore, managed, unencrypted] complete
2017-06-01 17:38:29,727 INFO [org.alfresco.repo.domain.schema.SchemaBootstrap] [alf-test.pstu.ru-startStop-1] Connecting to database: jdbcSmiley Tongueostgresql://localhost:5432/alfresco, UserName=alfresco, PostgreSQL Native Driver
2017-06-01 17:38:29,727 INFO [org.alfresco.repo.domain.schema.SchemaBootstrap] [alf-test.pstu.ru-startStop-1] Schema managed by database dialect org.hibernate.dialect.PostgreSQLDialect.
2017-06-01 17:38:30,907 INFO [org.alfresco.repo.domain.schema.SchemaBootstrap] [alf-test.pstu.ru-startStop-1] No changes were made to the schema.
2017-06-01 17:38:34,654 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'thirdparty' subsystem, ID: [thirdparty, default]
2017-06-01 17:38:36,345 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'thirdparty' subsystem, ID: [thirdparty, default] complete
2017-06-01 17:38:36,345 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'OOoDirect' subsystem, ID: [OOoDirect, default]
2017-06-01 17:38:38,930 WARN [org.alfresco.util.OpenOfficeConnectionTester] [alf-test.pstu.ru-startStop-1] An initial OpenOffice connection could not be established.
2017-06-01 17:38:38,934 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'OOoDirect' subsystem, ID: [OOoDirect, default] complete
2017-06-01 17:38:38,944 INFO [org.alfresco.repo.admin.ConfigurationChecker] [alf-test.pstu.ru-startStop-1] The root data directory ('dir.root') is: C:\ALFRES~1\alf_data
2017-06-01 17:38:38,945 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'Search' subsystem, ID: [Search, managed, solr4]
2017-06-01 17:38:39,397 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'Search' subsystem, ID: [Search, managed, solr4] complete
2017-06-01 17:38:39,421 INFO [org.alfresco.repo.admin.patch.PatchExecuter] [alf-test.pstu.ru-startStop-1] Checking for patches to apply ...
2017-06-01 17:38:40,121 INFO [org.alfresco.repo.admin.patch.PatchExecuter] [alf-test.pstu.ru-startStop-1] No patches were required.
2017-06-01 17:38:40,221 INFO [org.alfresco.repo.module.ModuleServiceImpl] [alf-test.pstu.ru-startStop-1] Found 4 module package(s).
2017-06-01 17:38:40,305 INFO [org.alfresco.repo.module.ModuleServiceImpl] [alf-test.pstu.ru-startStop-1] Starting module 'alfresco-aos-module' version 1.1.5.
2017-06-01 17:38:40,335 INFO [org.alfresco.repo.module.ModuleServiceImpl] [alf-test.pstu.ru-startStop-1] Starting module 'uploader-plus-repo' version 1.2.1502120927.
2017-06-01 17:38:40,358 INFO [org.alfresco.repo.module.ModuleServiceImpl] [alf-test.pstu.ru-startStop-1] Starting module 'alfresco-share-services' version 5.2.0.
2017-06-01 17:38:40,384 INFO [org.alfresco.repo.module.ModuleServiceImpl] [alf-test.pstu.ru-startStop-1] Starting module 'alfresco-trashcan-cleaner' version 2.2.
2017-06-01 17:38:40,410 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'fileServers' subsystem, ID: [fileServers, default]
2017-06-01 17:38:40,970 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'sysAdmin' subsystem, ID: [sysAdmin, default]
2017-06-01 17:38:41,005 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'sysAdmin' subsystem, ID: [sysAdmin, default] complete
2017-06-01 17:38:41,072 ERROR [org.alfresco.fileserver] [alf-test.pstu.ru-startStop-1] No enabled CIFS authenticator found in authentication chain. CIFS Server disabled
2017-06-01 17:38:41,072 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'fileServers' subsystem, ID: [fileServers, default] complete
2017-06-01 17:38:41,073 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'imap' subsystem, ID: [imap, default]
2017-06-01 17:38:41,314 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'imap' subsystem, ID: [imap, default] complete
2017-06-01 17:38:41,314 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'email' subsystem, ID: [email, outbound]
2017-06-01 17:38:41,862 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'email' subsystem, ID: [email, outbound] complete
2017-06-01 17:38:41,863 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'email' subsystem, ID: [email, inbound]
2017-06-01 17:38:41,959 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'email' subsystem, ID: [email, inbound] complete
2017-06-01 17:38:41,960 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'Subscriptions' subsystem, ID: [Subscriptions, default]
2017-06-01 17:38:41,992 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'Subscriptions' subsystem, ID: [Subscriptions, default] complete
2017-06-01 17:38:57,351 INFO [org.alfresco.service.descriptor.DescriptorService] [alf-test.pstu.ru-startStop-1] Alfresco JVM - v1.8.0_111-b14; maximum heap size 2031,375MB
2017-06-01 17:38:57,352 INFO [org.alfresco.service.descriptor.DescriptorService] [alf-test.pstu.ru-startStop-1] Server Mode :UNKNOWN
2017-06-01 17:38:57,352 INFO [org.alfresco.service.descriptor.DescriptorService] [alf-test.pstu.ru-startStop-1] Alfresco Content Services started (Community). Current version: 5.2.0 (r135134-b14) schema 10†005. Originally installed version: 5.2.0 (r135134-b14) schema 10†005.
2017-06-01 17:38:57,369 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'ActivitiesFeed' subsystem, ID: [ActivitiesFeed, default]
2017-06-01 17:38:57,832 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'ActivitiesFeed' subsystem, ID: [ActivitiesFeed, default] complete
2017-06-01 17:38:57,834 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Starting 'Replication' subsystem, ID: [Replication, default]
2017-06-01 17:38:57,862 INFO [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [alf-test.pstu.ru-startStop-1] Startup of 'Replication' subsystem, ID: [Replication, default] complete
2017-06-01 17:39:05,049 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 405 Web Scripts (+0 failed), 554 URLs
2017-06-01 17:39:05,051 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 1 Package Description Documents (+0 failed)
2017-06-01 17:39:05,052 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 0 Schema Description Documents (+0 failed)
2017-06-01 17:39:07,676 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [alf-test.pstu.ru-startStop-1] Registered 405 Web Scripts (+0 failed), 554 URLs
2017-06-01 17:39:07,677 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [alf-test.pstu.ru-startStop-1] Registered 1 Package Description Documents (+0 failed)
2017-06-01 17:39:07,677 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [alf-test.pstu.ru-startStop-1] Registered 0 Schema Description Documents (+0 failed)
2017-06-01 17:39:07,684 INFO [org.springframework.extensions.webscripts.AbstractRuntimeContainer] [alf-test.pstu.ru-startStop-1] Initialised Repository Web Script Container (in 7636.207ms)
2017-06-01 17:39:07,706 INFO [org.springframework.extensions.webscripts.TemplateProcessorRegistry] [alf-test.pstu.ru-startStop-1] Registered template processor freemarker for extension ftl
2017-06-01 17:39:07,717 INFO [org.springframework.extensions.webscripts.ScriptProcessorRegistry] [alf-test.pstu.ru-startStop-1] Registered script processor javascript for extension js
2017-06-01 17:39:10,182 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 405 Web Scripts (+0 failed), 554 URLs
2017-06-01 17:39:10,183 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 1 Package Description Documents (+0 failed)
2017-06-01 17:39:10,183 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 0 Schema Description Documents (+0 failed)
2017-06-01 17:39:10,313 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 13 Web Scripts (+0 failed), 102 URLs
2017-06-01 17:39:10,313 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 0 Package Description Documents (+0 failed)
2017-06-01 17:39:10,313 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 0 Schema Description Documents (+0 failed)
2017-06-01 17:39:10,376 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [alf-test.pstu.ru-startStop-1] Registered 13 Web Scripts (+0 failed), 102 URLs
2017-06-01 17:39:10,377 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [alf-test.pstu.ru-startStop-1] Registered 0 Package Description Documents (+0 failed)
2017-06-01 17:39:10,377 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [alf-test.pstu.ru-startStop-1] Registered 0 Schema Description Documents (+0 failed)
2017-06-01 17:39:10,383 INFO [org.springframework.extensions.webscripts.AbstractRuntimeContainer] [alf-test.pstu.ru-startStop-1] Initialised Public Api Web Script Container (in 2615.3364ms)
2017-06-01 17:39:10,573 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 13 Web Scripts (+0 failed), 102 URLs
2017-06-01 17:39:10,573 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 0 Package Description Documents (+0 failed)
2017-06-01 17:39:10,573 INFO [org.springframework.extensions.webscripts.DeclarativeRegistry] [asynchronouslyRefreshedCacheThreadPool1] Registered 0 Schema Description Documents (+0 failed)
2017-06-01 17:40:00,664 WARN [org.alfresco.util.OpenOfficeConnectionTester] [DefaultScheduler_Worker-4] Error trying to query Open Office version information. OpenOffice.org's ConfigurationRegistry not implemented in this version of OOo. This should not affect the operation of OOo.
2017-06-01 17:40:00,664 INFO [org.alfresco.util.OpenOfficeConnectionTester] [DefaultScheduler_Worker-4] The OpenOffice connection was re-established.
2017-06-01 17:42:31,190 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-apr-8180-exec-9] Exception from executeScript: 05010127 —The custom model doesn't support the 'mandatory-aspects' element.
org.springframework.extensions.webscripts.WebScriptException: 05010127 —The custom model doesn't support the 'mandatory-aspects' element.
at org.alfresco.repo.web.scripts.custommodel.CustomModelUploadPost.importModel(CustomModelUploadPost.java:250)
at org.alfresco.repo.web.scripts.custommodel.CustomModelUploadPost.processUpload(CustomModelUploadPost.java:186)
at org.alfresco.repo.web.scripts.custommodel.CustomModelUploadPost.executeImpl(CustomModelUploadPost.java:115)
at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:519)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:587)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.module.aosmodule.service.ContextRootFilter.doFilter(ContextRootFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

douglascrp
Advanced II

Re: Custom content model with mandatory aspects.

Ah, I think I know what the problem is.

You have a <mandatory-aspects/> tag inside the aspect definition.

Remove it and try again.

jurahf
Active Member

Re: Custom content model with mandatory aspects.

Sorry, but no result.

douglascrp
Advanced II

Re: Custom content model with mandatory aspects.

And how about the log file?

Don't you see any other error there?

With that change, you should at least to noticed some change in it.

jurahf
Active Member

Re: Custom content model with mandatory aspects.

Nothing changes in log. But I have returned to this problem. It turned out that there are exceptions in source code of alfresco: 

community-edition-old/CustomModelsImpl.java at 2c1eff9953d3105e738f7b06ba9ba8a079ca4c24 · Alfresco/c... 

Method:

    private void checkUnsupportedModelElements(Collection<? extends M2Class> m2Classes)
    {
        for (M2Class cls : m2Classes)
        {
            if (cls.getAssociations().size() > 0)
            {
                throw new ConstraintViolatedException("cmm.rest_api.model.import_associations_unsupported");
            }
            if (cls.getPropertyOverrides().size() > 0)
            {
                throw new ConstraintViolatedException("cmm.rest_api.model.import_overrides_unsupported");
            }
            if (cls.getMandatoryAspects().size() > 0)
            {
                throw new ConstraintViolatedException("cmm.rest_api.model.import_mandatory_aspects_unsupported");
            }
            if(cls.getArchive() != null)
            {
                throw new ConstraintViolatedException("cmm.rest_api.model.import_archive_unsupported");
            }
            if(cls.getIncludedInSuperTypeQuery() != null)
            {
                throw new ConstraintViolatedException("cmm.rest_api.model.import_includedInSuperTQ_unsupported");
            }
        }
    }

It's explicitly prohibits associations and mandatory aspects.

Do you know, is it only in community version?

douglascrp
Advanced II

Re: Custom content model with mandatory aspects.

No, there is no difference in that part between Community and Enterprise.

I guess the best thing to do is to share your full project here in order that we can take a look and try to help you.

mikef38
Member II

Re: Custom content model with mandatory aspects.

It's an old question but the problem is still there.

All this (asking for the full project) is obviously useless, the element that triggers the error is known from the very beginning, the error is explicit. MANDATORY ASPECTS ARE FORBIDDEN DURING IMPORT in Community Edition.

The code that explicitely forbids this is even given here. 

Looks like those who were supposed to help can't understand simple facts. I found the thread because I have the same problem, I am new here, have little knowledge of Alfresco, and yet I can read the code and understand what's going on, and also ask WHY ? Question to which no answer was given, but my opinion is that this is on purpose to limit the community edition functionalities. Why such a lie about "no differerence between editions" ?