当前位置: 首页>>代码示例>>Java>>正文


Java DNXConstants类代码示例

本文整理汇总了Java中com.exlibris.digitool.common.dnx.DNXConstants的典型用法代码示例。如果您正苦于以下问题:Java DNXConstants类的具体用法?Java DNXConstants怎么用?Java DNXConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DNXConstants类属于com.exlibris.digitool.common.dnx包,在下文中一共展示了DNXConstants类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: populateFileSections

import com.exlibris.digitool.common.dnx.DNXConstants; //导入依赖的package包/类
private void populateFileSections(WctDataExtractor wctData, MetsWriter metsWriter) {
    MetsType.FileSec.FileGrp metsRepresentation = metsWriter.addNewFileGrp(Enum.UsageType.VIEW, Enum.PreservationType.PRESERVATION_MASTER, "");

    String grpId = metsRepresentation.getID();
    DnxDocument dnx = metsWriter.getFileGrpDnx(grpId);
    dnx.updateSectionKey(DNXConstants.GENERALREPCHARACTERISTICS.PRESERVATIONTYPE, Enum.PreservationType.PRESERVATION_MASTER.toString());
    dnx.updateSectionKey(DNXConstants.GENERALREPCHARACTERISTICS.DIGITALORIGINAL, "true");
    metsWriter.setFileGrpDnx(dnx, grpId);

    addFilesToRepresentation(metsWriter, metsRepresentation, wctData.getArchiveFiles());
    addFilesToRepresentation(metsWriter, metsRepresentation, wctData.getHomeDirectoryFiles());
    addFilesToRepresentation(metsWriter, metsRepresentation, wctData.getLogFiles());
    addFilesToRepresentation(metsWriter, metsRepresentation, wctData.getReportFiles());
    addFileToRepresentation(metsWriter, metsRepresentation, wctData.getArcIndexFile());
    addFileToRepresentation(metsWriter, metsRepresentation, wctData.getWctMetsFile());
    
    log.debug(wctData.getHomeDirectoryFiles());
    //metsWriter.generateChecksum(wctData., "MD5");
}
 
开发者ID:DIA-NZ,项目名称:webcurator,代码行数:20,代码来源:DnxMapperImpl.java

示例2: addWebHarvestSpecificDnx

import com.exlibris.digitool.common.dnx.DNXConstants; //导入依赖的package包/类
/**
 * This method is made public so that other projects (specifically, OMS Extractor) can call this
 * to populate WCT-specific metadata information.
 * 
 * @param wctData
 * @param dnx
 */
public void addWebHarvestSpecificDnx(WctDataExtractor wctData, DnxDocument dnx) {
    String ieEntityTypeToUse = wctData.getIeEntityType();
    if (ieEntityTypeToUse == null) {
        if (HarvestType.HtmlSerialHarvest.equals(wctData.getHarvestType())) {
            // For an HTML Serial, the IE Entity Type needs to be specified explicitly.
            throw new RuntimeException("The IE Entity Type was not specified for the HTML Serial Deposit. " +
                    "Please check the DAS configuration file to make sure this is configured correctly");
        } else if(HarvestType.CustomWebHarvest.equals(wctData.getHarvestType())){
            // For a Custom Web Harvest, the IE Entity Type needs to be specified explicitly.
            throw new RuntimeException("The IE Entity Type was not specified for the Custom Web Harvest. " +
                    "Please check the DAS configuration file to make sure this is configured correctly");
        }
        ieEntityTypeToUse = OmsCodeToMetsMapping.getObjectTypeCodeMapping(OmsCodeToMetsMapping.OT_WWW).ieEntityType;
    }
    dnx.updateSectionKey(DNXConstants.GENERALIECHARACTERISTICS.IEENTITYTYPE, ieEntityTypeToUse);
    dnx.updateSectionKey(DNXConstants.GENERALIECHARACTERISTICS.SUBMISSIONREASON, "Web Harvesting");

    /*
     * The primarySeedUrl element in DNX doesn't accept multiple seed URLs. If a given
     * web archive contains multiple seed urls, put them as space-separated strings in
     * this element. Also, any space within the URL needs to be replaced with %20.
     */
    StringBuffer seedUrls = new StringBuffer();
    String space = " ";
    for (SeedUrl seedUrlObj : wctData.getSeedUrls()) {
        String seedUrl = seedUrlObj.getUrl();
        if (seedUrl.contains(space)) seedUrl = seedUrl.replaceAll(space, "%20");
        seedUrls.append(seedUrl).append(space);
    }
    dnx.updateSectionKey(DNXConstants.WEBHARVESTING.PRIMARYSEEDURL, seedUrls.toString());
    dnx.updateSectionKey(DNXConstants.WEBHARVESTING.TARGETNAME, wctData.getTargetName());
}
 
开发者ID:DIA-NZ,项目名称:webcurator,代码行数:40,代码来源:DnxMapperImpl.java

示例3: putObject

