01: /**
02: * Copyright 2006 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: **/package org.araneaframework.example.main.web.company;
16:
17: import org.apache.commons.logging.Log;
18: import org.apache.commons.logging.LogFactory;
19: import org.araneaframework.example.main.TemplateBaseWidget;
20: import org.araneaframework.example.main.business.model.CompanyMO;
21:
22: /**
23: * This widget is for displaying a company.
24: * It cancels current call only.
25: *
26: * @author Rein Raudjärv <reinra@ut.ee>*
27: */
28: public class CompanyViewWidget extends TemplateBaseWidget {
29: private static final long serialVersionUID = 1L;
30: private static final Log log = LogFactory
31: .getLog(CompanyViewWidget.class);
32: private Long id = null;
33:
34: /**
35: * @param id Company's Id.
36: */
37: public CompanyViewWidget(Long id) {
38: super ();
39: this .id = id;
40: }
41:
42: protected void init() throws Exception {
43: setViewSelector("company/companyView");
44: log.debug("TemplateCompanyViewWidget init called");
45:
46: putViewData("company", getGeneralDAO().getById(CompanyMO.class,
47: id));
48: }
49:
50: public void handleEventReturn(String eventParameter)
51: throws Exception {
52: getFlowCtx().cancel();
53: }
54: }
|