0% found this document useful (0 votes)
15 views6 pages

New Patch For Template Document 1

Hhhnhhihgg

Uploaded by

simipan136
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

New Patch For Template Document 1

Hhhnhhihgg

Uploaded by

simipan136
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

1. deploy ProposalHTMLTemplate.jsp in Webdesktop.war.( PATH (webdesktop.

war\
CustomForms\CorporateLoan\ProposalHTMLTemplate.jsp) )

2. Put Template Generation folder in JBOSS--> bin\Clos\Accelerator\.

3. Inside Template Generation folder goto config\config.ini and change value of


appServerType to your appServerType (eg. JBOSS, WEBLOGIC) and value of volumeId to
your volume id.

4. Deploy froalahtml2pdf.war in JBOSS-->standalone-->deployments.

5. Put config.ini in JBOSS-->bin\Clos\Accelerator\HTML2PDF. In config.ini put you


appServerIp, appServerPort, appServerType, volumeId, cabinetName.

6. Put log4j2.xml at location -->JBOSS-->\bin\Clos\Accelerator\HTML2PDF.

7. Put template exection jar in ( webdesktop.war \ web inf \ lib\ )

7. Create following tables in DataBase-->

>>>>>>>> CREATE TABLE NG_CLOS_TEMPLATE_GEN_JSON_CONTAINER


( "ENCRYTED_CONTENT" NVARCHAR2(200) COLLATE "USING_NLS_COMP",
"JSON_STRING" NVARCHAR2(500) COLLATE "USING_NLS_COMP",
"CREATED_DATE" DATE DEFAULT SYSDATE
)

>>>>>>>>> CREATE TABLE NG_SECUREKEYS_TBL


( "APPNAME" NVARCHAR2(100) COLLATE "USING_NLS_COMP",
"ENCRYPTIONALGO" NVARCHAR2(100) COLLATE "USING_NLS_COMP",
"PUBLICKEY" NVARCHAR2(100) COLLATE "USING_NLS_COMP",
"PRIVATEKEY" NVARCHAR2(100) COLLATE "USING_NLS_COMP"
)

>>>>>>>>>INSERT INTO NG_SECUREKEYS_TBL (appname, encryptionalgo, publickey,


privatekey) VALUES ('template', 'AES', '', '$Template~Encryption~Key$')

** Change script according to Database environment.

8. make following changes in document.js

>>>> replace generateTemplate function with

