Changes for page Click to Open
Last modified by Kieran Kelleher on 2012/07/21 20:41
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,14 +1,13 @@ 1 1 == What It Is == 2 2 3 +C2O allows you to open components in Eclipse directly from the running application in your browser! Click to Open appears in the lower 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. It also provides some other very slick debugging tools. 4 + 3 3 Check out the [[screencast at the mDimension build site>>http://webobjects.mdimension.com/wolips/preview/WOLipsFramework.m4v]]! 4 4 5 -Click to Open is a browser based extension to WOLips found in [[Project Wonder>>WONDER:Home]]. Itprovidessome 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.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. 6 6 7 - ClickOpenappearsinthelover left cornerofbrowseraspartof the pages ofyour running application.Clickingonthiscomponent,andthenonanobjectinthebrowser windowopensthe relevant WOComponentin Eclipse.This makeslifeeasierUIdesignersandfor developersgettingfamiliarwithnew projects.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.** 8 8 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.** 11 - 12 12 == What You Need == 13 13 14 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).,, ... ... @@ -45,7 +45,7 @@ 45 45 */ 46 46 public class ClickToOpenComponent extends com.webobjects.appserver.WOComponent { 47 47 48 - p rivatestatic final boolean isClickToOpenEnabled = ERXProperties.booleanForKeyWithDefault("er.component.clickToOpen", false);47 + public static final boolean isClickToOpenEnabled = ERXProperties.booleanForKeyWithDefault("er.component.clickToOpen", false); 49 49 50 50 public ClickToOpenComponent(WOContext context) { 51 51 super(context); ... ... @@ -60,8 +60,21 @@ 60 60 61 61 {{/code}} 62 62 63 - Note thatwhenisClickToOpenEnabled isfalse,the ERXClickToOpenSupport methodsareno-ops.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: 64 64 64 +{{code value="java"}} 65 + 66 +public void appendToResponse(WOResponse response, WOContext context) 67 +{ 68 + ERXClickToOpenSupport.preProcessResponse(response, context, ClickToOpenComponent.isClickToOpenEnabled); 69 + super.appendToResponse(response, context); 70 + ERXClickToOpenSupport.postProcessResponse(getClass(), response, context, ClickToOpenComponent.isClickToOpenEnabled); 71 +} 72 + 73 +{{/code}} 74 + 75 +**Note that when isClickToOpenEnabled is false, the ERXClickToOpenSupport methods are no-ops.** 76 + 65 65 === Add Support to Application === 66 66 67 67 If your Application.java class extends Wonder's ERXApplication, you can skip this step too. Otherwise, add a developmentMode() method like this: ... ... @@ -78,29 +78,36 @@ 78 78 79 79 {{/code}} 80 80 81 -And add this to the launch arguments: 82 ---DdevelopmentMode=true-- 83 - 84 84 === Set Application Properties === 85 85 86 -In your application preferences,you canthenset:95 +In your application's Properties file, add this line: 87 87 88 - wolips.host=localhost 89 - wolips.port=9485 90 - wolips.password=yourpassword 91 - er.component.clickToOpen=true 97 +{{code}} 92 92 93 - Only 'wolips.password' is strictlyrequiredaslong asyou use the default port of 9485.99 +wolips.password=yourpassword 94 94 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 + 95 95 === Provide prototype.js === 96 96 97 -WOLips.framework needs a prototype.js. If you are using Ajax framework, you don't need to do 98 -anything, because it will default to use Ajax.framework's prototype.js. However, if you are not, 99 -you must set (as an example): 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): 100 100 101 - wolips.prototype.framework=app 102 - wolips.prototype.fileName=prototype.js 116 +{{code}} 103 103 118 +wolips.prototype.framework=app 119 +wolips.prototype.fileName=prototype.js 120 + 121 +{{/code}} 122 + 104 104 === Add WOLToolBar to Your Pages === 105 105 106 106 5) In your page wrapper, add a <wo:WOLToolBar/> component, and you're good to go. Look in the lower ... ... @@ -112,4 +112,26 @@ 112 112 your WOLips preferences, you must enable the WOLips Server, set the port number and the communication 113 113 password. Turning on the WOLips Server requires a restart of WOLips. 114 114 134 +[[image:WOLipsServerPreferences.png]] 135 + 136 +=== Enable Click to Open === 137 + 138 +And add this to the launch arguments: 139 +--DdevelopmentMode=true-- 140 + 141 +[[image:EnableClickToOpen.png]] 142 + 115 115 == 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