Changes for page Click to Open
Last modified by Kieran Kelleher on 2012/07/21 20:41
From version 21.1
edited by David Avendasora
on 2008/04/18 10:36
on 2008/04/18 10:36
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. avendasora1 +XWiki.chuckhill - Content
-
... ... @@ -1,34 +1,33 @@ 1 1 == What It Is == 2 2 3 -C licktoOpen (C2O) allows youoopencomponentsin Eclipse directly from therunning application in your browser ClicktoOpenappearsinthelower left corner of browser as partofthe pages of your running application.Clicking onthis component, andthenon an objectn thebrowser window, opens the relevant WOComponent in Eclipse. This makes life easier for UI designers and for developers getting familiar with newrojects. It also provides somethervery slickdebugging tools.3 +Check out the [[screencast at the mDimension build site>>http://webobjects.mdimension.com/wolips/preview/WOLipsFramework.m4v]]! 4 4 5 -C heckoutthe[[screencastat the mDimensionbuildsite>>http://webobjects.mdimension.com/wolips/preview/WOLipsFramework.m4v]]5 +Click to Open is a browser based extension to WOLips found in [[Project Wonder>>WONDER:Home]]. It provides some very slick debugging tools, like the ability to click on arbitrary components in your web browser and have the corresponding component open in WOLips. All of the Wonder ERD2W components support this. 6 6 7 -Click to Open isabrowserbasedextension toWOLipsfoundin[[ProjectWonder>>WONDER:Home]].AlloftheWonderERD2Wcomponents supportClicktoOpen.7 +Click to Open appears in the lover left corner of browser as part of the pages of your running application. Clicking on this component, and then on an object in the browser window opens the relevant WOComponent in Eclipse. This makes life easier for UI designers and for developers getting familiar with new projects. 8 8 9 -**Note that click-to-open support is expensive, because it has to dig around your component HTML quite a bit, so you will take a performance hit in development to have it enabled.** 9 +**Note that click-to-open support is expensive, because it has to dig around 10 +your component HTML quite a bit, so you will take a performance hit in development to have it enabled.** 10 10 11 11 == What You Need == 12 12 13 -You need the **WOLips** framework that is part of Project Wonder. You a lsoneed the**ERExtensions**frameworkthatispartofProject Wonderon theclasspathatruntime.Ifyou alreadyuseProjectWonder,youarealmostdone.14 +You either need to be using Project Wonder or you need to get the **WOLips** framework that is part of Project Wonder. You can download it from [[mDimension's site>>http://webobjects.mdimension.com/wonder/]]. If not using Wonder, untar the frameworks and copy WOLips.framework to where you have the rest of your frameworks (usually /Library or ,,/Library).,, 14 14 15 -If you are not using Project Wonder, you can download it from [[mDimension's site>>http://webobjects.mdimension.com/wonder/]], untar the frameworks, and copy just the WOLips.framework and ERExtensions.framework to where you have the rest of your frameworks (usually /Library/Frameworks or /Library/Frameworks). 16 - 17 17 == Getting Set Up == 18 18 19 19 === Add the WOLips.framework === 20 20 21 -Follow the [[tutorial>>Add a Framework Dependency]] on adding a framework to add WOLips.framework and ERXExtentions.frameworktoyour application.20 +Follow the [[tutorial>>Add a Framework Dependency]] on adding a framework to add WOLips.framework to your application. 22 22 23 23 === Add Support to Component Base Class === 24 24 25 25 If your components extend Wonder's ERXComponent, you can skip this step. Once again, using Wonder makes your life easier. 26 26 27 -If you don't have a custom component base class, you really should. Using com.webobjects.appserver.WOComponent as the super-class for your pages and components is just going to leave you doing the same things over and over. If you don't have one, you might want to start using the ClickToOpenComponent below.26 +If you don't have a custom component base class, you really should. Using com.webobjects.appserver.WOComponent as the super-class for your pages and components is just going to leave you doing the same things over and over. 28 28 29 -You will need to add the appendToResponse(WOResponse, WOContext) method belowto your component base class, or add thiscode toyourappendToResponse methodif you alreadyhave28 +You will need to add the appendToResponse(WOResponse, WOContext) method to your component base class, or add to it if you already have that method. You should ONLY have clickToOpen execute in your component if you are in development mode. 30 30 31 - Hereis anexample implementation ofacomponent base class andofClickto Opensupport:30 +To include it into your component base class, you can use this sample implementation: 32 32 33 33 {{code value="java"}} 34 34 ... ... @@ -35,8 +35,8 @@ 35 35 package net.com.foo.bar; 36 36 37 37 import com.webobjects.appserver.*; 37 +import er.extensions.*; 38 38 39 - 40 40 /** 41 41 * Support for "Click to Open" navigation from the browser to the template in Eclipse. To enable this, 42 42 * launch with: ... ... @@ -46,7 +46,7 @@ 46 46 */ 47 47 public class ClickToOpenComponent extends com.webobjects.appserver.WOComponent { 48 48 49 - public static final boolean isClickToOpenEnabled = Boolean.getBoolean(System.getProperty("er.component.clickToOpen","false"));48 + public static final boolean isClickToOpenEnabled = ERXProperties.booleanForKeyWithDefault("er.component.clickToOpen", false); 50 50 51 51 public ClickToOpenComponent(WOContext context) { 52 52 super(context); ... ... @@ -85,7 +85,7 @@ 85 85 private Boolean isDevelopmentMode; 86 86 public boolean developmentMode() { 87 87 if (isDevelopmentMode == null) { 88 - isDevelopmentMode = new Boolean( System.getProperty("er.extensions.ERXApplication.developmentMode","false"));87 + isDevelopmentMode = new Boolean(ERXProperties.booleanForKey("developmentMode", false)); 89 89 } 90 90 return isDevelopmentMode.booleanValue(); 91 91 } ... ... @@ -92,118 +92,46 @@ 92 92 93 93 {{/code}} 94 94 94 +And add this to the launch arguments: 95 +--DdevelopmentMode=true-- 96 + 95 95 === Set Application Properties === 96 96 97 -In your application 'sPropertiesfile, addthis line:99 +In your application preferences, you can then set: 98 98 99 -{{code}} 100 - 101 -wolips.password=yourpassword 102 - 103 -{{/code}} 104 - 105 -If you need to, you can also change these default values: 106 - 107 -{{code}} 108 - 109 109 wolips.host=localhost 110 110 wolips.port=9485 103 +wolips.password=yourpassword 104 +er.component.clickToOpen=true 111 111 112 - {{/code}}106 +Only 'wolips.password' is strictly required as long as you use the default port of 9485. 113 113 114 114 === Provide prototype.js === 115 115 116 -WOLips.framework needs a prototype.js. If you are using Ajax framework, you don't need to do anything, because it will default to use Ajax.framework's prototype.js. However, if you are not, add this to your application's Properties file (as an example, change the values as appropriate): 110 +WOLips.framework needs a prototype.js. If you are using Ajax framework, you don't need to do 111 +anything, because it will default to use Ajax.framework's prototype.js. However, if you are not, 112 +you must set (as an example): 117 117 118 -{{code}} 114 + wolips.prototype.framework=app 115 + wolips.prototype.fileName=prototype.js 119 119 120 -wolips.prototype.framework=app 121 -wolips.prototype.fileName=prototype.js 122 - 123 -{{/code}} 124 - 125 125 === Add WOLToolBar to Your Pages === 126 126 127 -In your page wrapper's HTML template, add 119 +5) In your page wrapper, add a <wo:WOLToolBar/> component, and you're good to go. Look in the lower 120 +left hand corner of the browser window for the link. 128 128 129 -{{code value="html"}} 130 - 131 -<wo:WOLToolBar/> 132 - 133 -{{/code}} 134 - 135 -and you're done. If you don't have a [[page wrapper>>WO:Web Applications-Development-Examples-Page Layout]], you will have to add this to every page. Hint: page wrappers make your life easier. 136 - 137 -If you are using the old WO template syntax, add this to the .html file: 138 - 139 -{{code value="html"}} 140 - 141 -<webobject name="WOLToolBar" /> 142 - 143 -{{/code}} 144 - 145 -And add this to the .wod file: 146 - 147 -{{code value="html"}} 148 - 149 -WOLToolBar: WOLToolBar{ 150 -} 151 - 152 -{{/code}} 153 - 154 154 === Configure WOLips Server === 155 155 156 -You must be using a recent version of WOLips that supports the **WOLips Server**. In your WOLips preferences, you must enable the WOLips Server and set the communication password. This password must match the ##wolips.password## in the **Set Application Properties** section above. 124 +You must be using a recent version of WOLips that supports the WOLips Server. In 125 +your WOLips preferences, you must enable the WOLips Server, set the port number and the communication 126 +password. Turning on the WOLips Server requires a restart of WOLips. 157 157 158 -**Turning on the WOLips Server requires Eclipse to be restarted.** 159 - 160 160 [[image:WOLipsServerPreferences.png]] 161 161 162 -You can optionally change the port number. If you do change the port number, see ##wolips.port## in the **Set Application Properties** section above. 163 - 164 -=== Enable Click to Open === 165 - 166 -If you are using Wonder, add the following to your Properties file: 167 - 168 -* **er.component.clickToOpen=true** 169 -* **er.extensions.ERXApplication.developmentMode=true** 170 - 171 -If you are not using Wonder, add the Launch parameters as follows: 172 - 173 -* Parameter = **Der.component.clickToOpen=true**, Argument = **true** 174 -* Parameter = **Der.extensions.ERXApplication.developmentMode=true** Argument = **true** 175 - (needing to have "true" twice is a [[minor bug>>http://issues.objectstyle.org/jira/browse/WOL-787]]. The really important one is the first one) 176 - 177 -[[image:EnableClickToOpen.png]] 178 - 179 179 == Using Click to Open == 180 180 181 -Run your application and look in the lower, left hand corner. You should see a link like this: 182 - 183 183 [[image:ClickToOpenLink.png]] 184 184 185 -If you don't, check that the page has the WOLToolBar on it and that the ##er.component.clickToOpen## property is set to true and the ##er.extensions.ERXApplication.developmentMode## property is set to true. 186 - 187 -\\ 188 - 189 -Click on this component to open the Click to Open UI: 190 - 191 191 [[image:ClickToOpenExpanded.png]] 192 192 193 -**EditDisplayAd** is the page in the browser. Click on this link to open this page in Eclipse. 194 - 195 -\\ 196 - 197 -If you are looking for a sub-component of this page, click on the **Click to Open** link. As you move your mouse over the page, the bread crumb of components will change to show you where you are. Just click to open the component under the mouse in Eclipse. It is that easy 198 - 199 199 [[image:ClickToOpenInAction.png]] 200 - 201 -\\ 202 - 203 -=== Additional Functionality === 204 - 205 -* Esc is a shortcut for getting out of click-to-open mode 206 -* hold down the Cmd key while you move the mouse around and it will highlight the component 207 -* Cmd-click it will popup the stack of components and you can pick from the stack: 208 -[[image:ComponentStack.png]] 209 -* you can set the binding ##expanded=true;## on WOLToolBar so it's open by default, instead of closed