01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/courier/tags/sakai_2-4-1/courier-util/util/src/java/org/sakaiproject/util/DirectRefreshDelivery.java $
03: * $Id: DirectRefreshDelivery.java 7855 2006-04-17 15:33:53Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.util;
21:
22: /**
23: * <p>
24: * DirectRefreshDelivery is a Delivery that does a direct location refresh.
25: * </p>
26: */
27: public class DirectRefreshDelivery extends BaseDelivery {
28: /**
29: * Construct.
30: *
31: * @param address
32: * The address.
33: */
34: public DirectRefreshDelivery(String address) {
35: super (address, null);
36: }
37:
38: /**
39: * Construct.
40: *
41: * @param address
42: * The address.
43: * @param elementId
44: * The elementId.
45: */
46: public DirectRefreshDelivery(String address, String elementId) {
47: super (address, elementId);
48: }
49:
50: /**
51: * Compose a javascript message for delivery to the browser client window.
52: *
53: * @return The javascript message to send to the browser client window.
54: */
55: public String compose() {
56: return "try { "
57: + ((m_elementId == null) ? "" : m_elementId + ".")
58: + "location.replace("
59: + ((m_elementId == null) ? "" : m_elementId + ".")
60: + "location); } catch(error) {}";
61: }
62: }
|