Changes for page Click to Open
Last modified by Kieran Kelleher on 2012/07/21 20:41
To version 39.1
edited by chuckhill
on 2008/03/12 00:15
on 2008/03/12 00:15
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,13 +1,7 @@ 1 1 == What It Is == 2 2 3 -C 2O allowsyoutoopencomponentsinEclipse directly from therunningapplicationinyourbrowser!Click toOpen appears in thelower left corner ofbrowser as part of the pages of your running application. Clicking on thiscomponent, and then on an object in the browser window,opens the relevant WOComponent in Eclipse.It also provides some other very slick debugging tools.3 +Click to Open is a browser based extension to WOLips. It provides a component that appears in the browser as part of the pages of your running application. Clicking on this, 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. 4 4 5 -Check out the [[screencast at the mDimension build site>>http://webobjects.mdimension.com/wolips/preview/WOLipsFramework.m4v]]! 6 - 7 -Click to Open is a browser based extension to WOLips found in [[Project Wonder>>WONDER:Home]]. All of the Wonder ERD2W components support this. 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.** 10 - 11 11 == What You Need == 12 12 13 13 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,70 +14,39 @@ 14 14 15 15 == Getting Set Up == 16 16 17 -=== Add the WOLips.framework === 11 +To fully utilize WOLips.framework, you must add support for click-to-open and you must provide 12 +a prototype.js implementation. Note that click-to-open support is expensive, because it has to dig around 13 +your component HTML quite a bit, so you will take a performance hit in development to have it enabled. 18 18 19 - Followthe[[tutorial>>Adda FrameworkDependency]]onaddingaframeworktoaddWOLips.frameworkto your application.15 +1) If your components extends ERXComponent, all you need to do is set: 20 20 21 - ===Add Support toComponentBase Class===17 + er.component.clickToOpen=true 22 22 23 - Ifyourcomponents extend Wonder's ERXComponent, you can skip this step. Once again, usingWonder makes your life easier.19 +in your Properties file. 24 24 25 -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. 21 +If you do not use ERXComponent and instead have a custom component base class, you must add 22 +clickToOpen support to your components on your own. You should ONLY have clickToOpen execute in your 23 +component if you are in development mode. To include it into your component base class, you can use 24 +the sample implementation from ERXComponent: 26 26 27 -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. 28 - 29 -To include it into your component base class, you can use this sample implementation: 30 - 31 31 {{code value="java"}} 32 32 33 -package net.com.foo.bar; 34 - 35 -import com.webobjects.appserver.*; 36 -import er.extensions.*; 37 - 38 -/** 39 - * Support for "Click to Open" navigation from the browser to the template in Eclipse. To enable this, 40 - * launch with: 41 - * <pre> 42 - * -Der.component.clickToOpen=true 43 - * </pre> 44 - */ 45 -public class ClickToOpenComponent extends com.webobjects.appserver.WOComponent { 46 - 47 - public static final boolean isClickToOpenEnabled = ERXProperties.booleanForKeyWithDefault("er.component.clickToOpen", false); 48 - 49 - public ClickToOpenComponent(WOContext context) { 50 - super(context); 51 - } 52 - 53 - public void appendToResponse(WOResponse response, WOContext context) { 54 - ERXClickToOpenSupport.preProcessResponse(response, context, isClickToOpenEnabled); 55 - super.appendToResponse(response, context); 56 - ERXClickToOpenSupport.postProcessResponse(getClass(), response, context, isClickToOpenEnabled); 57 - } 58 -} 59 - 60 -{{/code}} 61 - 62 -For components that can't sub-class ClickToOpenComponent (directly or indirectly), you can enable Click to Open by adding this method to your component: 63 - 64 -{{code value="java"}} 65 - 66 -public void appendToResponse(WOResponse response, WOContext context) 67 -{ 68 - ERXClickToOpenSupport.preProcessResponse(response, context, ClickToOpenComponent.isClickToOpenEnabled); 28 +@Override 29 +public void appendToResponse(WOResponse response, WOContext context) { 30 + ... 31 + boolean clickToOpenEnabled = ...; 32 + ERXClickToOpenSupport.preProcessResponse(response, context, clickToOpenEnabled); 69 69 super.appendToResponse(response, context); 70 - ERXClickToOpenSupport.postProcessResponse(getClass(), response, context, ClickToOpenComponent.isClickToOpenEnabled); 34 + ERXClickToOpenSupport.postProcessResponse(getClass(), response, context, clickToOpenEnabled); 35 + ... 71 71 } 72 72 73 73 {{/code}} 74 74 75 - **Note that whenisClickToOpenEnabled is false, the ERXClickToOpenSupport methods are no-ops.**40 +Note that when clickToOpenEnabled is false, the ERXClickToOpenSupport methods are no-ops. 76 76 77 - ===AddSupport toApplication===42 +2) If your Application.java class does not extend ERXApplication, add a method like this: 78 78 79 -If your Application.java class extends Wonder's ERXApplication, you can skip this step too. Otherwise, add a developmentMode() method like this: 80 - 81 81 {{code value="java"}} 82 82 83 83 private Boolean isDevelopmentMode; ... ... @@ -90,67 +90,27 @@ 90 90 91 91 {{/code}} 92 92 93 -=== Set Application Properties === 56 +And add this to the launch arguments: 57 +--DdevelopmentMode=true-- 94 94 95 -In your application's Properties file, add this line: 96 - 97 -{{code}} 98 - 99 -wolips.password=yourpassword 100 - 101 -{{/code}} 102 - 103 -If you need to, you can also change these default values: 104 - 105 -{{code}} 106 - 107 -wolips.host=localhost 108 -wolips.port=9485 109 - 110 -{{/code}} 111 - 112 -=== Provide prototype.js === 113 - 114 -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): 115 - 116 -{{code}} 117 - 118 -wolips.prototype.framework=app 119 -wolips.prototype.fileName=prototype.js 120 - 121 -{{/code}} 122 - 123 -=== Add WOLToolBar to Your Pages === 124 - 125 -5) In your page wrapper, add a <wo:WOLToolBar/> component, and you're good to go. Look in the lower 126 -left hand corner of the browser window for the link. 127 - 128 -=== Configure WOLips Server === 129 - 130 -You must be using a recent version of WOLips that supports the WOLips Server. In 59 +3) You must be using a recent version of WOLips that supports the WOLips Server. In 131 131 your WOLips preferences, you must enable the WOLips Server, set the port number and the communication 132 132 password. Turning on the WOLips Server requires a restart of WOLips. 133 133 134 - [[image:WOLipsServerPreferences.png]]63 +In your application preferences, you can then set: 135 135 136 -=== Enable Click to Open === 65 + wolips.host=localhost 66 + wolips.port=9485 67 + wolips.password=yourpassword 68 + 69 +Only 'wolips.password' is strictly required as long as you use the default port of 9485. 137 137 138 -And add this to the launch arguments: 139 ---DdevelopmentMode=true-- 71 +4) WOLips.framework needs a prototype.js. If you are using Ajax framework, you don't need to do 72 +anything, because it will default to use Ajax.framework's prototype.js. However, if you are not, 73 +you must set (as an example): 140 140 141 -[[image:EnableClickToOpen.png]] 75 + wolips.prototype.framework=app 76 + wolips.prototype.fileName=prototype.js 142 142 143 -== Using Click to Open == 144 - 145 -[[image:ClickToOpenLink.png]] 146 - 147 -[[image:ClickToOpenExpanded.png]] 148 - 149 -[[image:ClickToOpenInAction.png]] 150 - 151 -you can hold cmd 152 -and it will highlight the component 153 -and if you cmd-click 154 -it will popup the stack 155 -and you can pick from the stack 156 -also esc is a shortcut for getting out of click-to-open mode 78 +5) In your page wrapper, add a <wo:WOLToolBar/> component, and you're good to go. Look in the lower 79 +left hand corner of the browser window for the link.