@Test public void testElementToDataNodeSavesAttributes() throws KettleException { JobMeta mockJobMeta = mock( JobMeta.class ); IUnifiedRepository mockUnifiedRepository = mock( IUnifiedRepository.class ); JobDelegate jobDelegate = new JobDelegate( mockPurRepository, mockUnifiedRepository ); JobLogTable mockJobLogTable = mock( JobLogTable.class ); JobEntryCopy mockJobEntryCopy = mock( JobEntryCopy.class ); Map<String, Map<String, String>> attributes = new HashMap<String, Map<String, String>>(); Map<String, String> group = new HashMap<String, String>(); final String mockGroup = "MOCK_GROUP"; final String mockProperty = "MOCK_PROPERTY"; final String mockValue = "MOCK_VALUE"; group.put( mockProperty, mockValue ); attributes.put( mockGroup, group ); JobEntryBaseAndInterface mockJobEntry = mock( JobEntryBaseAndInterface.class ); when( mockJobEntry.getAttributesMap() ).thenReturn( attributes ); when( mockJobMeta.listParameters() ).thenReturn( new String[] {} ); when( mockJobMeta.getJobLogTable() ).thenReturn( mockJobLogTable ); when( mockJobMeta.nrJobEntries() ).thenReturn( 1 ); when( mockJobMeta.getJobEntry( 0 ) ).thenReturn( mockJobEntryCopy ); when( mockJobEntryCopy.getName() ).thenReturn( "MOCK_NAME" ); when( mockJobEntryCopy.getLocation() ).thenReturn( new Point( 0, 0 ) ); when( mockJobEntryCopy.getEntry() ).thenReturn( mockJobEntry ); DataNode dataNode = jobDelegate.elementToDataNode( mockJobMeta ); DataNode groups = dataNode.getNode( "entries" ).getNodes().iterator().next().getNode( AttributesMapUtil.NODE_ATTRIBUTE_GROUPS ); DataNode mockGroupNode = groups.getNode( mockGroup ); assertEquals( mockValue, mockGroupNode.getProperty( mockProperty ).getString() ); }
public DataNode elementToDataNode( final RepositoryElementInterface element ) throws KettleException { JobMeta jobMeta = (JobMeta) element; DataNode rootNode = new DataNode( NODE_JOB ); if ( jobMeta.getPrivateDatabases() != null ) { String privateDatabaseNames = StringUtils.join( jobMeta.getPrivateDatabases(), JOB_PRIVATE_DATABASE_DELIMITER ); DataNode privateDatabaseNode = rootNode.addNode( NODE_JOB_PRIVATE_DATABASES ); privateDatabaseNode.setProperty( PROP_JOB_PRIVATE_DATABASE_NAMES, privateDatabaseNames ); } DataNode notesNode = rootNode.addNode( NODE_NOTES ); notesNode.setProperty( PROP_NR_NOTES, jobMeta.nrNotes() ); for ( int i = 0; i < jobMeta.nrNotes(); i++ ) { NotePadMeta note = jobMeta.getNote( i ); DataNode noteNode = notesNode.addNode( NOTE_PREFIX + i ); noteNode.setProperty( PROP_XML, note.getXML() ); } if ( log.isDetailed() ) { log.logDetailed( toString(), "Saving " + jobMeta.nrJobEntries() + " Job enty copies to repository..." ); } DataNode entriesNode = rootNode.addNode( NODE_ENTRIES ); entriesNode.setProperty( PROP_NR_JOB_ENTRY_COPIES, jobMeta.nrJobEntries() ); for ( int i = 0; i < jobMeta.nrJobEntries(); i++ ) { JobEntryCopy copy = jobMeta.getJobEntry( i ); JobEntryInterface entry = copy.getEntry(); DataNode copyNode = entriesNode.addNode( sanitizeNodeName( copy.getName() ) + "_" + ( i + 1 ) + EXT_JOB_ENTRY_COPY ); copyNode.setProperty( PROP_NAME, copy.getName() ); copyNode.setProperty( PROP_DESCRIPTION, copy.getDescription() ); copyNode.setProperty( PROP_NR, copy.getNr() ); copyNode.setProperty( PROP_GUI_LOCATION_X, copy.getLocation().x ); copyNode.setProperty( PROP_GUI_LOCATION_Y, copy.getLocation().y ); copyNode.setProperty( PROP_GUI_DRAW, copy.isDrawn() ); copyNode.setProperty( PROP_PARALLEL, copy.isLaunchingInParallel() ); if ( entry instanceof JobEntryBase ) { AttributesMapUtil.saveAttributesMap( copyNode, (JobEntryBase) entry ); } AttributesMapUtil.saveAttributesMap( copyNode, copy ); copyNode.setProperty( PROP_JOBENTRY_TYPE, entry.getPluginId() ); DataNode customNode = new DataNode( NODE_CUSTOM ); RepositoryProxy proxy = new RepositoryProxy( customNode ); entry.saveRep( proxy, proxy.getMetaStore(), null ); compatibleEntrySaveRep( entry, proxy, null ); copyNode.addNode( customNode ); } DataNode hopsNode = rootNode.addNode( NODE_HOPS ); hopsNode.setProperty( PROP_NR_HOPS, jobMeta.nrJobHops() ); for ( int i = 0; i < jobMeta.nrJobHops(); i++ ) { JobHopMeta hop = jobMeta.getJobHop( i ); DataNode hopNode = hopsNode.addNode( JOB_HOP_PREFIX + i ); hopNode.setProperty( JOB_HOP_FROM, hop.getFromEntry().getName() ); hopNode.setProperty( JOB_HOP_FROM_NR, hop.getFromEntry().getNr() ); hopNode.setProperty( JOB_HOP_TO, hop.getToEntry().getName() ); hopNode.setProperty( JOB_HOP_TO_NR, hop.getToEntry().getNr() ); hopNode.setProperty( JOB_HOP_ENABLED, hop.isEnabled() ); hopNode.setProperty( JOB_HOP_EVALUATION, hop.getEvaluation() ); hopNode.setProperty( JOB_HOP_UNCONDITIONAL, hop.isUnconditional() ); } String[] paramKeys = jobMeta.listParameters(); DataNode paramsNode = rootNode.addNode( NODE_PARAMETERS ); paramsNode.setProperty( PROP_NR_PARAMETERS, paramKeys == null ? 0 : paramKeys.length ); for ( int idx = 0; idx < paramKeys.length; idx++ ) { DataNode paramNode = paramsNode.addNode( PARAM_PREFIX + idx ); String key = paramKeys[idx]; String description = jobMeta.getParameterDescription( paramKeys[idx] ); String defaultValue = jobMeta.getParameterDefault( paramKeys[idx] ); paramNode.setProperty( PARAM_KEY, key != null ? key : "" ); paramNode.setProperty( PARAM_DEFAULT, defaultValue != null ? defaultValue : "" ); paramNode.setProperty( PARAM_DESC, description != null ? description : "" ); } saveJobDetails( rootNode, jobMeta ); return rootNode; }
JobDelegate extends AbstractDelegate implements ISharedObjectsTransformer, java.io.Serializable { public DataNode elementToDataNode( final RepositoryElementInterface element ) throws KettleException { JobMeta jobMeta = (JobMeta) element; DataNode rootNode = new DataNode( NODE_JOB ); if ( jobMeta.getPrivateDatabases() != null ) { String privateDatabaseNames = StringUtils.join( jobMeta.getPrivateDatabases(), JOB_PRIVATE_DATABASE_DELIMITER ); DataNode privateDatabaseNode = rootNode.addNode( NODE_JOB_PRIVATE_DATABASES ); privateDatabaseNode.setProperty( PROP_JOB_PRIVATE_DATABASE_NAMES, privateDatabaseNames ); } DataNode notesNode = rootNode.addNode( NODE_NOTES ); notesNode.setProperty( PROP_NR_NOTES, jobMeta.nrNotes() ); for ( int i = 0; i < jobMeta.nrNotes(); i++ ) { NotePadMeta note = jobMeta.getNote( i ); DataNode noteNode = notesNode.addNode( NOTE_PREFIX + i ); noteNode.setProperty( PROP_XML, note.getXML() ); } if ( log.isDetailed() ) { log.logDetailed( toString(), "Saving " + jobMeta.nrJobEntries() + " Job enty copies to repository..." ); } DataNode entriesNode = rootNode.addNode( NODE_ENTRIES ); entriesNode.setProperty( PROP_NR_JOB_ENTRY_COPIES, jobMeta.nrJobEntries() ); for ( int i = 0; i < jobMeta.nrJobEntries(); i++ ) { JobEntryCopy copy = jobMeta.getJobEntry( i ); JobEntryInterface entry = copy.getEntry(); DataNode copyNode = entriesNode.addNode( sanitizeNodeName( copy.getName() ) + "_" + ( i + 1 ) + EXT_JOB_ENTRY_COPY ); copyNode.setProperty( PROP_NAME, copy.getName() ); copyNode.setProperty( PROP_DESCRIPTION, copy.getDescription() ); copyNode.setProperty( PROP_NR, copy.getNr() ); copyNode.setProperty( PROP_GUI_LOCATION_X, copy.getLocation().x ); copyNode.setProperty( PROP_GUI_LOCATION_Y, copy.getLocation().y ); copyNode.setProperty( PROP_GUI_DRAW, copy.isDrawn() ); copyNode.setProperty( PROP_PARALLEL, copy.isLaunchingInParallel() ); if ( entry instanceof JobEntryBase ) { AttributesMapUtil.saveAttributesMap( copyNode, (JobEntryBase) entry ); } AttributesMapUtil.saveAttributesMap( copyNode, copy ); copyNode.setProperty( PROP_JOBENTRY_TYPE, entry.getPluginId() ); DataNode customNode = new DataNode( NODE_CUSTOM ); RepositoryProxy proxy = new RepositoryProxy( customNode ); entry.saveRep( proxy, proxy.getMetaStore(), null ); compatibleEntrySaveRep( entry, proxy, null ); copyNode.addNode( customNode ); } DataNode hopsNode = rootNode.addNode( NODE_HOPS ); hopsNode.setProperty( PROP_NR_HOPS, jobMeta.nrJobHops() ); for ( int i = 0; i < jobMeta.nrJobHops(); i++ ) { JobHopMeta hop = jobMeta.getJobHop( i ); DataNode hopNode = hopsNode.addNode( JOB_HOP_PREFIX + i ); hopNode.setProperty( JOB_HOP_FROM, hop.getFromEntry().getName() ); hopNode.setProperty( JOB_HOP_FROM_NR, hop.getFromEntry().getNr() ); hopNode.setProperty( JOB_HOP_TO, hop.getToEntry().getName() ); hopNode.setProperty( JOB_HOP_TO_NR, hop.getToEntry().getNr() ); hopNode.setProperty( JOB_HOP_ENABLED, hop.isEnabled() ); hopNode.setProperty( JOB_HOP_EVALUATION, hop.getEvaluation() ); hopNode.setProperty( JOB_HOP_UNCONDITIONAL, hop.isUnconditional() ); } String[] paramKeys = jobMeta.listParameters(); DataNode paramsNode = rootNode.addNode( NODE_PARAMETERS ); paramsNode.setProperty( PROP_NR_PARAMETERS, paramKeys == null ? 0 : paramKeys.length ); for ( int idx = 0; idx < paramKeys.length; idx++ ) { DataNode paramNode = paramsNode.addNode( PARAM_PREFIX + idx ); String key = paramKeys[idx]; String description = jobMeta.getParameterDescription( paramKeys[idx] ); String defaultValue = jobMeta.getParameterDefault( paramKeys[idx] ); paramNode.setProperty( PARAM_KEY, key != null ? key : "" ); paramNode.setProperty( PARAM_DEFAULT, defaultValue != null ? defaultValue : "" ); paramNode.setProperty( PARAM_DESC, description != null ? description : "" ); } saveJobDetails( rootNode, jobMeta ); return rootNode; } }
JobDelegate extends AbstractDelegate implements ISharedObjectsTransformer, java.io.Serializable { public DataNode elementToDataNode( final RepositoryElementInterface element ) throws KettleException { JobMeta jobMeta = (JobMeta) element; DataNode rootNode = new DataNode( NODE_JOB ); if ( jobMeta.getPrivateDatabases() != null ) { String privateDatabaseNames = StringUtils.join( jobMeta.getPrivateDatabases(), JOB_PRIVATE_DATABASE_DELIMITER ); DataNode privateDatabaseNode = rootNode.addNode( NODE_JOB_PRIVATE_DATABASES ); privateDatabaseNode.setProperty( PROP_JOB_PRIVATE_DATABASE_NAMES, privateDatabaseNames ); } DataNode notesNode = rootNode.addNode( NODE_NOTES ); notesNode.setProperty( PROP_NR_NOTES, jobMeta.nrNotes() ); for ( int i = 0; i < jobMeta.nrNotes(); i++ ) { NotePadMeta note = jobMeta.getNote( i ); DataNode noteNode = notesNode.addNode( NOTE_PREFIX + i ); noteNode.setProperty( PROP_XML, note.getXML() ); } if ( log.isDetailed() ) { log.logDetailed( toString(), "Saving " + jobMeta.nrJobEntries() + " Job enty copies to repository..." ); } DataNode entriesNode = rootNode.addNode( NODE_ENTRIES ); entriesNode.setProperty( PROP_NR_JOB_ENTRY_COPIES, jobMeta.nrJobEntries() ); for ( int i = 0; i < jobMeta.nrJobEntries(); i++ ) { JobEntryCopy copy = jobMeta.getJobEntry( i ); JobEntryInterface entry = copy.getEntry(); DataNode copyNode = entriesNode.addNode( sanitizeNodeName( copy.getName() ) + "_" + ( i + 1 ) + EXT_JOB_ENTRY_COPY ); copyNode.setProperty( PROP_NAME, copy.getName() ); copyNode.setProperty( PROP_DESCRIPTION, copy.getDescription() ); copyNode.setProperty( PROP_NR, copy.getNr() ); copyNode.setProperty( PROP_GUI_LOCATION_X, copy.getLocation().x ); copyNode.setProperty( PROP_GUI_LOCATION_Y, copy.getLocation().y ); copyNode.setProperty( PROP_GUI_DRAW, copy.isDrawn() ); copyNode.setProperty( PROP_PARALLEL, copy.isLaunchingInParallel() ); if ( entry instanceof JobEntryBase ) { AttributesMapUtil.saveAttributesMap( copyNode, (JobEntryBase) entry ); } AttributesMapUtil.saveAttributesMap( copyNode, copy ); copyNode.setProperty( PROP_JOBENTRY_TYPE, entry.getPluginId() ); DataNode customNode = new DataNode( NODE_CUSTOM ); RepositoryProxy proxy = new RepositoryProxy( customNode ); entry.saveRep( proxy, proxy.getMetaStore(), null ); compatibleEntrySaveRep( entry, proxy, null ); copyNode.addNode( customNode ); } DataNode hopsNode = rootNode.addNode( NODE_HOPS ); hopsNode.setProperty( PROP_NR_HOPS, jobMeta.nrJobHops() ); for ( int i = 0; i < jobMeta.nrJobHops(); i++ ) { JobHopMeta hop = jobMeta.getJobHop( i ); DataNode hopNode = hopsNode.addNode( JOB_HOP_PREFIX + i ); hopNode.setProperty( JOB_HOP_FROM, hop.getFromEntry().getName() ); hopNode.setProperty( JOB_HOP_FROM_NR, hop.getFromEntry().getNr() ); hopNode.setProperty( JOB_HOP_TO, hop.getToEntry().getName() ); hopNode.setProperty( JOB_HOP_TO_NR, hop.getToEntry().getNr() ); hopNode.setProperty( JOB_HOP_ENABLED, hop.isEnabled() ); hopNode.setProperty( JOB_HOP_EVALUATION, hop.getEvaluation() ); hopNode.setProperty( JOB_HOP_UNCONDITIONAL, hop.isUnconditional() ); } String[] paramKeys = jobMeta.listParameters(); DataNode paramsNode = rootNode.addNode( NODE_PARAMETERS ); paramsNode.setProperty( PROP_NR_PARAMETERS, paramKeys == null ? 0 : paramKeys.length ); for ( int idx = 0; idx < paramKeys.length; idx++ ) { DataNode paramNode = paramsNode.addNode( PARAM_PREFIX + idx ); String key = paramKeys[idx]; String description = jobMeta.getParameterDescription( paramKeys[idx] ); String defaultValue = jobMeta.getParameterDefault( paramKeys[idx] ); paramNode.setProperty( PARAM_KEY, key != null ? key : "" ); paramNode.setProperty( PARAM_DEFAULT, defaultValue != null ? defaultValue : "" ); paramNode.setProperty( PARAM_DESC, description != null ? description : "" ); } saveJobDetails( rootNode, jobMeta ); return rootNode; } JobDelegate( final Repository repo, final IUnifiedRepository pur ); }
JobDelegate extends AbstractDelegate implements ISharedObjectsTransformer, java.io.Serializable { public DataNode elementToDataNode( final RepositoryElementInterface element ) throws KettleException { JobMeta jobMeta = (JobMeta) element; DataNode rootNode = new DataNode( NODE_JOB ); if ( jobMeta.getPrivateDatabases() != null ) { String privateDatabaseNames = StringUtils.join( jobMeta.getPrivateDatabases(), JOB_PRIVATE_DATABASE_DELIMITER ); DataNode privateDatabaseNode = rootNode.addNode( NODE_JOB_PRIVATE_DATABASES ); privateDatabaseNode.setProperty( PROP_JOB_PRIVATE_DATABASE_NAMES, privateDatabaseNames ); } DataNode notesNode = rootNode.addNode( NODE_NOTES ); notesNode.setProperty( PROP_NR_NOTES, jobMeta.nrNotes() ); for ( int i = 0; i < jobMeta.nrNotes(); i++ ) { NotePadMeta note = jobMeta.getNote( i ); DataNode noteNode = notesNode.addNode( NOTE_PREFIX + i ); noteNode.setProperty( PROP_XML, note.getXML() ); } if ( log.isDetailed() ) { log.logDetailed( toString(), "Saving " + jobMeta.nrJobEntries() + " Job enty copies to repository..." ); } DataNode entriesNode = rootNode.addNode( NODE_ENTRIES ); entriesNode.setProperty( PROP_NR_JOB_ENTRY_COPIES, jobMeta.nrJobEntries() ); for ( int i = 0; i < jobMeta.nrJobEntries(); i++ ) { JobEntryCopy copy = jobMeta.getJobEntry( i ); JobEntryInterface entry = copy.getEntry(); DataNode copyNode = entriesNode.addNode( sanitizeNodeName( copy.getName() ) + "_" + ( i + 1 ) + EXT_JOB_ENTRY_COPY ); copyNode.setProperty( PROP_NAME, copy.getName() ); copyNode.setProperty( PROP_DESCRIPTION, copy.getDescription() ); copyNode.setProperty( PROP_NR, copy.getNr() ); copyNode.setProperty( PROP_GUI_LOCATION_X, copy.getLocation().x ); copyNode.setProperty( PROP_GUI_LOCATION_Y, copy.getLocation().y ); copyNode.setProperty( PROP_GUI_DRAW, copy.isDrawn() ); copyNode.setProperty( PROP_PARALLEL, copy.isLaunchingInParallel() ); if ( entry instanceof JobEntryBase ) { AttributesMapUtil.saveAttributesMap( copyNode, (JobEntryBase) entry ); } AttributesMapUtil.saveAttributesMap( copyNode, copy ); copyNode.setProperty( PROP_JOBENTRY_TYPE, entry.getPluginId() ); DataNode customNode = new DataNode( NODE_CUSTOM ); RepositoryProxy proxy = new RepositoryProxy( customNode ); entry.saveRep( proxy, proxy.getMetaStore(), null ); compatibleEntrySaveRep( entry, proxy, null ); copyNode.addNode( customNode ); } DataNode hopsNode = rootNode.addNode( NODE_HOPS ); hopsNode.setProperty( PROP_NR_HOPS, jobMeta.nrJobHops() ); for ( int i = 0; i < jobMeta.nrJobHops(); i++ ) { JobHopMeta hop = jobMeta.getJobHop( i ); DataNode hopNode = hopsNode.addNode( JOB_HOP_PREFIX + i ); hopNode.setProperty( JOB_HOP_FROM, hop.getFromEntry().getName() ); hopNode.setProperty( JOB_HOP_FROM_NR, hop.getFromEntry().getNr() ); hopNode.setProperty( JOB_HOP_TO, hop.getToEntry().getName() ); hopNode.setProperty( JOB_HOP_TO_NR, hop.getToEntry().getNr() ); hopNode.setProperty( JOB_HOP_ENABLED, hop.isEnabled() ); hopNode.setProperty( JOB_HOP_EVALUATION, hop.getEvaluation() ); hopNode.setProperty( JOB_HOP_UNCONDITIONAL, hop.isUnconditional() ); } String[] paramKeys = jobMeta.listParameters(); DataNode paramsNode = rootNode.addNode( NODE_PARAMETERS ); paramsNode.setProperty( PROP_NR_PARAMETERS, paramKeys == null ? 0 : paramKeys.length ); for ( int idx = 0; idx < paramKeys.length; idx++ ) { DataNode paramNode = paramsNode.addNode( PARAM_PREFIX + idx ); String key = paramKeys[idx]; String description = jobMeta.getParameterDescription( paramKeys[idx] ); String defaultValue = jobMeta.getParameterDefault( paramKeys[idx] ); paramNode.setProperty( PARAM_KEY, key != null ? key : "" ); paramNode.setProperty( PARAM_DEFAULT, defaultValue != null ? defaultValue : "" ); paramNode.setProperty( PARAM_DESC, description != null ? description : "" ); } saveJobDetails( rootNode, jobMeta ); return rootNode; } JobDelegate( final Repository repo, final IUnifiedRepository pur ); @SuppressWarnings( "unchecked" ) SharedObjects loadSharedObjects( final RepositoryElementInterface element,
      final Map<RepositoryObjectType, List<? extends SharedObjectInterface>> sharedObjectsByType ); void saveSharedObjects( final RepositoryElementInterface element, final String versionComment ); RepositoryElementInterface dataNodeToElement( final DataNode rootNode ); void dataNodeToElement( final DataNode rootNode, final RepositoryElementInterface element ); DataNode elementToDataNode( final RepositoryElementInterface element ); }
