boolean setFontSize = rundata.getParameters().getBoolean("setFontSize");
boolean setFontColor = rundata.getParameters().getBoolean(
"setFontColor");
boolean setTitle = rundata.getParameters().getBoolean("setTitle");
FileItem fileLogo = null;
FileItem fileBgImage = null;
String bgColor = "";
String fontFace = "";
String fontSize = "";
String fontColor = "";
String bgImage = "";
String title = "";
if (setLogo)
{
fileLogo = rundata.getParameters().getFileItem("imgLogo");
}
if (setBgImage)
{
String sampleBg = rundata.getParameters()
.getString("sampleBgImage").trim();
if (sampleBg != null && sampleBg.length() != 0)
{
bgImage = IMAGES_DIRECTORY + sampleBg;
} else
{
fileBgImage = rundata.getParameters().getFileItem("bgImage");
}
}
if (setBgColor)
{
bgColor = rundata.getParameters().getString("bgColor").trim();
}
if (setFontFace)
{
fontFace = rundata.getParameters().getString("fontFace").trim();
}
if (setFontSize)
{
fontSize = rundata.getParameters().getString("fontSize").trim();
}
if (setFontColor)
{
fontColor = rundata.getParameters().getString("fontColor").trim();
}
if (setTitle)
{
title = rundata.getParameters().getString("portalTitle").trim();
}
log.info("fontColor : " + fontColor);
String message = "";
try
{
String logo = "";
String slash = System.getProperty("file.separator");
String imagePath = FormatPath.normalizeDirectoryPath(rundata
.getServletContext().getRealPath("/" + IMAGES_DIRECTORY));
if (fileLogo != null)
{
File file = new File(fileLogo.getFileName());
logo = file.getName();
int index = logo.lastIndexOf("\\");
int index2 = logo.lastIndexOf("//");
if (index > 0)
{
logo = logo.substring(index + 1);
}
if (index2 > 0)
{
logo = logo.substring(index2 + 1);
}
File f = new File(imagePath + logo);
if (f.exists())
{
f.delete();//nik
}
FileUploader fu = new FileUploader();
boolean hasUploaded = fu.upload(fileLogo, imagePath, fileTypes);
//String filename = fu.getFilename(fileLogo, imagePath,
// fileTypes);
if (hasUploaded == true)
{
logo = IMAGES_DIRECTORY + logo;
} else
{
context
.put(
"logoStatus",
"Error occurred while uploading "
+ logo
+ ". Only gif, jpg, and jpeg image files can be uploaded. ");
logo = "";
}
//context.put("logoFile", filename);
}
if (fileBgImage != null)
{
File file1 = new File(fileBgImage.getFileName());
bgImage = file1.getName();
int index = bgImage.lastIndexOf("\\");
int index2 = bgImage.lastIndexOf("//");