Skip to main content

Posts

SAP simple transformer

let say we have s insurance xml data as a response of a web service and we want to expose this data as  a complex structure data type to deal with it in SAP   (the same like DOM parser in other programming languages) the xml data as below <?xml version="1.0" encoding="utf-8"?> <RequestResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   <Response>     <TreatmentBasis>1</TreatmentBasis>     <TreatmentClassification>1</TreatmentClassification>     <MemberDetails>       <Tag>         <ID>1</ID>         <Label>DOB</Label>         <Value>05-Jun-2011</Value>         <Type>Date</Type>       </Tag>       <Tag>       ...

Oracle 11g socket timeout while working well locally via sqlplus

It was not a firewall or port blockage It was  a trace listener.log file increasing (5 Giga) ( it was located under  C:\app\admin_user_name\diag\tnslsnr\onlinesurvey\listener\trace) i have resolved this issue by 1- stop the listener      lsnrctl stop 2- shutdown db  sqlplus / as sysdba SHUTDOWN IMMEDIATE 3- rename the log    ( it should be listener.log file) 4- start db sqlplus / as sysdba STARTUP 5-start listner      lsnrctl start to stop listener log at all  i used this command lsnrctl set log_status off

liferay service connects to external oracle database

1- configure service.xml 2- create ext-spring.xml 3-create the oracle  table and sequesnce 4- build the service 1-service.xml  note that we add <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd"> <service-builder package-path="com.dash.hr.forms"> <author>melsonbati</author> <namespace>SAMPLE</namespace> <entity name="Coupon"  table="HR_COUPON" local-service="true" remote-service="true" data-source="tcsDS" session-factory="testSessionFactory" tx-manager="testTransactionManager"> <!-- PK fields --> <column name="couponId" type="long" primary="true"  id-type="sequence" id-param="id_sequence_cp"  /> ...

script to recursively convert word docs to pdfs

prerequisites:  you have to have ms office with the version which lets you save docs as pdf    two steps   first create this script file to use ms office plugin  and name it as conv.js var fso = new ActiveXObject("Scripting.FileSystemObject"); var docPath = WScript.Arguments(0); docPath = fso.GetAbsolutePathName(docPath); var pdfPath = docPath.replace(/\.doc[^.]*$/, ".pdf"); var objWord = null; try {     WScript.Echo("Saving '" + docPath + "' as '" + pdfPath + "'...");     objWord = new ActiveXObject("Word.Application");     objWord.Visible = false;     var objDoc = objWord.Documents.Open(docPath);     var wdFormatPdf = 17;     objDoc.SaveAs(pdfPath, wdFormatPdf);     objDoc.Close();     WScript.Echo("Done."); } finally {     if (objWord != null)     {         objWord.Quit();     } } then run th...

LIFERAY PORTAL FORCE BROWSER TO ATTACH THE PDF INSTEAD OF AUTO OPEN IT

public StreamedContent getAttachment(){           portletResourceResponse.setContentType("application/pdf");  //application/pdf   portletResourceResponse.setProperty("Content-Disposition", "attachment");     try{  portletResourceResponse.flushBuffer(); OutputStream out =                portletResourceResponse.getPortletOutputStream();  out.write(------);  out.flush();  facesContext.responseComplete();  out.close();  }catch(Exception e) {     e.printStackTrace(); }  return null;  }