cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 6.0 advanced custom search query

pedrohernandez
Confirmed Champ
Confirmed Champ

Hello guys,

I have a custom model for my files, I added custom aspects to my nodes, Example: "Name_company:XYZ", Now I want to search for these properties on the search bar.

On internet it says something about adding a section of search on  a file name share-config-custom.xml. But I'm running alfresco on docker so, I'm not sure how to modify this file. Inside the container i know where is the file but at runtime it doesn't let me mount the volume of the file because it has the same name and it's in use and dont let me replace the file.

What would be the best approach to do this?.

Thanks for your help.

19 REPLIES 19

angelborroy
Community Manager Community Manager
Community Manager

You can include an extension from official Alfresco Share Docker image with something similar to the following:

FROM alfresco/alfresco-share:6.0

ARG TOMCAT_DIR=/usr/local/tomcat

RUN sed -i '/<\/alfresco-config>/i \
<config evaluator="string-compare" condition="CSRFPolicy" replace="true"> \n\
    <filter/> \n\
</config>\n\
' $TOMCAT_DIR/shared/classes/alfresco/web-extension/share-config-custom.xml

In the sample, CSRF filter is being disabled but you can add your configuration for the Advanced Search.

Or you can overwrite share-config-custom.xml contents by using this other approach:

FROM alfresco/alfresco-share:6.0

ARG TOMCAT_DIR=/usr/local/tomcat

COPY share-config-custom.xml $TOMCAT_DIR/shared/classes/alfresco/web-extension/share-config-custom.xml

Alternatively you can package your forms using Alfresco SDK and deploy it as a Share module (AMP or JAR)

Hyland Developer Evangelist

Oh Thank you Angel, I'll try that

cesarista
World-Class Innovator
World-Class Innovator

Or just mounting share-config-custom.xml as a local volume for share image in docker-compose.yml

Regards.

--C.

Mounting a local volume only for configuration purposes? I thought volumes were only recommended for persistence...

Hyland Developer Evangelist

cesarista
World-Class Innovator
World-Class Innovator

And why not to persist your custom configuration ? IMO, the approximation seems simpler, easier for managing and working with configuration files and you do not need to create custom images for basic / simple setups. Why to include docker RUN / COPY commands for "everything" ? I can't confirm if this is considered as a non-recommended practice from a docker point of view, maybe someone can give other arguments against it.

Regards.

--C.

I (more or less) agree with this: https://dantehranian.wordpress.com/2015/03/25/how-should-i-get-application-configuration-into-my-doc...

Anyway, I'm evaluating "docker config" for this kind of configurations.

Hyland Developer Evangelist

cesarista
World-Class Innovator
World-Class Innovator

Thanks for the link Angel Borroy‌.

Regards.

--C.

I tried to mount a local volume in the compose, but it says that the file already exist and does not allow me to replace it

Wow, I will check it.

Regards.

--C.