Я пытаюсь опубликовать sh документ с использованием IBM Fil eNet.
Я использовал руководство: https://www.ibm.com/support/knowledgecenter/SSNW2F_5.2.0/com.ibm.p8.ce.dev.ce.doc/publish_procedures.htm
Но я получил исключение «Произошло исключение во время чтения RenditionEngineConnection».
В чем моя ошибка? Как нам настроить «Fil eNet P8 Rendition Engine»? https://www.ibm.com/support/knowledgecenter/it/SSNW2F_5.1.0/com.ibm.p8.installingre.doc/p8pic003.htm
Мой исходный код:
/**
* Create {@link PublishStyleTemplate}
*
* @param objectStore {@link ObjectStore}
* @param description description
*/
public void createPublishStyleTemplate(final ObjectStore objectStore, final String description) {
PublishStyleTemplate pst = Factory.PublishStyleTemplate.createInstance(objectStore);
pst.set_Title(description);
pst.set_Description(description);
StringList formats = Factory.StringList.createList();
formats.add("text/plain");
formats.add("application/msword");
formats.add("application/vnd.ms-excel");
formats.add("application/vnd.ms-powerpoint");
formats.add("application/vnd.openxmlformat");
formats.add("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
formats.add("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
formats.add("application/vnd.openxmlformats-officedocument.presentationml.presentation");
pst.set_InputFormats(formats);
// ProviderID must use the well-known handler name.
String PDF_HANDLER = "PublishRequestPDFHandler";
pst.set_ProviderID(PDF_HANDLER);
pst.set_OutputFormat("application/pdf"); // PDF transformation
pst.save(RefreshMode.REFRESH);
}
/**
* Create {@link PublishTemplate}
*
* @param objectStore {@link ObjectStore}
* @param publishStyleTemplate {@link PublishStyleTemplate}
* @param description description
*/
public void createPublishTemplate(final ObjectStore objectStore, final PublishStyleTemplate publishStyleTemplate, final String description) {
// Create a publish template object.
PublishTemplate pt = Factory.PublishTemplate.createInstance(objectStore);
pt.set_StyleTemplate(publishStyleTemplate);
// Set document title for the publish template
pt.getProperties().putValue("DocumentTitle", description);
pt.set_Description("test_PublishTemplate");
// Is there a cascade delete dependency between source document and publication?
boolean isSourceDependency = true;
// isSourceDependency is a boolean variable that specifies whether the user wants
// to delete the publication automatically when the source is deleted. It is whichever value
// (true or false) the user chooses.
String VALUE_ISSOURCEDEPENDENCY = isSourceDependency ? "true" : "false";
// Publish template content.
String PT_CONTENT =
"<?xml version='1.0'?>" +
"<publishtemplatecontent>" +
"<version>2.0.1</version>" +
"<newinstructions>" +
"<issourcedependent>" + VALUE_ISSOURCEDEPENDENCY + "</issourcedependent>" +
"<outputfolderid>" + "B0FA3471-0000-CD1D-9D5E-B1E6E5E82135" + "</outputfolderid>" +
"<applyproperties><from>source</from></applyproperties>" +
"<applysecurity><from>default</from></applysecurity>" +
"</newinstructions>" +
"<republishinstructions>" +
"<versionablerepublishtype>versionandkeep</versionablerepublishtype>" +
"<nonversionablerepublishtype>addandkeep</nonversionablerepublishtype>" +
"<applypropertiesfrom>destination</applypropertiesfrom>" +
"<applysecurityfrom>destination</applysecurityfrom>" +
"</republishinstructions>" +
"</publishtemplatecontent>";
String[] PT_DATA = {"myNewPublishTemplate.xml", "application/x-filenet-publishtemplate", PT_CONTENT};
// Create content elements.
ContentElementList cel = Factory.ContentElement.createList();
ContentTransfer ctNew = Factory.ContentTransfer.createInstance();
ByteArrayInputStream is = new ByteArrayInputStream(PT_CONTENT.getBytes());
ctNew.setCaptureSource(is);
ctNew.set_RetrievalName(PT_DATA[0]);
ctNew.set_ContentType(PT_DATA[1]);
cel.add(ctNew);
pt.set_ContentElements(cel);
// Check in publish template as major version.
pt.checkin(AutoClassify.DO_NOT_AUTO_CLASSIFY, CheckinType.MAJOR_VERSION);
pt.save(RefreshMode.REFRESH);
}
/**
* Create {@link PublishRequest}
*
* @param objectStore
* @param document
* @param publishTemplate
* @return
*/
public PublishRequest createPublishRequest(
final ObjectStore objectStore,
final Document document,
final PublishTemplate publishTemplate) {
System.out.println(String.format("Document Id = %s", document.get_Id().toString()));
System.out.println(String.format("Document MimeType = %s", document.get_MimeType()));
System.out.println(String.format("Document Name = %s", document.get_Name()));
System.out.println(String.format("PublishTemplate Id = %s", publishTemplate.get_Id().toString()));
PublishStyleTemplate publishStyleTemplate = publishTemplate.get_StyleTemplate();
System.out.println(String.format("PublishStyleTemplate ProviderID = %s", publishStyleTemplate.get_ProviderID()));
StringList stringList = publishStyleTemplate.get_InputFormats();
Iterator iterator = stringList.iterator();
while(iterator.hasNext()) {
String inputFormat = (String) iterator.next();
System.out.println(String.format("PublishStyleTemplate InputFormat = %s", inputFormat));
}
String publishOpts = new String(
"<publishoptions><publicationname>"
+ document.get_Name()
+ "</publicationname></publishoptions>");
PublishRequest publishRequest = Factory.PublishRequest.createInstance(objectStore);
publishRequest.set_InputDocument(document);
publishRequest.set_PublishTemplate(publishTemplate);
publishRequest.setPublishOptions(publishOpts);
publishRequest.save(RefreshMode.REFRESH);
return publishRequest;
}
Журнал: 2020-04-14T12: 47: 57.492 9F0B4BDE PUBL FNRCE0000E - ОШИБКА: Чтение RenditionEngineConnection выбросило: Произошло непредвиденное исключение. 2020-04-14T12: 47: 57.493 9F0B4BDE PUBL FNRCE0000I - INFO Исключение InvokeVista: во время чтения RenditionEngineConnection возникла исключительная ситуация. 2020-04-14T12: 47: 57.493 E0476562 PUBL FNRCE0066E - ОШИБКА Не удалось отправить строку PublishRequest {B0AB7771-0000-CA39-BFFD-BF7A84D30A96} \ ncom.fil enet .api.exception.EngineRuntimeException: FNCE_Exception: FNCE_Exception_Exception_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Ex_Exce_Ex_Ex_Ex_Ex_Ex_Exce_Ex_Ex_Exce_Ex_Ex_Exce_Ex_Exce_Ex_Exception произошло. \ n в com.fil enet .engine.publi sh .PublishRequestPDFHandler.publishPDF (PublishRequestPDFHandler. java: 435) \ n в com.fil enet .engine.publi sh .PublishRequestPDHH execute (PublishRequestPDFHandler. java: 169) \ n на com.fil enet .engine.publi sh .PublishRequestHandlerBase $ 1.run (PublishRequestHandlerBase. java: 226) \ n на com.fil enet. engine.context.CallState.doAs (CallState. java: 236) \ n на com.fil enet .engine.context.CallState.doAs (CallState. java: 153) \ n на com.fil enet* \ n на com.fil enet .engine.queueitem.QueueE xecutor.dispatchQueuedRow (QueueExecutor. java: 389) \ n на com.fil enet .engine.queueitem.QueueExecutor.dispatchEvent (QueueExecutor. java: 209) \ n на com.fil enet .engine. queueitem.QueueExecutor.execute (QueueExecutor. java: 133) \ n на com.fil enet .engine.tasks.BackgroundTask.safeExecute (BackgroundTask. java: 275) \ n на com.fil enet. engine.tasks.BackgroundTask $ BackgroundTaskPriviledgedExceptionAction.run (BackgroundTask. java: 1110) \ n на com.fil enet .engine.context.CallState.doAsSystem (CallState. java: 575) \ n на com.fil enet .engine.tasks.BackgroundTask.run (BackgroundTask. java: 209) \ n в java .util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor. java: 1153) \ n в java. util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor. java: 628) \ n в java .lang.Thread.run (Тема. java: 785) \ nПричинено: com.fil enet. api.exception.EngineRuntimeException: FNRCU0005E: PUBLISH_READING_REC_THREW: Возникла исключительная ситуация при чтении RenditionEngineConnection. \ n на com.fil * 10 63 * .engine.publi sh .PublishRequestHandlerUtil.readRenditionEngineConnection (PublishRequestHandlerUtil. java: 199) \ n в com.fil enet .engine.publi sh .PublishRequestPDFHandler $ InvokeVisP $. *: 128) \ n на com.fil enet .engine.context.CallState.doAs (CallState. java: 236) \ n на com.fil enet .engine.context.CallState.doAs (CallState. java: 153) \ n на com.fil enet .engine.publi sh .PublishRequestPDFHandler $ InvokeVistaPDF.run (PublishRequestPDFHandler. java: 118) \ n ... еще 3 \ nПричинено: com. fil enet .api.exception.EngineRuntimeException: FNRCE0066E: E_UNEXPECTED_EXCEPTION: Произошло непредвиденное исключение. \ n в com.fil enet .engine.publi sh .PublishRequestHandlerUtil.readRenditionEngineConnection (10) .RetilEx: 120:. n ... 7 more 2020-04-14T12: 47: 57.494 E0476562 PUBL FNRCE0000I - INFO dispatchFailed: помеченный элемент очереди: {B0AB7771-0000-CA39-BFFD-BF7A84D30A96} как «отравленный» и больше не будет повторяться.