summaryrefslogtreecommitdiff
path: root/wotonomy-test/src/main/java/DirectAction.java
blob: f5dc85135d243e1db6bc00aa20c13dd7e88e0829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

import java.io.PrintStream;
import java.util.Date;
import net.wotonomy.foundation.NSArray;
import net.wotonomy.foundation.NSDictionary;
import net.wotonomy.web.*;

public class DirectAction extends WODirectAction {

    private Date testing;

    public DirectAction(WORequest aRequest) {
        super(aRequest);
        testing = new Date();
        System.out.println("DirectAction()");
    }

    public WOActionResults defaultAction() {
        return pageWithName("Main");
    }

    public Object getTesting() {
        return testing;
    }

    public void setTesting(Date anObject) {
        testing = anObject;
    }

    public WOActionResults testAction() {
        System.out.println("DirectAction.testAction()");
        takeFormValuesForKeyArray(request().formValues().allKeys());
        WOResponse response = new WOResponse();
        response.appendContentString("This is really just a test.");
        response.appendContentString("<p>");
        response.appendContentString(Application.application().name());
        response.appendContentString("<p>");
        response.appendContentHTMLString("<p>");
        response.appendContentString("<p>");
        response.appendContentString(getTesting().toString());
        response.appendContentString("<p>");
        response.appendContentString(request().formValues().toString());
        response.appendContentString("<p>");
        response.appendContentString("browserLanguages: ");
        response.appendContentString(request().browserLanguages().toString());
        response.appendContentString("<p>");
        response.appendContentString("uri: ");
        response.appendContentString(request().uri().toString());
        response.appendContentString("<p>");
        response.appendContentString("adaptorPrefix: ");
        response.appendContentString(request().adaptorPrefix().toString());
        response.appendContentString("<p>");
        response.appendContentString("applicationName: ");
        response.appendContentString(request().applicationName().toString());
        response.appendContentString("<p>");
        response.appendContentString("requestHandlerKey: ");
        response.appendContentString(request().requestHandlerKey().toString());
        response.appendContentString("<p>");
        response.appendContentString("requestHandlerPath: ");
        response.appendContentString(request().requestHandlerPath().toString());
        response.appendContentString("<p>");
        response.appendContentString("requestHandlerPathArray: ");
        response.appendContentString(request().requestHandlerPathArray().toString());
        response.appendContentString("<p>");
        response.appendContentString("method: ");
        response.appendContentString(request().method().toString());
        response.appendContentString("<p>");
        response.appendContentString("content: ");
        return response;
    }
}