import com.exlibris.digitool.common.dnx.DNXConstants; //导入依赖的package包/类
public String putObject(NetAppClient netAppClient, StoredEntityMetaData storedEntityMetadata, InputStream inputStream) throws Exception{
		// Create the request
		DefaultHttpClient httpclient = createHttpClient(netAppClient, true);
		HttpPost httpPost = new HttpPost(new URI(getContainerURI(netAppClient, true)));

		// TODO: support chunks for big files
		byte[] encode = Base64.encode(IOUtils.toByteArray(inputStream));
		String bytes = new String(encode);

		initializeHeaders(httpPost, CDMIHttpHeader.CONTENT_TYPE_CDMI_OBJECT);
		String domainURI = "/cdmi_domains/";
		DnxDocument fileDnx = storedEntityMetadata.getFileDnx();
		String mimetype = fileDnx.getSectionKeyValue(DNXConstants.FILEFORMAT.MIMETYPE);
		String string = "{\"domainURI\":\"" + domainURI
				+ "\",\"mimetype\":\"" + mimetype + "\",\"metadata\":{\"pid\" : \"" + storedEntityMetadata.getEntityPid()
				+ "\"},\"valuetransferencoding\":\"base64\",\"value\":\"" + bytes + "\"}";
		httpPost.setEntity(new StringEntity(string));

		// 1. Create data object
		HttpResponse response = httpclient.execute(httpPost);

		// 2. get object id from the response
		String identifier = getSpecificJSONValue(response, "objectID");

		// 3. update the existing object value in ranges
/*
    FIXME

    !!! If InputStreamEntity will not work - try sending in ranges manually

 		long partSize = 4096;
		long remainingBytes = storedEntityMetadata.getSizeInBytes();
		long currentRange = 0;
		long endRange = 0;
		boolean isLastPart = (remainingBytes - partSize <= 0);
		while (remainingBytes > 0) {
			isLastPart = (remainingBytes - partSize <= 0);
			if(isLastPart){
				partSize = remainingBytes;
			}
			endRange = currentRange+partSize;
			httpput = new HttpPut(getCDMIObjectURI(netAppClient, identifier)+"?value:"+currentRange+":"+endRange);
			byte [] stream = new byte[(int) partSize];
			inputStream.read(stream);
			StringEntity entity = new StringEntity(new String(stream));
			httpput.setEntity(entity);
			response = httpclient.execute(httpput);
			if (!isSuccessfulResponse(response)){
				deleteObject(netAppClient, identifier);
				return null;
			}
			remainingBytes = remainingBytes - partSize;
		}
*/

		return identifier;
	}
 
开发者ID:ExLibrisGroup,项目名称:Rosetta.NetAppStoragePlugin,代码行数:58,代码来源:CDMIConnector.java

示例4: populateIeDnx

import com.exlibris.digitool.common.dnx.DNXConstants; //导入依赖的package包/类
private void populateIeDnx(WctDataExtractor wctData, MetsWriter metsWriter) {

    	addProvenanceNote(metsWriter
                , "IE Created in NLNZ WCT"
                , convertDateFormat(wctData, wctData.getHarvestDate(), "yyyy-MM-dd HH:mm:ss.SSSSSS", PROV_EVENT_DATE_FORMAT)
                , "WCT_1"
                , "Created by " + wctData.getCreatedBy()
                , "Created on " + convertDateFormat(wctData, wctData.getHarvestDate(), "yyyy-MM-dd HH:mm:ss.SSSSSS", "yyyy-MM-dd")
                , "");
    	String provNoteFromWCT = wctData.getProvenanceNote();
    	if (!StringUtils.isEmpty(provNoteFromWCT)) {
    		addProvenanceNote(metsWriter
    				, "Provenance Note from NLNZ WCT"
    				, convertDateFormat(wctData, wctData.getCreationDate(), "yyyy-MM-dd", PROV_EVENT_DATE_FORMAT)
    				, "WCT_2"
    				, provNoteFromWCT
    				, ""
    				, "");
    	}

        DnxDocument dnx = getDnxDoc(metsWriter);

        dnx.updateSectionKey(DNXConstants.ACCESSRIGHTSPOLICY.POLICYID,
                determineAccessRightsCode(wctData));

        dnx.updateSectionKey(DNXConstants.WEBHARVESTING.HARVESTDATE, wctData.getHarvestDate());

        if(wctData.getCmsSection().equals("objectIdentifier")){
            DnxDocumentHelper dnxHelper = new DnxDocumentHelper(dnx);
            List<DnxDocumentHelper.ObjectIdentifier> OIs = dnxHelper.getObjectIdentifiers();
            DnxDocumentHelper.ObjectIdentifier cmsOI = dnxHelper.new ObjectIdentifier(wctData.getCmsSystem(), wctData.getILSReference());
            OIs.add(cmsOI);
            dnxHelper.setObjectIdentifiers(OIs);
        }
        else if(wctData.getCmsSection().equals("CMS")){
            dnx.updateSectionKey(DNXConstants.CMS.SYSTEM, wctData.getCmsSystem());
            dnx.updateSectionKey(DNXConstants.CMS.RECORDID, wctData.getILSReference());
        }
        else{
            dnx.updateSectionKey(DNXConstants.CMS.SYSTEM, "ilsdb");
            dnx.updateSectionKey(DNXConstants.CMS.RECORDID, wctData.getILSReference());
        }

        addWebHarvestSpecificDnx(wctData, dnx);

        metsWriter.setIeDnx(dnx);
    }
 
开发者ID:DIA-NZ,项目名称:webcurator,代码行数:48,代码来源:DnxMapperImpl.java


注:本文中的com.exlibris.digitool.common.dnx.DNXConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。