KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > webforwards > actions > LaunchWebForwardAction


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.webforwards.actions;
21
22 import java.awt.Rectangle JavaDoc;
23
24 import com.sslexplorer.core.WindowOpenJavascriptLink;
25 import com.sslexplorer.policyframework.LaunchSession;
26 import com.sslexplorer.policyframework.Resource;
27 import com.sslexplorer.policyframework.actions.AbstractRedirectLaunchAction;
28 import com.sslexplorer.security.SessionInfo;
29 import com.sslexplorer.webforwards.WebForward;
30 import com.sslexplorer.webforwards.WebForwardPlugin;
31
32 /**
33  * Implementation of {@link com.sslexplorer.core.actions.AuthenticatedAction}
34  * that launches a <i>Network Place</i>.
35  * <p>
36  *
37  *
38  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
39  */

40 public class LaunchWebForwardAction extends AbstractRedirectLaunchAction {
41
42     /**
43      * Constructor.
44      *
45      */

46     public LaunchWebForwardAction() {
47         super(WebForwardPlugin.WEBFORWARD_RESOURCE_TYPE, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT | SessionInfo.USER_CONSOLE_CONTEXT);
48     }
49
50     protected String JavaDoc doPrepareLink(LaunchSession launchSession, String JavaDoc returnTo) {
51         WebForward webForward = (WebForward)launchSession.getResource();
52         String JavaDoc uri = webForward.getLaunchUri(launchSession);
53         return new WindowOpenJavascriptLink(uri, "wf_" + webForward.getResourceId(), new Rectangle JavaDoc(0, 0, 800, 600), true, true,
54                         true, true, true).toJavascript();
55     }
56
57     protected boolean isAgentRequired(Resource resource) {
58         return ((WebForward)resource).getType() == WebForward.TYPE_TUNNELED_SITE;
59     }
60
61     protected boolean isDirectLink(LaunchSession launchSession) {
62         return false;
63     }
64 }
65
Popular Tags