提交 5a28f0d1 编写于 作者: H hot13399

refactor. clean code for Json, MailSender, pojo and properties.

上级 e5743c80
......@@ -16,9 +16,9 @@ import com.spring.mvc.mini.pojo.ObjectClass;
import com.spring.mvc.mini.properties.Properties;
@Component
public class RequestStatusJsonMapping {
public class RequestStatusJsonParser {
static Logger LOG = LoggerFactory.getLogger(RequestStatusJsonMapping.class);
static Logger LOG = LoggerFactory.getLogger(RequestStatusJsonParser.class);
@Autowired
private Properties properties;
......@@ -27,7 +27,7 @@ public class RequestStatusJsonMapping {
ArrayList<RequestStatus> list = this.readStatus();
ArrayList<ObjectClass> objectClasses = list.get(list.size() - 1).getObjectClassListType().getObjectclasslist();
ArrayList<ObjectClass> objectClasses = list.get(list.size() - 1).getObjectClassListType().getObjectClasses();
return objectClasses.get(objectClasses.size() - 1).getIntclass();
}
......
......@@ -21,36 +21,37 @@ import com.spring.mvc.mini.properties.Properties;
@Component
public class MailSender {
static Logger LOGGER = LoggerFactory.getLogger(MailSender.class);
static Logger LOG = LoggerFactory.getLogger(MailSender.class);
@Autowired
private Properties properties;
public void sendMail(final String username,final String password, String fromAddress, Address[] toAddress, String subject, String text) throws AddressException, MessagingException {
java.util.Properties props = new java.util.Properties();
props.put("mail.smtp.starttls.enable", properties.getStarttlsEnable());
props.put("mail.smtp.auth", properties.getAuth());
props.put("mail.smtp.host", properties.getHost());
props.put("mail.smtp.port", properties.getPort());
public void sendMail(final String username,final String password, String fromAddress, Address[] toAddress, String subject, String text) throws Exception {
Authenticator au = new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
};
Session session = Session.getInstance(props, au);
Message message = new MimeMessage(session);
Message message = new MimeMessage(Session.getInstance(getProperties(), au));
message.setFrom(new InternetAddress(fromAddress));
message.setSubject(subject);
message.setText(text);
message.setRecipients(Message.RecipientType.TO, toAddress);
Transport.send(message);
LOGGER.info("Send Mail Done: "+fromAddress+" to" + toAddress);
LOG.info("Send Mail Done: " + fromAddress + " to" + toAddress);
}
private java.util.Properties getProperties() {
java.util.Properties props = new java.util.Properties();
props.put("mail.smtp.starttls.enable", properties.getStarttlsEnable());
props.put("mail.smtp.auth", properties.getAuth());
props.put("mail.smtp.host", properties.getHost());
props.put("mail.smtp.port", properties.getPort());
return props;
}
}
......@@ -4,106 +4,119 @@ import java.io.Serializable;
import javax.validation.constraints.NotNull;
public class ObjectClass implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@NotNull
String id;
@NotNull
int intclass;
@NotNull
String abbrev;
@NotNull
String adaID;
@NotNull
String name;
@NotNull
String parents;
String comment;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getIntclass() {
return intclass;
}
public void setIntclass(int intclass) {
this.intclass = intclass;
}
public String getAbbrev() {
return abbrev;
}
public void setAbbrev(String abbrev) {
this.abbrev = abbrev;
}
public String getAdaID() {
return adaID;
}
public void setAdaID(String adaID) {
this.adaID = adaID;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParents() {
return parents;
}
public void setParents(String parents) {
this.parents = parents;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
@Override
public String toString() {
return "ObjectClass [id=" + id + ", intclass=" + intclass + ", abbrev="
+ abbrev + ", adaID=" + adaID + ", name=" + name + ", parents="
+ parents + ", comment=" + comment + "]";
}
public boolean match(String searchcritical){
if (this.abbrev.contains(searchcritical)){
return true;
}
if (this.abbrev.contains(searchcritical)){
return true;
}
if (this.adaID.contains(searchcritical)){
return true;
}
if (this.comment.contains(searchcritical)){
return true;
}
if (this.id.contains(searchcritical)){
return true;
}
if (this.name.contains(searchcritical)){
return true;
}
if (this.parents.contains(searchcritical)){
return true;
}
if (String.valueOf(this.intclass).contains(searchcritical)){
return true;
}
return false;
}
public class ObjectClass implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@NotNull
String id;
@NotNull
int intclass;
@NotNull
String abbreviation;
@NotNull
String packageName;
@NotNull
String name;
@NotNull
String parents;
String comment;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int getIntclass() {
return intclass;
}
public void setIntclass(int intclass) {
this.intclass = intclass;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParents() {
return parents;
}
public void setParents(String parents) {
this.parents = parents;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
@Override
public String toString() {
return "ObjectClass [id=" + id + ", intclass=" + intclass + ", abbreviation="
+ abbreviation + ", packageName=" + packageName + ", name=" + name + ", parents="
+ parents + ", comment=" + comment + "]";
}
public boolean match(String searchcritical) {
if (this.abbreviation.contains(searchcritical)) {
return true;
}
if (this.abbreviation.contains(searchcritical)) {
return true;
}
if (this.packageName.contains(searchcritical)) {
return true;
}
if (this.comment.contains(searchcritical)) {
return true;
}
if (this.id.contains(searchcritical)) {
return true;
}
if (this.name.contains(searchcritical)) {
return true;
}
if (this.parents.contains(searchcritical)) {
return true;
}
if (String.valueOf(this.intclass).contains(searchcritical)) {
return true;
}
return false;
}
}
......@@ -3,22 +3,23 @@ package com.spring.mvc.mini.pojo;
import java.util.ArrayList;
public class ObjectClassListType {
ArrayList<ObjectClass> objectclasslist;
public ArrayList<ObjectClass> getObjectclasslist() {
return objectclasslist;
}
ArrayList<ObjectClass> objectClasses;
public void setObjectclasslist(ArrayList<ObjectClass> objectclasslist) {
this.objectclasslist = objectclasslist;
}
public ArrayList<ObjectClass> getObjectClasses() {
return objectClasses;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
for (ObjectClass item:objectclasslist){
sb.append(item);
}
return "ObjectClassListType [objectclasslist=" + sb.toString() + "]";
}
public void setObjectClasses(ArrayList<ObjectClass> objectClasses) {
this.objectClasses = objectClasses;
}
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
for (ObjectClass item : objectClasses) {
sb.append(item);
}
return "ObjectClassListType [objectClasses=" + sb + "]";
}
}
......@@ -5,35 +5,41 @@ import javax.validation.constraints.NotNull;
import com.spring.mvc.mini.password.PasswordJasypter;
public class UserInfo {
@NotNull
String username;
@NotNull
String email;
@NotNull
String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return PasswordJasypter.decryption(this.password);
}
public void setPassword(String password) {
this.password = PasswordJasypter.encryption(password);
}
@Override
public String toString() {
return "UserInfo [username=" + username + ", email=" + email
+ ", password=******]";
}
@NotNull
String username;
@NotNull
String email;
@NotNull
String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return PasswordJasypter.decryption(this.password);
}
public void setPassword(String password) {
this.password = PasswordJasypter.encryption(password);
}
@Override
public String toString() {
return "UserInfo [username=" + username + ", email=" + email
+ ", password=******]";
}
}
......@@ -5,8 +5,6 @@ import java.util.Calendar;
import java.util.Date;
import javax.mail.Address;
import javax.mail.MessagingException;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import org.joda.time.DateTime;
......@@ -15,7 +13,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.spring.mvc.mini.json.RequestStatusJsonMapping;
import com.spring.mvc.mini.json.RequestStatusJsonParser;
import com.spring.mvc.mini.mail.MailSender;
import com.spring.mvc.mini.pojo.RequestStatus;
import com.spring.mvc.mini.pojo.RequestStatusListType;
......@@ -26,75 +24,82 @@ import com.spring.mvc.mini.svn.SVNHandler;
import com.spring.mvc.mini.xml.ObjectClassXMLPaser;
public class ScheduleFileUpdator {
static Logger LOGGER = LoggerFactory.getLogger(ScheduleFileUpdator.class);
@Autowired
RequestStatusJsonMapping rsjm;
@Autowired
SVNHandler sh;
@Autowired
ObjectClassXMLPaser ocxp;
@Autowired
MailSender ms;
public void commitObjectClassXml()
{
Calendar cal = Calendar.getInstance();
Date currenttime = cal.getTime();
LOGGER.info("Scheduler start at:"+ currenttime);
ArrayList<RequestStatus> mrsList = rsjm.readStatus();
int mrsIndex = 0;
for(RequestStatus mrs:mrsList){
int days = Days.daysBetween(new DateTime(mrs.getSubmitDate()), new DateTime(currenttime)).getDays();
if(StatusType.ongoing.equals(mrs.getStatus())){
if(days >= 5){
mrsIndex = mrsList.indexOf(mrs);
mrsList.get(mrsIndex).setCommitDate(currenttime);
mrsList.get(mrsIndex).setStatus(StatusType.commited);
StringBuffer subjectsb = new StringBuffer();
subjectsb.append("Final approval of MO CR ");
subjectsb.append(mrs.getmocrid());
subjectsb.append(" for ");
for(ObjectClass objcls:mrs.getObjectClassListType().getObjectclasslist()){
ocxp.AddObjectClass(objcls);
subjectsb.append(objcls.getAbbrev());
}
LOGGER.info("MO CR "+mrs.getmocrid()+" was checked at:"+ new Date());
try {
this.commitAndSendMail(mrs.getUserinfo(), subjectsb.toString(), "Congratulation!");
} catch (MessagingException e) {
LOGGER.error(e.toString());
}
}
}
}
RequestStatusListType mrslt = new RequestStatusListType();
mrslt.setRequestStatuses(mrsList);
rsjm.writeStatus(mrslt);
sh.svnCheckin();
static Logger LOG = LoggerFactory.getLogger(ScheduleFileUpdator.class);
@Autowired
RequestStatusJsonParser jsonParser;
@Autowired
SVNHandler svnHandler;
@Autowired
ObjectClassXMLPaser objectClassXMLPaser;
@Autowired
MailSender mailSender;
public void commitObjectClassXml() {
Calendar calendar = Calendar.getInstance();
Date currentTime = calendar.getTime();
LOG.info("Scheduler start at:" + currentTime);
ArrayList<RequestStatus> requestStatuses = jsonParser.readStatus();
int requestStatusIndex = 0;
for (RequestStatus status : requestStatuses) {
int daysBetweenSubmitAndCurrent = Days.daysBetween(new DateTime(status.getSubmitDate()), new DateTime(currentTime)).getDays();
if (StatusType.ongoing.equals(status.getStatus())) {
if (daysBetweenSubmitAndCurrent >= 5) {
setCommitDateAndStatus(currentTime, requestStatuses, status);
LOG.info("MO CR " + status.getmocrid() + " was checked at:" + new Date());
try {
this.commitAndSendMail(status.getUserinfo(), appendCommitMessage(status), "Congratulation!");
} catch (Exception e) {
LOG.error(e.toString());
}
}
}
}
RequestStatusListType type = new RequestStatusListType();
type.setRequestStatuses(requestStatuses);
jsonParser.writeStatus(type);
svnHandler.svnCheckin();
}
private String appendCommitMessage(RequestStatus status) {
StringBuffer s = new StringBuffer();
s.append("Final approval of MO CR ");
s.append(status.getmocrid());
s.append(" for ");
for (ObjectClass objcls : status.getObjectClassListType().getObjectClasses()) {
objectClassXMLPaser.AddObjectClass(objcls);
s.append(objcls.getAbbreviation());
}
return s.toString();
}
private void setCommitDateAndStatus(Date currentTime, ArrayList<RequestStatus> requestStatuses, RequestStatus status) {
int requestStatusIndex;
requestStatusIndex = requestStatuses.indexOf(status);
requestStatuses.get(requestStatusIndex).setCommitDate(currentTime);
requestStatuses.get(requestStatusIndex).setStatus(StatusType.commited);
}
public void commitAndSendMail(UserInfo userInfo, String subject, String text) throws Exception {
Address[] toAddress = {new InternetAddress(userInfo.getEmail())};
mailSender.sendMail(userInfo.getUsername(), userInfo.getPassword(), userInfo.getEmail(), toAddress, subject, text);
}
public void commitAndSendMail(UserInfo userinfo ,String subject, String text) throws AddressException, MessagingException{
Address[] toAddress = {new InternetAddress(userinfo.getEmail())};
ms.sendMail(userinfo.getUsername(),userinfo.getPassword(),userinfo.getEmail(),toAddress, subject, text);
}
}
......@@ -25,110 +25,102 @@ import com.spring.mvc.mini.properties.Properties;
@Component
public class SVNHandler {
static Logger LOGGER = LoggerFactory.getLogger(SVNHandler.class);
static Logger LOG = LoggerFactory.getLogger(SVNHandler.class);
@Autowired
private Properties properties;
public void svnCheckin(){
SVNRepository repository = null;
SVNClientManager ourClientManager = SVNClientManager.newInstance();
try{
//initiate the reporitory from the url
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(properties.getRepURL()));
//create authentication data
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(properties.getUsername(), properties.getPassword());
repository.setAuthenticationManager(authManager);
//output some data to verify connection
System.out.println( "Repository Root: " + repository.getRepositoryRoot( true ) );
System.out.println( "Repository UUID: " + repository.getRepositoryUUID( true ) );
//need to identify latest revision
long latestRevision = repository.getLatestRevision();
System.out.println( "Repository Latest Revision: " + latestRevision);
//create client manager and set authentication
ourClientManager.setAuthenticationManager(authManager);
//use commitClient to do the export
SVNCommitClient commitClient = ourClientManager.getCommitClient();
SVNDiffClient diffClient = ourClientManager.getDiffClient();
File xmlfile = new File(properties.getXmlPath());
File jsonfile = new File(properties.getJsonPath());
File[] xmlfilearray = {xmlfile};
File[] jsonfilearray = {jsonfile};
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
diffClient.doDiff(xmlfile, SVNRevision.UNDEFINED, SVNRevision.BASE ,SVNRevision.WORKING,
SVNDepth.INFINITY, true, outputStream, null);
if(outputStream.size() > 0){
commitClient.doCommit(xmlfilearray, false,outputStream.toString() , false, true);
LOGGER.info("XML Checked in at "+new Date());
}
diffClient.doDiff(jsonfile, SVNRevision.UNDEFINED, SVNRevision.BASE ,SVNRevision.WORKING,
public void svnCheckin() {
SVNRepository repository = null;
SVNClientManager ourClientManager = SVNClientManager.newInstance();
try {
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(properties.getRepURL()));
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(properties.getUsername(), properties.getPassword());
repository.setAuthenticationManager(authManager);
LOG.info("Repository Root: " + repository.getRepositoryRoot(true));
LOG.info("Repository UUID: " + repository.getRepositoryUUID(true));
LOG.info("Repository Latest Revision: " + repository.getLatestRevision());
ourClientManager.setAuthenticationManager(authManager);
SVNCommitClient commitClient = ourClientManager.getCommitClient();
SVNDiffClient diffClient = ourClientManager.getDiffClient();
File xmlfile = new File(properties.getXmlPath());
File jsonfile = new File(properties.getJsonPath());
File[] xmlfilearray = {xmlfile};
File[] jsonfilearray = {jsonfile};
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
diffClient.doDiff(xmlfile, SVNRevision.UNDEFINED, SVNRevision.BASE, SVNRevision.WORKING,
SVNDepth.INFINITY, true, outputStream, null);
if(outputStream.size() > 0){
commitClient.doCommit(jsonfilearray, false,outputStream.toString() , false, true);
LOGGER.info("Json SVN Checked in at "+new Date());
}
} catch (SVNException e) {
LOGGER.error(e.toString());
} finally {
ourClientManager.dispose();
}
}
public void svnCheckout() {
File svnTempDir = new File(properties.getRepPath());
if (svnTempDir.exists()){
return;
}
SVNRepository repository = null;
try{
//initiate the reporitory from the url
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(properties.getRepURL()));
//create authentication data
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(properties.getUsername(), properties.getPassword());
repository.setAuthenticationManager(authManager);
//need to identify latest revision
long latestRevision = repository.getLatestRevision();
//create client manager and set authentication
SVNClientManager ourClientManager = SVNClientManager.newInstance();
ourClientManager.setAuthenticationManager(authManager);
//use SVNUpdateClient to do the export
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals( false );
updateClient.doCheckout(repository.getLocation(), svnTempDir,
SVNRevision.create(latestRevision), SVNRevision.create(latestRevision), true);
} catch (SVNException e) {
LOGGER.error(e.toString());
} finally {
LOGGER.info("resources/svn_temp checked outs");
}
}
if (outputStream.size() > 0) {
commitClient.doCommit(xmlfilearray, false, outputStream.toString(), false, true);
LOG.info("XML Checked in at " + new Date());
}
diffClient.doDiff(jsonfile, SVNRevision.UNDEFINED, SVNRevision.BASE, SVNRevision.WORKING,
SVNDepth.INFINITY, true, outputStream, null);
if (outputStream.size() > 0) {
commitClient.doCommit(jsonfilearray, false, outputStream.toString(), false, true);
LOG.info("Json SVN Checked in at " + new Date());
}
} catch (SVNException e) {
LOG.error(e.toString());
} finally {
ourClientManager.dispose();
}
}
public void svnCheckout() {
File svnTempDir = new File(properties.getRepPath());
if (svnTempDir.exists()) {
return;
}
SVNRepository repository = null;
try {
//initiate the reporitory from the url
repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(properties.getRepURL()));
//create authentication data
ISVNAuthenticationManager authManager =
SVNWCUtil.createDefaultAuthenticationManager(properties.getUsername(), properties.getPassword());
repository.setAuthenticationManager(authManager);
//need to identify latest revision
long latestRevision = repository.getLatestRevision();
//create client manager and set authentication
SVNClientManager ourClientManager = SVNClientManager.newInstance();
ourClientManager.setAuthenticationManager(authManager);
//use SVNUpdateClient to do the export
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
updateClient.doCheckout(repository.getLocation(), svnTempDir,
SVNRevision.create(latestRevision), SVNRevision.create(latestRevision), true);
} catch (SVNException e) {
LOG.error(e.toString());
} finally {
LOG.info("resources/svn_temp checked outs");
}
}
}
......@@ -22,8 +22,8 @@ public class ObjectClassDataValidator {
boolean parentsMark = false;
if(!objclsItemFormIn.getAbbrev().equals(objclsItemFormIn.getAbbrev().toUpperCase())){
throw new ObjectClassDataValidationException("FAILED:ObjectClass abbrev:\""+objclsItemFormIn.getAbbrev()+"\" should be all uppercase.");
if(!objclsItemFormIn.getAbbreviation().equals(objclsItemFormIn.getAbbreviation().toUpperCase())){
throw new ObjectClassDataValidationException("FAILED:ObjectClass abbrev:\""+objclsItemFormIn.getAbbreviation()+"\" should be all uppercase.");
}
for (ObjectClass objclsItemXmlIn:objclsListXmlIn){
......@@ -31,8 +31,8 @@ public class ObjectClassDataValidator {
if(objclsItemXmlIn.getId().equals(objclsItemFormIn.getId())){
throw new ObjectClassDataValidationException("FAILED:ObjectClass id:\""+objclsItemFormIn.getId()+"\" is already reserved.");
}
if(objclsItemXmlIn.getAbbrev().equals(objclsItemFormIn.getAbbrev())){
throw new ObjectClassDataValidationException("FAILED:ObjectClass abbrev:\""+objclsItemFormIn.getAbbrev()+"\" is already reserved.");
if(objclsItemXmlIn.getAbbreviation().equals(objclsItemFormIn.getAbbreviation())){
throw new ObjectClassDataValidationException("FAILED:ObjectClass abbrev:\""+objclsItemFormIn.getAbbreviation()+"\" is already reserved.");
}
if(objclsItemXmlIn.getId().equals(objclsItemFormIn.getParents())){
parentsMark = true;
......
......@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.spring.mvc.mini.json.RequestStatusJsonMapping;
import com.spring.mvc.mini.json.RequestStatusJsonParser;
import com.spring.mvc.mini.mail.MailSender;
import com.spring.mvc.mini.pojo.RequestStatus;
import com.spring.mvc.mini.properties.Properties;
......@@ -40,7 +40,7 @@ public class ObjectClassFormController {
static Logger LOGGER = LoggerFactory.getLogger(ObjectClassFormController.class);
@Autowired
RequestStatusJsonMapping rsjm;
RequestStatusJsonParser rsjm;
@Autowired
ObjectClassDataValidator ocdv;
......@@ -72,7 +72,7 @@ public class ObjectClassFormController {
ArrayList<ObjectClass> objclsList = new ArrayList<ObjectClass>();
objclsList.add(createObjectClassInstance(0,userinfo,mocrid));
ojbclslisttype.setObjectclasslist(objclsList);
ojbclslisttype.setObjectClasses(objclsList);
model.addAttribute("ojbclslisttype", ojbclslisttype);
}
......@@ -83,7 +83,7 @@ public class ObjectClassFormController {
@RequestMapping(params={"objclscount"},method=RequestMethod.POST)
public void objectClassFormWithParam(@Valid ObjectClassListType ojbclslisttype, @ModelAttribute("userinfo") UserInfo userinfo, @ModelAttribute("mocrid") String mocrid, @RequestParam String objclscount, Model model) {
ArrayList<ObjectClass> objclsList = ojbclslisttype.getObjectclasslist();
ArrayList<ObjectClass> objclsList = ojbclslisttype.getObjectClasses();
// for(int i=1;i<Integer.parseInt(objclscount)+1;i++){
......@@ -91,7 +91,7 @@ public class ObjectClassFormController {
// }
ojbclslisttype.setObjectclasslist(objclsList);
ojbclslisttype.setObjectClasses(objclsList);
model.addAttribute("ojbclslisttype", ojbclslisttype);
}
......@@ -109,7 +109,7 @@ public class ObjectClassFormController {
return null;
}
ArrayList<ObjectClass> objclsList = ojbclslisttype.getObjectclasslist();
ArrayList<ObjectClass> objclsList = ojbclslisttype.getObjectClasses();
try {
ocdv.checkData(objclsList);
......@@ -151,7 +151,7 @@ public class ObjectClassFormController {
subjectsb.append(mocrid);
subjectsb.append(" for ");
for(ObjectClass objcls:objclsList){
subjectsb.append(objcls.getAbbrev());
subjectsb.append(objcls.getAbbreviation());
}
StringBuffer textsb = new StringBuffer();
......
......@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.spring.mvc.mini.json.RequestStatusJsonMapping;
import com.spring.mvc.mini.json.RequestStatusJsonParser;
import com.spring.mvc.mini.mail.MailSender;
import com.spring.mvc.mini.pojo.RequestStatusListType;
import com.spring.mvc.mini.pojo.UserInfo;
......@@ -34,7 +34,7 @@ public class RequestStatusController {
static Logger LOGGER = LoggerFactory.getLogger(RequestStatusController.class);
@Autowired
RequestStatusJsonMapping rsjm;
RequestStatusJsonParser rsjm;
@Autowired
MailSender ms;
......
......@@ -78,13 +78,13 @@ public class ObjectClassXMLPaser {
if (node instanceof Element) {
objcls.setId(((Element) node).getAttribute("id").toString());
objcls.setAbbrev(((Element) node).getAttribute("abbrev")
objcls.setAbbreviation(((Element) node).getAttribute("abbrev")
.toString());
objcls.setIntclass(Integer.parseInt(((Element) node).getAttribute("intclass")));
objcls.setName(((Element) node).getAttribute("name").toString());
objcls.setParents(((Element) node).getAttribute("parents")
.toString());
objcls.setAdaID(((Element) node).getAttribute("adaID")
objcls.setPackageName(((Element) node).getAttribute("adaID")
.toString());
elementcount++;
objclsList.add(objcls);
......@@ -123,8 +123,8 @@ public class ObjectClassXMLPaser {
Element objclselement = document.createElement("objclass");
objclselement.setAttribute("id", objcls.getId());
objclselement.setAttribute("intclass", String.valueOf(objcls.getIntclass()));
objclselement.setAttribute("abbrev", objcls.getAbbrev());
objclselement.setAttribute("adaID", objcls.getAdaID());
objclselement.setAttribute("abbrev", objcls.getAbbreviation());
objclselement.setAttribute("adaID", objcls.getPackageName());
objclselement.setAttribute("name", objcls.getName());
objclselement.setAttribute("parents", objcls.getParents());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册