/** * Checks if an object id using the specified institution id, aggregator id, * and root id has already been used in the current data set. * * @param institutionId * The institution is the check for. * @param aggregatorId * The aggregator id to check for. * @param rootId * The root id to check for. * * @return True if an object id using the specified institution id, * aggregator id, and root id has already been used in the current * data set. */ private boolean isObjectIdUsed(String institutionId, String aggregatorId, String rootId) { if (this.targetObjects != null) { for (RcMetadata rcMd : this.targetObjects) { if (rcMd instanceof RcObjectMetadata && ((RcObjectMetadata) rcMd).getInstitutionId().equals(institutionId) && ((RcObjectMetadata) rcMd).getAggregator().equals(aggregatorId) && ((RcObjectMetadata) rcMd).getRootId().equals(rootId)) { return true; } } } return false; }
curOutputFilename += curRcObjectMetadata.getRootId(); curOutputFilename += ".xml"; curOutputFilename += curRcObjectMetadata.getRootId() + File.separator; if (rcDcOutputParams.getDcFilenameMode() == RcDcOutputParameters.DC_OUTPUT_FILENAME_USE_FULL_OBJECT_ID) { curOutputFilename += curRcObjectMetadata.getInstitutionId(); curOutputFilename += curRcObjectMetadata.getAggregator(); curOutputFilename += curRcObjectMetadata.getRootId(); curOutputFilename += ".xml";
curDestinationDirName = rootDestinationDirName + rcObjMd.getInstitutionId() + File.separator + rcObjMd.getAggregator() + File.separator + rcObjMd.getRootId(); curDestinationDir = new File(curDestinationDirName); if (curDestinationDir.exists() && curDestinationDir.listFiles().length > 0) {
this.config.getObjectIdSource() == RcMetadataCreationToolConfiguration.SHARED_FILE_OBJECT_ID_SOURCE) { String finalizedRootId = rcFileSyncObjIdSrc.getRootId(rcObjMd.getInstitutionId(), rcObjMd.getAggregator()); if (!finalizedRootId.equals(rcObjMd.getRootId())) { this.showInformationMessageDialog("Root id " + rcObjMd.getRootId() + " was taken by another user. Root id " + finalizedRootId + " will be used instead.", "Root Id Reassigned"); rcObjMd.setRootId(finalizedRootId); if (this.creatingMetadata) { String curRootId = rcObjMd.getRootId(); if (this.config.getObjectIdSource() == RcMetadataCreationToolConfiguration.USER_CONFIGURATION_OBJECT_ID_SOURCE) {
if (!curDestinationDirectory.exists()) curDestinationDirectory.mkdir(); curDestinationDirectoryPath += curSourceRcObjectMetadata.getRootId() + File.separator; curDestinationDirectory = new File(curDestinationDirectoryPath); if (curDestinationDirectory.exists())