import org.splat.som.Step;
/**
- * @author RKV
- *
+ * Step service implementation.
+ * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
*/
public class StepServiceImpl implements StepService {
+ /**
+ * Injected index service.
+ */
private IndexService _indexService;
+ /**
+ * Injected document service.
+ */
private DocumentService _documentService;
+ /**
+ * Injected simulation context service.
+ */
+ private SimulationContextService _simulationContextService;
public SimulationContext addSimulationContext(Step aStep,
SimulationContext.Properties dprop) throws MissedPropertyException,
public SimulationContext addSimulationContext(Step aStep,
SimulationContext context) {
// -------------------------------------------------------------------------
- context.hold(); // Increments the reference count of simulation context
+ getSimulationContextService().hold(context); // Increments the reference count of simulation context
if (aStep.getOwner().isSaved())
try {
Session session = Database.getSession();
aStep.getContex().remove(torem);
session.update(aStep.getOwner());
if (torem.isShared()) {
- torem.release();
+ getSimulationContextService().release(torem);
session.update(torem);
} else {
session.delete(torem);
getDocumentService().generateDocumentId(newdoc, dprop);
// Creation of the save directory
- File wdir = newdoc.getSaveDirectory();
+ File wdir = getDocumentService().getSaveDirectory(newdoc);
if (!wdir.exists()) if (!wdir.mkdirs()) throw new IOException("Cannot create the repository vault directory");
// Identification and save
String refid = dprop.getReference();
if (refid == null) return null;
- Document slot = Database.selectDocument(refid, new Revision().toString());
+ Document slot = getDocumentService().selectDocument(refid, new Revision().toString());
if ( slot == null ) return null;
if (!slot.isUndefined()) return null; // Should not happen
public void setDocumentService(DocumentService documentService) {
_documentService = documentService;
}
+
+ /**
+ * Get the simulationContextService.
+ * @return the simulationContextService
+ */
+ public SimulationContextService getSimulationContextService() {
+ return _simulationContextService;
+ }
+
+ /**
+ * Set the simulationContextService.
+ * @param simulationContextService the simulationContextService to set
+ */
+ public void setSimulationContextService(
+ SimulationContextService simulationContextService) {
+ _simulationContextService = simulationContextService;
+ }
}