Share customtization - Advanced Search does not have my custom type

cancel
Showing results for 
Search instead for 
Did you mean: 
Established Member

Share customtization - Advanced Search does not have my custom type

Jump to solution

I am using Alfresco Community 5.2. I used Alfresco Maven SDK 3.0 to generate AMPs for the repository tier and share UI tier. I did customization in the share config custom XML, etc.

During customization of Share UI, when I execute the run.bat (that is in the customization folder), in the Advanced Search, in the Look For dropdown, I am able to see the (all the) custom types I defined, along with Content & Folders.
But when I deploy (apply) the same AMPs in 5.2 community server, and restarted Alfresco service, I could not see the same types in the Advanced Search Look For dropdown. In 5.2 community server, however, please note that the custom aspect properties (of the types) do show up in the Edit Properties of an image or file that I uploaded. So, the aspect and the properties are recognized. Also, I can define a rule on a folder to specialize to one of these custom document types.

Gnanasekaran Sakthivel
1 Solution

Accepted Solutions
Moderator
Moderator

Re: Share customtization - Advanced Search does not have my custom type

Jump to solution

Check whether any exsting amps are overding the share advanced search form. Make sure any addtional amp/add-on etc. has not set the config as "replace=true". see example below:

<config evaluator="string-compare" condition="AdvancedSearch" replace="true">
        <advanced-search>
            <forms>
                <!-- Standard out-of-the-box types -->
                <form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content
                </form>
                <form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form>

                <!-- Custom type -->
                <form labelId="form.label.advancedsearch.acmeDocument"
                      descriptionId="form.description.advancedsearch.acmeDocument">acme:document
                </form>
            </forms>
        </advanced-search>
    </config>

Remove "replace=true" if there is any and try again. When using "replace=true", you need to be very careful.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)

View solution in original post

5 Replies
Moderator
Moderator

Re: Share customtization - Advanced Search does not have my custom type

Jump to solution

Check whether any exsting amps are overding the share advanced search form. Make sure any addtional amp/add-on etc. has not set the config as "replace=true". see example below:

<config evaluator="string-compare" condition="AdvancedSearch" replace="true">
        <advanced-search>
            <forms>
                <!-- Standard out-of-the-box types -->
                <form labelId="search.form.label.cm_content" descriptionId="search.form.desc.cm_content">cm:content
                </form>
                <form labelId="search.form.label.cm_folder" descriptionId="search.form.desc.cm_folder">cm:folder</form>

                <!-- Custom type -->
                <form labelId="form.label.advancedsearch.acmeDocument"
                      descriptionId="form.description.advancedsearch.acmeDocument">acme:document
                </form>
            </forms>
        </advanced-search>
    </config>

Remove "replace=true" if there is any and try again. When using "replace=true", you need to be very careful.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)

View solution in original post

Established Member

Re: Share customtization - Advanced Search does not have my custom type

Jump to solution

That is a good find.
Another model we deployed a year back as amps has replace=true (only for the Advanced Search configuration). 
These amps are already applied to the existing Alfresco Community 5.2. 
Now, how would I go about fixing this.

Recreate only the share amp for the other model by setting replace=false
From alfresco installation, take away the previous amp of this other model
Put this new amp in place
Do applyamps

Would this work?
I guess I do not have to change the repository tier amp since there is no change.


 

 

Gnanasekaran Sakthivel
Moderator
Moderator

Re: Share customtization - Advanced Search does not have my custom type

Jump to solution

Like i mentioned do not use repace=true unless you know its impact and intention. 

Here is what you can do, if you have those amps are part of SDK, just find the share config and remove "replace=true" save it, generate amps with updates and re-apply those amps. 

If not using sdk, then :

- Copy the share amps locally

- Unpack it (you can rename the amp to .zip and extract its content)

- Find share config

- Remove "replace=true", Save the share config

- Package it again (if renamed as zip, you can package as zip and then rename it back to .amp) and apply the amps on share.war

Yes, no change on repo amps.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)
Established Member

Re: Share customtization - Advanced Search does not have my custom type

Jump to solution

Thank you.
I recreated my share amp (Alfresco Maven SDK).

I unstalled the amp following this - https://docs.alfresco.com/6.1/tasks/uninstall-amp.html 

java -jar bin/alfresco-mmt.jar uninstall <ModuleId> <WARFileLocation>

Then reinstalled the share amps (by running apply_amps.bat). 
It worked, meaning I am able to see both custom document types in the advanced search "Look For" drop down

Gnanasekaran Sakthivel
Moderator
Moderator

Re: Share customtization - Advanced Search does not have my custom type

Jump to solution

Glad to hear that it worked for you.

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)