1 /**
2 * Copyright (C) 2005-2009 Alfresco Software Limited.
3 *
4 * This file is part of the Spring Surf Extension project.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package org.springframework.extensions.webscripts;
20
21 /**
22 * Provides information about the WCM sandbox which is currently being
23 * previewed.
24 *
25 * A sandbox context provider may be registered with any of the Alfresco
26 * Store types.
27 *
28 * LocalFileSystemStore
29 * RemoteStore
30 *
31 * @author muzquiano
32 */
33 public class PreviewContext
34 {
35 public static final String DEFAULT_STORE_ID = "sitestore";
36
37 private String storeId = null;
38 private String webappId = null;
39
40 public PreviewContext()
41 {
42 this.storeId = DEFAULT_STORE_ID;
43 }
44
45 /**
46 * Constructs a new remote sandbox context instance
47 *
48 * @param storeId the store id
49 */
50 public PreviewContext(String storeId)
51 {
52 this.storeId = storeId;
53 }
54
55 /**
56 * Constructs a new remote sandbox context instance
57 *
58 * @param storeId the store id
59 * @param webappId the WCM web application id
60 */
61 public PreviewContext(String storeId, String webappId)
62 {
63 this.storeId = storeId;
64 this.webappId = webappId;
65 }
66
67 /**
68 * Gets the id of the store
69 *
70 * @return the store id
71 */
72 public String getStoreId()
73 {
74 return this.storeId;
75 }
76
77 /**
78 * Sets the id of the store
79 *
80 * @param storeId the store id
81 */
82 public void setStoreId(String storeId)
83 {
84 this.storeId = storeId;
85 }
86
87 /**
88 * Gets the WCM web application id
89 *
90 * This applies for the case where the store is an AVM store which
91 * was built by Alfresco WCM.
92 *
93 * @return the WCM web application id
94 */
95 public String getWebappId()
96 {
97 return this.webappId;
98 }
99
100 /**
101 * Sets the WCM web application id
102 *
103 * This applies for the case where the store is an AVM store which
104 * was built by Alfresco WCM.
105 *
106 * @param webappId the WCM web application id
107 */
108 public void setWebappId(String webappId)
109 {
110 this.webappId = webappId;
111 }
112 }