private void create(){
  DocumentBuilderFactory docBFac;
  DocumentBuilder docBuild;
  try {
    docBFac=DocumentBuilderFactory.newInstance();
    docBuild=docBFac.newDocumentBuilder();
    doc=docBuild.newDocument();
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    return;
  }
  rootElement=doc.createElement("mailTemplates");
  doc.appendChild(rootElement);
  Element newelem=doc.createElement("accepted");
  newelem.setAttribute("name","Standard");
  newelem.setAttribute("subject","[JPlag] Account request accepted");
  newelem.setAttribute("data","Dear {realname},\n\nYour JPlag account " + "request has been accepted.\nPlease visit the following " + "URL to get access to the client application:\n\n"+ "Website: {server}\nUsername: {username}\n\n"+ "Best regards\nThe JPlag administration");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("accepted");
  newelem.setAttribute("name","No email");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","Standard");
  newelem.setAttribute("subject","[JPlag] Account request rejected");
  newelem.setAttribute("data","Dear {realname},\n\nWe are sorry to tell" + " you, that we decided not to give you a JPlag account" + " because\n\n<ENTER REASON HERE>\n\nBest regards\nThe JPlag"+ " administration");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","No comparison to the Internet");
  newelem.setAttribute("subject","[JPlag] Account request denied");
  newelem.setAttribute("data","Dear {realname},\n\nIt is our impression" + " that you want to compare your students work to the" + " internet, but JPlag does not do that. For more information"+ " about what JPlag is able to do, please refer to our"+ " website.\nIf this assumption is wrong, please apply again"+ " so that we can give you an account.\n\n"+ "Best regards\nThe JPlag administration");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","No teacher");
  newelem.setAttribute("subject","[JPlag] Account request denied");
  newelem.setAttribute("data","Dear {realname},\n\n" + "You need to be a teacher or lecturer to qualify for an account. " + "If you are neither, you may still get an account for research "+ "reasons, but you have to give more details about the kind of "+ "research you are doing.\n\n"+ "Best regards\nThe JPlag administration");
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","Illegal Email address");
  newelem.setAttribute("subject","[JPlag] Account request denied");
  newelem.setAttribute("data","Dear {realname},\n\n" + "We are sorry to tell you that we can not give you a JPlag " + "account, since you registered with an anonymous email address. "+ "You may re-apply with your official school/university email "+ "address.\n\n"+ "Best regards\nThe JPlag administration");
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","No individual account");
  newelem.setAttribute("subject","[JPlag] Account request denied");
  newelem.setAttribute("data","Dear {realname},\n\n" + "We are sorry to tell you that we can not give you a JPlag " + "account, since you did not apply as an individual. (We do not "+ "give accounts to groups.)\nPlease re-apply with your personal "+ "data.\n\n"+ "Best regards\nThe JPlag administration");
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","Duplication");
  newelem.setAttribute("subject","[JPlag] Account request denied");
  newelem.setAttribute("data","Dear {realname},\n\n" + "We denied your account, since you plan to use JPlag to find " + "code duplication; something which JPlag can not do.\n"+ "It is made to compare different programs to each other. While "+ "this seems to be similar to find duplicates, it is something "+ "different from the technical point of view.\n\n"+ "Best regards\nThe JPlag administration");
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","English");
  newelem.setAttribute("subject","[JPlag] Account request denied");
  newelem.setAttribute("data","Dear {realname},\n\n" + "Although we have localized versions of the JPlag program itself," + " you still have to apply in English or German, since these are"+ " the only languages we understand.\n\n"+ "Best regards\nThe JPlag administration");
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","Full name");
  newelem.setAttribute("subject","[JPlag] Account request denied");
  newelem.setAttribute("data","Dear {realname},\n\n" + "Your account was denied, since you did not fill in the form on " + "the Website properly.\nPlease apply with your full name and "+ "correct email address of your school/university.\n\n"+ "Best regards\nThe JPlag administration");
  newelem=doc.createElement("declined");
  newelem.setAttribute("name","No email");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("serverMail");
  newelem.setAttribute("name","verification");
  newelem.setAttribute("subject","[JPlag] Email address verification");
  newelem.setAttribute("data","Dear {realname},\n\nThis mail is sent " + "to you in order to verificate your email address. Please " + "visit the following URL to activate your request:\n\n"+ "{server}/indexActivate.jsp?code={code}"+ "\n\nAfter the activation the request will be sent to the "+ "administrator who will then decide on your application.\n\n"+ "Best regards\nThe JPlag administration");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("serverMail");
  newelem.setAttribute("name","warnExpire");
  newelem.setAttribute("subject","[JPlag] Your account expires within two weeks!");
  newelem.setAttribute("data","Dear {realname},\n\n" + "Your JPlag account will expire on {expires} (DD.MM.YYYY).\n" + "Please contact us, if you want to extend your "+ "account time.\n\nBest regards\nThe JPlag administration");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("serverMail");
  newelem.setAttribute("name","askExtend");
  newelem.setAttribute("subject","[JPlag] Your account expires within two weeks!");
  newelem.setAttribute("data","Dear {realname},\n\n" + "Your JPlag account will expire on {expires} (DD.MM.YYYY).\n" + "If you want to extend your account time for a year, just "+ "visit the following URL:\n\n"+ "{server}/indexExtend.jsp?code={code}"+ "\n\nIf you do not need this account anymore, you can just "+ "ignore this mail."+ "\n\nBest regards\nThe JPlag administration");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("serverMail");
  newelem.setAttribute("name","expired");
  newelem.setAttribute("subject","[JPlag] Your account has expired!");
  newelem.setAttribute("data","Dear {realname},\n\n" + "We are sorry to tell you that your JPlag account expired " + "today.\nPlease contact us, if you want to reactivate your "+ "account.\n\nBest regards\nThe JPlag administration");
  rootElement.appendChild(newelem);
  newelem=doc.createElement("serverMail");
  newelem.setAttribute("name","requestNotify");
  newelem.setAttribute("subject","[JPlag] New request notification");
  newelem.setAttribute("data","Please decide on the following request " + "in the AdminTool:\n\nUsername: {username}" + "\nReal name: {realname}"+ "\nEmail: {email}\nAlternative email: {emailSecond}"+ "\nHomepage: {homepage}\nReason: {reason}"+ "\nAdditional notes: {notes}");
  rootElement.appendChild(newelem);
  writeXMLFile();
}

