KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > nl > hippo > cms > workflows > multiplesitesdocument > StoreNumberOfOutstandingDeletionReviewsFunction


1 /*
2  * Copyright 2004 Hippo Webworks.
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 nl.hippo.cms.workflows.multiplesitesdocument;
17
18 import com.opensymphony.module.propertyset.PropertySet;
19 import com.opensymphony.workflow.WorkflowException;
20 import java.util.Map JavaDoc;
21 import nl.hippo.cms.sitesdirectory.SitesDirectory;
22 import nl.hippo.cms.workflows.shared.FunctionProviderComponent;
23 import org.apache.avalon.framework.service.ServiceException;
24
25 public class StoreNumberOfOutstandingDeletionReviewsFunction extends FunctionProviderComponent
26 {
27
28     public StoreNumberOfOutstandingDeletionReviewsFunction()
29     {
30         super();
31     }
32
33     public void executeImpl(Map JavaDoc transientVars, Map JavaDoc args, PropertySet ps) throws WorkflowException
34     {
35         try
36         {
37             SitesDirectory sitesDir = (SitesDirectory) m_manager.lookup(SitesDirectory.ROLE);
38             try
39             {
40                 int numberOfOutstandingReviews = sitesDir.getNumberOfSites();
41                 ps.setInt("numberOfOutstandingReviews", numberOfOutstandingReviews);
42             }
43             finally
44             {
45                 m_manager.release(sitesDir);
46             }
47         }
48         catch (ServiceException e)
49         {
50             throw new WorkflowException(e);
51         }
52     }
53
54 }
55
Popular Tags