Problem: Im trying to develop a Confluence plugin for the first time in my life. I need to create a configuration screen for my plugin in the system administration screen. I already have created the Web Section and the Web-Item for it, as follows:
<web-section name="Archive" i18n-name-key="archive.name" key="archive" location="system.admin" weight="10"> <description key="archive.description">The Archive Plugin</description> <label key="archive.label" /> </web-section> <web-item name="Manage Revisions" section="system.admin/archive" weight="500" key="manage_revisions"> <description>Configuration</description> <label key="archive.section.revisions" /> <link linkId="manage-revisions">/admin/plugins/archive/view.action</link> </web-item>
Also, i already have created the Xwork/action element, as follows:
<xwork name="archiveaction" key="archiveaction"> <package name="archive" extends="default" namespace="/admin/plugins/archive/"> <default-interceptor-ref name="defaultStack"/> <action name="view" class="com.grendene.plugin.xwork.ArchiveAction" method="view"> <result name="success" type="velocity">/templates/archiveaction.vm</result> </action> </package> </xwork>
The problem is that when i try to access the web-item, an error shows up telling that the page was not found. I spent almost 2 days trying to solve this problem, but i just cant find where i'm missing something, because i copied the skeleton from an Confluence Plugin that is already in the Marketplace and works.
Also, the packaging of my JAR seems to be alright (every file that should be in the jar IS in the jar).
Could somebody help me with this ?
Community moderators have prevented the ability to post new answers.
There's a couple of things you'll want to check
com.atlassian.confluence.plugin.descriptor.XWorkModuleDescriptor
, and see if you can spot the module in your plugin loading (you might have to re-install the plugin after putting in the breakpoint in the init()
method).
The module is working, and i've managed to access a blank page that i THINK is my .vm with the following address: http://gra_dti_035335n:1990/admin/archive/view.action (removed the "/confluence/" after the first slash). Also, it is being shown full-screened, and i want the .vm content to appear on the right side of the admin console. How i manage to do that ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem Solved! Looked through the startup of tomcat and found that the webwork class was not implementing Action. Thanks for the help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello!
I found this post after scratching my head for a while on the same issue. It turns out the package name="archive-page" element and the action name="archive-page" need to be unique from other xwork entries and be named the same within the same xwork plugin.
Hopefully this helps someone out down the line.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rodolfo,
developing UI related modules is little trickey as your targeting Dev and Confluence instance.
i would suggest below points.
1) check your web-work action is loded into the plugin area from anaged plugins you should see plugin module details.
once you find the plugin module is updated it means problem with accessing url only.
Accessing web-work URL goes through 2 cycles
* ) Accessing URL From Dev Enviornent :localhost:1990 it is little diffrent from accessing url on 8090 confluence instance. you should avoid base url.
http://localhost:1990/admin/archive/view.action
*) Accessing URL From Confluence Instance after installing plugin should go as : http://localhost:8090/confluence/admin/archive/view.action :
all the best.
Tousif Shaikh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Tousif. The module is enabled. I've tried to access the page with the link you provided (without "/confluence/") and i've got a white screen. I don't know if this means it worked, because i expected to see a "Hello world" (that's what my .vm has atm). Also, how do i make my page appear in the right side of the admin console panel? I don't want it to appear without the admin options on the left. Thanks!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok and whats the URL you type in the browser to call the action and thereby get a page not found?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When i click my web-item in the administration console it redirects me to http://localhost:1990/confluence/admin/archive/view.action
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, one thing to try out and one thing to check: 1) In the xml file, change key="manage_revisions" to key="manage-revisions" 2) If the above doesnt work, check if your VM file is in place. Based on whats there in the descriptor, it should be under resources/templates folder - confirm if it is.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1) changed the key but still not working 2) it was in the older src/main/java/templates. Changed to src/main/resources/templates but still no deal... :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, 2 things - can you show me how your vm looks like? And when you moved your vm to the right directory, did you do make sure that you are using the newly built jar?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oh and yes, when you do a new build , make sure that you clear the browser cache as well ....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello and thanks for replying Yagnesh.
I've removed the last "/" from the namespace but i still got the problem. Here is how my code looks like after changing that
<web-section name="Archive" i18n-name-key="archive.name" key="archive" location="system.admin" weight="10"> <description key="archive.description">The Archive Plugin</description> <label key="archive.label" /> </web-section> <web-item name="Manage Revisions" section="system.admin/archive" weight="500" key="manage_revisions"> <description>Configuration</description> <label key="archive.section.revisions" /> <link linkId="manage-revisions">/admin/archive/view.action</link> </web-item> <xwork name="archiveaction" key="archiveaction"> <package name="archive" extends="default" namespace="/admin/archive"> <default-interceptor-ref name="validatingStack" /> <action name="view" class="com.grendene.plugin.xwork.ArchiveAction"> <result name="success" type="velocity">/templates/archiveaction.vm</result> </action> </package> </xwork>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Whats the URL you are using to access the web-item? My first attempt to fix this would be to remove the last "/" from here :
namespace="/admin/plugins/archive/"
Try this too and let me know - we can take it on from there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.