Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable some options from "Membership Link Mode" list #7

Open
mhshinde opened this issue Sep 5, 2018 · 2 comments
Open

Disable some options from "Membership Link Mode" list #7

mhshinde opened this issue Sep 5, 2018 · 2 comments

Comments

@mhshinde
Copy link

mhshinde commented Sep 5, 2018

Under "Membership Mode" there are a total of four options, I want to disable following options

  • Parent Site members as Consumers
  • No Link

I did changes in "siteHierarchyModel.xml", I have commented both the options but no change in the list,
<aspect name="aco6sh:childSite"> <parent>aco6sh:hierarchySite</parent> <properties> <property name="aco6sh:autoMembershipMode"> <type>d:text</type> <protected>true</protected> <mandatory>true</mandatory> <default>systemDefault</default> <index enabled="false" /> <constraints> <constraint name="aco6sh:autoMembershipModes" type="LIST"> <parameter name="allowedValues"> <list> <!-- <value>none</value> --> <value>systemDefault</value> <!-- <value>parentMembersAsChildConsumers</value> --> <value>childMembersAsParentConsumers</value> </list> </parameter> </constraint> </constraints> </property> </properties> </aspect>

So, what am I missing here? Is there an additional step I am not including? Do I need to edit some other properties? I'd be grateful if you could point me in the right direction.

@mhshinde mhshinde changed the title Disable some options from "Membership Mode" list Disable some options from "Membership Link Mode" list Sep 5, 2018
@AFaust
Copy link
Member

AFaust commented Sep 6, 2018

Unfortunately - due to how the create / edit site dialogs are build by default Alfresco - the constraint in the model is not used to restrict the options. You would have to customise the FreeMarker template for the dialogs themself to remove the options you do not want to provide. Check https://github.com/Acosix/alfresco-site-hierarchy/blob/master/share/src/main/site-webscripts/de/acosix/acosix-site-hierarchy/site-management-customisations/modules/create-site.get.html.ftl#L57 for the create site dialog.

@mhshinde
Copy link
Author

  1. I have removed both of the options from following files,

     -  siteHierarchyModel.xml 
       Removed line 75 and 78
    

<list>
<value>systemDefault</value>
<value>parentMembersAsChildConsumers</value>
</list>

    - create-site.get.html.ftl   
       Edited line 57, removed  "none", "childMembersAsParentConsumers" options.

<#list ["systemDefault", "parentMembersAsChildConsumers"] as mode>

    - edit-site.get.html.ftl   
      Edited line 41, removed  "none", "childMembersAsParentConsumers" options.

<#list ["systemDefault", "parentMembersAsChildConsumers"] as mode>

  1. And mvn install it.
  2. Copied relevant .amp and .jar files to alfresco-community.

By removing entries from above three files, I am able to achieve following,

  1. Both the options are not allowing to create site, it is giving an ERROR
    Could Not Create Site
    08110003 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/modules/create-site.post.json.js': 08110002 SyntaxError: Expected end of stream at char 638 (file:/home/mayuri/finalize/alfresco-community/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/create-site.post.json.js#28)

But it has not removed the options from the menu dropdown. I want to disable them in the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants