if (monitor != null) {
monitor.beginTask("", 1); //$NON-NLS-1$
}
try {
IDataModel config = null;
if (cfg != null) {
config = (IDataModel) cfg;
} else {
throw new TapestryFacetException(
Messages.TapestryFacetInstallDelegate_InternalErr);
}
final TapestryUtils tapestryUtil = new TapestryUtilFactory()
.create(fv, ModelProviderManager.getModelProvider(project));
if (tapestryUtil == null) {
throw new TapestryFacetException(NLS.bind(
Messages.Could_Not_GetTapestryVersion, fv.toString()));
}
if (tapestryFacetConfigurationEnabled) {
// Before we do any configuration, verify that web.xml is //
// available for update
final IModelProvider provider = tapestryUtil.getModelProvider();
if (provider == null) {
throw new TapestryFacetException(NLS.bind(
Messages.TapestryFacetInstallDelegate_ConfigErr,
project.getName()));
} else if (!(provider.validateEdit(null, null).isOK())) {
if (!(provider.validateEdit(null, null).isOK())) {// checks
// for
// web.xml
// file
// being
// read-only
// and
// allows
// user
// to
// set
// writeable
throw new TapestryFacetException(
NLS.bind(
Messages.TapestryFacetInstallDelegate_NonUpdateableWebXML,
project.getName()));
}
}
}
Object obj = config
.getProperty(ITapestryFacetInstallDataModelProperties.LIBRARY_PROVIDER_DELEGATE);
// Configure libraries
((LibraryInstallDelegate) obj).execute(new NullProgressMonitor());
final LibraryInstallDelegate libDelegate = (LibraryInstallDelegate) (config
.getProperty(ITapestryFacetInstallDataModelProperties.LIBRARY_PROVIDER_DELEGATE));
final LibraryProviderOperationConfig libConfig = libDelegate
.getLibraryProviderOperationConfig();
if (tapestryFacetConfigurationEnabled) {