Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I want to add custom action on a windchill workspace GUI , if any body done then please share the details.
Solved! Go to Solution.
Hi @SA_9497989
There is no way without editing the WsMenuBarHelper.... (or I've never found it in my notes I wrote that WsMenuBarHelper is not extendable...)
You need a better decompilator.
PS> the class is in a wncWeb.jar so you need to remove the class from that jar file and located it in codebase folder or update it in the file..
as I said, Changing the ws menu is not supported and is too complicated.
PetrH
Hi @SA_9497989
Workspace customization UI is not supported but it does not mean you can not do it.
I just can say it is hardcoded and very very complicated. I did it several times, but it is time consuming process.
here is an article CS15567 that describes APIs used in Workspace. You can rewrite them and add own function.
com.ptc.windchill.uwgm.cadx.ws.WorkspaceActionsUrlLinkResource
com.ptc.windchill.uwgm.cadx.ws.MselUrlLinkResource
I change an another class where I just add a custom menu function
com.ptc.windchill.uwgm.cadx.ws.WsMenuBarHelper
this api can not be extended so you need to rewrite it and every new version do the customization again.
PetrH
Thanks for your suggestion , How this page Actions are loading , what is the ActionModel name ?
Hi @SA_9497989
There is not the actionModel name because it does not exists. The menu is defined in a java class .
As I mentioned earlier it is the com.ptc.windchill.uwgm.cadx.ws.WsMenuBarHelper class
PetrH
@HelesicPetr, how is adding actions in the workspace menus any different than normal Windchill actions?
Hi @avillanueva
The Workspace menu are not defined in a customActionModels so you need to change the classes where the menu is defined.
To create own action is normal procedure, with customActions but the adding custom action to WS menu is more complicated because it is hardcoded.
example of editing the com.ptc.windchill.uwgm.cadx.ws.WsMenuBarHelper class
Additionally
You need to define yours ActionDelegates and URLActionDelegates for each your action.
Create the classes and register it in a service.properties.
PetrH
this com.ptc.windchill.uwgm.cadx.ws.WsMenuBarHelper class I tried to decompile with multiple decompilers refer attached decompilers list, but no luck and not able to edit this java class.
Any other way instead of directly updating OOTB files ?
Hi @SA_9497989
There is no way without editing the WsMenuBarHelper.... (or I've never found it in my notes I wrote that WsMenuBarHelper is not extendable...)
You need a better decompilator.
PS> the class is in a wncWeb.jar so you need to remove the class from that jar file and located it in codebase folder or update it in the file..
as I said, Changing the ws menu is not supported and is too complicated.
PetrH
I am able to add action on Workspace GUI and I have implemented the following java class.
1) ActionDelegate.java ( which extends BasicWildfireNavBarActionDelegate )
2) URLActionDelegate.java
3) TemplateProcessor.java ( which extends DefaultTemplateProcessor )
after clicking button then getting following screen shot error , any thing I missed then please let me know.
Hi @SA_9497989
Check methodServer.log because this is general page error.
I guess that you can not use normal template processor
Additionally
You need to use com.ptc.windchill.uwgm.cadx.ws.WsJSTableProcessor or I used it.
I could not extend this processor so I also rewrite it. The point is that there are many private methods that you need to use but from own extended processor it is not usable from own class package
PetrH
My requirement is when I click the button then display window with ok ,cancel buttons and with some input text fields .
how can I achieve this requirement ? any idea please let me know.
Hi @SA_9497989
As I said, it is really complicated.
ActionDelegate.class has to be defined
URLActionDelegate.class has to be defined
The classes are a connection between workspace action and customaction.xml definition.
You write standard jsp pages with wizard with steps and the delegate links them
delegates need to be registered in the service.properties
ActionDelegate.class
wt.services/svc/default/wt.enterprise.ActionDelegate/AVWSActionDelegate/java.lang.Object/0=cz.aveng.AVCustomWorkspace.WSActionDelegate/duplicate
URLActionDelegate.class
wt.services/svc/default/wt.enterprise.URLActionDelegate/AVWSURLActionDelegate/java.lang.Object/0=cz.aveng.AVCustomWorkspace.WSURLActionDelegate/duplicate
PetrH