Commit ef68c235 by iqbal

Merge branch 'beta-4.2-training' of https://git.opensipkd.com/aa.gusti/opensipkd…

…-base into beta-4.2-training
2 parents f2ba79c4 cb165740
Showing 29 changed files with 602 additions and 56 deletions
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding/departemen.jrxml=UTF-8
encoding/partner.jrxml=UTF-8 encoding/partner.jrxml=UTF-8
encoding/pemerintah.jrxml=UTF-8
encoding/provinsi.jrxml=UTF-8
encoding/users-external.jrxml=UTF-8
encoding/users.jrxml=UTF-8 encoding/users.jrxml=UTF-8
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<jdbcDataAdapter class="net.sf.jasperreports.data.jdbc.JdbcDataAdapterImpl"> <jdbcDataAdapter class="net.sf.jasperreports.data.jdbc.JdbcDataAdapterImpl">
<name>New Data Adapter 1</name> <name>DatabaseAdapter</name>
<driver>org.postgresql.Driver</driver> <driver>org.postgresql.Driver</driver>
<username>postgres</username> <username>postgres</username>
<password>postgres</password> <password>postgres</password>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.5.final using JasperReports Library version 6.20.5-3efcf2e67f959db3888d79f73dde2dbd7acb4f8e -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="users" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="cc1a9dab-bb8a-4181-94ac-73c3dc91137c">
<property name="ireport.zoom" value="1.3310000000000004"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DatabaseAdapter.jrdax"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<parameter name="judul" class="java.lang.String"/>
<parameter name="logo" class="java.lang.String"/>
<queryString>
<![CDATA[SELECT *
FROM res_provinsi]]>
</queryString>
<field name="kategori" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="kategori"/>
<property name="com.jaspersoft.studio.field.label" value="kategori"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="ibu_kota" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="ibu_kota"/>
<property name="com.jaspersoft.studio.field.label" value="ibu_kota"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="nama" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="nama"/>
<property name="com.jaspersoft.studio.field.label" value="nama"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="kode" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="kode"/>
<property name="com.jaspersoft.studio.field.label" value="kode"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="status" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.name" value="status"/>
<property name="com.jaspersoft.studio.field.label" value="status"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="created" class="java.sql.Timestamp">
<property name="com.jaspersoft.studio.field.name" value="created"/>
<property name="com.jaspersoft.studio.field.label" value="created"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="updated" class="java.sql.Timestamp">
<property name="com.jaspersoft.studio.field.name" value="updated"/>
<property name="com.jaspersoft.studio.field.label" value="updated"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="create_uid" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.name" value="create_uid"/>
<property name="com.jaspersoft.studio.field.label" value="create_uid"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="update_uid" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.name" value="update_uid"/>
<property name="com.jaspersoft.studio.field.label" value="update_uid"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<field name="id" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.name" value="id"/>
<property name="com.jaspersoft.studio.field.label" value="id"/>
<property name="com.jaspersoft.studio.field.tree.path" value="res_provinsi"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="73" splitType="Stretch">
<staticText>
<reportElement x="63" y="40" width="492" height="20" uuid="abe9cbb1-2e91-4eb0-b3ee-05e9a967c5f6"/>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[DAFTAR PROVINSI]]></text>
</staticText>
<image>
<reportElement x="10" y="10" width="53" height="58" uuid="3fe2de31-ff3e-4451-8d0d-6b2753184c09"/>
<imageExpression><![CDATA[$P{logo}]]></imageExpression>
</image>
<textField>
<reportElement x="63" y="10" width="492" height="30" uuid="00412b89-3587-423f-8aaf-1526e5f32540"/>
<textElement textAlignment="Center">
<font size="20" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{judul}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="7" splitType="Stretch">
<line>
<reportElement x="0" y="-5" width="555" height="1" uuid="10e401ac-e33c-4e46-b2e1-62703f3cea4e"/>
<graphicElement>
<pen lineWidth="4.0"/>
</graphicElement>
</line>
</band>
</pageHeader>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="20" uuid="45c2cace-4a3f-495c-9002-be2f2ac8eca4"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Kode]]></text>
</staticText>
<staticText>
<reportElement x="100" y="0" width="255" height="20" uuid="3a03e8b0-96f7-4754-b00e-ceae1a0e5aa9"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Nama]]></text>
</staticText>
<staticText>
<reportElement x="355" y="0" width="200" height="20" uuid="f19e05c8-f1bf-4d94-927d-07111ed068df"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Ibu Kota]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="aec5f07a-b9fb-4ce1-9e7e-957f6315acb0"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{kode}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="255" height="20" uuid="04eef3a7-87ca-4a27-9392-1368a6ba2fd1"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{nama}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="355" y="0" width="200" height="20" uuid="47051f05-f634-4c32-97cc-ce9af7b8f382"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{ibu_kota}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.20.5.final using JasperReports Library version 6.20.5-3efcf2e67f959db3888d79f73dde2dbd7acb4f8e -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="users" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="cc1a9dab-bb8a-4181-94ac-73c3dc91137c">
<property name="ireport.zoom" value="1.3310000000000004"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DatabaseAdapter.jrdax"/>
<parameter name="judul" class="java.lang.String"/>
<parameter name="logo" class="java.lang.String"/>
<queryString>
<![CDATA[SELECT *
FROM external_identities]]>
</queryString>
<field name="external_id" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="external_id"/>
<property name="com.jaspersoft.studio.field.label" value="external_id"/>
<property name="com.jaspersoft.studio.field.tree.path" value="external_identities"/>
</field>
<field name="external_user_name" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="external_user_name"/>
<property name="com.jaspersoft.studio.field.label" value="external_user_name"/>
<property name="com.jaspersoft.studio.field.tree.path" value="external_identities"/>
</field>
<field name="local_user_id" class="java.lang.Integer">
<property name="com.jaspersoft.studio.field.name" value="local_user_id"/>
<property name="com.jaspersoft.studio.field.label" value="local_user_id"/>
<property name="com.jaspersoft.studio.field.tree.path" value="external_identities"/>
</field>
<field name="provider_name" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="provider_name"/>
<property name="com.jaspersoft.studio.field.label" value="provider_name"/>
<property name="com.jaspersoft.studio.field.tree.path" value="external_identities"/>
</field>
<field name="access_token" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="access_token"/>
<property name="com.jaspersoft.studio.field.label" value="access_token"/>
<property name="com.jaspersoft.studio.field.tree.path" value="external_identities"/>
</field>
<field name="alt_token" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="alt_token"/>
<property name="com.jaspersoft.studio.field.label" value="alt_token"/>
<property name="com.jaspersoft.studio.field.tree.path" value="external_identities"/>
</field>
<field name="token_secret" class="java.lang.String">
<property name="com.jaspersoft.studio.field.name" value="token_secret"/>
<property name="com.jaspersoft.studio.field.label" value="token_secret"/>
<property name="com.jaspersoft.studio.field.tree.path" value="external_identities"/>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="73" splitType="Stretch">
<staticText>
<reportElement x="63" y="40" width="492" height="20" uuid="abe9cbb1-2e91-4eb0-b3ee-05e9a967c5f6"/>
<textElement textAlignment="Center">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[DAFTAR EXTERNAL USER]]></text>
</staticText>
<image>
<reportElement x="10" y="10" width="53" height="58" uuid="3fe2de31-ff3e-4451-8d0d-6b2753184c09"/>
<imageExpression><![CDATA[$P{logo}]]></imageExpression>
</image>
<textField>
<reportElement x="63" y="10" width="492" height="30" uuid="00412b89-3587-423f-8aaf-1526e5f32540"/>
<textElement textAlignment="Center">
<font size="20" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{judul}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="10" splitType="Stretch">
<line>
<reportElement x="0" y="-5" width="555" height="1" uuid="7b197a7c-c9f8-4564-8934-0c288f892b7d"/>
<graphicElement>
<pen lineWidth="4.0"/>
</graphicElement>
</line>
</band>
</pageHeader>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="20" uuid="45c2cace-4a3f-495c-9002-be2f2ac8eca4"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[User Name]]></text>
</staticText>
<staticText>
<reportElement x="100" y="0" width="255" height="20" uuid="3a03e8b0-96f7-4754-b00e-ceae1a0e5aa9"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Provider]]></text>
</staticText>
<staticText>
<reportElement x="355" y="0" width="200" height="20" uuid="f19e05c8-f1bf-4d94-927d-07111ed068df"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/>
</textElement>
<text><![CDATA[User ID]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="aec5f07a-b9fb-4ce1-9e7e-957f6315acb0"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{external_user_name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="100" y="0" width="255" height="20" uuid="04eef3a7-87ca-4a27-9392-1368a6ba2fd1"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{provider_name}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="355" y="0" width="200" height="20" uuid="47051f05-f634-4c32-97cc-ce9af7b8f382"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{local_user_id}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
...@@ -6,12 +6,8 @@ ...@@ -6,12 +6,8 @@
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DemoAdapter.jrdax"/> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="DemoAdapter.jrdax"/>
<property name="com.jaspersoft.studio.data.sql.tables" value=""/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<parameter name="Judul" class="java.lang.String"> <parameter name="judul" class="java.lang.String"/>
<defaultValueExpression><![CDATA[PEMERINTAH TANGERANG]]></defaultValueExpression> <parameter name="logo" class="java.lang.String"/>
</parameter>
<parameter name="Logo" class="java.lang.String">
<defaultValueExpression><![CDATA["C:\\Users\\ASUS\\Downloads\\bangkit.png"]]></defaultValueExpression>
</parameter>
<queryString> <queryString>
<![CDATA[SELECT * <![CDATA[SELECT *
FROM users]]> FROM users]]>
...@@ -34,22 +30,22 @@ FROM users]]> ...@@ -34,22 +30,22 @@ FROM users]]>
<title> <title>
<band height="73" splitType="Stretch"> <band height="73" splitType="Stretch">
<staticText> <staticText>
<reportElement x="230" y="40" width="130" height="20" uuid="abe9cbb1-2e91-4eb0-b3ee-05e9a967c5f6"/> <reportElement x="63" y="40" width="492" height="20" uuid="abe9cbb1-2e91-4eb0-b3ee-05e9a967c5f6"/>
<textElement> <textElement textAlignment="Center">
<font size="14" isBold="true"/> <font size="14" isBold="true"/>
</textElement> </textElement>
<text><![CDATA[DAFTAR PARTNER]]></text> <text><![CDATA[DAFTAR USER]]></text>
</staticText> </staticText>
<image> <image>
<reportElement x="10" y="10" width="53" height="58" uuid="3fe2de31-ff3e-4451-8d0d-6b2753184c09"/> <reportElement x="10" y="10" width="53" height="58" uuid="3fe2de31-ff3e-4451-8d0d-6b2753184c09"/>
<imageExpression><![CDATA[$P{Logo}]]></imageExpression> <imageExpression><![CDATA[$P{logo}]]></imageExpression>
</image> </image>
<textField> <textField>
<reportElement x="-20" y="10" width="595" height="30" uuid="00412b89-3587-423f-8aaf-1526e5f32540"/> <reportElement x="63" y="10" width="492" height="30" uuid="00412b89-3587-423f-8aaf-1526e5f32540"/>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font size="20" isBold="true"/> <font size="20" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$P{Judul}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{judul}]]></textFieldExpression>
</textField> </textField>
</band> </band>
</title> </title>
...@@ -60,6 +56,12 @@ FROM users]]> ...@@ -60,6 +56,12 @@ FROM users]]>
<band height="20" splitType="Stretch"> <band height="20" splitType="Stretch">
<staticText> <staticText>
<reportElement x="0" y="0" width="100" height="20" uuid="45c2cace-4a3f-495c-9002-be2f2ac8eca4"/> <reportElement x="0" y="0" width="100" height="20" uuid="45c2cace-4a3f-495c-9002-be2f2ac8eca4"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
...@@ -67,6 +69,12 @@ FROM users]]> ...@@ -67,6 +69,12 @@ FROM users]]>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="100" y="0" width="255" height="20" uuid="3a03e8b0-96f7-4754-b00e-ceae1a0e5aa9"/> <reportElement x="100" y="0" width="255" height="20" uuid="3a03e8b0-96f7-4754-b00e-ceae1a0e5aa9"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
...@@ -74,6 +82,12 @@ FROM users]]> ...@@ -74,6 +82,12 @@ FROM users]]>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="355" y="0" width="100" height="20" uuid="f19e05c8-f1bf-4d94-927d-07111ed068df"/> <reportElement x="355" y="0" width="100" height="20" uuid="f19e05c8-f1bf-4d94-927d-07111ed068df"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
...@@ -81,6 +95,12 @@ FROM users]]> ...@@ -81,6 +95,12 @@ FROM users]]>
</staticText> </staticText>
<staticText> <staticText>
<reportElement x="455" y="0" width="100" height="20" uuid="8a8040c2-e6ba-4473-835f-c9cfe3568fb9"/> <reportElement x="455" y="0" width="100" height="20" uuid="8a8040c2-e6ba-4473-835f-c9cfe3568fb9"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"> <textElement textAlignment="Center">
<font isBold="true" isUnderline="true"/> <font isBold="true" isUnderline="true"/>
</textElement> </textElement>
...@@ -89,24 +109,48 @@ FROM users]]> ...@@ -89,24 +109,48 @@ FROM users]]>
</band> </band>
</columnHeader> </columnHeader>
<detail> <detail>
<band height="22" splitType="Stretch"> <band height="20" splitType="Stretch">
<textField> <textField>
<reportElement x="0" y="0" width="100" height="20" uuid="aec5f07a-b9fb-4ce1-9e7e-957f6315acb0"/> <reportElement x="0" y="0" width="100" height="20" uuid="aec5f07a-b9fb-4ce1-9e7e-957f6315acb0"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/> <textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{user_name}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{user_name}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="100" y="0" width="255" height="20" uuid="04eef3a7-87ca-4a27-9392-1368a6ba2fd1"/> <reportElement x="100" y="0" width="255" height="20" uuid="04eef3a7-87ca-4a27-9392-1368a6ba2fd1"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/> <textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{email}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{email}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="455" y="0" width="100" height="20" uuid="24a12a8f-a1e1-4ae3-adb7-bbcf450560ee"/> <reportElement x="455" y="0" width="100" height="20" uuid="24a12a8f-a1e1-4ae3-adb7-bbcf450560ee"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/> <textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{registered_date}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{registered_date}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="355" y="0" width="100" height="20" uuid="47051f05-f634-4c32-97cc-ce9af7b8f382"/> <reportElement x="355" y="0" width="100" height="20" uuid="47051f05-f634-4c32-97cc-ce9af7b8f382"/>
<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center"/> <textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField> </textField>
......
...@@ -89,10 +89,10 @@ def jasper_export(input_file, output_file=None, schema=None, ...@@ -89,10 +89,10 @@ def jasper_export(input_file, output_file=None, schema=None,
module_file = input_file[0] module_file = input_file[0]
input_file = input_file[1] input_file = input_file[1]
if module_file: if module_file:
path = __import__(module_file) path = __import__(module_file)
path = os.path.dirname(path.__file__) path = os.path.dirname(path.__file__)
input_file = os.path.join(path, input_file) input_file = os.path.join(path, input_file)
else: else:
input_file = input_file[0] input_file = input_file[0]
......
from . import DataTables, button_import import os
from . import DataTables, button_import, get_params
from .partner_base import PartnerSchema from .partner_base import PartnerSchema
from .. import get_urls from .. import get_urls
from ..views import BaseView from ..views import BaseView
...@@ -13,7 +14,10 @@ from sqlalchemy.orm import aliased ...@@ -13,7 +14,10 @@ from sqlalchemy.orm import aliased
from opensipkd.models import DBSession, ResCompany, ResKecamatan, Partner from opensipkd.models import DBSession, ResCompany, ResKecamatan, Partner
from opensipkd.models import ResProvinsi, ResDati2, ResDesa, User from opensipkd.models import ResProvinsi, ResDati2, ResDesa, User
from opensipkd.tools.buttons import btn_upload from opensipkd.tools.buttons import btn_upload
from opensipkd.tools.report import file_response
# lib buat mendapatkan full path asset
from pyramid.path import AssetResolver
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
SESS_ADD_FAILED = 'Tambah pemda gagal' SESS_ADD_FAILED = 'Tambah pemda gagal'
...@@ -100,6 +104,10 @@ class ViewCompany(BaseView): ...@@ -100,6 +104,10 @@ class ViewCompany(BaseView):
self.table = ResCompany self.table = ResCompany
self.list_buttons = self.list_buttons + self.list_report + (button_import,) self.list_buttons = self.list_buttons + self.list_report + (button_import,)
path = os.path.dirname(__file__)
path = os.path.dirname(path)
self.report_file = os.path.join(path, 'reports', 'pemerintah.jrxml')
def form_validator(self, form, value): def form_validator(self, form, value):
err = colander.Invalid(form, "") err = colander.Invalid(form, "")
...@@ -194,42 +202,61 @@ class ViewCompany(BaseView): ...@@ -194,42 +202,61 @@ class ViewCompany(BaseView):
self.table.id == self.req.user.company_id) self.table.id == self.req.user.company_id)
return query return query
# Mendapatkan path gambar
def get_module_path(self, module_name):
a = AssetResolver(module_name)
resolver = a.resolve('')
return resolver.abspath()
def pdf_response(self, **kwargs):
from opensipkd.base.tools.report import jasper_export
logo = self.get_module_path('opensipkd.base')
logo = os.path.join(logo, 'static', 'img', 'logo.png')
parameters = {
"judul": get_params('company', "openSIPKD"),
"logo": logo
}
print(parameters)
filename = jasper_export(self.report_file, parameters=parameters)
return file_response(self.req, filename=filename[0])
@view_config( @view_config(
route_name='company-act', route_name='company-act',
renderer='json', renderer='json',
permission='view') permission='view')
def view_act(self): def view_act(self):
request = self.req # request = self.req
ses = request.session # ses = request.session
params = request.params # params = request.params
url_dict = request.matchdict # url_dict = request.matchdict
alias = aliased(ResCompany) # alias = aliased(ResCompany)
if url_dict['act'] == 'grid': # if url_dict['act'] == 'grid':
columns = [ColumnDT(self.table.id, mData='id'), # columns = [ColumnDT(self.table.id, mData='id'),
ColumnDT(self.table.kode, mData='kode'), # ColumnDT(self.table.kode, mData='kode'),
ColumnDT(self.table.nama, mData='nama'), # ColumnDT(self.table.nama, mData='nama'),
ColumnDT(alias.nama, mData='parent_nm'), # ColumnDT(alias.nama, mData='parent_nm'),
ColumnDT(self.table.status, mData='status'), # ColumnDT(self.table.status, mData='status'),
# ColumnDT(Departemen.level_id, mData='level_id'), # # ColumnDT(Departemen.level_id, mData='level_id'),
] # ]
query = DBSession.query().select_from(ResCompany).outerjoin( # query = DBSession.query().select_from(ResCompany).outerjoin(
alias, ResCompany.parent_id == alias.id) # alias, ResCompany.parent_id == alias.id)
query = self.filter_company(query) # query = self.filter_company(query)
row_table = DataTables(request.GET, query, columns) # row_table = DataTables(request.GET, query, columns)
return row_table.output_result() # return row_table.output_result()
elif url_dict['act'] == 'hon': # elif url_dict['act'] == 'hon':
term = 'term' in params and params['term'] or '' # term = 'term' in params and params['term'] or ''
q = DBSession.query(self.table) \ # q = DBSession.query(self.table) \
.filter(self.table.status == 1, # .filter(self.table.status == 1,
self.table.nama.ilike('%%%s%%' % term)) \ # self.table.nama.ilike('%%%s%%' % term)) \
.order_by(self.table.nama) # .order_by(self.table.nama)
rows = q.all() # rows = q.all()
r = [] # r = []
for k in rows: # for k in rows:
d = dict(id=k.id, value=k.nama, kode=k.kode, nama=k.nama) # d = dict(id=k.id, value=k.nama, kode=k.kode, nama=k.nama)
r.append(d) # r.append(d)
log.error(r) # log.error(r)
return r # return r
return super(ViewCompany, self).view_act()
@view_config( @view_config(
route_name='company-add', route_name='company-add',
...@@ -261,7 +288,7 @@ class ViewCompany(BaseView): ...@@ -261,7 +288,7 @@ class ViewCompany(BaseView):
@view_config( @view_config(
route_name='company-delete', route_name='company-delete',
renderer='templates/form_input.pt', renderer='templates/form.pt',
permission='company') permission='company')
def view_delete(self): def view_delete(self):
return super(ViewCompany, self).view_delete() return super(ViewCompany, self).view_delete()
......
from . import widget_os, button_import import os
from . import widget_os, button_import, get_params
from ..views import BaseView from ..views import BaseView
import colander import colander
...@@ -7,7 +8,10 @@ from pyramid.i18n import TranslationStringFactory ...@@ -7,7 +8,10 @@ from pyramid.i18n import TranslationStringFactory
from pyramid.view import (view_config, ) from pyramid.view import (view_config, )
from opensipkd.models import DBSession, ResProvinsi, kategori_provinsi from opensipkd.models import DBSession, ResProvinsi, kategori_provinsi
from opensipkd.tools.buttons import btn_upload from opensipkd.tools.buttons import btn_upload
from opensipkd.tools.report import file_response
# lib buat mendapatkan full path asset
from pyramid.path import AssetResolver
_ = TranslationStringFactory("opensipkd") _ = TranslationStringFactory("opensipkd")
...@@ -83,6 +87,10 @@ class ViewProvinsi(BaseView): ...@@ -83,6 +87,10 @@ class ViewProvinsi(BaseView):
self.table = ResProvinsi self.table = ResProvinsi
self.list_buttons = self.list_buttons + self.list_report + (button_import,) self.list_buttons = self.list_buttons + self.list_report + (button_import,)
path = os.path.dirname(__file__)
path = os.path.dirname(path)
self.report_file = os.path.join(path, 'reports', 'provinsi.jrxml')
######## ########
# List # # List #
######## ########
...@@ -134,6 +142,24 @@ class ViewProvinsi(BaseView): ...@@ -134,6 +142,24 @@ class ViewProvinsi(BaseView):
def view_list(self): def view_list(self):
return super(ViewProvinsi, self).view_list() return super(ViewProvinsi, self).view_list()
# Mendapatkan path gambar
def get_module_path(self, module_name):
a = AssetResolver(module_name)
resolver = a.resolve('')
return resolver.abspath()
def pdf_response(self, **kwargs):
from opensipkd.base.tools.report import jasper_export
logo = self.get_module_path('opensipkd.base')
logo = os.path.join(logo, 'static', 'img', 'logo.png')
parameters = {
"judul": get_params('company', "openSIPKD"),
"logo": logo
}
print(parameters)
filename = jasper_export(self.report_file, parameters=parameters)
return file_response(self.req, filename=filename[0])
@view_config( @view_config(
route_name='provinsi-act', route_name='provinsi-act',
renderer='json', renderer='json',
......
from . import BaseView, button_import from . import BaseView, button_import, get_params
from .company import company_widget from .company import company_widget
from .user_login import (regenerate_security_code, send_email_security_code, generate_api_key,) from .user_login import (regenerate_security_code, send_email_security_code, generate_api_key,)
import os import os
...@@ -14,6 +14,9 @@ from pyramid.view import view_config ...@@ -14,6 +14,9 @@ from pyramid.view import view_config
from sqlalchemy import (func,) from sqlalchemy import (func,)
from ziggurat_foundations.models.services.user import UserService from ziggurat_foundations.models.services.user import UserService
# lib buat mendapatkan full path asset
from pyramid.path import AssetResolver
_ = TranslationStringFactory('user') _ = TranslationStringFactory('user')
...@@ -85,6 +88,24 @@ class Views(BaseView): ...@@ -85,6 +88,24 @@ class Views(BaseView):
def view_list(self): def view_list(self):
return super(Views, self).view_list() return super(Views, self).view_list()
# Mendapatkan path gambar
def get_module_path(self, module_name):
a = AssetResolver(module_name)
resolver = a.resolve('')
return resolver.abspath()
def pdf_response(self, **kwargs):
from opensipkd.base.tools.report import jasper_export
logo = self.get_module_path('opensipkd.base')
logo = os.path.join(logo, 'static', 'img', 'logo.png')
parameters = {
"judul": get_params('company', "openSIPKD"),
"logo": logo
}
print(parameters)
filename = jasper_export(self.report_file, parameters=parameters)
return file_response(self.req, filename=filename[0])
@view_config( @view_config(
route_name='user-act', route_name='user-act',
renderer='json', renderer='json',
...@@ -102,7 +123,7 @@ class Views(BaseView): ...@@ -102,7 +123,7 @@ class Views(BaseView):
# 'rows': rows, # 'rows': rows,
# } # }
# return csv_response(self.req, value, filename) # return csv_response(self.req, value, filename)
#
# elif url_dict['act'] == 'pdf': # elif url_dict['act'] == 'pdf':
# query = query_register() # query = query_register()
# import opensipkd.base # import opensipkd.base
......
import os
import colander import colander
from datatables import (ColumnDT, DataTables, ) from datatables import (ColumnDT, DataTables, )
from deform import (widget, ) from deform import (widget, )
from opensipkd.tools.buttons import btn_close, btn_delete, btn_view from opensipkd.tools.buttons import btn_close, btn_delete, btn_view
from opensipkd.tools.report import open_rml_row, csv_response, open_rml_pdf, pdf_response, file_response
from pyramid.i18n import TranslationStringFactory from pyramid.i18n import TranslationStringFactory
from pyramid.view import view_config from pyramid.view import view_config
from . import BaseView, button_import # Tombol import from . import BaseView, button_import, get_params # Tombol import
from opensipkd.models import (DBSession, User, ExternalIdentity) from opensipkd.models import (DBSession, User, ExternalIdentity)
# lib buat mendapatkan full path asset
from pyramid.path import AssetResolver
_ = TranslationStringFactory('user') _ = TranslationStringFactory('user')
...@@ -41,6 +46,11 @@ class UserExt(BaseView): ...@@ -41,6 +46,11 @@ class UserExt(BaseView):
self.list_buttons = (btn_close,) + self.list_report + (button_import,) self.list_buttons = (btn_close,) + self.list_report + (button_import,)
self.table = ExternalIdentity self.table = ExternalIdentity
# Coba cetak pdf
path = os.path.dirname(__file__)
path = os.path.dirname(path)
self.report_file = os.path.join(path, 'reports', 'users-external.jrxml')
@view_config( @view_config(
route_name='user-ext', route_name='user-ext',
renderer='templates/table.pt', renderer='templates/table.pt',
...@@ -64,9 +74,60 @@ class UserExt(BaseView): ...@@ -64,9 +74,60 @@ class UserExt(BaseView):
def view_delete(self): def view_delete(self):
return super(UserExt, self).view_delete() return super(UserExt, self).view_delete()
# Mendapatkan path gambar
def get_module_path(self, module_name):
a = AssetResolver(module_name)
resolver = a.resolve('')
return resolver.abspath()
def pdf_response(self, **kwargs):
from opensipkd.base.tools.report import jasper_export
logo = self.get_module_path('opensipkd.base')
logo = os.path.join(logo, 'static', 'img', 'logo.png')
parameters = {
"judul": get_params('company', "openSIPKD"),
"logo": logo
}
print(parameters)
filename = jasper_export(self.report_file, parameters=parameters)
return file_response(self.req, filename=filename[0])
# Coba csv
def csv_response(self, **kwargs):
query = self.table.query_register()
row = query.first()
header = row._mapping.keys()
rows = [list(item) for item in query.all()]
filename = f"{get_random_string(16)}.csv"
value = {
'header': header,
'rows': rows,
}
return csv_response(self.req, value, filename)
def csv_response(request, value, filename=None):
if not filename:
filename = get_random_string(20)+".csv"
response = request.response
response.content_type = 'text/csv'
# response.content_disposition = 'attachment;filename=' + filename
response.content_disposition = 'filename=' + filename
if sys.version_info < (3,):
import StringIO
fout = StringIO.StringIO()
else:
fout = io.StringIO()
fcsv = csv.writer(fout, delimiter=',', quotechar='"',
quoting=csv.QUOTE_MINIMAL)
fcsv.writerow(value.get('header', []))
fcsv.writerows(value.get('rows', []))
response.write(fout.getvalue())
return response
@view_config( @view_config(
route_name='user-ext-act', route_name='user-ext-act',
renderer='json', permission='user-view') renderer='json',
permission='user-view')
def view_act(self): def view_act(self):
return super(UserExt, self).view_act() return super(UserExt, self).view_act()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!