@Test public void testValidateMaterialFlowAssociation() { DPSArchive archiver; archiver = new DPSArchive() { public DepData[] getMaterialFlows(String producerID) { return null; } }; archiver.setTargetDCTypesOfHtmlSerials("eJournal, eManuscript, eSerial"); archiver.setMaterialFlowsOfHtmlSerials("1111, 2222, 3333"); assertFalse(archiver.validateMaterialFlowAssociation("1234", "eSerial")); archiver = new DPSArchive() { public DepData[] getMaterialFlows(String producerID) { DepData[] depData = new DepData[10]; for (int i = 0; i < depData.length; i++) { depData[i] = mockDepData("" + i, "Description for " + i); } return depData; } }; archiver.setTargetDCTypesOfHtmlSerials("eJournal, eManuscript, eSerial"); archiver.setMaterialFlowsOfHtmlSerials("1111, 2222, 3333"); assertFalse(archiver.validateMaterialFlowAssociation("1234", "eSerial")); assertFalse(archiver.validateMaterialFlowAssociation("1234", "someOtherDcType")); archiver.setMaterialFlowsOfHtmlSerials("1111, 2222, 5"); assertTrue(archiver.validateMaterialFlowAssociation("1234", "eSerial")); }
public boolean validateMaterialFlowAssociation(String producerId, String targetDcType) { String materialFlowOfTargetDcType = getMaterialFlowOfTargetDCType(targetDcType); if (materialFlowOfTargetDcType == null || materialFlowOfTargetDcType.length() <= 0) return false; DepData[] materialFlows = getMaterialFlows(producerId); if (materialFlows == null || materialFlows.length <=0) { log.error("Could not get any material flows from Rosetta for producer " + producerId + " using URL " + producerWsdlUrl); return false; } for (int i = 0; i < materialFlows.length; i++) { DepData anMF = materialFlows[i]; if (materialFlowOfTargetDcType.equals(anMF.id)) { return true; } } return false; }
DPSArchive extends BaseArchive { public boolean validateMaterialFlowAssociation(String producerId, String targetDcType) { String materialFlowOfTargetDcType = getMaterialFlowOfTargetDCType(targetDcType); if (materialFlowOfTargetDcType == null || materialFlowOfTargetDcType.length() <= 0) return false; DepData[] materialFlows = getMaterialFlows(producerId); if (materialFlows == null || materialFlows.length <=0) { log.error("Could not get any material flows from Rosetta for producer " + producerId + " using URL " + producerWsdlUrl); return false; } for (int i = 0; i < materialFlows.length; i++) { DepData anMF = materialFlows[i]; if (materialFlowOfTargetDcType.equals(anMF.id)) { return true; } } return false; } }
DPSArchive extends BaseArchive { public boolean validateMaterialFlowAssociation(String producerId, String targetDcType) { String materialFlowOfTargetDcType = getMaterialFlowOfTargetDCType(targetDcType); if (materialFlowOfTargetDcType == null || materialFlowOfTargetDcType.length() <= 0) return false; DepData[] materialFlows = getMaterialFlows(producerId); if (materialFlows == null || materialFlows.length <=0) { log.error("Could not get any material flows from Rosetta for producer " + producerId + " using URL " + producerWsdlUrl); return false; } for (int i = 0; i < materialFlows.length; i++) { DepData anMF = materialFlows[i]; if (materialFlowOfTargetDcType.equals(anMF.id)) { return true; } } return false; }  }
DPSArchive extends BaseArchive { public boolean validateMaterialFlowAssociation(String producerId, String targetDcType) { String materialFlowOfTargetDcType = getMaterialFlowOfTargetDCType(targetDcType); if (materialFlowOfTargetDcType == null || materialFlowOfTargetDcType.length() <= 0) return false; DepData[] materialFlows = getMaterialFlows(producerId); if (materialFlows == null || materialFlows.length <=0) { log.error("Could not get any material flows from Rosetta for producer " + producerId + " using URL " + producerWsdlUrl); return false; } for (int i = 0; i < materialFlows.length; i++) { DepData anMF = materialFlows[i]; if (materialFlowOfTargetDcType.equals(anMF.id)) { return true; } } return false; }  @SuppressWarnings("unchecked") String submitToArchive(String targetInstanceOID, String SIP, Map xAttributes, List<ArchiveFile> fileList); CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria); boolean validateProducerAgentName(String producerAgent); boolean isLoginSuccessful(String producerAgent, String agentPassword); DepData[] getProducer(String producerAgentUserId, boolean fromCache); DepData getProducer(String producerAgentUserId, String producerId); DepData[] getMaterialFlows(String producerID); boolean validateMaterialFlowAssociation(String producerId, String targetDcType); void setPdsUrl(String pdsUrl); void setFtpHost(String ftpHost); void setFtpUserName(String ftpUserName); void setFtpPassword(String ftpPassword); void setFtpDirectory(String ftpDirectory); void setDepositServerBaseUrl(String depositServerBaseUrl); void setDpsUserInstitution(String dpsUserInstitution); void setDpsUserName(String dpsUserName); void setDpsUserPassword(String dpsUserPassword); void setMaterialFlowId(String materialFlowId); void setProducerId(String producerId); void setProducerWsdlRelativePath(String producerWsdlRelativePath); void setDepositWsdlRelativePath(String depositWsdlRelativePath); void setAgenciesResponsibleForHtmlSerials(String agenciesResponsibleForHtmlSerials); void setTargetDCTypesOfHtmlSerials(String targetDCTypesOfHtmlSerials); void setMaterialFlowsOfHtmlSerials(String materialFlowsOfHtmlSerials); void setProducerIdsOfHtmlSerials(String producerIdsOfHtmlSerials); void setIeEntityTypesOfHtmlSerials(String ieEntityTypesOfHtmlSerials); void setCustomDepositFormURLsForHtmlSerialIngest(String customDepositFormURLsForHtmlSerialIngest); void setRestrictHTMLSerialAgenciesToHTMLSerialTypes(String restrictHTMLSerialAgenciesToHTMLSerialTypes); void setTargetDCTypesOfCustomWebHarvest(String targetDCTypesOfCustomWebHarvest); void setMaterialFlowsOfCustomWebHarvest(String materialFlowsOfCustomWebHarvest); void setProducerIdsOfCustomWebHarvest(String producerIdsOfCustomWebHarvest); void setIeEntityTypesOfCustomWebHarvest(String ieEntityTypesOfCustomWebHarvest); void setDCTitleSourceOfCustomWebHarvest(String DCTitleSourceOfCustomWebHarvest); void setOmsOpenAccess(String omsOpenAccess); void setOmsPublishedRestricted(String omsPublishedRestricted); void setOmsUnpublishedRestrictedByLocation(String omsUnpublishedRestrictedByLocation); void setOmsUnpublishedRestrictedByPersion(String omsUnpublishedRestrictedByPersion); void setCmsSection(String cmsSection); void setCmsSystem(String cmsSystem); void setCustomDepositFormMapping(CustomDepositFormMapping customDepositFormMapping); }
DPSArchive extends BaseArchive { public boolean validateMaterialFlowAssociation(String producerId, String targetDcType) { String materialFlowOfTargetDcType = getMaterialFlowOfTargetDCType(targetDcType); if (materialFlowOfTargetDcType == null || materialFlowOfTargetDcType.length() <= 0) return false; DepData[] materialFlows = getMaterialFlows(producerId); if (materialFlows == null || materialFlows.length <=0) { log.error("Could not get any material flows from Rosetta for producer " + producerId + " using URL " + producerWsdlUrl); return false; } for (int i = 0; i < materialFlows.length; i++) { DepData anMF = materialFlows[i]; if (materialFlowOfTargetDcType.equals(anMF.id)) { return true; } } return false; }  @SuppressWarnings("unchecked") String submitToArchive(String targetInstanceOID, String SIP, Map xAttributes, List<ArchiveFile> fileList); CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria); boolean validateProducerAgentName(String producerAgent); boolean isLoginSuccessful(String producerAgent, String agentPassword); DepData[] getProducer(String producerAgentUserId, boolean fromCache); DepData getProducer(String producerAgentUserId, String producerId); DepData[] getMaterialFlows(String producerID); boolean validateMaterialFlowAssociation(String producerId, String targetDcType); void setPdsUrl(String pdsUrl); void setFtpHost(String ftpHost); void setFtpUserName(String ftpUserName); void setFtpPassword(String ftpPassword); void setFtpDirectory(String ftpDirectory); void setDepositServerBaseUrl(String depositServerBaseUrl); void setDpsUserInstitution(String dpsUserInstitution); void setDpsUserName(String dpsUserName); void setDpsUserPassword(String dpsUserPassword); void setMaterialFlowId(String materialFlowId); void setProducerId(String producerId); void setProducerWsdlRelativePath(String producerWsdlRelativePath); void setDepositWsdlRelativePath(String depositWsdlRelativePath); void setAgenciesResponsibleForHtmlSerials(String agenciesResponsibleForHtmlSerials); void setTargetDCTypesOfHtmlSerials(String targetDCTypesOfHtmlSerials); void setMaterialFlowsOfHtmlSerials(String materialFlowsOfHtmlSerials); void setProducerIdsOfHtmlSerials(String producerIdsOfHtmlSerials); void setIeEntityTypesOfHtmlSerials(String ieEntityTypesOfHtmlSerials); void setCustomDepositFormURLsForHtmlSerialIngest(String customDepositFormURLsForHtmlSerialIngest); void setRestrictHTMLSerialAgenciesToHTMLSerialTypes(String restrictHTMLSerialAgenciesToHTMLSerialTypes); void setTargetDCTypesOfCustomWebHarvest(String targetDCTypesOfCustomWebHarvest); void setMaterialFlowsOfCustomWebHarvest(String materialFlowsOfCustomWebHarvest); void setProducerIdsOfCustomWebHarvest(String producerIdsOfCustomWebHarvest); void setIeEntityTypesOfCustomWebHarvest(String ieEntityTypesOfCustomWebHarvest); void setDCTitleSourceOfCustomWebHarvest(String DCTitleSourceOfCustomWebHarvest); void setOmsOpenAccess(String omsOpenAccess); void setOmsPublishedRestricted(String omsPublishedRestricted); void setOmsUnpublishedRestrictedByLocation(String omsUnpublishedRestrictedByLocation); void setOmsUnpublishedRestrictedByPersion(String omsUnpublishedRestrictedByPersion); void setCmsSection(String cmsSection); void setCmsSystem(String cmsSystem); void setCustomDepositFormMapping(CustomDepositFormMapping customDepositFormMapping);  }