Search for proposed content


To search for your proposed content, you can define a dedicated back-office search engine, with specific access rights.

Below is an example of plugin Classified Ads, which defines a search engine dedicated to classified ads:

<feature name="org.ametys.plugins.classified.ads.search"> 
    <extensions> 
        <extension id="search-ui.classified.ads" 
point="org.ametys.cms.search.ui.model.SearchUIModelExtensionPoint" 
config="search/ads.xml"> 
        </extension> 

        <extension point="org.ametys.core.right.RightsExtensionPoint" 
id="org.ametys.plugins.classified.ads.search.right"> 
            <right id="Classified_Ads_Right_BOSearch"> 
                <label>PLUGINS_CLASSIFIED_ADS_CONTENT_ADS_SEARCH_RIGHT_LABEL</label> 
                <description>PLUGINS_CLASSIFIED_ADS_CONTENT_ADS_SEARCH_RIGHT_DESC</description> 
                <category>PLUGINS_CLASSIFIED_ADS_CONTENT_ADS_RIGHT_CATEGORY</category> 
            </right> 
        </extension> 

        <extension id="org.ametys.plugins.classified.ads.Search" 
point="org.ametys.core.ui.RibbonControlsManager" 
class="org.ametys.core.ui.StaticClientSideElement"> 
            <class name="Ametys.ribbon.element.ui.button.OpenToolButtonController"> 
                <opentool-id>uitool-web-search</opentool-id> 
                <opentool-params> 
                    <id>search-ui.classified.ads</id> 
                    <title i18n="true">PLUGINS_CLASSIFIED_ADS_CONTENT_ADS_SEARCH_LABEL</title> 
                    <description i18n="true">PLUGINS_CLASSIFIED_ADS_CONTENT_ADS_SEARCH_DESC</description> 
                    <icon-glyph>ametysicon-newspaper1</icon-glyph> 
                    <icon-decorator>decorator-ametysicon-magnifier12</icon-decorator> 
                    <icon-decorator-type>action-default</icon-decorator-type> 
                </opentool-params> 
                <label i18n="true">PLUGINS_CLASSIFIED_ADS_CONTENT_ADS_SEARCH_LABEL</label> 
                <description i18n="true">PLUGINS_CLASSIFIED_ADS_CONTENT_ADS_SEARCH_DESC</description> 
                <icon-glyph>ametysicon-newspaper1</icon-glyph> 
                <icon-decorator>decorator-ametysicon-magnifier12</icon-decorator> 
                <icon-decorator-type>action-default</icon-decorator-type> 
            </class> 
            <right context-prefix="/cms">Classified_Ads_Right_BOSearch</right> 
            <depends> 
                <org.ametys.core.ui.UIToolsFactoriesManager>uitool-web-search</org.ametys.core.ui.UIToolsFactoriesManager> 
            </depends> 
        </extension> 
    </extensions> 
</feature>    

To add this button to the ribbon, the ribbon must be overloaded.

For example, plugin Classified Ads adds a button to the "Tools" group of the Home tab like this:

<tab label="plugin.cms:RIBBON_TABS_TAB_HOME_LABEL" override="true">   
    <groups>   
       <group label="plugin.cms:RIBBON_TABS_TAB_HOME_GROUPS_GROUP_TOOL_LABEL" override="true" controlsOrder="0.30">   
         <control id="org.ametys.plugins.classified.ads.Search"/>   
       </group>   
     </groups>   
</tab>   
Back to top

UGC