May 6th, 2008
public void xdoPdf(
oracle.apps.fnd.common.AppsContext appsContext,
String datatemplateName,
String templateName,
java.util.Properties params,
{
java.sql.Connection conn;
conn = appsContext.getJDBCConnection();
java.io.InputStream datatemplate = null;
java.sql.Blob blob = null;
java.sql.CallableStatement stmt =
conn.prepareCall(
"select file_data from xdo_lobs where lob_code = :1 and lob_type = :2");
stmt.setString(1, datatemplateName);
stmt.setString(2, "DATA_TEMPLATE");
stmt.execute();
java.sql.ResultSet rs = stmt.getResultSet();
rs.next();
blob = rs.getBlob(1);
datatemplate = blob.getBinaryStream();
stmt.close();
oracle.apps.xdo.dataengine.DataProcessor dataProcessor = new DataProcessor();
dataProcessor.setDataTemplate(datatemplate);
ArrayList parameters;
parameters = dataProcessor.getParameters();
for (Iterator it = parameters.iterator(); it.hasNext();)
{
Parameter p = (Parameter) it.next();
if (params.get(p.getName()) != null)
{
p.setValue(params.get(p.getName()));
}
}
dataProcessor.setParameters(parameters);
ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
ByteArrayInputStream dataIn;
dataProcessor.setConnection(conn);
dataProcessor.setOutput(dataOut);
dataProcessor.processData();
dataIn = new ByteArrayInputStream(dataOut.toByteArray());
blob = null;
java.io.InputStream template = null;
CallableStatement stmt =
conn.prepareCall(
"select file_data from xdo_lobs where lob_code = :1 and lob_type = :2");
stmt.setString(1, templateName);
stmt.setString(2, "TEMPLATE");
stmt.execute();
ResultSet rs = stmt.getResultSet();
rs.next();
blob = rs.getBlob(1);
template = blob.getBinaryStream();
stmt.close();
ByteArrayOutputStream pdfOut = new ByteArrayOutputStream();
ByteArrayInputStream pdfIn;
oracle.apps.xdo.template.FOProcessor processor = new FOProcessor();
processor.setTemplate(template);
processor.setConfig(new Properties());
processor.setData(dataIn);
processor.setOutput(pdfOut);
processor.setOutputFormat(FOProcessor.FORMAT_PDF);
processor.generate();
pdfIn = new ByteArrayInputStream(pdfOut.toByteArray());
}
Posted in Oracle | No Comments »
May 3rd, 2008
Sometimes, when you’ve rolled out new pages to the Application server and use adapcctl.sh restart, the web server won’t respond at all any more.
This is usually caused by a hanging fcgi process. Find the port number in $IAS_APACHE_HOME/Apache/Apache/logs/error_log* and use netstat -p -l | grep <port> to find the culprit.
If that works, but JSP’s still aren’t showing, you have a hanging Jserv. More on that later.
Disclaimer
Any Oracle-related tips are meant for development environments, not production.
Posted in English, Oracle | No Comments »
May 3rd, 2007
Siden det nå er store endringer likevel, og hele jernbanetorget er gravd opp, tenkte jeg at jeg legger dette ut selv hvis jeg ikke har 10 punkt enda.
- Fler avganger på linje 34 og 54 i rushen
- Her er det altid fullt fra Oslo S og oppover Iladalen.
- De nye t-bane-vognene har ikke plass til ski
- Oslo sporveier har sikkert tenkt at dette ikke er et problem siden det er gamle vogner som går til Frognerseteren. Men hva med Sognsvann m.fl.
- Mere beinplass
- Hvorfor skal det være slik at det for meg som er 192 cm lang bare finnes 8 (av over 40) sitteplasser som er mulige å sitte på på de nye bussene?
Posted in Norsk, Politics, Travel | No Comments »
May 3rd, 2007
After the ham-to-spam ration in my comments reached 100:1 I decided something needed to be done. I didn’t want CAPTCHA, so I installed Bad Behaviour and a new http:BL plugin, and things got much better!
(The 100 spam per real comment never really showed, of course: Akismet caught them. But they were still creating unnecessary load.)
Posted in English, WordPress | No Comments »
March 29th, 2007
Posted in Photos, Svenska | 3 Comments »
February 11th, 2007
Yesterday night, someone placed a half-eaten hamburger in our mailbox. Sheesh.
Posted in English | 2 Comments »
December 15th, 2006
Uh. It seems MySQL has botched the main data file for one of my pet projects, the Bologna Process web site.
There wasn’t much there anyway, but it’s still sad. I need to find an automatic backup option, I guess. And I didn’t really like TextPattern anyway. I think I’d rather go to using WordPress as a CMS, and hack a call to the built-in backup into every write or edit.
Posted in Computers & co, EHEA, English, WordPress | No Comments »
December 10th, 2006
Dette pepperkakehuset er nå stilt ut på Nasjonalgalleriet…

Posted in Norsk, Photos | No Comments »
December 10th, 2006
Beim mündlichen Auswahlverfahren für den höheren Auswärtigen Dienst bin ich leider nicht genommen worden. Aber das Auswahlverfahren an sich war auch ganz interessant…
Ihr Ergebnis des schrftlichen
Auswahlverfahrens:
| DGP-Test: |
121,76 |
(von 130) |
| Fachtest Allgemeinwissen: |
6,00 |
(von 25) |
| Fachtest Recht: |
12,00 |
(von 25) |
| Fachtest VWL: |
13,00 |
(von 25) |
| Fachtest Politik/Geschichte: |
8,00 |
(von 25) |
| Summe Fachtests: |
39,00 |
(von 100) |
| Sprachtest Englich: |
62,50 |
(von 70) |
| Sprachtest Zweitsprache*: |
60,00 |
(von 70) |
| Aufsatz Note: |
3,00 |
(Noten 1-6, wie Schulnoten) |
* Französisch
Posted in Deutsch, Jobs, Politics, Travel | 1 Comment »
September 12th, 2006
On my way to Chicago for Accenture training in St. Charles. In-flight Internet access is great, and I can’t understand my Connexion (the Boeing subsidiary that runs this) is going out of business.
Part of the reason might be that I seem to be the only one using it — there’s good bandwidth anyway.
Posted in Computers & co, English, Travel | No Comments »