EMMA Coverage Report (generated Fri Sep 15 10:32:43 EDT 2006)
[all classes][edu.iu.uis.sit.portal.portlet.admin.services]

COVERAGE SUMMARY FOR SOURCE FILE [AdminServiceImpl.java]

nameclass, %method, %block, %line, %
AdminServiceImpl.java100% (1/1)96%  (22/23)96%  (183/190)96%  (53/55)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AdminServiceImpl100% (1/1)96%  (22/23)96%  (183/190)96%  (53/55)
getAdminDAO (): AdminDAO 0%   (0/1)0%   (0/3)0%   (0/1)
getPortalConfig (): PortalConfig 100% (1/1)78%  (14/18)75%  (3/4)
AdminServiceImpl (): void 100% (1/1)100% (3/3)100% (1/1)
deleteApplicationConstant (ApplicationConstant): void 100% (1/1)100% (5/5)100% (2/2)
deletePortalSupport (PortalSupport): void 100% (1/1)100% (5/5)100% (2/2)
deletePortletApplication (PortletApplication): void 100% (1/1)100% (5/5)100% (2/2)
deletePortletConfig (PortletConfig): void 100% (1/1)100% (5/5)100% (2/2)
deletePortletMapping (PortletMapping): void 100% (1/1)100% (5/5)100% (2/2)
findAllApplicationConstants (): List 100% (1/1)100% (4/4)100% (1/1)
findAllPortletMappings (): List 100% (1/1)100% (4/4)100% (1/1)
findApplicationConstantById (Long): ApplicationConstant 100% (1/1)100% (5/5)100% (1/1)
findApplicationConstantByName (String): ApplicationConstant 100% (1/1)100% (5/5)100% (1/1)
findPortalSupportById (Long): PortalSupport 100% (1/1)100% (5/5)100% (1/1)
findPortletApplicationById (Long): PortletApplication 100% (1/1)100% (5/5)100% (1/1)
findPortletConfigById (Long): PortletConfig 100% (1/1)100% (5/5)100% (1/1)
findPortletMappingById (Long): PortletMapping 100% (1/1)100% (5/5)100% (1/1)
saveApplicationConstant (ApplicationConstant): void 100% (1/1)100% (5/5)100% (2/2)
savePortalConfig (PortalConfig): void 100% (1/1)100% (5/5)100% (2/2)
savePortalSupport (PortalConfig, PortalSupport): void 100% (1/1)100% (38/38)100% (10/10)
savePortletApplication (PortalConfig, PortletApplication): void 100% (1/1)100% (38/38)100% (10/10)
savePortletConfig (PortletApplication, PortletConfig): void 100% (1/1)100% (8/8)100% (3/3)
savePortletMapping (PortletMapping): void 100% (1/1)100% (5/5)100% (2/2)
setAdminDAO (AdminDAO): void 100% (1/1)100% (4/4)100% (2/2)

