@Test public void testGetCustomDepositFormDetails() throws Exception { String customFormUrl_eJournal = "/some/nice/url/eJournal"; String customFormUrl_eManuscript = "/some/nice/url/eManuscript"; String customFormUrl_Blog = "/some/nice/url/blog"; String customFormUrls = customFormUrl_eJournal + ", " + customFormUrl_eManuscript + ", " + customFormUrl_Blog; DPSArchive archiver; CustomDepositFormResultDTO result; CustomDepositFormCriteriaDTO criteria; archiver = new DPSArchive(); archiver.setCustomDepositFormURLsForHtmlSerialIngest(customFormUrls); archiver.setTargetDCTypesOfHtmlSerials("HTML Serial Type 1 - eJournals, HTML Serial Type 2 - Manuscripts , HTML Serial Type 3 - Blogs "); archiver.setAgenciesResponsibleForHtmlSerials(" Electronic Journals , Electronic Serials "); criteria = new CustomDepositFormCriteriaDTO(); criteria.setAgencyName("some agency"); criteria.setTargetType("HTML Serial Type 2 - maNuScripts"); result = archiver.getCustomDepositFormDetails(criteria); assertNotNull(result); assertEquals(true, result.isCustomDepositFormRequired()); assertEquals(customFormUrl_eManuscript, result.getUrlForCustomDepositForm()); assertNull(result.getHTMLForCustomDepositForm()); archiver = new DPSArchive(); archiver.setCustomDepositFormURLsForHtmlSerialIngest(customFormUrls); archiver.setTargetDCTypesOfHtmlSerials("HTML Serial Type 1 - eJournals, HTML Serial Type 2 - Manuscripts , HTML Serial Type 3 - Blogs "); archiver.setAgenciesResponsibleForHtmlSerials(" Electronic Journals , Electronic Serials "); archiver.setRestrictHTMLSerialAgenciesToHTMLSerialTypes("true"); criteria = new CustomDepositFormCriteriaDTO(); criteria.setAgencyName("eLectroniC SeRials"); criteria.setTargetType("some target DC type"); result = archiver.getCustomDepositFormDetails(criteria); assertNotNull(result); assertEquals(true, result.isCustomDepositFormRequired()); assertEquals("/wct-store/customDepositForms/rosetta_custom_deposit_form_invalid_dctype.jsp", result.getUrlForCustomDepositForm()); assertNull(result.getHTMLForCustomDepositForm()); archiver = new DPSArchive(); archiver.setCustomDepositFormURLsForHtmlSerialIngest(customFormUrls); archiver.setTargetDCTypesOfHtmlSerials("HTML Serial Type 1 - eJournals, HTML Serial Type 2 - Manuscripts , HTML Serial Type 3 - Blogs "); archiver.setAgenciesResponsibleForHtmlSerials(" Electronic Journals , Electronic Serials "); criteria = new CustomDepositFormCriteriaDTO(); criteria.setAgencyName("eLectroniC SeRials"); criteria.setTargetType("HTML Serial Type 2 - maNuScripts"); result = archiver.getCustomDepositFormDetails(criteria); assertNotNull(result); assertEquals(true, result.isCustomDepositFormRequired()); assertEquals(customFormUrl_eManuscript, result.getUrlForCustomDepositForm()); assertNull(result.getHTMLForCustomDepositForm()); archiver = new DPSArchive(); archiver.setCustomDepositFormURLsForHtmlSerialIngest(customFormUrls); archiver.setTargetDCTypesOfHtmlSerials("HTML Serial Type 1 - eJournals, HTML Serial Type 2 - Manuscripts , HTML Serial Type 3 - Blogs "); archiver.setAgenciesResponsibleForHtmlSerials(" Electronic Journals , Electronic Serials "); criteria = new CustomDepositFormCriteriaDTO(); criteria.setAgencyName("some agency"); criteria.setTargetType("some target DC type"); result = archiver.getCustomDepositFormDetails(criteria); assertNotNull(result); assertEquals(false, result.isCustomDepositFormRequired()); assertNull(result.getUrlForCustomDepositForm()); assertNull(result.getHTMLForCustomDepositForm()); archiver = new DPSArchive(); archiver.setCustomDepositFormURLsForHtmlSerialIngest(customFormUrls); archiver.setTargetDCTypesOfHtmlSerials("HTML Serial Type 1 - eJournals, HTML Serial Type 2 - Manuscripts , HTML Serial Type 3 - Blogs "); archiver.setAgenciesResponsibleForHtmlSerials(" Electronic Journals , Electronic Serials "); criteria = null; result = archiver.getCustomDepositFormDetails(criteria); assertNotNull(result); assertEquals(false, result.isCustomDepositFormRequired()); assertNull(result.getUrlForCustomDepositForm()); assertNull(result.getHTMLForCustomDepositForm()); }
public CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria) { log.debug("DPSArchive: getCustomDepositFormDetails() invoked with " + criteria); CustomDepositFormResultDTO response = new CustomDepositFormResultDTO(); if (criteria == null) return response; int targetTypeIndex = getIndexInList(criteria.getTargetType(), targetDCTypesOfHtmlSerials); boolean isAgencyResponsibleForHtmlSerials = containsInList(criteria.getAgencyName(), agenciesResponsibleForHtmlSerials); boolean isTargetDCTypeOfHtmlSerials = (targetTypeIndex >= 0); response.setCustomDepositFormRequired(false); if (isTargetDCTypeOfHtmlSerials) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm(customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); response.setProducerId(getProdcuerIdOfTargetDCType(criteria.getTargetType())); } else { if (isAgencyResponsibleForHtmlSerials && restrictHTMLSerialAgenciesToHTMLSerialTypes) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm("/wct-store/customDepositForms/rosetta_custom_deposit_form_invalid_dctype.jsp"); } } return response; }
DPSArchive extends BaseArchive { public CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria) { log.debug("DPSArchive: getCustomDepositFormDetails() invoked with " + criteria); CustomDepositFormResultDTO response = new CustomDepositFormResultDTO(); if (criteria == null) return response; int targetTypeIndex = getIndexInList(criteria.getTargetType(), targetDCTypesOfHtmlSerials); boolean isAgencyResponsibleForHtmlSerials = containsInList(criteria.getAgencyName(), agenciesResponsibleForHtmlSerials); boolean isTargetDCTypeOfHtmlSerials = (targetTypeIndex >= 0); response.setCustomDepositFormRequired(false); if (isTargetDCTypeOfHtmlSerials) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm(customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); response.setProducerId(getProdcuerIdOfTargetDCType(criteria.getTargetType())); } else { if (isAgencyResponsibleForHtmlSerials && restrictHTMLSerialAgenciesToHTMLSerialTypes) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm("/wct-store/customDepositForms/rosetta_custom_deposit_form_invalid_dctype.jsp"); } } return response; } }
DPSArchive extends BaseArchive { public CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria) { log.debug("DPSArchive: getCustomDepositFormDetails() invoked with " + criteria); CustomDepositFormResultDTO response = new CustomDepositFormResultDTO(); if (criteria == null) return response; int targetTypeIndex = getIndexInList(criteria.getTargetType(), targetDCTypesOfHtmlSerials); boolean isAgencyResponsibleForHtmlSerials = containsInList(criteria.getAgencyName(), agenciesResponsibleForHtmlSerials); boolean isTargetDCTypeOfHtmlSerials = (targetTypeIndex >= 0); response.setCustomDepositFormRequired(false); if (isTargetDCTypeOfHtmlSerials) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm(customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); response.setProducerId(getProdcuerIdOfTargetDCType(criteria.getTargetType())); } else { if (isAgencyResponsibleForHtmlSerials && restrictHTMLSerialAgenciesToHTMLSerialTypes) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm("/wct-store/customDepositForms/rosetta_custom_deposit_form_invalid_dctype.jsp"); } } return response; }  }
DPSArchive extends BaseArchive { public CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria) { log.debug("DPSArchive: getCustomDepositFormDetails() invoked with " + criteria); CustomDepositFormResultDTO response = new CustomDepositFormResultDTO(); if (criteria == null) return response; int targetTypeIndex = getIndexInList(criteria.getTargetType(), targetDCTypesOfHtmlSerials); boolean isAgencyResponsibleForHtmlSerials = containsInList(criteria.getAgencyName(), agenciesResponsibleForHtmlSerials); boolean isTargetDCTypeOfHtmlSerials = (targetTypeIndex >= 0); response.setCustomDepositFormRequired(false); if (isTargetDCTypeOfHtmlSerials) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm(customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); response.setProducerId(getProdcuerIdOfTargetDCType(criteria.getTargetType())); } else { if (isAgencyResponsibleForHtmlSerials && restrictHTMLSerialAgenciesToHTMLSerialTypes) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm("/wct-store/customDepositForms/rosetta_custom_deposit_form_invalid_dctype.jsp"); } } return response; }  @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 CustomDepositFormResultDTO getCustomDepositFormDetails(CustomDepositFormCriteriaDTO criteria) { log.debug("DPSArchive: getCustomDepositFormDetails() invoked with " + criteria); CustomDepositFormResultDTO response = new CustomDepositFormResultDTO(); if (criteria == null) return response; int targetTypeIndex = getIndexInList(criteria.getTargetType(), targetDCTypesOfHtmlSerials); boolean isAgencyResponsibleForHtmlSerials = containsInList(criteria.getAgencyName(), agenciesResponsibleForHtmlSerials); boolean isTargetDCTypeOfHtmlSerials = (targetTypeIndex >= 0); response.setCustomDepositFormRequired(false); if (isTargetDCTypeOfHtmlSerials) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm(customDepositFormURLsForHtmlSerialIngest.get(targetTypeIndex)); response.setProducerId(getProdcuerIdOfTargetDCType(criteria.getTargetType())); } else { if (isAgencyResponsibleForHtmlSerials && restrictHTMLSerialAgenciesToHTMLSerialTypes) { response.setCustomDepositFormRequired(true); response.setUrlForCustomDepositForm("/wct-store/customDepositForms/rosetta_custom_deposit_form_invalid_dctype.jsp"); } } return response; }  @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);  }