@Test public void testPopulateDepositParameterFromFields_webHarvest() { DPSArchive archiver = new DPSArchive(); setVariousParameters(archiver); Map<String, String> attributes = mockDasAttributeMap(); String finalSIP = "someFinalSIPXml"; String targetInstanceOID = "112233"; Map<String, String> parameters = archiver.populateDepositParameterFromFields(attributes, finalSIP, targetInstanceOID); assertEquals("aDpsUserInstitution", parameters.get(DpsDepositFacade.DPS_INSTITUTION)); assertEquals("aDpsUserName", parameters.get(DpsDepositFacade.DPS_USER_NAME)); assertEquals("aDpsUserPassword", parameters.get(DpsDepositFacade.DPS_PASSWORD)); assertEquals("aFtpHost", parameters.get(DpsDepositFacade.FTP_HOST)); assertEquals("aFtpPassword", parameters.get(DpsDepositFacade.FTP_PASSWORD)); assertEquals("aFtpUserName", parameters.get(DpsDepositFacade.FTP_USER_NAME)); assertEquals("aFtpDirectory", parameters.get(DpsDepositFacade.FTP_DIRECTORY)); assertEquals("aMaterialFlowId", parameters.get(DpsDepositFacade.MATERIAL_FLOW_ID)); assertEquals("aPdsUrl", parameters.get(DpsDepositFacade.PDS_URL)); assertEquals("aProducerId", parameters.get(DpsDepositFacade.PRODUCER_ID)); assertEquals("http: assertEquals("112233", parameters.get(DpsDepositFacade.TARGET_INSTANCE_ID)); assertEquals("someFinalSIPXml", parameters.get(DpsDepositFacade.WCT_METS_XML_DOCUMENT)); assertEquals("1234567890", parameters.get(DpsDepositFacade.ILS_REFERENCE)); assertEquals("anAccessRestriction", parameters.get(DpsDepositFacade.ACCESS_RESTRICTION)); assertEquals("TraditionalWebHarvest", parameters.get(DpsDepositFacade.HARVEST_TYPE)); }
protected Map<String, String> populateDepositParameterFromFields(Map<?, ?> attributes, String finalSIP, String targetInstanceOID) { Map<String, String> parameterMap = new HashMap<String, String>(); String dpsUserNameToUse = this.dpsUserName; String dpsUserPasswordToUse = this.dpsUserPassword; String producerIdToUse = this.producerId; String materialFlowIdToUse = this.materialFlowId; String ieEntityTypeToUse = null; String dcTitleSourceToUse = null; if (Boolean.parseBoolean((String)attributes.get("customDepositForm_customFormPopulated"))) { int targetTypeIndex = getIndexInList((String) attributes.get(HARVEST_TYPE), targetDCTypesOfHtmlSerials); List<CustomDepositField> customDepositFormFieldMapping = null; String customFormURL = customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex); if(customDepositFormMapping.hasFormMapping(customFormURL)){ customDepositFormFieldMapping = customDepositFormMapping.getFormMapping(customFormURL); } else { throw new RuntimeException("Could not retrieve the Custom Deposit Form mappings for " + customFormURL + "."); } dpsUserNameToUse = (String) attributes.get("customDepositForm_producerAgent"); dpsUserPasswordToUse = (String) attributes.get("customDepositForm_producerAgentPassword"); producerIdToUse = (String) attributes.get("customDepositForm_producerId"); String targetDcType = (String) attributes.get("customDepositForm_targetDcType"); materialFlowIdToUse = getMaterialFlowOfTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfTargetDCType(targetDcType); parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.HtmlSerialHarvest.name()); parameterMap.put(DpsDepositFacade.CUSTOM_DEPOSIT_FORM_URL, customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); for(CustomDepositField field : customDepositFormFieldMapping){ parameterMap.put(field.getFieldReference(), (String) attributes.get(field.getFormFieldLabel())); } } else { if(isCustomTargetDCType((String) attributes.get(HARVEST_TYPE))){ String targetDcType = (String) attributes.get(HARVEST_TYPE); materialFlowIdToUse = getMaterialFlowOfCustomTargetDCType(targetDcType); producerIdToUse = getProducerIdsOfCustomTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfCustomTargetDCType(targetDcType); dcTitleSourceToUse= getDCTitleSourceOfCustomTargetDCType(targetDcType); if(dcTitleSourceToUse == null) dcTitleSourceToUse = ""; parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.CustomWebHarvest.name()); } else { parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.TraditionalWebHarvest.name()); } } parameterMap.put(DpsDepositFacade.DPS_INSTITUTION, this.dpsUserInstitution); parameterMap.put(DpsDepositFacade.DPS_USER_NAME, dpsUserNameToUse); parameterMap.put(DpsDepositFacade.DPS_PASSWORD, dpsUserPasswordToUse); parameterMap.put(DpsDepositFacade.FTP_HOST, this.ftpHost); parameterMap.put(DpsDepositFacade.FTP_PASSWORD, this.ftpPassword); parameterMap.put(DpsDepositFacade.FTP_USER_NAME, this.ftpUserName); parameterMap.put(DpsDepositFacade.FTP_DIRECTORY, this.ftpDirectory); parameterMap.put(DpsDepositFacade.MATERIAL_FLOW_ID, materialFlowIdToUse); parameterMap.put(DpsDepositFacade.IE_ENTITY_TYPE, ieEntityTypeToUse); parameterMap.put(DpsDepositFacade.TITLE_SOURCE, dcTitleSourceToUse); parameterMap.put(DpsDepositFacade.PDS_URL, this.pdsUrl); parameterMap.put(DpsDepositFacade.PRODUCER_ID, producerIdToUse); parameterMap.put(DpsDepositFacade.DPS_WSDL_URL, depositServerBaseUrl + depositWsdlRelativePath); parameterMap.put(DpsDepositFacade.OMS_OPEN_ACCESS, this.omsOpenAccess); parameterMap.put(DpsDepositFacade.OMS_PUBLISHED_RESTRICTED, this.omsPublishedRestricted); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_LOCATION, this.omsUnpublishedRestrictedByLocation); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_PERSON, this.omsUnpublishedRestrictedByPersion); parameterMap.put(DpsDepositFacade.CMS_SECTION, this.cmsSection); parameterMap.put(DpsDepositFacade.CMS_SYSTEM, this.cmsSystem); String ilsReference = (String)attributes.get(REFERENCE_NUMBER); if (ilsReference != null) ilsReference = ilsReference.trim(); parameterMap.put(DpsDepositFacade.ILS_REFERENCE, ilsReference); parameterMap.put(DpsDepositFacade.ACCESS_RESTRICTION, (String)attributes.get(ACCESS_RESTRICTION)); parameterMap.put(DpsDepositFacade.WCT_METS_XML_DOCUMENT, finalSIP); parameterMap.put(DpsDepositFacade.TARGET_INSTANCE_ID, targetInstanceOID); return parameterMap; }
DPSArchive extends BaseArchive { protected Map<String, String> populateDepositParameterFromFields(Map<?, ?> attributes, String finalSIP, String targetInstanceOID) { Map<String, String> parameterMap = new HashMap<String, String>(); String dpsUserNameToUse = this.dpsUserName; String dpsUserPasswordToUse = this.dpsUserPassword; String producerIdToUse = this.producerId; String materialFlowIdToUse = this.materialFlowId; String ieEntityTypeToUse = null; String dcTitleSourceToUse = null; if (Boolean.parseBoolean((String)attributes.get("customDepositForm_customFormPopulated"))) { int targetTypeIndex = getIndexInList((String) attributes.get(HARVEST_TYPE), targetDCTypesOfHtmlSerials); List<CustomDepositField> customDepositFormFieldMapping = null; String customFormURL = customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex); if(customDepositFormMapping.hasFormMapping(customFormURL)){ customDepositFormFieldMapping = customDepositFormMapping.getFormMapping(customFormURL); } else { throw new RuntimeException("Could not retrieve the Custom Deposit Form mappings for " + customFormURL + "."); } dpsUserNameToUse = (String) attributes.get("customDepositForm_producerAgent"); dpsUserPasswordToUse = (String) attributes.get("customDepositForm_producerAgentPassword"); producerIdToUse = (String) attributes.get("customDepositForm_producerId"); String targetDcType = (String) attributes.get("customDepositForm_targetDcType"); materialFlowIdToUse = getMaterialFlowOfTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfTargetDCType(targetDcType); parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.HtmlSerialHarvest.name()); parameterMap.put(DpsDepositFacade.CUSTOM_DEPOSIT_FORM_URL, customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); for(CustomDepositField field : customDepositFormFieldMapping){ parameterMap.put(field.getFieldReference(), (String) attributes.get(field.getFormFieldLabel())); } } else { if(isCustomTargetDCType((String) attributes.get(HARVEST_TYPE))){ String targetDcType = (String) attributes.get(HARVEST_TYPE); materialFlowIdToUse = getMaterialFlowOfCustomTargetDCType(targetDcType); producerIdToUse = getProducerIdsOfCustomTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfCustomTargetDCType(targetDcType); dcTitleSourceToUse= getDCTitleSourceOfCustomTargetDCType(targetDcType); if(dcTitleSourceToUse == null) dcTitleSourceToUse = ""; parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.CustomWebHarvest.name()); } else { parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.TraditionalWebHarvest.name()); } } parameterMap.put(DpsDepositFacade.DPS_INSTITUTION, this.dpsUserInstitution); parameterMap.put(DpsDepositFacade.DPS_USER_NAME, dpsUserNameToUse); parameterMap.put(DpsDepositFacade.DPS_PASSWORD, dpsUserPasswordToUse); parameterMap.put(DpsDepositFacade.FTP_HOST, this.ftpHost); parameterMap.put(DpsDepositFacade.FTP_PASSWORD, this.ftpPassword); parameterMap.put(DpsDepositFacade.FTP_USER_NAME, this.ftpUserName); parameterMap.put(DpsDepositFacade.FTP_DIRECTORY, this.ftpDirectory); parameterMap.put(DpsDepositFacade.MATERIAL_FLOW_ID, materialFlowIdToUse); parameterMap.put(DpsDepositFacade.IE_ENTITY_TYPE, ieEntityTypeToUse); parameterMap.put(DpsDepositFacade.TITLE_SOURCE, dcTitleSourceToUse); parameterMap.put(DpsDepositFacade.PDS_URL, this.pdsUrl); parameterMap.put(DpsDepositFacade.PRODUCER_ID, producerIdToUse); parameterMap.put(DpsDepositFacade.DPS_WSDL_URL, depositServerBaseUrl + depositWsdlRelativePath); parameterMap.put(DpsDepositFacade.OMS_OPEN_ACCESS, this.omsOpenAccess); parameterMap.put(DpsDepositFacade.OMS_PUBLISHED_RESTRICTED, this.omsPublishedRestricted); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_LOCATION, this.omsUnpublishedRestrictedByLocation); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_PERSON, this.omsUnpublishedRestrictedByPersion); parameterMap.put(DpsDepositFacade.CMS_SECTION, this.cmsSection); parameterMap.put(DpsDepositFacade.CMS_SYSTEM, this.cmsSystem); String ilsReference = (String)attributes.get(REFERENCE_NUMBER); if (ilsReference != null) ilsReference = ilsReference.trim(); parameterMap.put(DpsDepositFacade.ILS_REFERENCE, ilsReference); parameterMap.put(DpsDepositFacade.ACCESS_RESTRICTION, (String)attributes.get(ACCESS_RESTRICTION)); parameterMap.put(DpsDepositFacade.WCT_METS_XML_DOCUMENT, finalSIP); parameterMap.put(DpsDepositFacade.TARGET_INSTANCE_ID, targetInstanceOID); return parameterMap; } }
DPSArchive extends BaseArchive { protected Map<String, String> populateDepositParameterFromFields(Map<?, ?> attributes, String finalSIP, String targetInstanceOID) { Map<String, String> parameterMap = new HashMap<String, String>(); String dpsUserNameToUse = this.dpsUserName; String dpsUserPasswordToUse = this.dpsUserPassword; String producerIdToUse = this.producerId; String materialFlowIdToUse = this.materialFlowId; String ieEntityTypeToUse = null; String dcTitleSourceToUse = null; if (Boolean.parseBoolean((String)attributes.get("customDepositForm_customFormPopulated"))) { int targetTypeIndex = getIndexInList((String) attributes.get(HARVEST_TYPE), targetDCTypesOfHtmlSerials); List<CustomDepositField> customDepositFormFieldMapping = null; String customFormURL = customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex); if(customDepositFormMapping.hasFormMapping(customFormURL)){ customDepositFormFieldMapping = customDepositFormMapping.getFormMapping(customFormURL); } else { throw new RuntimeException("Could not retrieve the Custom Deposit Form mappings for " + customFormURL + "."); } dpsUserNameToUse = (String) attributes.get("customDepositForm_producerAgent"); dpsUserPasswordToUse = (String) attributes.get("customDepositForm_producerAgentPassword"); producerIdToUse = (String) attributes.get("customDepositForm_producerId"); String targetDcType = (String) attributes.get("customDepositForm_targetDcType"); materialFlowIdToUse = getMaterialFlowOfTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfTargetDCType(targetDcType); parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.HtmlSerialHarvest.name()); parameterMap.put(DpsDepositFacade.CUSTOM_DEPOSIT_FORM_URL, customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); for(CustomDepositField field : customDepositFormFieldMapping){ parameterMap.put(field.getFieldReference(), (String) attributes.get(field.getFormFieldLabel())); } } else { if(isCustomTargetDCType((String) attributes.get(HARVEST_TYPE))){ String targetDcType = (String) attributes.get(HARVEST_TYPE); materialFlowIdToUse = getMaterialFlowOfCustomTargetDCType(targetDcType); producerIdToUse = getProducerIdsOfCustomTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfCustomTargetDCType(targetDcType); dcTitleSourceToUse= getDCTitleSourceOfCustomTargetDCType(targetDcType); if(dcTitleSourceToUse == null) dcTitleSourceToUse = ""; parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.CustomWebHarvest.name()); } else { parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.TraditionalWebHarvest.name()); } } parameterMap.put(DpsDepositFacade.DPS_INSTITUTION, this.dpsUserInstitution); parameterMap.put(DpsDepositFacade.DPS_USER_NAME, dpsUserNameToUse); parameterMap.put(DpsDepositFacade.DPS_PASSWORD, dpsUserPasswordToUse); parameterMap.put(DpsDepositFacade.FTP_HOST, this.ftpHost); parameterMap.put(DpsDepositFacade.FTP_PASSWORD, this.ftpPassword); parameterMap.put(DpsDepositFacade.FTP_USER_NAME, this.ftpUserName); parameterMap.put(DpsDepositFacade.FTP_DIRECTORY, this.ftpDirectory); parameterMap.put(DpsDepositFacade.MATERIAL_FLOW_ID, materialFlowIdToUse); parameterMap.put(DpsDepositFacade.IE_ENTITY_TYPE, ieEntityTypeToUse); parameterMap.put(DpsDepositFacade.TITLE_SOURCE, dcTitleSourceToUse); parameterMap.put(DpsDepositFacade.PDS_URL, this.pdsUrl); parameterMap.put(DpsDepositFacade.PRODUCER_ID, producerIdToUse); parameterMap.put(DpsDepositFacade.DPS_WSDL_URL, depositServerBaseUrl + depositWsdlRelativePath); parameterMap.put(DpsDepositFacade.OMS_OPEN_ACCESS, this.omsOpenAccess); parameterMap.put(DpsDepositFacade.OMS_PUBLISHED_RESTRICTED, this.omsPublishedRestricted); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_LOCATION, this.omsUnpublishedRestrictedByLocation); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_PERSON, this.omsUnpublishedRestrictedByPersion); parameterMap.put(DpsDepositFacade.CMS_SECTION, this.cmsSection); parameterMap.put(DpsDepositFacade.CMS_SYSTEM, this.cmsSystem); String ilsReference = (String)attributes.get(REFERENCE_NUMBER); if (ilsReference != null) ilsReference = ilsReference.trim(); parameterMap.put(DpsDepositFacade.ILS_REFERENCE, ilsReference); parameterMap.put(DpsDepositFacade.ACCESS_RESTRICTION, (String)attributes.get(ACCESS_RESTRICTION)); parameterMap.put(DpsDepositFacade.WCT_METS_XML_DOCUMENT, finalSIP); parameterMap.put(DpsDepositFacade.TARGET_INSTANCE_ID, targetInstanceOID); return parameterMap; }  }
DPSArchive extends BaseArchive { protected Map<String, String> populateDepositParameterFromFields(Map<?, ?> attributes, String finalSIP, String targetInstanceOID) { Map<String, String> parameterMap = new HashMap<String, String>(); String dpsUserNameToUse = this.dpsUserName; String dpsUserPasswordToUse = this.dpsUserPassword; String producerIdToUse = this.producerId; String materialFlowIdToUse = this.materialFlowId; String ieEntityTypeToUse = null; String dcTitleSourceToUse = null; if (Boolean.parseBoolean((String)attributes.get("customDepositForm_customFormPopulated"))) { int targetTypeIndex = getIndexInList((String) attributes.get(HARVEST_TYPE), targetDCTypesOfHtmlSerials); List<CustomDepositField> customDepositFormFieldMapping = null; String customFormURL = customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex); if(customDepositFormMapping.hasFormMapping(customFormURL)){ customDepositFormFieldMapping = customDepositFormMapping.getFormMapping(customFormURL); } else { throw new RuntimeException("Could not retrieve the Custom Deposit Form mappings for " + customFormURL + "."); } dpsUserNameToUse = (String) attributes.get("customDepositForm_producerAgent"); dpsUserPasswordToUse = (String) attributes.get("customDepositForm_producerAgentPassword"); producerIdToUse = (String) attributes.get("customDepositForm_producerId"); String targetDcType = (String) attributes.get("customDepositForm_targetDcType"); materialFlowIdToUse = getMaterialFlowOfTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfTargetDCType(targetDcType); parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.HtmlSerialHarvest.name()); parameterMap.put(DpsDepositFacade.CUSTOM_DEPOSIT_FORM_URL, customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); for(CustomDepositField field : customDepositFormFieldMapping){ parameterMap.put(field.getFieldReference(), (String) attributes.get(field.getFormFieldLabel())); } } else { if(isCustomTargetDCType((String) attributes.get(HARVEST_TYPE))){ String targetDcType = (String) attributes.get(HARVEST_TYPE); materialFlowIdToUse = getMaterialFlowOfCustomTargetDCType(targetDcType); producerIdToUse = getProducerIdsOfCustomTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfCustomTargetDCType(targetDcType); dcTitleSourceToUse= getDCTitleSourceOfCustomTargetDCType(targetDcType); if(dcTitleSourceToUse == null) dcTitleSourceToUse = ""; parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.CustomWebHarvest.name()); } else { parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.TraditionalWebHarvest.name()); } } parameterMap.put(DpsDepositFacade.DPS_INSTITUTION, this.dpsUserInstitution); parameterMap.put(DpsDepositFacade.DPS_USER_NAME, dpsUserNameToUse); parameterMap.put(DpsDepositFacade.DPS_PASSWORD, dpsUserPasswordToUse); parameterMap.put(DpsDepositFacade.FTP_HOST, this.ftpHost); parameterMap.put(DpsDepositFacade.FTP_PASSWORD, this.ftpPassword); parameterMap.put(DpsDepositFacade.FTP_USER_NAME, this.ftpUserName); parameterMap.put(DpsDepositFacade.FTP_DIRECTORY, this.ftpDirectory); parameterMap.put(DpsDepositFacade.MATERIAL_FLOW_ID, materialFlowIdToUse); parameterMap.put(DpsDepositFacade.IE_ENTITY_TYPE, ieEntityTypeToUse); parameterMap.put(DpsDepositFacade.TITLE_SOURCE, dcTitleSourceToUse); parameterMap.put(DpsDepositFacade.PDS_URL, this.pdsUrl); parameterMap.put(DpsDepositFacade.PRODUCER_ID, producerIdToUse); parameterMap.put(DpsDepositFacade.DPS_WSDL_URL, depositServerBaseUrl + depositWsdlRelativePath); parameterMap.put(DpsDepositFacade.OMS_OPEN_ACCESS, this.omsOpenAccess); parameterMap.put(DpsDepositFacade.OMS_PUBLISHED_RESTRICTED, this.omsPublishedRestricted); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_LOCATION, this.omsUnpublishedRestrictedByLocation); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_PERSON, this.omsUnpublishedRestrictedByPersion); parameterMap.put(DpsDepositFacade.CMS_SECTION, this.cmsSection); parameterMap.put(DpsDepositFacade.CMS_SYSTEM, this.cmsSystem); String ilsReference = (String)attributes.get(REFERENCE_NUMBER); if (ilsReference != null) ilsReference = ilsReference.trim(); parameterMap.put(DpsDepositFacade.ILS_REFERENCE, ilsReference); parameterMap.put(DpsDepositFacade.ACCESS_RESTRICTION, (String)attributes.get(ACCESS_RESTRICTION)); parameterMap.put(DpsDepositFacade.WCT_METS_XML_DOCUMENT, finalSIP); parameterMap.put(DpsDepositFacade.TARGET_INSTANCE_ID, targetInstanceOID); return parameterMap; }  @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 { protected Map<String, String> populateDepositParameterFromFields(Map<?, ?> attributes, String finalSIP, String targetInstanceOID) { Map<String, String> parameterMap = new HashMap<String, String>(); String dpsUserNameToUse = this.dpsUserName; String dpsUserPasswordToUse = this.dpsUserPassword; String producerIdToUse = this.producerId; String materialFlowIdToUse = this.materialFlowId; String ieEntityTypeToUse = null; String dcTitleSourceToUse = null; if (Boolean.parseBoolean((String)attributes.get("customDepositForm_customFormPopulated"))) { int targetTypeIndex = getIndexInList((String) attributes.get(HARVEST_TYPE), targetDCTypesOfHtmlSerials); List<CustomDepositField> customDepositFormFieldMapping = null; String customFormURL = customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex); if(customDepositFormMapping.hasFormMapping(customFormURL)){ customDepositFormFieldMapping = customDepositFormMapping.getFormMapping(customFormURL); } else { throw new RuntimeException("Could not retrieve the Custom Deposit Form mappings for " + customFormURL + "."); } dpsUserNameToUse = (String) attributes.get("customDepositForm_producerAgent"); dpsUserPasswordToUse = (String) attributes.get("customDepositForm_producerAgentPassword"); producerIdToUse = (String) attributes.get("customDepositForm_producerId"); String targetDcType = (String) attributes.get("customDepositForm_targetDcType"); materialFlowIdToUse = getMaterialFlowOfTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfTargetDCType(targetDcType); parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.HtmlSerialHarvest.name()); parameterMap.put(DpsDepositFacade.CUSTOM_DEPOSIT_FORM_URL, customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); for(CustomDepositField field : customDepositFormFieldMapping){ parameterMap.put(field.getFieldReference(), (String) attributes.get(field.getFormFieldLabel())); } } else { if(isCustomTargetDCType((String) attributes.get(HARVEST_TYPE))){ String targetDcType = (String) attributes.get(HARVEST_TYPE); materialFlowIdToUse = getMaterialFlowOfCustomTargetDCType(targetDcType); producerIdToUse = getProducerIdsOfCustomTargetDCType(targetDcType); ieEntityTypeToUse = getIeEntityTypeOfCustomTargetDCType(targetDcType); dcTitleSourceToUse= getDCTitleSourceOfCustomTargetDCType(targetDcType); if(dcTitleSourceToUse == null) dcTitleSourceToUse = ""; parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.CustomWebHarvest.name()); } else { parameterMap.put(DpsDepositFacade.HARVEST_TYPE, DpsDepositFacade.HarvestType.TraditionalWebHarvest.name()); } } parameterMap.put(DpsDepositFacade.DPS_INSTITUTION, this.dpsUserInstitution); parameterMap.put(DpsDepositFacade.DPS_USER_NAME, dpsUserNameToUse); parameterMap.put(DpsDepositFacade.DPS_PASSWORD, dpsUserPasswordToUse); parameterMap.put(DpsDepositFacade.FTP_HOST, this.ftpHost); parameterMap.put(DpsDepositFacade.FTP_PASSWORD, this.ftpPassword); parameterMap.put(DpsDepositFacade.FTP_USER_NAME, this.ftpUserName); parameterMap.put(DpsDepositFacade.FTP_DIRECTORY, this.ftpDirectory); parameterMap.put(DpsDepositFacade.MATERIAL_FLOW_ID, materialFlowIdToUse); parameterMap.put(DpsDepositFacade.IE_ENTITY_TYPE, ieEntityTypeToUse); parameterMap.put(DpsDepositFacade.TITLE_SOURCE, dcTitleSourceToUse); parameterMap.put(DpsDepositFacade.PDS_URL, this.pdsUrl); parameterMap.put(DpsDepositFacade.PRODUCER_ID, producerIdToUse); parameterMap.put(DpsDepositFacade.DPS_WSDL_URL, depositServerBaseUrl + depositWsdlRelativePath); parameterMap.put(DpsDepositFacade.OMS_OPEN_ACCESS, this.omsOpenAccess); parameterMap.put(DpsDepositFacade.OMS_PUBLISHED_RESTRICTED, this.omsPublishedRestricted); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_LOCATION, this.omsUnpublishedRestrictedByLocation); parameterMap.put(DpsDepositFacade.OMS_UNPUBLISHED_RESTRICTED_BY_PERSON, this.omsUnpublishedRestrictedByPersion); parameterMap.put(DpsDepositFacade.CMS_SECTION, this.cmsSection); parameterMap.put(DpsDepositFacade.CMS_SYSTEM, this.cmsSystem); String ilsReference = (String)attributes.get(REFERENCE_NUMBER); if (ilsReference != null) ilsReference = ilsReference.trim(); parameterMap.put(DpsDepositFacade.ILS_REFERENCE, ilsReference); parameterMap.put(DpsDepositFacade.ACCESS_RESTRICTION, (String)attributes.get(ACCESS_RESTRICTION)); parameterMap.put(DpsDepositFacade.WCT_METS_XML_DOCUMENT, finalSIP); parameterMap.put(DpsDepositFacade.TARGET_INSTANCE_ID, targetInstanceOID); return parameterMap; }  @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);  }