Rev 1737 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1737 | Rev 1776 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | package pt.estgp.estgweb.services.configuration; |
1 | package pt.estgp.estgweb.services.configuration; |
2 | 2 | ||
3 | import com.owlike.genson.TransformationException; |
- | |
4 | import org.apache.log4j.Logger; |
3 | import org.apache.log4j.Logger; |
5 | import pt.estgp.estgweb.domain.*; |
4 | import pt.estgp.estgweb.domain.*; |
6 | import pt.estgp.estgweb.domain.dao.DaoFactory; |
5 | import pt.estgp.estgweb.domain.dao.DaoFactory; |
7 | import pt.utl.ist.berserk.logic.serviceManager.IService; |
6 | import pt.utl.ist.berserk.logic.serviceManager.IService; |
8 | 7 | ||
Line 14... | Line 13... | ||
14 | { |
13 | { |
15 | private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(ConfigurationSeparatorsService.class); |
14 | private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(ConfigurationSeparatorsService.class); |
16 | 15 | ||
17 | 16 | ||
18 | 17 | ||
19 | public ConfigurationSeparatorImpl newConfigurationSeparator(UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException |
18 | public ConfigurationSeparatorImpl newConfigurationSeparator(UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException |
20 | { |
19 | { |
21 | ConfigurationSeparatorImpl separator = DomainObjectFactory.createConfigurationSeparatorImpl(); |
20 | ConfigurationSeparatorImpl separator = DomainObjectFactory.createConfigurationSeparatorImpl(); |
22 | 21 | ||
23 | separator.setActive(false); |
22 | separator.setActive(false); |
24 | DaoFactory.getConfigurationSeparatorDaoImpl().save(separator); |
23 | DaoFactory.getConfigurationSeparatorDaoImpl().save(separator); |
25 | return separator; |
24 | return separator; |
26 | 25 | ||
27 | } |
26 | } |
28 | public ConfigurationSeparatorImpl removeConfigurationSeparator(1.5.0/docs/api/java/lang/String.html">String json,UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException |
27 | public ConfigurationSeparatorImpl removeConfigurationSeparator(1.5.0/docs/api/java/lang/String.html">String json,UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException |
29 | { |
28 | { |
30 | ConfigurationSeparatorImpl config = ConfigurationSeparatorImpl.loadFromJson(json); |
29 | ConfigurationSeparatorImpl config = ConfigurationSeparatorImpl.loadFromJson(json); |
31 | ConfigurationSeparatorImpl configPersistent = (ConfigurationSeparatorImpl) DaoFactory.getConfigurationSeparatorDaoImpl().load(config.getId()); |
30 | ConfigurationSeparatorImpl configPersistent = (ConfigurationSeparatorImpl) DaoFactory.getConfigurationSeparatorDaoImpl().load(config.getId()); |
32 | DaoFactory.getConfigurationSeparatorDaoImpl().delete(configPersistent); |
31 | DaoFactory.getConfigurationSeparatorDaoImpl().delete(configPersistent); |
33 | return configPersistent; |
32 | return configPersistent; |
34 | 33 | ||
35 | 34 | ||
36 | } |
35 | } |
37 | public ConfigurationSeparatorImpl updateConfigurationSeparator(1.5.0/docs/api/java/lang/String.html">String json, UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException, TransformationException |
36 | public ConfigurationSeparatorImpl updateConfigurationSeparator(1.5.0/docs/api/java/lang/String.html">String json, UserSession session) throws 1.5.0/docs/api/java/io/IOException.html">IOException |
38 | { |
37 | { |
39 | 38 | ||
40 | ConfigurationSeparatorImpl config = ConfigurationSeparatorImpl.loadFromJson(json); |
39 | ConfigurationSeparatorImpl config = ConfigurationSeparatorImpl.loadFromJson(json); |
41 | ConfigurationSeparatorImpl configPersistent = (ConfigurationSeparatorImpl) DaoFactory.getConfigurationSeparatorDaoImpl().load(config.getId()); |
40 | ConfigurationSeparatorImpl configPersistent = (ConfigurationSeparatorImpl) DaoFactory.getConfigurationSeparatorDaoImpl().load(config.getId()); |
42 | configPersistent.setName(config.getName()); |
41 | configPersistent.setName(config.getName()); |