Custom Datalist in alfresco community 6.2.0-ga

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

Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

Hello World,

 

I'm trying to create custom datalist from this example https://docs.alfresco.com/5.2/references/dev-extension-points-data-lists.html

but the model don't appear in the Data list model purpose ...

 

2 Solutions

Accepted Solutions
abhinavmishra14
Advanced

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

You may have missed to apply a mandatory amp "alfresco-share-services".  Amp can be found in the distribution package.  

https://download.alfresco.com/cloudfront/release/community/201911-GA-build-368/alfresco-content-serv...

See the steps and details here: https://docs.alfresco.com/community/tasks/alf-war-install.html

~Abhinav
(ACSCE, AWS SAA, Azure Admin)

View solution in original post

vpan
Active Member II

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

Right,

It's all good now thx a lot for your time

 

regards,

View solution in original post

10 Replies
abhinavmishra14
Advanced

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

Datalist model is now moved and part of alfresco-share-services.amp module 

In order for you to get the out of the box datalist model in classpath, you need to add following dependency:

 <dependency>
	<groupId>org.alfresco</groupId>
	<artifactId>alfresco-share-services</artifactId>
	<version>${alfresco.platform.version}</version>
	<classifier>classes</classifier>
	<scope>provided</scope>
 </dependency>	

You need to add the dependency in acs module pom.xml. It makes the datalist model available to your custom model

<!-- Import Alfresco Data List Model Definitions -->
<import uri="http://www.alfresco.org/model/datalist/1.0"   prefix="dl" />

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
vpan
Active Member II

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

thx,

but the what the way to do this ...

i don't understand ... does i have to download an extra package ??

do i have just to modify a file ..?

.... sorry i'm lost // just to create a datalist model ....

abhinavmishra14
Advanced

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

@vpan may i know where and how you are creating the datalist, are you using sdk ? 

If you are using sdk, you don't need to download any package manually, just add the dependency mentioned above so that you have the share services jar in classpath.

The amp is anyway mandatory for alfresco.war so you would have to apply that if you have setup your server using distribution package. With docker based deployment the module is by default applied. Any custom modules with your custom datalist should work fine.

If you can't see your custom model, make sure you correctly bootstrap it. Cross check all the steps and review logs to see if you can find any errors: https://docs.alfresco.com/6.2/references/dev-extension-points-data-lists.html

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
vpan
Active Member II

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution
 

I installed alfresco CE from the standard package (not dockeriser).
With the basic alfreco.war.
The list I'm trying to define
is in / tomcat / shared / alfresco / extension
...
what should I do ..?

Thank you

 
abhinavmishra14
Advanced

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

I notice that the path for extension seems to be wrong, it should be "/ tomcat / shared / classes/ alfresco / extension" NOT / tomcat / shared / alfresco / extension.

I requested you to check the log and report any errors. It is always helpful to provide the details such as logs when you expect any help from community. 

I hope you followed all the steps while setting up the services using distribution package. you can also find the steps here: https://javaworld-abhinav.blogspot.com/2020/12/setup-acs62-ga-and-ass14-distribution-stepbystep.html

One of the important steps when using distribution package for installation is that you need to apply the amps which also includes alfresco-share-servies.amp. This amp can be found in amps folder in the distribution package. 

See the details here: https://docs.alfresco.com/community/tasks/alf-war-install.html

If you have already installed the amp, you should be able to use/import ootb dataList model. Follow the steps as given here: https://docs.alfresco.com/community/references/dev-extension-points-data-lists.html

Copy the content model in $ALF_INSTALL/tomcat/shared/classes/alfresco/extension directory and also copy the context file under same directory with correct path to your custom datalist model. You can find how to deploy a model here: https://docs.alfresco.com/community/tasks/deploy-bootstrap.html

e.g. i created this datalist model named myCustomDLmodel.xml:

 

<?xml version="1.0" encoding="UTF-8"?>
<model name="xyzdl:datalistModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <description>XYZ Data List Content model</description>
    <author>xyz</author>
    <version>1.0</version>
    <imports>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
        <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
        <import uri="http://www.alfresco.org/model/datalist/1.0"   prefix="dl" />
    </imports>
    <namespaces>
        <namespace uri="http://www.xyz.com/model/datalist/1.0" prefix="xyzdl"/>
    </namespaces>
    <types>
        <type name="xyzdl:myListItem">
            <title>My List Item</title>
            <parent>dl:dataListItem</parent>
            <properties>
                <property name="xyzdl:name">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                </property>
        </type>
    </types>
</model>

 

I would copy "myCustomDLmodel.xml" to "$ALF_INSTALL/tomcat/shared/classes/alfresco/extension" directory. I would also create a spring context xml file named "custom-model-context.xml" e.g. (see the model name highlighed and the path):

<bean id="cutomModel.dictionaryBootstrap"
          parent="dictionaryModelBootstrap"
          depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <!-- Bootstrap Data List Model -->
                <value>alfresco/extension/myCustomDLmodel.xml</value>
            </list>
        </property>
    </bean>

I would also copy custom-model-context.xml to $ALF_INSTALL/tomcat/shared/classes/alfresco/extension directory and restart the services. 

Similar steps are explained here : https://docs.alfresco.com/community/references/dev-extension-points-data-lists.html

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
vpan
Active Member II

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

thank's a lot

No i'm facing with this error :

 

org.alfresco.service.namespace.NamespaceException: URI http://www.alfresco.org/model/datalist/1.0 cannot be imported as it is not defined (with prefix dl ...

abhinavmishra14
Advanced

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

You may have missed to apply a mandatory amp "alfresco-share-services".  Amp can be found in the distribution package.  

https://download.alfresco.com/cloudfront/release/community/201911-GA-build-368/alfresco-content-serv...

See the steps and details here: https://docs.alfresco.com/community/tasks/alf-war-install.html

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
vpan
Active Member II

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

Right,

It's all good now thx a lot for your time

 

regards,

EddieMay
Alfresco Employee

Re: Custom Datalist in alfresco community 6.2.0-ga

Jump to solution

Hi @vpan 

Glad you got it sorted and thanks for reporting back - useful to other users.

Cheers,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!