1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
package org.apache.jetspeed.layout.impl; |
18 |
|
|
19 |
|
import java.util.Map; |
20 |
|
import java.util.Iterator; |
21 |
|
|
22 |
|
import org.apache.commons.logging.Log; |
23 |
|
import org.apache.commons.logging.LogFactory; |
24 |
|
import org.apache.jetspeed.JetspeedActions; |
25 |
|
import org.apache.jetspeed.ajax.AJAXException; |
26 |
|
import org.apache.jetspeed.ajax.AjaxAction; |
27 |
|
import org.apache.jetspeed.ajax.AjaxBuilder; |
28 |
|
import org.apache.jetspeed.layout.Coordinate; |
29 |
|
import org.apache.jetspeed.layout.PortletActionSecurityBehavior; |
30 |
|
import org.apache.jetspeed.layout.PortletPlacementException; |
31 |
|
import org.apache.jetspeed.layout.PortletPlacementContext; |
32 |
|
import org.apache.jetspeed.om.page.Fragment; |
33 |
|
import org.apache.jetspeed.om.page.Page; |
34 |
|
import org.apache.jetspeed.page.PageManager; |
35 |
|
import org.apache.jetspeed.page.document.NodeException; |
36 |
|
import org.apache.jetspeed.request.RequestContext; |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
public class MovePortletAction |
55 |
|
extends BasePortletAction |
56 |
|
implements AjaxAction, AjaxBuilder, Constants |
57 |
|
{ |
58 |
0 |
protected static final Log log = LogFactory.getLog(MovePortletAction.class); |
59 |
0 |
private int iMoveType = -1; |
60 |
0 |
private String sMoveType = null; |
61 |
|
|
62 |
|
public MovePortletAction(String template, |
63 |
|
String errorTemplate, |
64 |
|
String sMoveType) |
65 |
|
throws AJAXException |
66 |
|
{ |
67 |
0 |
this(template, errorTemplate, sMoveType, null, class="keyword">null); |
68 |
0 |
} |
69 |
|
|
70 |
|
public MovePortletAction(String template, |
71 |
|
String errorTemplate, |
72 |
|
PageManager pageManager, |
73 |
|
PortletActionSecurityBehavior securityBehavior) |
74 |
|
throws AJAXException |
75 |
|
{ |
76 |
0 |
this( template, errorTemplate, "moveabs", pageManager, securityBehavior ); |
77 |
0 |
} |
78 |
|
|
79 |
|
public MovePortletAction(String template, |
80 |
|
String errorTemplate, |
81 |
|
String sMoveType, |
82 |
|
PageManager pageManager, |
83 |
|
PortletActionSecurityBehavior securityBehavior) |
84 |
|
throws AJAXException |
85 |
|
{ |
86 |
0 |
super(template, errorTemplate, pageManager, securityBehavior); |
87 |
0 |
setMoveType(sMoveType); |
88 |
0 |
} |
89 |
|
|
90 |
|
|
91 |
|
public void setMoveType(String p_sMoveType) throws AJAXException |
92 |
|
{ |
93 |
0 |
sMoveType = p_sMoveType; |
94 |
|
|
95 |
0 |
if (p_sMoveType.equalsIgnoreCase("moveabs")) |
96 |
|
{ |
97 |
0 |
iMoveType = ABS; |
98 |
|
} |
99 |
0 |
else if (p_sMoveType.equalsIgnoreCase("moveup")) |
100 |
|
{ |
101 |
0 |
iMoveType = UP; |
102 |
|
} |
103 |
0 |
else if (p_sMoveType.equalsIgnoreCase("movedown")) |
104 |
|
{ |
105 |
0 |
iMoveType = DOWN; |
106 |
|
} |
107 |
0 |
else if (p_sMoveType.equalsIgnoreCase("moveleft")) |
108 |
|
{ |
109 |
0 |
iMoveType = LEFT; |
110 |
|
} |
111 |
0 |
else if (p_sMoveType.equalsIgnoreCase("moveright")) |
112 |
|
{ |
113 |
0 |
iMoveType = RIGHT; |
114 |
|
} |
115 |
0 |
else if (p_sMoveType.equalsIgnoreCase("move")) |
116 |
|
{ |
117 |
0 |
iMoveType = CARTESIAN; |
118 |
|
} |
119 |
|
else |
120 |
|
{ |
121 |
0 |
throw new AJAXException("invalid move type of:" + p_sMoveType); |
122 |
|
} |
123 |
0 |
} |
124 |
|
|
125 |
|
public boolean runBatch(RequestContext requestContext, Map resultMap) throws AJAXException |
126 |
|
{ |
127 |
0 |
return runAction(requestContext, resultMap, true); |
128 |
|
} |
129 |
|
|
130 |
|
public boolean run(RequestContext requestContext, Map resultMap) |
131 |
|
throws AJAXException |
132 |
|
{ |
133 |
0 |
return runAction(requestContext, resultMap, false); |
134 |
|
} |
135 |
|
|
136 |
|
protected boolean runAction( RequestContext requestContext, Map resultMap, class="keyword">boolean batch ) throws AJAXException |
137 |
|
{ |
138 |
0 |
boolean success = true; |
139 |
0 |
String status = "success"; |
140 |
|
try |
141 |
|
{ |
142 |
0 |
resultMap.put(ACTION, sMoveType); |
143 |
|
|
144 |
0 |
String moveFragmentId = getActionParameter(requestContext, FRAGMENTID); |
145 |
0 |
String layoutId = getActionParameter(requestContext, LAYOUTID); |
146 |
0 |
if ( moveFragmentId == null ) |
147 |
|
{ |
148 |
0 |
throw new Exception( FRAGMENTID + " not provided; must specify portlet or layout id" ); |
149 |
|
} |
150 |
0 |
resultMap.put(FRAGMENTID, moveFragmentId); |
151 |
|
|
152 |
0 |
Fragment currentLayoutFragment = null; |
153 |
0 |
Fragment moveToLayoutFragment = null; |
154 |
|
|
155 |
0 |
if ( layoutId != null && layoutId.length() > 0 && iMoveType != CARTESIAN ) |
156 |
|
{ |
157 |
0 |
Page page = requestContext.getPage(); |
158 |
0 |
currentLayoutFragment = page.getFragmentById( layoutId ); |
159 |
0 |
if ( currentLayoutFragment == null ) |
160 |
|
{ |
161 |
0 |
throw new Exception("layout id not found: " + layoutId ); |
162 |
|
} |
163 |
|
else |
164 |
|
{ |
165 |
|
|
166 |
0 |
moveToLayoutFragment = currentLayoutFragment; |
167 |
0 |
Iterator layoutChildIter = moveToLayoutFragment.getFragments().iterator(); |
168 |
0 |
while ( layoutChildIter.hasNext() ) |
169 |
|
{ |
170 |
0 |
Fragment childFrag = (Fragment)layoutChildIter.next(); |
171 |
0 |
if ( childFrag != null ) |
172 |
|
{ |
173 |
0 |
if ( moveFragmentId.equals( childFrag.getId() ) ) |
174 |
|
{ |
175 |
0 |
moveToLayoutFragment = null; |
176 |
0 |
break; |
177 |
|
} |
178 |
|
} |
179 |
0 |
} |
180 |
0 |
if ( moveToLayoutFragment != null ) |
181 |
|
{ |
182 |
|
|
183 |
|
|
184 |
0 |
Fragment root = requestContext.getPage().getRootFragment(); |
185 |
0 |
currentLayoutFragment = getParentFragmentById(moveFragmentId, root); |
186 |
|
} |
187 |
|
} |
188 |
0 |
if ( currentLayoutFragment == null ) |
189 |
|
{ |
190 |
|
|
191 |
0 |
throw new Exception("parent layout id not found for portlet id:" + moveFragmentId ); |
192 |
|
} |
193 |
|
} |
194 |
|
|
195 |
0 |
if (false == checkAccess(requestContext, JetspeedActions.EDIT)) |
196 |
|
{ |
197 |
0 |
Page page = requestContext.getPage(); |
198 |
0 |
Fragment fragment = page.getFragmentById(moveFragmentId); |
199 |
0 |
if (fragment == null) |
200 |
|
{ |
201 |
0 |
success = false; |
202 |
0 |
resultMap.put(REASON, "Fragment not found"); |
203 |
0 |
return success; |
204 |
|
} |
205 |
|
|
206 |
|
|
207 |
0 |
int column = fragment.getLayoutColumn(); |
208 |
0 |
int row = fragment.getLayoutRow(); |
209 |
|
|
210 |
|
|
211 |
0 |
int layoutColumn = -1, layoutRow = -1; |
212 |
0 |
int moveToLayoutColumn = -1, moveToLayoutRow = -1; |
213 |
0 |
if ( currentLayoutFragment != null ) |
214 |
|
{ |
215 |
0 |
layoutColumn = currentLayoutFragment.getLayoutColumn(); |
216 |
0 |
layoutRow = currentLayoutFragment.getLayoutRow(); |
217 |
0 |
if ( moveToLayoutFragment != null ) |
218 |
|
{ |
219 |
0 |
moveToLayoutColumn = moveToLayoutFragment.getLayoutColumn(); |
220 |
0 |
moveToLayoutRow = moveToLayoutFragment.getLayoutRow(); |
221 |
|
} |
222 |
|
} |
223 |
|
|
224 |
0 |
if (!createNewPageOnEdit(requestContext)) |
225 |
|
{ |
226 |
0 |
success = false; |
227 |
0 |
resultMap.put(REASON, "Insufficient access to edit page"); |
228 |
0 |
return success; |
229 |
|
} |
230 |
0 |
status = "refresh"; |
231 |
|
|
232 |
|
|
233 |
0 |
Fragment newFragment = getFragmentIdFromLocation(row, column, requestContext.getPage()); |
234 |
0 |
if (newFragment == null) |
235 |
|
{ |
236 |
0 |
success = false; |
237 |
0 |
resultMap.put( REASON, "Failed to find new fragment for portlet id: " + moveFragmentId ); |
238 |
0 |
return success; |
239 |
|
} |
240 |
0 |
moveFragmentId = newFragment.getId(); |
241 |
|
|
242 |
0 |
if ( currentLayoutFragment != null ) |
243 |
|
{ |
244 |
0 |
newFragment = getFragmentIdFromLocation(layoutRow, layoutColumn, requestContext.getPage()); |
245 |
0 |
if (newFragment == null) |
246 |
|
{ |
247 |
0 |
success = false; |
248 |
0 |
resultMap.put( REASON, "Failed to find new parent layout fragment id: " + currentLayoutFragment.getId() + " for portlet id: " + moveFragmentId ); |
249 |
0 |
return success; |
250 |
|
} |
251 |
0 |
currentLayoutFragment = newFragment; |
252 |
0 |
if ( moveToLayoutFragment != null ) |
253 |
|
{ |
254 |
0 |
newFragment = getFragmentIdFromLocation(moveToLayoutRow, moveToLayoutColumn, requestContext.getPage()); |
255 |
0 |
if (newFragment == null) |
256 |
|
{ |
257 |
0 |
success = false; |
258 |
0 |
resultMap.put( REASON, "Failed to find new move-to layout fragment id: " + moveToLayoutFragment.getId() + " for portlet id: " + moveFragmentId ); |
259 |
0 |
return success; |
260 |
|
} |
261 |
0 |
moveToLayoutFragment = newFragment; |
262 |
|
} |
263 |
|
} |
264 |
|
} |
265 |
|
|
266 |
0 |
if ( moveToLayoutFragment != null ) |
267 |
|
{ |
268 |
0 |
success = moveFragment( requestContext, |
269 |
|
pageManager, |
270 |
|
batch, |
271 |
|
resultMap, |
272 |
|
moveFragmentId, |
273 |
|
moveToLayoutFragment, |
274 |
|
currentLayoutFragment ) ; |
275 |
|
} |
276 |
|
else |
277 |
|
{ |
278 |
0 |
PortletPlacementContext placement = null; |
279 |
0 |
if ( currentLayoutFragment != null ) |
280 |
0 |
placement = new PortletPlacementContextImpl(requestContext, currentLayoutFragment, 1); |
281 |
|
else |
282 |
|
{ |
283 |
0 |
placement = new PortletPlacementContextImpl(requestContext); |
284 |
|
} |
285 |
0 |
Fragment fragment = placement.getFragmentById(moveFragmentId); |
286 |
0 |
if (fragment == null) |
287 |
|
{ |
288 |
0 |
success = false; |
289 |
0 |
resultMap.put(REASON, "Failed to find fragment for portlet id: " + moveFragmentId ); |
290 |
0 |
return success; |
291 |
|
} |
292 |
0 |
Coordinate returnCoordinate = null; |
293 |
0 |
float oldX = 0f, oldY = 0f, oldZ = 0f, oldWidth = 0f, oldHeight = 0f; |
294 |
0 |
float x = -1f, y = -1f, z = -1f, width = -1f, height = -1f; |
295 |
0 |
boolean absHeightChanged = false; |
296 |
|
|
297 |
0 |
String posExtended = getActionParameter(requestContext, DESKTOP_EXTENDED); |
298 |
0 |
if ( posExtended != null ) |
299 |
|
{ |
300 |
0 |
Map fragmentProperties = fragment.getProperties(); |
301 |
0 |
if ( fragmentProperties == null ) |
302 |
|
{ |
303 |
0 |
success = false; |
304 |
0 |
resultMap.put(REASON, "Failed to acquire fragment properties map for portlet id: " + moveFragmentId ); |
305 |
0 |
return success; |
306 |
|
} |
307 |
0 |
String oldDeskExt = (String)fragmentProperties.get( DESKTOP_EXTENDED ); |
308 |
0 |
resultMap.put( OLD_DESKTOP_EXTENDED, ( (oldDeskExt != null) ? oldDeskExt : "" ) ); |
309 |
0 |
fragmentProperties.put( DESKTOP_EXTENDED, posExtended ); |
310 |
|
} |
311 |
|
|
312 |
|
|
313 |
0 |
if (iMoveType == ABS) |
314 |
|
{ |
315 |
0 |
Coordinate a_oCoordinate = getCoordinateFromParams(requestContext); |
316 |
0 |
returnCoordinate = placement.moveAbsolute(fragment, a_oCoordinate); |
317 |
0 |
String sHeight = getActionParameter(requestContext, HEIGHT); |
318 |
0 |
if ( sHeight != null && sHeight.length() > 0 ) |
319 |
|
{ |
320 |
0 |
oldHeight = fragment.getLayoutHeight(); |
321 |
0 |
height = Float.parseFloat(sHeight); |
322 |
0 |
fragment.setLayoutHeight(height); |
323 |
0 |
absHeightChanged = true; |
324 |
|
} |
325 |
0 |
} |
326 |
0 |
else if (iMoveType == LEFT) |
327 |
|
{ |
328 |
0 |
returnCoordinate = placement.moveLeft(fragment); |
329 |
|
} |
330 |
0 |
else if (iMoveType == RIGHT) |
331 |
|
{ |
332 |
0 |
returnCoordinate = placement.moveRight(fragment); |
333 |
|
} |
334 |
0 |
else if (iMoveType == UP) |
335 |
|
{ |
336 |
0 |
returnCoordinate = placement.moveUp(fragment); |
337 |
|
} |
338 |
0 |
else if (iMoveType == DOWN) |
339 |
|
{ |
340 |
0 |
returnCoordinate = placement.moveDown(fragment); |
341 |
|
} |
342 |
0 |
else if (iMoveType == CARTESIAN) |
343 |
|
{ |
344 |
0 |
String sx = getActionParameter(requestContext, X); |
345 |
0 |
String sy = getActionParameter(requestContext, Y); |
346 |
0 |
String sz = getActionParameter(requestContext, Z); |
347 |
0 |
String sWidth = getActionParameter(requestContext, WIDTH); |
348 |
0 |
String sHeight = getActionParameter(requestContext, HEIGHT); |
349 |
0 |
if (sx != null) |
350 |
|
{ |
351 |
0 |
oldX = fragment.getLayoutX(); |
352 |
0 |
x = Float.parseFloat(sx); |
353 |
0 |
fragment.setLayoutX(x); |
354 |
|
} |
355 |
0 |
if (sy != null) |
356 |
|
{ |
357 |
0 |
oldY = fragment.getLayoutY(); |
358 |
0 |
y = Float.parseFloat(sy); |
359 |
0 |
fragment.setLayoutY(y); |
360 |
|
} |
361 |
0 |
if (sz != null) |
362 |
|
{ |
363 |
0 |
oldZ = fragment.getLayoutZ(); |
364 |
0 |
z = Float.parseFloat(sz); |
365 |
0 |
fragment.setLayoutZ(z); |
366 |
|
} |
367 |
0 |
if (sWidth != null) |
368 |
|
{ |
369 |
0 |
oldWidth = fragment.getLayoutWidth(); |
370 |
0 |
width = Float.parseFloat(sWidth); |
371 |
0 |
fragment.setLayoutWidth(width); |
372 |
|
} |
373 |
0 |
if (sHeight != null) |
374 |
|
{ |
375 |
0 |
oldHeight = fragment.getLayoutHeight(); |
376 |
0 |
height = Float.parseFloat(sHeight); |
377 |
0 |
fragment.setLayoutHeight(height); |
378 |
|
} |
379 |
|
} |
380 |
|
|
381 |
0 |
Page page = placement.syncPageFragments(); |
382 |
|
|
383 |
0 |
if (pageManager != null && !batch) |
384 |
|
{ |
385 |
0 |
pageManager.updatePage(page); |
386 |
|
} |
387 |
|
|
388 |
0 |
if (iMoveType == CARTESIAN) |
389 |
|
{ |
390 |
0 |
putCartesianResult(resultMap, x, oldX, X, OLD_X); |
391 |
0 |
putCartesianResult(resultMap, y, oldY, Y, OLD_Y); |
392 |
0 |
putCartesianResult(resultMap, z, oldZ, Z, OLD_Z); |
393 |
0 |
putCartesianResult(resultMap, width, oldWidth, WIDTH, OLD_WIDTH); |
394 |
0 |
putCartesianResult(resultMap, height, oldHeight, HEIGHT, OLD_HEIGHT); |
395 |
|
} |
396 |
|
else |
397 |
|
{ |
398 |
|
|
399 |
0 |
resultMap.put(OLDCOL, String.valueOf(returnCoordinate |
400 |
|
.getOldCol())); |
401 |
0 |
resultMap.put(OLDROW, String.valueOf(returnCoordinate |
402 |
|
.getOldRow())); |
403 |
|
|
404 |
0 |
resultMap.put(NEWCOL, String.valueOf(returnCoordinate |
405 |
|
.getNewCol())); |
406 |
0 |
resultMap.put(NEWROW, String.valueOf(returnCoordinate |
407 |
|
.getNewRow())); |
408 |
0 |
if ( absHeightChanged ) |
409 |
|
{ |
410 |
0 |
putCartesianResult(resultMap, height, oldHeight, HEIGHT, OLD_HEIGHT); |
411 |
|
} |
412 |
|
} |
413 |
|
} |
414 |
0 |
resultMap.put(STATUS, status); |
415 |
0 |
resultMap.put(FRAGMENTID, moveFragmentId); |
416 |
|
} |
417 |
0 |
catch (Exception e) |
418 |
|
{ |
419 |
|
|
420 |
0 |
log.error("exception while moving a portlet", e); |
421 |
0 |
resultMap.put(REASON, e.toString()); |
422 |
|
|
423 |
0 |
success = false; |
424 |
0 |
} |
425 |
|
|
426 |
0 |
return success; |
427 |
|
} |
428 |
|
|
429 |
|
protected boolean moveFragment( RequestContext requestContext, |
430 |
|
PageManager pageManager, |
431 |
|
boolean batch, |
432 |
|
Map resultMap, |
433 |
|
String moveFragmentId, |
434 |
|
Fragment moveToLayoutFragment, |
435 |
|
Fragment removeFromLayoutFragment ) |
436 |
|
throws PortletPlacementException, NodeException |
437 |
|
{ |
438 |
0 |
boolean success = true; |
439 |
0 |
Fragment placeFragment = null; |
440 |
0 |
if ( removeFromLayoutFragment != null ) |
441 |
|
{ |
442 |
0 |
PortletPlacementContext placement = new PortletPlacementContextImpl( requestContext, removeFromLayoutFragment, 1 ); |
443 |
|
|
444 |
0 |
placeFragment = placement.getFragmentById( moveFragmentId ); |
445 |
0 |
if ( placeFragment == null ) |
446 |
|
{ |
447 |
0 |
success = false; |
448 |
0 |
resultMap.put( REASON, "Failed to find fragment to move to another layout for fragment id: " + moveFragmentId ); |
449 |
0 |
return success; |
450 |
|
} |
451 |
0 |
placement.remove( placeFragment ); |
452 |
0 |
Page page = placement.syncPageFragments(); |
453 |
0 |
page.removeFragmentById( moveFragmentId ); |
454 |
|
} |
455 |
0 |
if ( placeFragment != null ) |
456 |
|
{ |
457 |
0 |
return placeFragment( requestContext, |
458 |
|
pageManager, |
459 |
|
batch, |
460 |
|
resultMap, |
461 |
|
placeFragment, |
462 |
|
moveToLayoutFragment ); |
463 |
|
} |
464 |
0 |
return success; |
465 |
|
} |
466 |
|
|
467 |
|
protected boolean placeFragment( RequestContext requestContext, |
468 |
|
PageManager pageManager, |
469 |
|
boolean batch, |
470 |
|
Map resultMap, |
471 |
|
Fragment placeFragment, |
472 |
|
Fragment placeInLayoutFragment ) |
473 |
|
throws PortletPlacementException, NodeException |
474 |
|
{ |
475 |
0 |
boolean success = true; |
476 |
0 |
if ( placeFragment == null ) |
477 |
|
{ |
478 |
0 |
success = false; |
479 |
0 |
return success; |
480 |
|
} |
481 |
|
|
482 |
|
|
483 |
0 |
String posExtended = getActionParameter(requestContext, DESKTOP_EXTENDED); |
484 |
0 |
if ( posExtended != null ) |
485 |
|
{ |
486 |
0 |
Map fragmentProperties = placeFragment.getProperties(); |
487 |
0 |
if ( fragmentProperties == null ) |
488 |
|
{ |
489 |
0 |
success = false; |
490 |
0 |
resultMap.put(REASON, "Failed to acquire fragment properties map for fragment id: " + placeFragment.getId() ); |
491 |
0 |
return success; |
492 |
|
} |
493 |
0 |
String oldDeskExt = (String)fragmentProperties.get( DESKTOP_EXTENDED ); |
494 |
0 |
resultMap.put( OLD_DESKTOP_EXTENDED, ( (oldDeskExt != null) ? oldDeskExt : "" ) ); |
495 |
0 |
fragmentProperties.put( DESKTOP_EXTENDED, posExtended ); |
496 |
|
} |
497 |
|
|
498 |
|
|
499 |
0 |
PortletPlacementContext placement = new PortletPlacementContextImpl( requestContext, placeInLayoutFragment, 1 ); |
500 |
0 |
Coordinate returnCoordinate = placement.add( placeFragment, getCoordinateFromParams( requestContext ) ); |
501 |
0 |
Page page = placement.syncPageFragments(); |
502 |
|
|
503 |
0 |
placeInLayoutFragment.getFragments().add( placeFragment ); |
504 |
0 |
if ( pageManager != null && ! batch ) |
505 |
|
{ |
506 |
0 |
pageManager.updatePage( page ); |
507 |
|
} |
508 |
|
|
509 |
|
|
510 |
0 |
resultMap.put( OLDCOL, String.valueOf( returnCoordinate.getOldCol() ) ); |
511 |
0 |
resultMap.put( OLDROW, String.valueOf( returnCoordinate.getOldRow() ) ); |
512 |
|
|
513 |
0 |
resultMap.put( NEWCOL, String.valueOf( returnCoordinate.getNewCol() ) ); |
514 |
0 |
resultMap.put( NEWROW, String.valueOf( returnCoordinate.getNewRow() ) ); |
515 |
|
|
516 |
0 |
return success; |
517 |
|
} |
518 |
|
|
519 |
|
protected Coordinate getCoordinateFromParams(RequestContext requestContext) |
520 |
|
{ |
521 |
0 |
String a_sCol = getActionParameter( requestContext, COL ); |
522 |
0 |
String a_sRow = getActionParameter( requestContext, ROW ); |
523 |
|
|
524 |
0 |
int a_iCol = 0; |
525 |
0 |
int a_iRow = 0; |
526 |
|
|
527 |
|
|
528 |
0 |
if ( a_sCol != null ) |
529 |
|
{ |
530 |
0 |
a_iCol = Integer.parseInt( a_sCol ); |
531 |
|
} |
532 |
0 |
if ( a_sRow != null ) |
533 |
|
{ |
534 |
0 |
a_iRow = Integer.parseInt( a_sRow ); |
535 |
|
} |
536 |
|
|
537 |
0 |
Coordinate a_oCoordinate = new CoordinateImpl( 0, 0, a_iCol, a_iRow ); |
538 |
0 |
return a_oCoordinate; |
539 |
|
} |
540 |
|
|
541 |
|
protected void putCartesianResult(Map resultMap, float value, class="keyword">float oldValue, String name, String oldName) |
542 |
|
{ |
543 |
0 |
if (value != -1F) |
544 |
|
{ |
545 |
0 |
resultMap.put(oldName, new Float(oldValue)); |
546 |
0 |
resultMap.put(name, new Float(value)); |
547 |
|
} |
548 |
0 |
} |
549 |
|
} |