View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.portletbridge.portlet;
17  
18  import java.util.Map;
19  
20  import javax.portlet.PortletMode;
21  import javax.portlet.PortletModeException;
22  import javax.portlet.PortletSecurityException;
23  import javax.portlet.PortletURL;
24  import javax.portlet.WindowState;
25  import javax.portlet.WindowStateException;
26  
27  /***
28   * TODO: There's a simpler way of doing this 
29   * @author jmccrindle
30   */
31  public class PseudoPortletURL implements PortletURL {
32  
33      private String id;
34      private String start;
35      private String end;
36  
37      public PseudoPortletURL(String start, String end) {
38          this.start = start;
39          this.end = end;
40      }
41  
42      public void setWindowState(WindowState arg0) throws WindowStateException {
43          throw new UnsupportedOperationException();
44      }
45  
46      public void setPortletMode(PortletMode arg0) throws PortletModeException {
47          throw new UnsupportedOperationException();
48      }
49  
50      public void setParameter(String key, String value) {
51          if("id".equals(key)) {
52              this.id = value;
53          } else {
54              throw new UnsupportedOperationException();
55          }
56      }
57  
58      public void setParameter(String arg0, String[] arg1) {
59          throw new UnsupportedOperationException();
60      }
61  
62      public void setParameters(Map arg0) {
63          throw new UnsupportedOperationException();
64      }
65  
66      public void setSecure(boolean arg0) throws PortletSecurityException {
67          throw new UnsupportedOperationException();
68      }
69      
70      public String toString() {
71          return start + id + end;
72      }
73  
74  }