async function generateTemplate(ControlID, RowIndex) {

globalRowIndex = RowIndex;

templateCode = getValueFromTableCell(docoutwarddoc, RowIndex, 13)

var documentName = getValueFromTableCell(docoutwarddoc, RowIndex, 0)

var rteFlag = "N"

var itemindex = folderId;

var sessionId = getWorkItemData("sessionId");


console.log("sessionId:" + sessionId);

var cabinet = getWorkItemData("cabinetName");

console.log("cabinet:" + cabinet);

if(rteFlag=== 'Y'){

globalDocumentName = documentName;

var rte_Data = '';

var finalHTML = '';

var rteIdString = executeServerEvent("RteDataInHtml", "", templateCode,


true);

var rteIdJson = JSON.parse(rteIdString);

console.log('rteIdJson-->' + rteIdJson);

for (k = 0; k < rteIdJson.length; k++) {

selectSheet(rteIdJson[k].TAB_IDS, parseInt(rteIdJson[k].SHEET_INDEX));

// for (var j = 0; j < rteIdJson.length; j++) {

// setStyle(rteIdJson[j].FRAME_IDS, 'sectionstate', 'expanded');

// }

var a = await openFrames(rteIdJson);

console.log('frames are open');

var b = await openRTEs(rteIdJson);

//selectSheet(getConstantWrapper('MainTab_Index'),
getConstantWrapper('Documentation_Index'));

var finalurl =
"/webdesktop/CustomForms/CorporateLoan/ProposalHtmlTemplate.jsp?PROCESS_NAME="

+ processName

+ "&WI_NAME="

+ processInstanceId

+ "&TEMPLATE_CODE="

+ templateCode

+ "&WORK_STEP="

+ activityName
+ "&DOCUMENT_NAME="

+ documentName

+ "&abs=1&number="

+ Math.floor(Math.random() * 10000)

+ "&RTE_FLAG="

+ rteFlag;

var template_Frame = document.getElementById('iframe');

template_Frame.src = finalurl;

$('#iframe').one('load', function () {

//setRteDataInHtml(rteIdJson, template_Frame, rte_Data, finalHTML,


itemindex, sessionId, cabinet, rowIndex, documentName);

});

else{

var finalurl =
"/webdesktop/CustomForms/CorporateLoan/ProposalHtmlTemplate.jsp?PROCESS_NAME="

+ processName

+ "&WI_NAME="

+ processInstanceId

+ "&TEMPLATE_CODE="

+ templateCode

+ "&WORK_STEP="

+ activityName

+ "&DOCUMENT_NAME="

+ documentName

+ "&abs=1&number="

+ Math.floor(Math.random() * 10000)

+ "&TEMPPARENTFOLDERINDEX=359"

+ "&ITEMINDEX="

+ itemindex

+ "&RTE_FLAG="
+ rteFlag

fetch(finalurl)

.then(resp => {

if (!resp.ok) {

RemoveIndicator("application");

showMessage('', 'Error in Generating Template', 'error');

throw new Error('Server returned ' + resp.status);

return resp.json();

})

.then(retMsg => {

console.log(retMsg)

if (retMsg.status === 'success') {

ajaxCallForRteInHtmlPopulate1(sessionId, retMsg.content,
RowIndex);

else {

RemoveIndicator("application")

showMessage('', 'Error in Generating Template', 'error');

console.log("Some Error Occured During Template generation!!" +


e)

})

.catch(e => {

RemoveIndicator("application")

showMessage('', 'Error in Generating Template', 'error');

console.log("Some Error Occured During Template generation!!" + e)

})

}
>>>> replace ajaxCallForRteInHtmlPopulate1 function with

function ajaxCallForRteInHtmlPopulate1(...args) {

if(args.length == 3){

var [sessionId, content, rowIndex] = args

var requestString = `${sessionId}~${content}`;

else{

var [finalHTML, itemindex, sessionId, cabinet, rowIndex, documentName] =


args

console.log(finalHTML);

var inpJson = {

option: 'save',

htmldata: finalHTML,

itemindex: itemindex,

sessionId: sessionId,

docName: documentName,

documentIndex: '',

cabinet: cabinet,

tempParentFolderIndex: '359',

processName: processName,

templateCode: templateCode

var dataToSend = args.length == 3 ? requestString :JSON.stringify(inpJson);

console.log(dataToSend);

$.ajax({

url: "/FroalaHtml2Pdf/addDocument",

type: "POST",

contentType: "application/json; charset=utf-8",


dataType: "json",

data: dataToSend, // pass that text to the server as a correct JSON String

success: function (retmsg) {

console.log(retmsg.sOutputXML);

setTableCellData(docoutwarddoc, rowIndex, 8, retmsg.DocumentIndex,


true);

RemoveIndicator("application");

showMessage('', 'Template is Generated Sucessfully.', 'error');

setTableCellData(docoutwarddoc, rowIndex, 12, userName, true);


setTableCellData(docoutwarddoc, rowIndex, 5, "Generated", true);
setTableCellData(docoutwarddoc, rowIndex, 6, uploadedDate, true);

saveWorkItem();

},

error: function (type) {

// $("#loading").removeClass('backdrop_hidden');

// alert("ERROR!!" + type.responseText);

RemoveIndicator("application");

showMessage('', 'Error during generating the template.', 'error');

});

9. Make sure to make isEncryptForCustom = 'N' at 2 places,


Path 1->(\\192.168.154...\c$\deployment\jboss-eap-7.3\bin\Newgen\NGConfig\ngdbini\
Custom\cabinetName\eworkstyle.ini )
Path 2->(\\192.168.154...\c$\deployment\jboss-eap-7.3\bin\Newgen\NGConfig\ngdbini\
odwebini\cabinetName\eworkstyle.ini )

10. Also in webdesktop.war -> WEBINF -> WEBXML


Search CSRF MODE IS should be set to OFF.
Search WhiteListMODE IS should be set to OFF.

11.create FROALAHTML2PDF in omnidocs

12.Parentfolder index in commonproperties

13.add 7 jar related jsoup and html

You might also like