View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.portals.gems.browser;
18  
19  import java.io.Serializable;
20  
21  /***
22   * Action Parameter
23   * 
24   * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
25   * @version $Id: ActionParameter.java 516448 2007-03-09 16:25:47Z ate $
26   *  
27   */
28  public class ActionParameter implements Serializable
29  {
30      private static final long serialVersionUID = 1;    
31  
32      String name;
33  
34      String action;
35  
36      String type;
37  
38      String page;
39  
40      public ActionParameter(String name, String action, String type)
41      {
42          this.name = name;
43          if (type.equalsIgnoreCase("psml"))
44          {
45              int index = action.indexOf("/");
46              this.page = action.substring(0, index);
47              this.action = action.substring(index + 1);
48          } else
49          {
50              this.action = action;
51          }
52          this.type = type;
53      }
54  
55      public String getName()
56      {
57          return this.name;
58      }
59  
60      public String getPage()
61      {
62          return this.page;
63      }
64  
65      public String getAction()
66      {
67          return this.action;
68      }
69  
70      public String getType()
71      {
72          return this.type;
73      }
74  
75      public void setName(String name)
76      {
77          this.name = name;
78      }
79  
80      public void setAction(String action)
81      {
82          this.action = action;
83      }
84  
85      public void setType(String type)
86      {
87          this.type = type;
88      }
89  
90  }