* @param fileOrUrl a String representing either an absolute URL or an
* absolute filepath
*/
private PSMLDocument loadDocument(String fileOrUrl)
{
PSMLDocument doc = null;
if (fileOrUrl != null)
{
// we'll assume the name is the the location of the file
File f = null;
f = new File(fileOrUrl);
if (!f.exists())
{
return null;
}
doc = new BasePSMLDocument();
doc.setName(fileOrUrl);
// now that we have a file reference, try to load the serialized PSML
Portlets portlets = null;
FileReader reader = null;
try
{
reader = new FileReader(f);
Unmarshaller unmarshaller = new Unmarshaller(this.loadMapping());
portlets = (Portlets) unmarshaller.unmarshal(reader);
doc.setPortlets(portlets);
}
catch (IOException e)
{
logger.error("PSMLUpdateAction: Could not load the file " + f.getAbsolutePath(), e);