ApplicationPart EmailTemplatePart {
Module emailtemplate {
basePackage=com.fos.common.emailtemplate
/* Template FTL Model Value Object for UserRegisteration */
DataTransferObject UserRegisteration {
String userFirstName
String userLastName
String emailAddress
String password
String userId
String applicationUrl
String changePasswordUrlLink
String emailSenderDetail
Integer changePasswordLinkExpiry
String passwordLinkExpiry
}
/*
enum PassworkLinkExpiry {
SECONDS("Seconds"),
MINUTES("Minutes"),
HOURS("Hours"),
DAYS("Days")
}
enum EmailTemplatesEnum {
USER_REG_EMAIL("USER_REG_EMAIL"),
RESET_PASSWORD_EMAIL("RESET_PASSWORD_EMAIL")
} */
/* Email Template File to store Email Tempalte */
Entity EmailTemplate {
cache
scaffold
databaseTable="EMAIL_TEMPLATE"
reference @EmailTemplateKey emailTemplateKey key
String ftlFilePath databaseColumn="TEMPLATE_FILE_PATH" length="100"
Boolean status databaseColumn="ACTIVE_FLAG"
Repository EmailTemplateRepository {
List<@EmailTemplate> getEmailTemplate(String countryCode, String languageCode , String templateId) throws EmailTemplateNotFoundException;
}
}
/* Email Tempalte Key Attributes to reterive the tempalte file */
BasicType EmailTemplateKey {
String country_code key databaseColumn="COUNTRY_CODE" length="2"
String lang_code key databaseColumn="LANG_CODE" length="2"
String template_id key databaseColumn="TEMPLATE_ID" length="50"
}
/* Email Tempalte Service */
Service EmailTemplateService {
getEmailTemplate => EmailTemplateRepository.getEmailTemplate;
String getEmailContent(String countryCode , String languageCode , String emailTemplateType , Map<String,Object> dataModel) throws EmailTemplateException;
}
}
}
Currently I had commented the Enumeration to make it work. I have 4 module project set in the parent pom and tried to buid the project.
To make it work , I had commented the enum
Regards,
Mahmood
project.nature=business-tier
#App Server Configuration
deployment.applicationServer=JBoss
#Database Vendor
db.product=mysql
db.mysql.onDeleteCascade=false
generate.ddl=true
#db.useTablePrefixedIdColumn=true
#db.useUnderscoreNaming=false
#Package Names
package.serviceInterface=service
package.serviceImplementation=serviceimpl
package.serviceProxy=serviceproxy
package.consumer=consumer
package.xmlmapper=consumer
package.domain=domain
package.repositoryInterface=repository
package.exception=exception
package.repositoryImplementation=repositoryimpl
package.accessInterface=dao
package.accessImplementation=daoimpl
package.dto=dto
package.web=web
package.richClient=richclient
package.common=common
#Cache Provider
cache.provider=EhCache
# specifies if ServiceContext is to be generated
generate.serviceContext=false
generate.repository.finders=true
generate.NotFoundException=false
generate.module.crypto=false
Regards,
Mahmood
Yes, basePackage null is my error cause.
If I create an Entity on basePackage and the enum on the other model with same name, the generation successful.
Thanks for explanation.
Am Sonntag, den 29.01.2012, 09:30 +0800 schrieb Shamsul Kamal:I thought so. And I think I found the reason why basePackage is null.
Yes, basePackage null is my error cause.
This happens if you only specify ApplicationParts in your model files without an Application.
This is allowed now. I think there should be at least one Application.
I would prefer to add a constraint for this. But it is also easy to fix the NullEvaluation with that constraint.I have to correct myself.
If I create an Entity on basePackage and the enum on the other model with same name, the generation successful.Thanks for explanation.
It is not possible to have two DomainObjects with the same name in different Modules in the same Application/ApplicationPart.
But you can use two DomainObjects with the same name in different ApplicationParts.
It is possible to have the same Modules in two different ApplicationParts.
I think we should add a constraint to avoid splitting a Module over ApplicationParts.