Disable adding gadgets
Is it possible to disable the adding gadgets button in the dashboard? I tried to search some extension point, but I found nothing about it…
Hi,
Those actions are currently defined in the xhtml template. To override it and remove the Add gagdet
action, you need to override the user_opensocial_dashboard.xhtml
template in nuxeo.war/incl/dashboard/
in your own bundle and remove the following line:
<a id="addGadgetButton" href="#{baseURL}site/gadgets?language=#{localeSelector.language}">#{messages['label.opensocial.container.add.gadget']}</a>
<component name="org.nuxeo.dashboard.dashboard" version="1.0">
<extension target="org.nuxeo.ecm.platform.actions.ActionService" point="actions">
<action id="DashboardMain" link="/incl/dashboard/user_opensocial_dashboard.xhtml"/>
</extension>
</component>
In my Eclipse project it works, but when I create the corresponding jar and put it into the plugins folder of my nuxeo distribution, it returns an error (it does not find the .xhtml) or simply it does nothing.
You just need to override the template in your bundle and put the following require
in your deployment-fragment.xml
to be sure that your template will be deployed after the default one in Nuxeo:
<require>org.nuxeo.ecm.user.center.dashboard.opensocial</require>
<fragment version="1">
<require>org.nuxeo.ecm.user.center.dashboard.opensocial</require>
<install>
<unzip prefix="web" to="/" from="${bundle.fileName}">
<include>web/nuxeo.war/**</include>
</unzip>
</install>
</fragment>
Any other idea?
user_opensocial_dashboard.xhtml
file is deployed on your server (in nxserver/nuxeo.war/incl/dashboard/
)?nxserver/nuxeo.war/incl/dashboard/
? There should be at least the default xhtml templates of Nuxeo regarding the Dashboard.- rename the xhtml file user_opensocial_dashboard.xhtml by user_opensocial_dashboard2.xhtml
- build again your project
- copy your jar (from target/name_of_your_project-version.jar) in $Nuxeo/nxserver/bundles
- Start again your server
Can you check that $nuxeo/nxserver/nuxeo.war/incl/dashboard/user_opensocial_dashboard2.xhtml exists. I want to check if the problem you have is the order of deployment or the deployment itself.
It is strange, in the same distribution I've already deployed other plugins…
Here is the fast way to make your stuff working:
- Create a Nuxeo Plugin Project with Nuxeo IDE
- Create a web/incl/dashboard directory in src/main/resources/
- copy you xhtml
- do "mvn install" into the root of the project
- copy the jar created into the bundle
You will not need to have to create the deployment-fragment.xml
The longer way will be to check all the element of your current project. Here is the checklist you can follow:
Unzip your jar. look if you have into the root of your jar a directory web/nuxeo.war/incl/dashboard with your xhtml in it.
check that your deployment-fragment is exactly this one:
<?xml version="1.0"?> <fragment version="1"> <require>org.nuxeo.ecm.user.center.dashboard.opensocial </require> <install>
<!-- unzip the war template --> <unzip from="${bundle.fileName}" to="/" prefix="web"> <include>web/nuxeo.war/**</include> </unzip>
</install> </fragment>
check that your MANIFEST is well formed (you have to know that the JVM is really strict on the format. we give here thing to take care into the Create a "MANIFEST.MF" file section (red square).
be careful of your bundle name, check that you don't have named like another bundle deployed
check that you don't have 2 versions of your project deployed into the nxserver/bundle server.
Maybe other elements but I see just these ones.
Can you unzip the jar generated and list the content.
Inside the bundle, you can find the following folders and files:
META-INF
…….|_MANIFEST.MF
…….|_maven (with other sudirectories…will I post those too?)
org
..|_nuxeo
……..|_dashboard
………………|_dashboard.class
OSGI-INF
…….|_extensions
……………..|_deployment-fragment.xml
……………..|_dashboard.xml
web
..|_nuxeo.war
………..|_incl
…………….|_dashboard
……………………..|_user_opensocial_dashboard2.xhtml
nuxeo-user-dashboard-opensocial-5.5.jar
in $Nuxeo/nxserver/bundles
?During these days my distribution must have decided that it was time to stop those strange behaviours… I put the deployment-fragment into OSGI-INF directory and now, FINALLY, it works!!! However I'm quite sure to have already tested this solution, without results…but now it works and that's all! Thank you very much for the help :) !!