download data from localStorage

var json = localStorage.getItem('theData');
var blob = new Blob([json], {type: "application/json"});
var url = URL.createObjectURL(blob);

var a = document.createElement('a');
a.download = "backup.json";
a.href = url;
a.textContent = "Download backup.json";

($ == undefined ) ? document.body.appendChild(a) : $("body").append(a);

httpd with PHP and sqlite3 with SELinux

mkdir /var/www/data

semanage fcontext -a -t httpd_sys_rw_content_t “/var/www/data(/.*)?”

restorecon -Rv /var/www

chown -R apache:apache data

 

<?php

$dbhandle = new SQLite3(‘/var/www/data/mysqlitedb.db’);
$sql = “CREATE TABLE IF NOT EXISTS foo (id INTEGER PRIMARY KEY  AUTOINCREMENT, bar STRING)”;
$result = $dbhandle->query($sql);

Testproduct

123 Welcome World Product

CHF 11.25
Posted in Uncategorized

Bestellung aufgeben

Bitte teile uns deine Anschrift mit. Nachdem du den Gesamtbetrag einbezahlt hast, verschicke ich die bestellten Artikel per Post.

 

Jasperreports with Maven in Eclipse

  1. pom.xml
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    
    <modelVersion>4.0.0</modelVersion>
    
    <groupId>com.ofrick</groupId>
    
    <artifactId>jasper</artifactId>
    
    <version>0.0.1-SNAPSHOT</version>
    
    <dependencies>
    
    <!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
    
    <dependency>
    
    <groupId>net.sf.jasperreports</groupId>
    
    <artifactId>jasperreports</artifactId>
    
    <version>6.15.0</version>
    
    </dependency>
    
    </dependencies>
    
    </project>

2. Fix error for com.lowagie itext 2.1.7.js8

Download jar from http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/com/lowagie/itext/2.1.7.js8/itext-2.1.7.js8.jar

In Eclipse, Run Maven Build…  Goal install:install-file
in JRE Tab under VM arguments:
-DgroupId=com.lowagie -DartifactId=itext -Dversion=2.1.7.js8 -Dfile=C:\Users\O\Downloads\itext-2.1.7.js8.jar -DgeneratePom=true -Dpackaging=jar

3. Do Maven Update Project

package.jdo

if id is not needed as a number in the application

<class name=”Author” table=”MERIT_AUTHOR”>
<datastore-identity strategy=”sequence” sequence=”AUTHOR_ID_SEQ” column=”AUTHOR_ID”/>
<field name=”firstName”>
<column name=”FIRSTNAME”/>
</field>
<field name=”lastName”>
<column name=”LASTNAME”/>
</field>
<field name=”userName”>
<column name=”USERNAME”/>
</field>
<field name=”posts” mapped-by=”author”>
<collection element-type=”entity.Post”/>
</field>
</class>

 

to use the id

<sequence name=”WEBSESSION_ID_SEQ” datastore-sequence=”MERIT_WEBSESSION_SEQ” strategy=”noncontiguous” allocation-size=”1″ initial-value=”1″/>
<class name=”WebSession”>
<field name=”id” primary-key=”true” value-strategy=”sequence” sequence=”WEBSESSION_ID_SEQ”/>
</class>