Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Create Button
Terence
Hi all,
I'm using WorkSite MP 4.1
I need to add a button in present web component to provide some extra function due to client request.
I would like to ask, does someone have this kind of experience and can share with me???
Thx.
Terence.
Find more posts tagged with
Comments
Nicholas
Terence, you could add the new button, what problem you are facing?
Thanks Nicholas
Migrateduser
You can do it by customizing the JSP page in which you would like to add the button. You can access the Web Components Config Tool at
http://<server
ort>/worksitemp/config.jsp
. Please follow the online documentation if you are not familiar with the tool.
The recommended way to add this button is to add a new menu item on the page, by editing the menu section.
I can provide more details if you give me specifics
-bijoy
Terence
Now I can create a button inside the web-component.
For Example, once user click the button, it automatically create a new document folder.
I would like to ask can the button trigger a java program to start when user press it???
Since I read WOM Develpers Guide, it's seems that we need to write java program to use the API provided.
or does javascript can done the same thing rather that wirte java program?
Thx.
Terence
Migrateduser
Yes, you can write a custome WorkSite MP command to add this functionality. You need to extend the BaseCommand in the worksitemp.jar (the main web app library file located in WEB-INF/lib) and implement execute() method to perform your actions through Java WOM API. Unfortunately there is no documentation available on this front. But if you understand Java well, you can easily do this by looking at the other BaseCommand extensions.
You cannot use JavaScript (which runs on the client side browser) to call WOM methods.
-bijoy
Terence
How about I write the java program as a javabean and create my own jsp to call it????
is it possible???
Thx for for help.
Terence.
Migrateduser
Yes, that is an easier way to accomplish this. But adding a command to MP's common framework is the right (and recommended way) to do it. Error handling can become problematic/tricky if you use JSP approach.
Terence
May I ask what is MP's common framework ???
Migrateduser
By Common Framework, I meant using the command class that extends from BaseCommand class. I need to admit also that there is very little documentation on this stuff. You kind of have to use the Java Reflection on an IDE to figure out more details. In a nutshell, you need to extend the abstract class com.imanage.workteam.command.BaseCommand and implement the following method.
public abstract void execute(AppCommandRequest request, CommandResponse response) throws WtAppException;
When the request reaches this method, you are already authenticated and the http request/response are wrapped in CommandRequest/CommandResponse objects. You can obtain the authenticated AppSession from CommandRequest.getSession() method.
Package your command and the additional classes, if any, into a JAR file. Add this JAR file into your WEB-INF/lib directory using the Config Tool Files Manager. You can now specify this custom command in an existing or new Command Registration for a Component in Config Tool.
Please let me know if you have issues.
-bijoy