// get configuration parameters from Jetspeed Resources
ResourceService serviceConf = ((TurbineServices)TurbineServices.getInstance())
.getResources(PsmlManagerService.SERVICE_NAME);
// test the mapping file and create the mapping object
Mapping mapping = null;
String mapFile = serviceConf.getString("mapping","${webappRoot}/WEB-INF/conf/psml-mapping.xml");
mapFile = TurbineServlet.getRealPath( mapFile );
if (mapFile != null)
{
File map = new File(mapFile);
if ( logger.isDebugEnabled() )
{
logger.debug( "Loading psml mapping file " + mapFile );
}
if (map.exists() && map.isFile() && map.canRead())
{
try
{
mapping = new Mapping();
InputSource is = new InputSource( new FileReader(map) );
is.setSystemId( mapFile );
mapping.loadMapping( is );
}
catch (Exception e)
{
logger.error("Error in psml mapping creation", e);
throw new Exception("Error in mapping");