1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| //*******************************************************************
//* Fonction: exportInvitationFiles
//* Usage: Copie de tous les fichiers necessaires pour acceder à l'invitation sur le serveur externe
//* Paramètres: String : le type de document (Invitation, Reminder, Newsletter, RSVP, Form)
//* String : la cle primaire de l'objet
//* String : la langue dans laquelle les fichiers doivent être copiés (fr, en ou bi si dans les 2 langues)
//* Retour: aucun
//*******************************************************************
public void exportInvitationFiles(
Statement sqlConnexionRSVP,
String strFolderPath,
String strInvitationKey,
String strDocLanguage,
HttpServletRequest request,
HttpServletResponse response,
String strUser) throws Exception {
if(strDocLanguage.equals("bi")){
exportInvitationFiles(sqlConnexionRSVP, strFolderPath, strInvitationKey, "fr", request, response, strUser);
exportInvitationFiles(sqlConnexionRSVP, strFolderPath, strInvitationKey, "en", request, response, strUser);
}else{
String strImagePrefix = buildImagePrefix("Invitation", strInvitationKey);
String[] strImageInfo;
//Export du repertoire du template choisi pour cette invitation
String strTemplate = getInvitationTemplate(sqlConnexionRSVP, strInvitationKey);
copyFolder(FileAddress+TemplateCssAddress+strTemplate, strFolderPath+"\\"+TemplateCssAddressInWebSite);
//Export de toutes les images uploadees pour cette invitation
Hashtable htbImages = getInvitationImages(sqlConnexionRSVP, strInvitationKey);
Iterator it = htbImages.keySet().iterator();
while (it.hasNext()) {
strImageInfo = (String[])htbImages.get((String)it.next());
copyFile(FileAddress+UploadedFileAddress+strImagePrefix+strImageInfo[1], strFolderPath+"\\"+ImagesAddressInWebSite+strImagePrefix+strImageInfo[1]);
}
//Export du document
BufferedWriter bwOut = new BufferedWriter(new FileWriter(strFolderPath+"\\"+InvitationFileName));
bwOut.write(getGeneratedSourceFromJsp(request, response, "/preview.jsp?previewLanguage="+strDocLanguage+"&objectType=Invitation&objectKey="+strInvitationKey));
bwOut.close();
}
} |
Partager