aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-webapp/src/main/resources/xwork.xml
blob: 806e01095bef7704d571d6449da70562ce6ab2ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!--
  ~ Copyright 2005-2006 The Apache Software Foundation.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.1//EN"
    "http://www.opensymphony.com/xwork/xwork-1.1.dtd">

<xwork>
  <!-- TODO: better error handling for exceptions needed! -->

  <!-- Include webwork defaults (from WebWork JAR). -->
  <include file="webwork-default.xml"/>

  <!-- Include plexus-security xwork configurations. -->  
  <include file="xwork-security.xml" />

  <package name="base" extends="webwork-default">
    <interceptors>
      <interceptor name="configuration" class="configurationInterceptor"/>
      <interceptor name="pssSecureActions" class="pssSecureActionInterceptor"/>
      <interceptor-stack name="configuredStack">
        <interceptor-ref name="defaultStack"/>
        <interceptor-ref name="configuration"/>
        <interceptor-ref name="pssSecureActions"/>
      </interceptor-stack>
      <interceptor-stack name="configuredPrepareParamsStack">
        <interceptor-ref name="paramsPrepareParamsStack"/>
        <interceptor-ref name="configuration"/>
        <interceptor-ref name="pssSecureActions"/>
      </interceptor-stack>
    </interceptors>

    <!-- Default interceptor stack. -->
    <default-interceptor-ref name="configuredStack"/>

    <global-results>
      <!-- TODO: want an extra message on the configure page when this first happens! -->
      <!-- TODO: can we send them back to the original location afterwards? -->
      <result name="admin-user-needed" type="redirect-action">
        <param name="namespace">/admin</param>
        <param name="actionName">addadmin</param>
      </result>
      
      <result name="config-needed" type="redirect-action">
        <param name="namespace">/admin</param>
        <param name="actionName">configure</param>
      </result>
      
      <!-- This redirect is triggered by the configuration interceptor -->
      <result name="config-repository-needed" type="redirect-action">
        <param name="namespace">/admin</param>
        <param name="actionName">addRepository</param>
        <param name="method">input</param>
      </result>
      
      <!-- The following security-* result names arrive from the plexus-security package -->
      <result name="security-login-success" type="redirect-action">browse</result>
      <result name="security-login-cancel" type="redirect-action">browse</result>
      <result name="security-login-locked" type="redirect-action">browse</result>
      <result name="security-logout" type="redirect-action">browse</result>
      <result name="security-register-success" type="redirect-action">
        <param name="actionName">login</param>
        <param name="namespace">/security</param>
      </result>
      <result name="security-register-cancel" type="redirect-action">
        <param name="actionName">login</param>
        <param name="namespace">/security</param>
      </result>
      <result name="security-account-success" type="redirect-action">browse</result>
      <result name="security-account-cancel" type="redirect-action">browse</result>
      
      <!-- These results are names that the SecuredActionInterceptor utilizes -->
      <result name="requires-authentication">/WEB-INF/jsp/alert.jsp</result>
      <result name="requires-authorization">/WEB-INF/jsp/alert.jsp</result>
      
      <!-- Generic Catchall for those action configurations that forget to 
           include a result for 'error' -->
      <result name="error">/WEB-INF/jsp/generalError.jsp</result>
    </global-results>
  </package>

  <!-- Configuration for the default package. -->
  <package name="default" extends="base" namespace="/">
    <interceptors>
      <interceptor name="configuration" class="configurationInterceptor"/>
      <interceptor-stack name="configuredStack">
        <interceptor-ref name="defaultStack"/>
        <interceptor-ref name="configuration"/>
        <interceptor-ref name="pssSecureActions"/>
      </interceptor-stack>
    </interceptors>

    <!-- Default interceptor stack. -->
    <default-interceptor-ref name="configuredStack"/>
    
    <!-- This is the redirection facility for plexus-security, 
         allowing plexus-security to call out from its own set of actions
         into the application webapp, using global result names. -->
    <action name="pssRedirect" class="pss-redirect" method="redirect">
      <result type="redirect-action">browse</result>
    </action>    

    <action name="index" class="searchAction" method="input">
      <result name="input">/WEB-INF/jsp/quickSearch.jsp</result>
    </action>

    <action name="quickSearch" class="searchAction" method="quickSearch">
      <result name="input">/WEB-INF/jsp/quickSearch.jsp</result>
      <result>/WEB-INF/jsp/results.jsp</result>
      <result name="error">/WEB-INF/jsp/quickSearch.jsp</result>
    </action>

    <action name="findArtifact" class="searchAction" method="input">
      <result name="input">/WEB-INF/jsp/findArtifact.jsp</result>
    </action>

    <action name="checksumSearch" class="searchAction" method="findArtifact">
      <result name="input">/WEB-INF/jsp/findArtifact.jsp</result>
      <result name="results">/WEB-INF/jsp/results.jsp</result>
      <result name="error">/WEB-INF/jsp/findArtifact.jsp</result>
      <result name="artifact" type="redirect">
        /browse/${searchResults[0].groupId}/${searchResults[0].artifactId}/${searchResults[0].version}
      </result>
    </action>

    <action name="browse" class="browseAction" method="browse">
      <result>/WEB-INF/jsp/browse.jsp</result>
    </action>

    <action name="browseGroup" class="browseAction" method="browseGroup">
      <result>/WEB-INF/jsp/browseGroup.jsp</result>
    </action>

    <action name="browseArtifact" class="browseAction" method="browseArtifact">
      <result>/WEB-INF/jsp/browseArtifact.jsp</result>
    </action>

    <action name="showArtifact" class="showArtifactAction" method="artifact">
      <result>/WEB-INF/jsp/showArtifact.jsp</result>
    </action>

    <action name="showArtifactDependencies" class="showArtifactAction" method="dependencies">
      <result>/WEB-INF/jsp/showArtifact.jsp</result>
    </action>

    <action name="showArtifactDependees" class="showArtifactAction" method="dependees">
      <result>/WEB-INF/jsp/showArtifact.jsp</result>
    </action>
    
    <action name="showArtifactDependencyTree" class="showArtifactAction" method="dependencyTree">
      <result>/WEB-INF/jsp/showArtifact.jsp</result>
    </action>

    <action name="proxy" class="proxyAction">
      <result type="stream">
        <param name="contentType">${contentType}</param>
        <param name="contentDisposition">filename="${filename}"</param>
        <param name="inputName">artifactStream</param>
        <param name="bufferSize">1024</param>
      </result>
      <result name="notFound" type="httpheader">404</result>
    </action>
  </package>

  <!-- Configuration for the admin package. -->
  <package name="admin" namespace="/admin" extends="base">
  
    <action name="index" class="configureAction" method="input">
      <result name="input">/WEB-INF/jsp/admin/index.jsp</result>
    </action>
  
    <action name="addadmin" class="addAdminAction" method="show">
      <interceptor-ref name="defaultStack"/>
      <result name="input">/WEB-INF/jsp/admin/createAdmin.jsp</result>
      <result name="error">/WEB-INF/jsp/admin/createAdmin.jsp</result>
      <result name="success" type="redirect-action">
        <param name="namespace">/</param>
        <param name="actionName">browse</param>
      </result>    
    </action>

    <action name="addRepository" class="configureRepositoryAction" method="add">
      <result name="input">/WEB-INF/jsp/admin/addRepository.jsp</result>
      <result type="redirect-action">index</result>
      <interceptor-ref name="defaultStack"/>
    </action>

    <action name="editRepository" class="configureRepositoryAction" method="edit">
      <result name="input">/WEB-INF/jsp/admin/editRepository.jsp</result>
      <result type="redirect-action">index</result>
      <interceptor-ref name="configuredPrepareParamsStack"/>
    </action>

    <action name="deleteRepository" class="deleteRepositoryAction">
      <result name="input">/WEB-INF/jsp/admin/deleteRepository.jsp</result>
      <result type="redirect-action">index</result>
    </action>

    <action name="proxiedRepositories" class="configureAction" method="input">
      <result name="input">/WEB-INF/jsp/admin/proxiedRepositories.jsp</result>
    </action>

    <action name="addProxiedRepository" class="configureProxiedRepositoryAction" method="add">
      <result name="input">/WEB-INF/jsp/admin/addProxiedRepository.jsp</result>
      <result type="redirect-action">proxiedRepositories</result>
    </action>

    <action name="editProxiedRepository" class="configureProxiedRepositoryAction" method="edit">
      <result name="input">/WEB-INF/jsp/admin/editProxiedRepository.jsp</result>
      <result type="redirect-action">proxiedRepositories</result>
      <interceptor-ref name="configuredPrepareParamsStack"/>
    </action>

    <action name="deleteProxiedRepository" class="deleteProxiedRepositoryAction">
      <result name="input">/WEB-INF/jsp/admin/deleteProxiedRepository.jsp</result>
      <result type="redirect-action">proxiedRepositories</result>
    </action>

    <action name="syncedRepositories" class="configureAction" method="input">
      <result name="input">/WEB-INF/jsp/admin/syncedRepositories.jsp</result>
    </action>

    <action name="addSyncedRepository" class="configureSyncedRepositoryAction">
      <result name="input">/WEB-INF/jsp/admin/selectSyncedRepository.jsp</result>
      <result type="chain">
        <param name="actionName">addSelectedSyncedRepository</param>
        <param name="method">input</param>
      </result>
    </action>

    <action name="addSelectedSyncedRepository" class="configureSyncedRepositoryAction" method="add">
      <result name="input">/WEB-INF/jsp/admin/addSyncedRepository.jsp</result>
      <result type="redirect-action">syncedRepositories</result>
    </action>

    <action name="editSyncedRepository" class="configureSyncedRepositoryAction" method="edit">
      <result name="input">/WEB-INF/jsp/admin/editSyncedRepository.jsp</result>
      <result type="redirect-action">syncedRepositories</result>
      <interceptor-ref name="configuredPrepareParamsStack"/>
    </action>

    <action name="deleteSyncedRepository" class="deleteSyncedRepositoryAction">
      <result name="input">/WEB-INF/jsp/admin/deleteSyncedRepository.jsp</result>
      <result type="redirect-action">syncedRepositories</result>
    </action>

    <action name="configure" class="configureAction" method="input">
      <result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
      <interceptor-ref name="defaultStack"/>
    </action>

    <action name="saveConfiguration" class="configureAction">
      <result name="input">/WEB-INF/jsp/admin/configure.jsp</result>
      <result>/WEB-INF/jsp/admin/index.jsp</result>
      <interceptor-ref name="defaultStack"/>
    </action>

    <action name="runIndexer" class="runRepositoryTaskAction" method="runIndexer">
      <result type="redirect-action">index</result>
    </action>

    <action name="reports" class="reportsAction">
      <result>/WEB-INF/jsp/reports/reports.jsp</result>
    </action>

    <action name="runReport" class="reportsAction" method="runReport">
      <interceptor-ref name="configuredStack"/>
      <interceptor-ref name="execAndWait"/>
      <result name="wait" type="redirect">/admin/reports.action?reportGroup=${reportGroup}&amp;repositoryId=${repositoryId}&amp;filter=${filter}</result>
      <result name="success" type="redirect">/admin/reports.action?reportGroup=${reportGroup}&amp;repositoryId=${repositoryId}&amp;filter=${filter}</result>
    </action>
  </package>
</xwork>