Rule Lists
Below are some commonly used rules and information on keys which control D2W templates. You may wish to keep your own library of commonly used D2W rules, something like "D2WRuleLibrary.d2wmodel", which can then be used to copy and paste rules into your projects.
For quick reference:
1. How do I make my attributes and entities editable?
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
2. How do I make my relationships editable in ERD2W? (They are already are editable in D2W.)
Add two rules. This:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
and the below:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
3. Similarly how do I make my relationships display nicely in an Inspect page in ERD2W? By default they show up as an array fault.
There are many possible components to choose from. These are just a couple as an example.
Add two rules. This:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
and the below:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
4. I don't like the defaults for attributes that D2W chooses. Sometimes it chooses wisely, but not always. How do I change what gets displayed for an entity's attributes?
The key is: displayPropertyKeys. This key represents a list of attributes to display for an entity. An example rule:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Note that you can pick attributes across relationships. You now have total control of what gets displayed.
5. If you want to use WOL:Click to Open for your D2W project, you'll need to disable it when you are generating ERExcelLook pages or the resulting Excel file will be unreadable gibberish.
The key is: clickToOpenEnabled. This key is on ERD2WPage and controls whether clickToOpen is enabled for that specific page. An example rule:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
6. How do I control the list of visible Entities in my PageWrapper? My select entity popup is showing entities I don't want to be visible (ERAttachment, Lookup values, etc).
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
7. How do I easily use my own custom component in a Direct to Web page?
Step 1:
Add the following rules to your rule file:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Step 2:
Create a component in your project named 'MyThePropertyComponent' and give it an 'object' and 'key' binding. The object will receive the current object, and the key will receive the current propertyKey (as a string) from DirectToWeb. Do with them what you will.
public EOEnterpriseObject object() {
return (EOEnterpriseObject) valueForBinding("object");
}
public String key() {
return (String) valueForBinding("key");
}
8. How do I use features such as sections and tabs with the rules?
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
The second rule will give you:
Tabs: Foo, Bar
Sections under Foo: FooBar, FooBaz
Like:
FooBar
title
category
dateReleased
FooBaz
plotSummary
posterName
9. A simpler way to specify this stuff is:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
10. Changing the display name for a PageConfiguration
You may want to use a Page Configuration Name that is consistent with the rules for your application (uses an EntityName), but it looks weird when it is parsed for display in the default way.
For example, in Bugtracker there is a page configuration named "EditMyPeople" which makes perfect sense for the rules, but not too much as an "Edit My Profile" page. The easy way around it is:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
However, it is better practice to get labels out of the rules altogether unless you want to make use of variables inside them. You put labels in your Localizable.strings file. If you just want plain text, no rule is necessary. For the following examples, "MyDocuments" is the pageConfigurationName.
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
This entry can be used with no associated rule and it will do the right thing.
If you want to use the @@session.variable.blah@@ in your pageConfigurationNames, you'll need to use a rule with a delayed assignment.
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Adding a normal component to a ModernDirectToWeb App
Suppose you have a component somewhere that you would like to use to a direct To Web App as an extra option, under the tab section. How do get this component to work with the rest of the Direct To Web App?
The way to do this is described in some mails , but it took me some time to understand all the intricacies, so here it goes:
We have a component HelloWorld, that consist of the following contents:
HelloWorld.wo:
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
What is your name?Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld.java
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
com.webobjects.appserver.WOContext;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
er.extensions.components.ERXComponent;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
ERXComponent {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld(WOContext context) {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
(context);
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
ERXComponent fixUserName() {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld aPage = (HelloWorld) pageWithName(Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
);
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String extendedUserName=Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
(username()=Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
){
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
} Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
{
extendedUserName=Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
aPage.setUserNameExtended(extendedUserName);
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
aPage;
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String username() {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
setUsername(String username) {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
.Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
= username;
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String userNameExtended() {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
setUserNameExtended(String userNameExtended) {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
.Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
= userNameExtended;
}
}
========================
Normally, this Component will pickup a username, and will create a correct user name.
Now suppose we want to make this component a Direct To Web Component.
First I will do the obvious:
I will add the component to the NavigationMenu.plist:
({ name = Root; children = ("Home","HelloWorld"); },
{ name = "HelloWorld"; action = "HelloWorld"; },
{ name = "Home"; action = "session.navController.homeAction"; })
If you just do that, the result will be something like this if you click on the HelloWorld tab of your application:
| Reason: | <er.extensions.appserver.navigation.ERXNavigationMenuItem name: er.extensions.appserver.navigation.ERXNavigationMenuItem subcomponents: null > valueForKey(): lookup of unknown key: 'HelloWorld'. The WOComponent er.extensions.appserver.navigation.ERXNavigationMenuItem does not have an instance variable of the name HelloWorld or HelloWorld, nor a method of the name HelloWorld, HelloWorld, getHelloWorld, or getHelloWorld |
The reason is that you should have some subcomponent in navigation.ERXNavigationMenuItem, which in our case runs MainNavigationController. So we have to add an action to MainNavigationController:
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
ERXComponent helloWorld() {
ERXComponent nextPage = Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
nextPage = (HelloWorld) myApp().pageWithName(HelloWorld.Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
.getName(),session().context());
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
nextPage;
}
We still are getting errors:
| Reason: | <er.extensions.appserver.navigation.ERXNavigationMenuItem name: er.extensions.appserver.navigation.ERXNavigationMenuItem subcomponents: null > valueForKey(): lookup of unknown key: 'HelloWorld'. The WOComponent er.extensions.appserver.navigation.ERXNavigationMenuItem does not have an instance variable of the name HelloWorld or HelloWorld, nor a method of the name HelloWorld, HelloWorld, getHelloWorld, or getHelloWorld |
Perhaps add the session stuff to the NavigationList, so we change the navigation list item of HelloWorld to:
{
name = "HelloWorld";
action = "session.navController.helloWorld";
},
And indeed, we do get a response, but not what we expected:
Where is the menu? Ahh, we forgot the PageWrapper to wrap the page:
====================================
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
What is your name?Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
====================================
This should create all the menu's etc. Unfortunately, running this will result in the error:
Unknown macro: noformat. Click on this message for details.
The [noformat] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
The reason is that PageWrapper needs the component that is wrapped to have a D2WContext. ERXComponent does not have a D2WContext. So we change the HelloWorld class to ERD2WPage:
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
ERD2WPage {
That, unfortunately results in this error:
Apr 19 17:20:52 PSTennisExtended54682 WARN NSLog - <com.webobjects.appserver.private.WOComponentRequestHandler>: Exception occurred while handling request:
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
2011-4-19 17:20:52 CEST <WorkerThread4> Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
at er.directtoweb.pages.ERD2WPage.appendToResponse(Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
)
The reason being, that a page should be constructed via D2WFactory, instead of myApp().pageWithName. Looking at the code, you will find that line 644 tries to get something out of d2wcontext, which only gets created via the D2WFactory:
String info = "(" + d2wContext().dynamicPage() + ")";
But the D2wFactory creates pages via rules, if you do not add a couple of rules you will get this error:
| Error: | java.lang.IllegalStateException: Couldn't find the dynamic page named HelloWorld in your DirectToWeb model.task and entity is null, it seems that one model, maybe ERDirectToWeb d2w.d2wmodel is not loaded |
The reason that you get this error is because every DirectToWebpage should have an entity, and a task. And you have to make sure that the templateNameFortaskPage for that task points to your component:
pageConfiguration = 'HelloWorld' => entity = "Contacten" com.webobjects.directtoweb.EntityAssignment
pageConfiguration = 'HelloWorld' => task = "inspect" com.webobjects.directtoweb.Assignment
pageConfiguration = 'HelloWorld' => templateNameForInspectPage = "HelloWorld" com.webobjects.directtoweb.Assignment
100
: pageConfiguration = 'HelloWorld' => task = "inspect" com.webobjects.directtoweb.Assignment
100 : pageConfiguration = 'HelloWorld' => templateNameForInspectPage = "HelloWorld" com.webobjects.directtoweb.Assignment

We are nearly there.We just have to fix the navigationstate of the tab menu, which we can do via the rule:
pageConfiguration = 'HelloWorld' => navigationState = "HelloWorld" com.webobjects.directtoweb.Assignment 
And a submit will lead to:

The reason is that all the responses in the component should also be created as a D2WPage. Our action fixUsername() created a WOComponent but not in the D2WFactory.
We fix that by replacing
HelloWorld aPage = (HelloWorld) pageWithName(Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
);
with:
HelloWorld aPage = (HelloWorld) D2W.factory().pageForConfigurationNamed(Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
, session());
And there we go: 
So resume:
HelloWorld.java:
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
com.webobjects.appserver.WOContext;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
com.webobjects.directtoweb.D2W;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
er.directtoweb.pages.ERD2WPage;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
ERD2WPage {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld(WOContext context) {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
(context);
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
ERD2WPage fixUserName() {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
HelloWorld aPage = (HelloWorld) D2W.factory().pageForConfigurationNamed(Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
, session());
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String extendedUserName=Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
(username()=Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
){
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
} Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
{
extendedUserName=Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
aPage.setUserNameExtended(extendedUserName);
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
aPage;
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String username() {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
setUsername(String username) {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
.Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
= username;
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
String userNameExtended() {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
setUserNameExtended(String userNameExtended) {
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
.Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
= userNameExtended;
}
HelloWorld.wo:
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
What is your name?Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
{
name = "HelloWorld";
action = "session.navController.helloWorld";
}
Extra WOComponent method in MainNavigationController:
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
WOComponent helloWorld() {
WOComponent nextPage = Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
;
nextPage = D2W.factory().pageForConfigurationNamed(Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
, session());
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
nextPage;
}
Unknown macro: color. Click on this message for details.
The [color] macro is not in the list of registered macros. Verify the spelling or contact your administrator.
Additional tips for ERExcelLook