Hi,
I would like to add a custom control in WP Editor. Is there anyone who has done it before? Or, what alternative free editor can i use with WP and how do I intergrate it with WP?
Your input is highly appreciated.
Yes it is possible.
1. Create a class with the following signature
public class LogoControl extends JPanel implements EditWidget
2. Create a method to build the GUI and call it from within your constructor. Using Eclipse will help you know all the class and method names involved.
3. Use method
public String getContent(int type)
to pass content entered by the user for this control to the WP Editor (This should be the content within the XML tags for this element)
4. Use method
public boolean setContent(String theContent)
to set content entered by the user. This will be just the content with the tags.
5. Deploying it --> The easiest way to deploy this would be to drop the class file in the following location wp\webcomponent\library\contentxfer while preserving the package structure
6. Using the new control: To use the new contro, you will have to edit the rules file locally, i.e. not use the WP Rules Editor. Editing locally, will give you the option to reference your custom control. So you would create a rule like this
<tagcontent tag_name="small_thumbnail"> <custom classname="com.mycompany.documentum.wp.control.LabelSelectorWidget" enable_locale_fallback="N" import="Y" instruction="Small Thumbnail" label="Small Thumbnail" location="/****/app/images/bg" output_property="folderPath" property="object_name" required="Y">
</custom>
</tagcontent>
7. I dont have a sample code handy. If I find one, i'll attach to the thread.
- Ashish
Hi Borkashi,
Thank you very much for your input. I will give it try...i hate SWING...i hate it...I hate it...i hate it
Where do i get the EditWidget reference / class?
I agree. I hate, I hate, I hate swing too
You will find the EditWidget class in swingTe.jar under webcomponent\library\contentxfer.
Add all JAR files under that directory to your classpath.
All the best
Thanks, I managed to get the EditWidget reference / jar
I'm about to test my widget but web publiher is giving me grief. It's throwing some errors when i try to create a web site using a wizard or when i go to the inbox. I have seen this error before, just can't remember what i did to fix it (I think i had to set BOF username and passord). Will see and update you.
I did swing component, but it doesn't display on Editor. When you say i will need to edit rule file locally, what do you mean exactly? do i have to export rule file to my machine, make changes, then import it again?
Anyone?
Please help.
HI
I am working on the same stuff, I am getting Class not found exception , do you got this to work. If so can you share how we can acheive this.
Thanks