private void create ( ) { DocumentBuilderFactory docBFac ; DocumentBuilder docBuild ; try { docBFac = DocumentBuilderFactory . newInstance ( ) ; docBuild = docBFac . newDocumentBuilder ( ) ; doc = docBuild . newDocument ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; return ; } rootElement = doc . createElement ( "mailTemplates" ) ; doc . appendChild ( rootElement ) ; Element newelem = doc . createElement ( "accepted" ) ; newelem . setAttribute ( "name" , "Standard" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request accepted" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\nYour JPlag account " + "request has been accepted.\nPlease visit the following " + "URL to get access to the client application:\n\n" + "Website: {server}\nUsername: {username}\n\n" + "Best regards\nThe JPlag administration" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "accepted" ) ; newelem . setAttribute ( "name" , "No email" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "Standard" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request rejected" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\nWe are sorry to tell" + " you, that we decided not to give you a JPlag account" + " because\n\n<ENTER REASON HERE>\n\nBest regards\nThe JPlag" + " administration" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "No comparison to the Internet" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request denied" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\nIt is our impression" + " that you want to compare your students work to the" + " internet, but JPlag does not do that. For more information" + " about what JPlag is able to do, please refer to our" + " website.\nIf this assumption is wrong, please apply again" + " so that we can give you an account.\n\n" + "Best regards\nThe JPlag administration" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "No teacher" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request denied" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "You need to be a teacher or lecturer to qualify for an account. " + "If you are neither, you may still get an account for research " + "reasons, but you have to give more details about the kind of " + "research you are doing.\n\n" + "Best regards\nThe JPlag administration" ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "Illegal Email address" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request denied" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "We are sorry to tell you that we can not give you a JPlag " + "account, since you registered with an anonymous email address. " + "You may re-apply with your official school/university email " + "address.\n\n" + "Best regards\nThe JPlag administration" ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "No individual account" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request denied" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "We are sorry to tell you that we can not give you a JPlag " + "account, since you did not apply as an individual. (We do not " + "give accounts to groups.)\nPlease re-apply with your personal " + "data.\n\n" + "Best regards\nThe JPlag administration" ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "Duplication" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request denied" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "We denied your account, since you plan to use JPlag to find " + "code duplication; something which JPlag can not do.\n" + "It is made to compare different programs to each other. While " + "this seems to be similar to find duplicates, it is something " + "different from the technical point of view.\n\n" + "Best regards\nThe JPlag administration" ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "English" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request denied" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "Although we have localized versions of the JPlag program itself," + " you still have to apply in English or German, since these are" + " the only languages we understand.\n\n" + "Best regards\nThe JPlag administration" ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "Full name" ) ; newelem . setAttribute ( "subject" , "[JPlag] Account request denied" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "Your account was denied, since you did not fill in the form on " + "the Website properly.\nPlease apply with your full name and " + "correct email address of your school/university.\n\n" + "Best regards\nThe JPlag administration" ) ; newelem = doc . createElement ( "declined" ) ; newelem . setAttribute ( "name" , "No email" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "serverMail" ) ; newelem . setAttribute ( "name" , "verification" ) ; newelem . setAttribute ( "subject" , "[JPlag] Email address verification" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\nThis mail is sent " + "to you in order to verificate your email address. Please " + "visit the following URL to activate your request:\n\n" + "{server}/indexActivate.jsp?code={code}" + "\n\nAfter the activation the request will be sent to the " + "administrator who will then decide on your application.\n\n" + "Best regards\nThe JPlag administration" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "serverMail" ) ; newelem . setAttribute ( "name" , "warnExpire" ) ; newelem . setAttribute ( "subject" , "[JPlag] Your account expires within two weeks!" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "Your JPlag account will expire on {expires} (DD.MM.YYYY).\n" + "Please contact us, if you want to extend your " + "account time.\n\nBest regards\nThe JPlag administration" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "serverMail" ) ; newelem . setAttribute ( "name" , "askExtend" ) ; newelem . setAttribute ( "subject" , "[JPlag] Your account expires within two weeks!" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "Your JPlag account will expire on {expires} (DD.MM.YYYY).\n" + "If you want to extend your account time for a year, just " + "visit the following URL:\n\n" + "{server}/indexExtend.jsp?code={code}" + "\n\nIf you do not need this account anymore, you can just " + "ignore this mail." + "\n\nBest regards\nThe JPlag administration" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "serverMail" ) ; newelem . setAttribute ( "name" , "expired" ) ; newelem . setAttribute ( "subject" , "[JPlag] Your account has expired!" ) ; newelem . setAttribute ( "data" , "Dear {realname},\n\n" + "We are sorry to tell you that your JPlag account expired " + "today.\nPlease contact us, if you want to reactivate your " + "account.\n\nBest regards\nThe JPlag administration" ) ; rootElement . appendChild ( newelem ) ; newelem = doc . createElement ( "serverMail" ) ; newelem . setAttribute ( "name" , "requestNotify" ) ; newelem . setAttribute ( "subject" , "[JPlag] New request notification" ) ; newelem . setAttribute ( "data" , "Please decide on the following request " + "in the AdminTool:\n\nUsername: {username}" + "\nReal name: {realname}" + "\nEmail: {email}\nAlternative email: {emailSecond}" + "\nHomepage: {homepage}\nReason: {reason}" + "\nAdditional notes: {notes}" ) ; rootElement . appendChild ( newelem ) ; writeXMLFile ( ) ; }
creates a new " jplag - user database " xml file
