KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > networkplaces > actions > LaunchNetworkPlaceAction


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.networkplaces.actions;
21
22 import java.awt.Rectangle JavaDoc;
23
24 import com.sslexplorer.boot.Util;
25 import com.sslexplorer.core.WindowOpenJavascriptLink;
26 import com.sslexplorer.networkplaces.NetworkPlace;
27 import com.sslexplorer.networkplaces.NetworkPlaceItem;
28 import com.sslexplorer.networkplaces.NetworkPlacePlugin;
29 import com.sslexplorer.policyframework.LaunchSession;
30 import com.sslexplorer.policyframework.Resource;
31 import com.sslexplorer.policyframework.actions.AbstractRedirectLaunchAction;
32 import com.sslexplorer.security.SessionInfo;
33
34 /**
35  * Implementation of {@link com.sslexplorer.core.actions.AuthenticatedAction}
36  * that launches a <i>Network Place</i>.
37  * <p>
38  *
39  *
40  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
41  */

42 public class LaunchNetworkPlaceAction extends AbstractRedirectLaunchAction {
43
44     /**
45      * Constructor.
46      */

47     public LaunchNetworkPlaceAction() {
48         super(NetworkPlacePlugin.NETWORK_PLACE_RESOURCE_TYPE, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT | SessionInfo.USER_CONSOLE_CONTEXT);
49     }
50
51     /*
52      * (non-Javadoc)
53      *
54      * @see com.sslexplorer.core.actions.AuthenticatedAction#isIgnoreSessionLock()
55      */

56     protected boolean isIgnoreSessionLock() {
57         return true;
58     }
59
60     protected String JavaDoc doPrepareLink(LaunchSession launchSession, String JavaDoc returnTo) {
61         String JavaDoc launchUri = ((NetworkPlace)launchSession.getResource()).getLaunchUri(launchSession);
62         return new WindowOpenJavascriptLink(launchUri,
63             "vfs_" + launchSession.getResource().getResourceId() + "_" + System.currentTimeMillis(),
64             new Rectangle JavaDoc(20, 20, NetworkPlaceItem.WINDOW_WIDTH, NetworkPlaceItem.WINDOW_HEIGHT), true, false, false, true, true).toJavascript();
65     }
66
67     protected boolean isAgentRequired(Resource resource) {
68         return false;
69     }
70
71     protected boolean isDirectLink(LaunchSession launchSession) {
72         return false;
73     }
74 }
75
Popular Tags