use of org.guvnor.common.services.project.builder.events.InvalidateDMOPackageCacheEvent in project drools-wb by kiegroup.
the class GlobalsEditorServiceImpl method save.
@Override
public Path save(final Path resource, final GlobalsModel content, final Metadata metadata, final String comment) {
try {
final Package pkg = moduleService.resolvePackage(resource);
final String packageName = (pkg == null ? null : pkg.getPackageName());
content.setPackageName(packageName);
Metadata currentMetadata = metadataService.getMetadata(resource);
ioService.write(Paths.convert(resource), GlobalsPersistence.getInstance().marshal(content), metadataService.setUpAttributes(resource, metadata), commentedOptionFactory.makeCommentedOption(comment));
// Invalidate Package-level DMO cache as Globals have changed.
invalidatePackageDMOEvent.fire(new InvalidateDMOPackageCacheEvent(resource));
fireMetadataSocialEvents(resource, currentMetadata, metadata);
return resource;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
use of org.guvnor.common.services.project.builder.events.InvalidateDMOPackageCacheEvent in project drools-wb by kiegroup.
the class DSLTextEditorServiceImpl method save.
@Override
public Path save(final Path resource, final String content, final Metadata metadata, final String comment) {
try {
Metadata currentMetadata = metadataService.getMetadata(resource);
ioService.write(Paths.convert(resource), content, metadataService.setUpAttributes(resource, metadata), commentedOptionFactory.makeCommentedOption(comment));
// Invalidate Package-level DMO cache as a DSL has been altered
invalidateDMOPackageCache.fire(new InvalidateDMOPackageCacheEvent(resource));
fireMetadataSocialEvents(resource, currentMetadata, metadata);
return resource;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
use of org.guvnor.common.services.project.builder.events.InvalidateDMOPackageCacheEvent in project drools-wb by kiegroup.
the class EnumServiceImpl method save.
@Override
public Path save(final Path resource, final String content, final Metadata metadata, final String comment) {
try {
Metadata currentMetadata = metadataService.getMetadata(resource);
ioService.write(Paths.convert(resource), content, metadataService.setUpAttributes(resource, metadata), commentedOptionFactory.makeCommentedOption(comment));
// Invalidate Package-level DMO cache as Enums have changed.
invalidateDMOPackageCache.fire(new InvalidateDMOPackageCacheEvent(resource));
fireMetadataSocialEvents(resource, currentMetadata, metadata);
return resource;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
Aggregations