He cogido este post:
The object to remove the widget definition from (you can typically just use “model.jsonModel“)
The attribute to search for (you should use “id“)
The value to match against the target attribute (the “id” attribute of the widget definition to remove)
So for example to remove the “My Files” link from the menu bar you would need to include the following code in your “share-header.get.js” extension:
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_MY_FILES");
Before the module is deployed the header is as follows:
————————————————————————–
Parece muy claro así que me ido a:
vi /opt/alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/header/share-header.get.js
Y he añadido al final widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_MY_FILES");
Quedadno el fichero asi:
<import resource="classpath:/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js">
model.jsonModel = {
rootNodeId: "share-header",
services: getHeaderServices(),
widgets: [
{
id: "SHARE_VERTICAL_LAYOUT",
name: "alfresco/layout/VerticalWidgets",
config:
{
widgets: getHeaderModel()
}
}
]
};
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_MY_FILES");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_MY_FILES");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_REPOSITORY");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_PEOPLE");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SITES_MENU");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_HOME");
Reinicio Alfresco y desaparece My files pero no todo lo demas, imagino que me estoy dejando de hacer algo pero me falta un empujon para entender como funciona, lo agradezco.