Daily Archives: September 27, 2017

WebObject questions

Q: How I can change the templates of Java files, which Eclipse creates for a new WebObject Application?
A: I found the template files within the Eclipse plugin folder:
/home/arothe/WODevelopment/Tools/eclipse-java-neon-3/plugins/org.objectstyle.wolips.templateengine_4.6.20170831.10/ProjectTemplates/<project type>/Sources/__basePackage_folder__
There it is possible to add the changed _isSupportedDevelopmentPlatform() method for Linux.

Q: How I can add actions or keys to a component?
A: Hold down the STRG key and click with the left mouse button on the name of the action/key within the WOD file view. This will add Java code to the associated Java file if the implementation doesn’t exist, or it will navigate you to the method in the Java file.

Q: Which bindings are possible for a component?
A: Open the WOD-file and click on a component entry. Press CTRL+Space to open a list of valid properties. Another method is to open the view “Bindings” of WOLips.

Q: How I can set the WebObjects and WOnder API Docs to get a mouse over help in Eclipse?
A: The JavaDocs are linked on WOCommunity.org. All libraries, which you can add to the project build path, have a property called javadoc, which is set by WOLips to the content of wo.api.root (defined within wolips.properties). So the best way would be to mirror the necessary JavaDoc files into that directory. Try to use:

# cd /home/arothe/WODevelopment/Libraries/WOnder/Developer/Documentation
# wget -nH --cut-dirs=2 --no-parent --recursive --level=inf --page-requisites --wait=1 --reject-regex='index.html\?(.*)' http://wocommunity.org/documents/javadoc/WebObjects/5.4.2/

It is not possible to use the URL direct as JavaDoc location on the build path, it will be overwritten by WOLips with the configured wo.api.root entry. The property must be a valid filesystem folder, an URL is not allowed. So the simplest solution is to copy all files into a local folder.

Q: How I can display the content of a database table within a web page?
A: It is possible to display multiple records with WORepetition. There you can set a list of records (as NSArray or List, which comes back from a Database query). The attribute “item”is the current record within the table. So you can refer to it on a click or something. For every attribute of the EnterpriseObject you have to use e.g. a WOString, the “value”is mapped to item.attribute. You can also use a method within the page component class, which translates the DB attribute into a huma-readable value.

WebObjects and GWT

Today I had the idea, that I could use GWT (Google WebToolkit) together with WebObjects. I’m not a HTML programmer, so my webpages are not really nice. It would be better to develop Javacode and put the web components together with a framework.

On the internet I found a tool to combine WebObjects and GWT: WOGWT.

First I downloaded the GWT plugin for Eclispe 4.6: Install instructions.

First problem could be: the GWT version is now 2.7, but the WOGWT uses 2.5?

Download the WOGWT latest version 0.6 and unzip it into /home/arothe/Libraries/WOnder/Library/Frameworks. Now it is time for a simple Hello World example project. I created a new WebObject Application within Eclipse and added the new WOGWT framework to the build path.

The application doesn’t start, I have to add both ERExtensions and ERJars framework.

Now I have to set the path to the GWT SDK within the Eclipse preferences. But it doesn’t work, because there is not “tools” folder. I think, that is the time to download the whole SDK.