1package edu.iu.uis.sit.portal.portlet.admin.services;
2 
3import java.util.Iterator;
4import java.util.List;
5 
6import edu.iu.uis.sit.portal.portlet.admin.dao.AdminDAO;
7import edu.iu.uis.sit.portal.portlet.admin.domain.ApplicationConstant;
8import edu.iu.uis.sit.portal.portlet.admin.domain.PortalConfig;
9import edu.iu.uis.sit.portal.portlet.admin.domain.PortalSupport;
10import edu.iu.uis.sit.portal.portlet.admin.domain.PortletApplication;
11import edu.iu.uis.sit.portal.portlet.admin.domain.PortletConfig;
12import edu.iu.uis.sit.portal.portlet.admin.domain.PortletMapping;
13 
14public class AdminServiceImpl implements AdminService {
15        private AdminDAO adminDAO;
16 
17        public void savePortletConfig(PortletApplication portletApplication, PortletConfig portletConfig) {
18                portletConfig.setPortletApplication(portletApplication);
19                adminDAO.savePortletConfig(portletConfig);
20        }
21 
22        public void deletePortletConfig(PortletConfig portletConfig) {
23                adminDAO.deletePortletConfig(portletConfig);
24        }
25 
26        public PortletConfig findPortletConfigById(Long portletConfigId) {
27                return adminDAO.findPortletConfigById(portletConfigId);
28        }
29 
30        public void deletePortalSupport(PortalSupport portalSupport) {
31                adminDAO.deletePortalSupport(portalSupport);
32        }
33 
34        public PortalSupport findPortalSupportById(Long portalSupportId) {
35                return adminDAO.findPortalSupportById(portalSupportId);
36        }
37 
38        public void savePortletApplication(PortalConfig portalConfig, PortletApplication portletApplication) {
39                if (portletApplication.getPortletApplicationId() != null) {
40                        for (Iterator iter = portalConfig.getPortletApplications().iterator(); iter.hasNext();) {
41                                PortletApplication application = (PortletApplication) iter.next();
42                                if (application.getPortletApplicationId().longValue() == portletApplication.getPortletApplicationId().longValue()) {
43                                        application.setContextPath(portletApplication.getContextPath());
44                                }
45                        }
46                } else {
47                        portalConfig.getPortalSupports().add(portletApplication);
48                }
49                adminDAO.savePortalConfig(portalConfig);
50        }
51 
52        public void deletePortletApplication(PortletApplication portletApplication) {
53                adminDAO.deletePortletApplication(portletApplication);
54        }
55 
56        public PortletApplication findPortletApplicationById(Long portletApplicationId) {
57                return adminDAO.findPortletApplicationById(portletApplicationId);
58        }
59 
60        public void savePortalSupport(PortalConfig portalConfig, PortalSupport portalSupport) {
61                if (portalSupport.getPortalSupportId() != null) {
62                        for (Iterator iter = portalConfig.getPortalSupports().iterator(); iter.hasNext();) {
63                                PortalSupport support = (PortalSupport) iter.next();
64                                if (support.getPortalSupportId().longValue() == portalSupport.getPortalSupportId().longValue()) {
65                                        support.setSupportName(portalSupport.getSupportName());
66                                }
67                        }
68                } else {
69                        portalConfig.getPortalSupports().add(portalSupport);
70                }
71                adminDAO.savePortalConfig(portalConfig);
72        }
73 
74        public void saveApplicationConstant(ApplicationConstant applicationConstant) {
75                adminDAO.saveApplicationConstant(applicationConstant);
76        }
77 
78        public void deleteApplicationConstant(ApplicationConstant applicationConstant) {
79                adminDAO.deleteApplicationConstant(applicationConstant);
80        }
81 
82        public List findAllApplicationConstants() {
83                return adminDAO.findAllApplicationConstants();
84        }
85 
86        public ApplicationConstant findApplicationConstantByName(String constantName) {
87                return adminDAO.findApplicationConstantByName(constantName);
88        }
89 
90        public ApplicationConstant findApplicationConstantById(Long constantId) {
91                return adminDAO.findApplicationConstantById(constantId);
92        }
93 
94        public void savePortletMapping(PortletMapping portletMapping) {
95                adminDAO.savePortletMapping(portletMapping);
96        }
97 
98        public void deletePortletMapping(PortletMapping portletMapping) {
99                adminDAO.deletePortletMapping(portletMapping);
100        }
101 
102        public List findAllPortletMappings() {
103                return adminDAO.findAllPortletMappings();
104        }
105 
106        public PortletMapping findPortletMappingById(Long mappingId) {
107                return adminDAO.findPortletMappingById(mappingId);
108        }
109 
110        public void savePortalConfig(PortalConfig portalConfig) {
111                adminDAO.savePortalConfig(portalConfig);
112        }
113 
114        public PortalConfig getPortalConfig() {
115                List portalConfig = adminDAO.getPortalConfigs();
116 
117                if (portalConfig != null && !portalConfig.isEmpty()) {
118                        return (PortalConfig) portalConfig.get(0);
119                }
120                return new PortalConfig();
121        }
122 
123        public AdminDAO getAdminDAO() {
124                return adminDAO;
125        }
126 
127        public void setAdminDAO(AdminDAO adminDAO) {
128                this.adminDAO = adminDAO;
129        }
130 
131}

[all classes][edu.iu.uis.sit.portal.portlet.admin.services]
EMMA 2.0.5312 (C) Vladimir Roubtsov