[DG: Spanish Sakai] [Importante] Sakai 2.8.2
Miguel Carro Pellicer
farreri.sakai at gmail.com
Tue Jun 12 02:31:18 PDT 2012
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/spanish-sakai/attachments/20120612/6192e195/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 3022 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/spanish-sakai/attachments/20120612/6192e195/attachment-0001.jpg
-------------- next part --------------
Index: api/src/java/org/sakaiproject/emailtemplateservice/hbm/EmailTemplate.hbm.xml
===================================================================
--- api/src/java/org/sakaiproject/emailtemplateservice/hbm/EmailTemplate.hbm.xml (revision 109227)
+++ api/src/java/org/sakaiproject/emailtemplateservice/hbm/EmailTemplate.hbm.xml (working copy)
@@ -34,10 +34,10 @@
<column name="HTMLMESSAGE" not-null="false" length="100000000"/>
</property>
<property name="key" type="java.lang.String" index="email_templ_key">
- <column name="TEMPLATE_KEY" not-null="true" length="255" unique-key="EMAIL_TEMPLATE_ITEM_KEY_LOCALE_KEY"/>
+ <column name="TEMPLATE_KEY" not-null="true" length="255" />
</property>
<property name="locale" type="java.lang.String">
- <column name="TEMPLATE_LOCALE" not-null="false" length="255" unique-key="EMAIL_TEMPLATE_ITEM_KEY_LOCALE_KEY"/>
+ <column name="TEMPLATE_LOCALE" not-null="false" length="255"/>
</property>
<!-- identifies this email template as a default template and indicates the type (reminder, available, etc.), use constants -->
<property name="defaultType" type="java.lang.String" unique="false" length="255" />
Index: impl/logic/pom.xml
===================================================================
--- impl/logic/pom.xml (revision 109227)
+++ impl/logic/pom.xml (working copy)
@@ -57,10 +57,8 @@
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
- <groupId>org.hsqldb</groupId>
+ <groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
- <version>2.2.8</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>dom4j</groupId>
Index: impl/logic/src/java/org/sakaiproject/emailtemplateservice/service/impl/EmailTemplateServiceImpl.java
===================================================================
--- impl/logic/src/java/org/sakaiproject/emailtemplateservice/service/impl/EmailTemplateServiceImpl.java (revision 109227)
+++ impl/logic/src/java/org/sakaiproject/emailtemplateservice/service/impl/EmailTemplateServiceImpl.java (working copy)
@@ -58,7 +58,6 @@
import org.sakaiproject.tool.api.Session;
import org.simpleframework.xml.core.Persister;
-import org.springframework.dao.DataIntegrityViolationException;
public class EmailTemplateServiceImpl implements EmailTemplateService {
@@ -203,12 +202,7 @@
public void saveTemplate(EmailTemplate template) {
//update the modified date
template.setLastModified(new Date());
- try {
- dao.save(template);
- }
- catch (DataIntegrityViolationException die) {
- throw new IllegalArgumentException("Key and locale in use already", die);
- }
+ dao.save(template);
log.info("saved template: " + template.getId());
}
Index: impl/logic/src/test/org/sakaiproject/emailtemplateservice/logic/test/TestEmailTemplateService.java
===================================================================
--- impl/logic/src/test/org/sakaiproject/emailtemplateservice/logic/test/TestEmailTemplateService.java (revision 109227)
+++ impl/logic/src/test/org/sakaiproject/emailtemplateservice/logic/test/TestEmailTemplateService.java (working copy)
@@ -78,33 +78,6 @@
//if these are the same there is something very wrong
assertNotSame(template2.getId(), template1.getId());
-
- //we should not be able to save a new template in the same locale/key
- EmailTemplate template3 = new EmailTemplate();
- template3.setKey(KEY_1);
- template3.setLocale(US_LOCALE);
- template3.setLastModified(new Date());
- template3.setOwner(ADMIN_USER);
- template3.setSubject("Subject 1");
- template3.setMessage("message 1");
-
- EmailTemplate template4 = new EmailTemplate();
- template4.setKey(KEY_1);
- template4.setLocale(US_LOCALE);
- template4.setLastModified(new Date());
- template4.setOwner(ADMIN_USER);
- template4.setSubject("Subject 1");
- template4.setMessage("message 1");
-
- try {
- emailTemplateService.saveTemplate(template3);
- emailTemplateService.saveTemplate(template4);
- fail();
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
}
More information about the spanish-sakai
mailing list