JobDelegate extends AbstractDelegate implements ISharedObjectsTransformer, java.io.Serializable { public DataNode elementToDataNode( final RepositoryElementInterface element ) throws KettleException { JobMeta jobMeta = (JobMeta) element; DataNode rootNode = new DataNode( NODE_JOB ); if ( jobMeta.getPrivateDatabases() != null ) { String privateDatabaseNames = StringUtils.join( jobMeta.getPrivateDatabases(), JOB_PRIVATE_DATABASE_DELIMITER ); DataNode privateDatabaseNode = rootNode.addNode( NODE_JOB_PRIVATE_DATABASES ); privateDatabaseNode.setProperty( PROP_JOB_PRIVATE_DATABASE_NAMES, privateDatabaseNames ); } DataNode notesNode = rootNode.addNode( NODE_NOTES ); notesNode.setProperty( PROP_NR_NOTES, jobMeta.nrNotes() ); for ( int i = 0; i < jobMeta.nrNotes(); i++ ) { NotePadMeta note = jobMeta.getNote( i ); DataNode noteNode = notesNode.addNode( NOTE_PREFIX + i ); noteNode.setProperty( PROP_XML, note.getXML() ); } if ( log.isDetailed() ) { log.logDetailed( toString(), "Saving " + jobMeta.nrJobEntries() + " Job enty copies to repository..." ); } DataNode entriesNode = rootNode.addNode( NODE_ENTRIES ); entriesNode.setProperty( PROP_NR_JOB_ENTRY_COPIES, jobMeta.nrJobEntries() ); for ( int i = 0; i < jobMeta.nrJobEntries(); i++ ) { JobEntryCopy copy = jobMeta.getJobEntry( i ); JobEntryInterface entry = copy.getEntry(); DataNode copyNode = entriesNode.addNode( sanitizeNodeName( copy.getName() ) + "_" + ( i + 1 ) + EXT_JOB_ENTRY_COPY ); copyNode.setProperty( PROP_NAME, copy.getName() ); copyNode.setProperty( PROP_DESCRIPTION, copy.getDescription() ); copyNode.setProperty( PROP_NR, copy.getNr() ); copyNode.setProperty( PROP_GUI_LOCATION_X, copy.getLocation().x ); copyNode.setProperty( PROP_GUI_LOCATION_Y, copy.getLocation().y ); copyNode.setProperty( PROP_GUI_DRAW, copy.isDrawn() ); copyNode.setProperty( PROP_PARALLEL, copy.isLaunchingInParallel() ); if ( entry instanceof JobEntryBase ) { AttributesMapUtil.saveAttributesMap( copyNode, (JobEntryBase) entry ); } AttributesMapUtil.saveAttributesMap( copyNode, copy ); copyNode.setProperty( PROP_JOBENTRY_TYPE, entry.getPluginId() ); DataNode customNode = new DataNode( NODE_CUSTOM ); RepositoryProxy proxy = new RepositoryProxy( customNode ); entry.saveRep( proxy, proxy.getMetaStore(), null ); compatibleEntrySaveRep( entry, proxy, null ); copyNode.addNode( customNode ); } DataNode hopsNode = rootNode.addNode( NODE_HOPS ); hopsNode.setProperty( PROP_NR_HOPS, jobMeta.nrJobHops() ); for ( int i = 0; i < jobMeta.nrJobHops(); i++ ) { JobHopMeta hop = jobMeta.getJobHop( i ); DataNode hopNode = hopsNode.addNode( JOB_HOP_PREFIX + i ); hopNode.setProperty( JOB_HOP_FROM, hop.getFromEntry().getName() ); hopNode.setProperty( JOB_HOP_FROM_NR, hop.getFromEntry().getNr() ); hopNode.setProperty( JOB_HOP_TO, hop.getToEntry().getName() ); hopNode.setProperty( JOB_HOP_TO_NR, hop.getToEntry().getNr() ); hopNode.setProperty( JOB_HOP_ENABLED, hop.isEnabled() ); hopNode.setProperty( JOB_HOP_EVALUATION, hop.getEvaluation() ); hopNode.setProperty( JOB_HOP_UNCONDITIONAL, hop.isUnconditional() ); } String[] paramKeys = jobMeta.listParameters(); DataNode paramsNode = rootNode.addNode( NODE_PARAMETERS ); paramsNode.setProperty( PROP_NR_PARAMETERS, paramKeys == null ? 0 : paramKeys.length ); for ( int idx = 0; idx < paramKeys.length; idx++ ) { DataNode paramNode = paramsNode.addNode( PARAM_PREFIX + idx ); String key = paramKeys[idx]; String description = jobMeta.getParameterDescription( paramKeys[idx] ); String defaultValue = jobMeta.getParameterDefault( paramKeys[idx] ); paramNode.setProperty( PARAM_KEY, key != null ? key : "" ); paramNode.setProperty( PARAM_DEFAULT, defaultValue != null ? defaultValue : "" ); paramNode.setProperty( PARAM_DESC, description != null ? description : "" ); } saveJobDetails( rootNode, jobMeta ); return rootNode; } JobDelegate( final Repository repo, final IUnifiedRepository pur ); @SuppressWarnings( "unchecked" ) SharedObjects loadSharedObjects( final RepositoryElementInterface element,
      final Map<RepositoryObjectType, List<? extends SharedObjectInterface>> sharedObjectsByType ); void saveSharedObjects( final RepositoryElementInterface element, final String versionComment ); RepositoryElementInterface dataNodeToElement( final DataNode rootNode ); void dataNodeToElement( final DataNode rootNode, final RepositoryElementInterface element ); DataNode elementToDataNode( final RepositoryElementInterface element ); static final String PROP_USE_LOGFIELD; static final String PROP_PASS_BATCH_ID; static final String PROP_USE_BATCH_ID; static final String PROP_JOB_STATUS; static final String NODE_PARAMETERS; static final String PROP_NR_PARAMETERS; static final String PROP_NR_HOPS; static final String NODE_HOPS; static final String NODE_CUSTOM; static final String PROP_JOBENTRY_TYPE; static final String PROP_PARALLEL; static final String PROP_GUI_DRAW; static final String PROP_GUI_LOCATION_Y; static final String PROP_GUI_LOCATION_X; static final String PROP_NR; static final String PROP_NR_JOB_ENTRY_COPIES; static final String PROP_NR_NOTES; static final String NODE_NOTES; static final String NODE_ENTRIES; }