Changes for page Create a new WO Component

Last modified by Kieran Kelleher on 2007/12/21 14:09

From version 17.2
edited by David Holt
on 2023/11/13 11:55
Change comment: Update document after refactoring.
To version 14.1
edited by Mike Schrag
on 2005/09/24 22:50
Change comment: There is no comment for this version

Summary

Details

Page properties
Parent
... ... @@ -1,1 +1,0 @@
1 -WOL.Home.Deprecated info.WebHome
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.dholt
1 +XWiki.mschrag
Tags
... ... @@ -1,1 +1,0 @@
1 -wikitodo
Content
... ... @@ -1,51 +5,59 @@
1 -{{info title="Short video showing new component editor"}}
2 -* [[How to use Component Editor>>url:http://www.wocommunity.org/podcasts/Component_Editor_Howto.mov||shape="rect"]]
3 -{{/info}}
4 -
5 5  Let's add a new WO Component to our project.
6 6  
7 -~1. Right-Click/Ctrl-Click on the project and select "New" => "WOComponent"
3 +1. Right-Click/Ctrl-Click on the project and select "New" => "WOComponent"
4 +\\\\[[image:Picture 25.png]]
5 +\\
8 8  
9 -[[image:attach:Picture 25.png]]
10 -
11 11  ----
12 12  
13 -2. The "New WebObjects Component" dialog opens. The only required field is the WOComponent name. Let's just use the default "MyComponent" as the component name. I generally deselect "Create body tag" and "Create api file", but you can leave them if you'd like. Click "Finish" to continue.
9 +\\
14 14  
15 -[[image:attach:Picture 26.png]]
11 +1. The "New WebObjects Component" dialog opens. The only required field is the WOComponent name. Let's just use the default "MyComponent" as the component name. I generally deselect "Create body tag" and "Create api file", but you can leave them if you'd like. Click "Finish" to continue.
12 +\\\\[[image:Picture 26.png]]
13 +\\
16 16  
17 17  ----
18 18  
19 -3. You should now have a new MyComponent.java in your source folder, a MyComponent.wo folder at the project root (or whereever you decide to add the component), a wod, woo, html, and optional api file, and the Component Editor should now open to show your new component.
17 +\\
20 20  
21 -[[image:attach:Picture 27.png]]
19 +1. You should now have a new MyComponent.java in your source folder, a MyComponent.wo folder at the project root (or whereever you decide to add the component), a wod, woo, html, and optional api file, and the Component Editor should now open to show your new component.
20 +\\\\[[image:Picture 27.png]]
21 +\\
22 22  
23 23  ----
24 24  
25 -4. Switch to the "Java" tab and add the "greeting" method as defined in the picture below and save.
25 +\\
26 26  
27 -[[image:attach:Picture 28.png]]
27 +1. Switch to the "Java" tab and add the "greeting" method as defined in the picture below and save.
28 +\\\\[[image:Picture 28.png]]
29 +\\
28 28  
29 29  ----
30 30  
31 -5. Now switch to the "Component" tab, add a <webobject> tag in the HTML and save, then the WOD definition and save. Note that you must save each of the editors individually for changes to be visible – even in the split view. If your file is unsaved, you will see a "*" next to the filename in the tab at the top of the editor.
33 +\\
32 32  
33 -[[image:attach:Picture 29.png]]
35 +1. Now switch to the "Component" tab, add a <webobject> tag in the HTML and save, then the WOD definition and save. Note that you must save each of the editors individually for changes to be visible ~-~- even in the split view. If your file is unsaved, you will see a "**" next to the filename in the tab at the top of the editor.
36 +\\\\[[image:Picture 29.png]]
37 +\\**
34 34  
35 35  ----
36 36  
37 -6. Now switch to your Main.wo Component Editor "Component" tab and add a <webobject> tag named "Greeting" and save. Switch to the WOD editor and add a Greeting element that is of type "MyComponent" (you'll notice that code completion now shows MyComponent in the list, because it is a subclass of WOElement).
41 +\\
38 38  
39 -[[image:attach:Picture 30.png]]
43 +1. Now switch to your Main.wo Component Editor "Component" tab and add a <webobject> tag named "Greeting" and save. Switch to the WOD editor and add a Greeting element that is of type "MyComponent" (you'll notice that code completion now shows MyComponent in the list, because it is a subclass of WOElement).
44 +\\\\[[image:Picture 30.png]]
45 +\\
40 40  
41 41  ----
42 42  
43 -7. Adding a new Java file technically is not a violation of Hot Code Replacement, however, WO seems to not like a new HTML template appearing in your bundle that it doesn't know about. So go ahead and stop your app if it's running and then re-debug it (from the previous instructions). You should now have a "Hello!" in Main.wo is generated by the embedded MyComponent component.
49 +\\
44 44  
45 -(Note: I found no need to stop/start. It worked fine – Lachlan Deck 8 Jan 2007).
51 +1. Adding a new Java file technically is not a violation of Hot Code Replacement, however, WO seems to not like a new HTML template appearing in your bundle that it doesn't know about. So go ahead and stop your app if it's running and then re-debug it (from the previous instructions). You should now have a "Hello!" in Main.wo is generated by the embedded MyComponent component.
52 +\\\\[[image:Picture 31.png]]
53 +\\
46 46  
47 -[[image:attach:Picture 31.png]]
48 -
49 49  ----
50 50  
51 -8. Continue on to see how to [[doc:documentation.Add a Framework Dependency]] to your project.
57 +\\
58 +
59 +1. Continue on to see how to [[Add a Framework Dependency]] to your project.
picture 25.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.XWikiGuest
Size
... ... @@ -1,1 +1,0 @@
1 -153.6 KB
Content
picture 26.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.XWikiGuest
Size
... ... @@ -1,1 +1,0 @@
1 -51.4 KB
Content
picture 27.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.XWikiGuest
Size
... ... @@ -1,1 +1,0 @@
1 -24.6 KB
Content
picture 28.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.XWikiGuest
Size
... ... @@ -1,1 +1,0 @@
1 -32.4 KB
Content
picture 29.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.XWikiGuest
Size
... ... @@ -1,1 +1,0 @@
1 -18.5 KB
Content
picture 30.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.XWikiGuest
Size
... ... @@ -1,1 +1,0 @@
1 -39.2 KB
Content
picture 31.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.XWikiGuest
Size
... ... @@ -1,1 +1,0 @@
1 -29.8 KB
Content
XWiki.XWikiComments[0]
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.probert
Comment
... ... @@ -1,3 +1,0 @@
1 -We must update the screenshots and instructions to WOLips 3.6. And a warning about creating the components outside the Components folder
2 -
3 -And the « Add a framework dependency » link should be remove, since the next page is not this one.
Date
... ... @@ -1,1 +1,0 @@
1 -2007-12-21 03:37:40.0