DocumentHandler fpsmlHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", FragmentDefinition.DOCUMENT_TYPE, FragmentDefinitionImpl.class, baseDir + "target/testdata/" + pagesDirName, cache);
DocumentHandler linkHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", Link.DOCUMENT_TYPE, LinkImpl.class, baseDir + "target/testdata/" + pagesDirName, cache);
DocumentHandler folderMetaDataHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", FolderMetaDataImpl.DOCUMENT_TYPE, FolderMetaDataImpl.class, baseDir + "target/testdata/" + pagesDirName, cache);
DocumentHandler pageSecurityHandler = new CastorFileSystemDocumentHandler(idGen, "/JETSPEED-INF/castor/page-mapping.xml", PageSecurityImpl.DOCUMENT_TYPE, PageSecurity.class, baseDir + "target/testdata/" + pagesDirName, cache);
DocumentHandlerFactory handlerFactory = new DocumentHandlerFactoryImpl();
handlerFactory.registerDocumentHandler(psmlHandler);
handlerFactory.registerDocumentHandler(tpsmlHandler);
handlerFactory.registerDocumentHandler(dpsmlHandler);
handlerFactory.registerDocumentHandler(fpsmlHandler);
handlerFactory.registerDocumentHandler(linkHandler);
handlerFactory.registerDocumentHandler(folderMetaDataHandler);
handlerFactory.registerDocumentHandler(pageSecurityHandler);
FolderHandler folderHandler = new FileSystemFolderHandler(idGen, baseDir+"target/testdata/" + pagesDirName, handlerFactory, cache);
CastorXmlPageManager pageManager = new CastorXmlPageManager(idGen, handlerFactory, folderHandler, cache, permissionsEnabled, constraintsEnabled);
pageManager.init();
return pageManager;