Skip to content
Browse files

Adding Open311 joget plugin

  • Loading branch information...
1 parent bb144c7 commit 4ae40b66e6808985c18b93fb94ea1ef7e4a38e6b @aashishmittal aashishmittal committed Jul 26, 2011
View
150 open311 plugin/pom.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.joget.open311</groupId>
+ <artifactId>dataplugin</artifactId>
+ <packaging>bundle</packaging>
+ <name>open311-request-plugin</name>
+ <version>6.0</version>
+ <url>http://www.joget.org</url>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <instructions>
+ <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+ <Bundle-Name>${pom.artifactId}</Bundle-Name>
+ <Bundle-Description>Open311 Request Bundle</Bundle-Description>
+ <Bundle-Version>1.0.0</Bundle-Version>
+ <Import-Package>org.osgi.framework;version="1.0.0", javax.servlet, javax.servlet.http</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4.3</version>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skipTests>false</skipTests>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <!-- Change package and plugin class here -->
+ <Export-Package>org.joget.open311.dataplugin</Export-Package>
+ <Private-Package>org.joget.open311.dataplugin.*</Private-Package>
+ <Bundle-Activator>org.joget.open311.dataplugin.DefaultActivator</Bundle-Activator>
+ <Import-Package>!*,org.joget.plugin.property.model,org.joget.plugin.base,org.joget.apps.form.lib,org.joget.workflow.model,org.joget.workflow.model.service,org.joget.workflow.util,org.joget.apps.app.model,org.joget.apps.app.service,org.joget.apps.userview.model,org.joget.apps.userview.service,org.joget.apps.datalist.model,org.joget.apps.datalist.service,org.joget.apps.list.service,org.joget.apps.form.model,org.joget.apps.form.service,javax.servlet,javax.servlet.http,org.osgi.framework;version="1.3.0"</Import-Package>
+ <!-- End change package and plugin class here -->
+ <Embed-Dependency>!org.apache.felix*;scope=compile|runtime;inline=false</Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Embed-Directory>dependency</Embed-Directory>
+ <Embed-StripGroup>true</Embed-StripGroup>
+ <DynamicImport-Package>*</DynamicImport-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20080701</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.5.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>2.5.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.joget</groupId>
+ <artifactId>wflow-core</artifactId>
+ <version>3.0-BETA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jfree</groupId>
+ <artifactId>jfreechart</artifactId>
+ <version>1.0.13</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>displaytag</groupId>
+ <artifactId>displaytag</artifactId>
+ <version>1.2</version>
+ </dependency>
+ </dependencies>
+ <distributionManagement>
+ <repository>
+ <id>internal</id>
+ <url>http://dev.joget.org/archiva/repository/internal</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots</id>
+ <url>http://dev.joget.org/archiva/repository/snapshots</url>
+ </snapshotRepository>
+ </distributionManagement>
+ <repositories>
+ <repository>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/2/
+ </url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+</project>
View
67 open311 plugin/src/main/java/org/joget/open311/dataplugin/CustomFormField.java
@@ -0,0 +1,67 @@
+package org.joget.open311.dataplugin;
+
+import java.util.Map;
+
+import org.joget.apps.app.service.AppUtil;
+import org.joget.apps.form.model.Element;
+import org.joget.apps.form.model.FormBuilderPaletteElement;
+import org.joget.apps.form.model.FormData;
+import org.joget.apps.form.service.FormUtil;
+
+
+public class CustomFormField extends Element implements FormBuilderPaletteElement {
+
+ @Override
+ public String renderTemplate(FormData formData, Map dataModel) {
+ String template = "map.ftl";
+ String value = FormUtil.getElementPropertyValue(this, formData);
+ dataModel.put("value", value);
+ String html = FormUtil.generateElementHtml(this, formData, template, dataModel);
+ return html;
+ }
+
+ public String getFormBuilderCategory() {
+ return "Basic";
+ }
+
+ public String getFormBuilderIcon() {
+ return null;
+ }
+
+ public int getFormBuilderPosition() {
+
+ return 5000;
+ }
+
+ public String getFormBuilderTemplate() {
+ return "<label class='label'>Map</label><input type='text' />";
+ }
+
+ public String getDefaultPropertyValues() {
+ return "{label:'Map'}";
+ }
+
+ public String getLabel() {
+ return "Map";
+ }
+
+ public String getPropertyOptions() {
+
+ return AppUtil.readPluginResource(getClass().getName(), "/properties/form/map.json", null, true, "message/form/Map");
+ }
+
+ public String getDescription() {
+
+ return "Google Map";
+ }
+
+ public String getName() {
+ return "Map";
+ }
+
+ public String getVersion() {
+ return "1.0.6";
+ }
+
+
+}
View
69 open311 plugin/src/main/java/org/joget/open311/dataplugin/DefaultActivator.java
@@ -0,0 +1,69 @@
+package org.joget.open311.dataplugin;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import org.joget.plugin.base.PluginProperty;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * Default package activator for the OSGI bundle. Refactor and rename as necessary
+ * @author Michael Yap
+ */
+public class DefaultActivator implements BundleActivator
+{
+ //Meta constants. Modify per use
+ public static final String ACTIVATOR_NAME = "Open311 Request Bundle";
+ public static final String ACTIVATOR_VER = "1.0.0";
+ public static final String ACTIVATOR_DESC = "Open311 Request Bundle";
+
+ protected Collection<ServiceRegistration> registration;
+
+ /**
+ * Start method invoked during OSGI container launch. Register your plugins
+ * into the registration list.
+ * @param context
+ */
+ public void start(BundleContext context)
+ {
+ registration = new ArrayList<ServiceRegistration>();
+ registration.add(context.registerService(Open311Data.class.getName(), new Open311Data(), null));
+ registration.add(context.registerService(CustomFormField.class.getName(), new CustomFormField(), null));
+
+ }
+
+ public void stop(BundleContext context)
+ {
+ for (ServiceRegistration registration : this.registration)
+ {
+ registration.unregister();
+ }
+ }
+
+ public String getName()
+ {
+ return ACTIVATOR_NAME;
+ }
+
+ public String getVersion()
+ {
+ return ACTIVATOR_VER;
+ }
+
+ public String getDescription()
+ {
+ return ACTIVATOR_DESC;
+ }
+
+ public PluginProperty[] getPluginProperties()
+ {
+ return null;
+ }
+
+ public Object execute(Map properties)
+ {
+ return null;
+ }
+}
View
243 open311 plugin/src/main/java/org/joget/open311/dataplugin/Open311Data.java
@@ -0,0 +1,243 @@
+package org.joget.open311.dataplugin;
+
+import java.util.Map;
+
+import org.joget.plugin.base.DefaultPlugin;
+import org.joget.plugin.base.Plugin;
+import org.joget.plugin.base.PluginProperty;
+import org.joget.plugin.base.PluginWebSupport;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.ServletException;
+import java.io.IOException;
+import java.sql.*;
+import java.text.*;
+
+public class Open311Data extends DefaultPlugin implements Plugin, PluginWebSupport {
+
+ public void webService(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+
+ String connectionURL = "jdbc:mysql://localhost:3306/jwdb";
+ String username = "root";
+ String password = "";
+ String tableName = "app_fd_open311_request_t";
+ String dat="01/01/1970";
+ String tim="00:00:00";
+ long l=0l;
+ StringBuilder my = new StringBuilder("");
+
+ if(request.getParameter("time")!=null)
+ {
+
+ l=Long.valueOf(request.getParameter("time"));
+ Date d=new Date(l);
+ Format formatDate = new SimpleDateFormat("MM/dd/yyyy");
+ Format formatTime = new SimpleDateFormat("HH:mm:ss");
+ dat = formatDate.format(d);
+ tim = formatTime.format(d);
+ }
+ String sqlQuery = "SELECT * FROM " + tableName + " where STR_TO_DATE(c_requestDate,'%m/%d/%Y') > STR_TO_DATE('"+dat+"','%m/%d/%Y') AND STR_TO_DATE(c_requestTime,'%H:%i:%s') > STR_TO_DATE('"+tim+"','%H:%i:%s') ORDER BY dateCreated DESC";
+
+ Connection connection = null;
+ Statement statement = null;
+ ResultSet rs = null;
+ try
+ {
+ try{
+ Class.forName("com.mysql.jdbc.Driver").newInstance();
+ }
+ catch (Exception e){
+ System.out.println(e);
+ }
+ try{
+ connection = DriverManager.getConnection(connectionURL, username, password);
+ }
+ catch (SQLException e){
+ System.out.println("Unable to create connection to the database " + e);
+ }
+ try{
+ statement = connection.createStatement();
+ }
+ catch (SQLException e){
+ System.out.println("Unable to create the sql statement object " + e);
+ }
+ try{
+ rs = statement.executeQuery(sqlQuery);
+ }
+ catch (SQLException e){
+ System.out.println("Unable to execute the query " + e);
+ }
+ while (rs.next())
+ {
+
+ my.append("<request>");
+ my.append("\n<service_request_id>");
+ if(!rs.getString("c_service_request_id").equals("")) {
+ my.append("\n\t"+rs.getString("c_service_request_id"));
+ }
+ my.append("\n</service_request_id>");
+
+
+ my.append("\n<status>");
+ if(!rs.getString("c_status").equals("")) {
+ my.append("\n\t"+rs.getString("c_status"));
+ }
+ my.append("\n</status>");
+
+ my.append("\n<status_notes>");
+ if(!rs.getString("c_status_notes").equals("")) {
+ my.append("\n\t"+rs.getString("c_status_notes"));
+ }
+ my.append("\n</status_notes>");
+
+ my.append("\n<service_name>");
+ if(!rs.getString("c_service_name").equals("")) {
+ my.append("\n\t"+rs.getString("c_service_name"));
+ }
+ my.append("\n</service_name>");
+
+ my.append("\n<service_code>");
+ if(!rs.getString("c_service_code").equals("")) {
+ my.append("\n\t"+rs.getString("c_service_code"));
+ }
+ my.append("\n</service_code>");
+
+ my.append("\n<description>");
+ if(!rs.getString("c_description").equals("")) {
+ my.append("\n\t"+rs.getString("c_description"));
+ }
+ my.append("\n</description>");
+
+ my.append("\n<agency_responsible>");
+ if(!rs.getString("c_agency_responsible").equals("")) {
+ my.append("\n\t"+rs.getString("c_agency_responsible"));
+ }
+ my.append("\n</agency_responsible>");
+
+ my.append("\n<service_notice>");
+ if(!rs.getString("c_service_notice").equals("")) {
+ my.append("\n\t"+rs.getString("c_service_notice"));
+ }
+ my.append("\n</service_notice>");
+
+ my.append("\n<requested_datetime>");
+ if(!rs.getString("c_requestDate").equals("")) {
+ my.append("\n\t"+rs.getString("c_requestDate") +" "+ rs.getString("c_requestTime"));
+ }
+ my.append("\n</requested_datetime>");
+
+ my.append("\n<updated_datetime>");
+ if(!rs.getString("c_updatedDate").equals("")) {
+ my.append("\n\t"+rs.getString("c_updatedDate") +" "+ rs.getString("c_updatedTime"));
+ }
+ my.append("\n</updated_datetime>");
+
+ my.append("\n<expected_datetime>");
+ if(!rs.getString("c_expectedDate").equals("")) {
+ my.append("\n\t"+rs.getString("c_expectedDate") +" "+ rs.getString("c_expectedTime"));
+ }
+ my.append("\n</expected_datetime>");
+
+ my.append("\n<address>");
+ if(!rs.getString("c_address").equals("")) {
+ my.append("\n\t"+rs.getString("c_address"));
+ }
+ my.append("\n</address>");
+
+ my.append("\n<address_id>");
+ if(!rs.getString("c_address_id").equals("")) {
+ my.append("\n\t"+rs.getString("c_address_id"));
+ }
+ my.append("\n</address_id>");
+
+ my.append("\n<zipcode>");
+ if(!rs.getString("c_zipcode").equals("")) {
+ my.append("\n\t"+rs.getString("c_zipcode"));
+ }
+ my.append("\n</zipcode>");
+
+ my.append("\n<lat>");
+ if(!rs.getString("c_lat").equals("")) {
+ my.append("\n\t"+rs.getString("c_lat"));
+ }
+ my.append("\n</lat>");
+
+ my.append("\n<long>");
+ if(!rs.getString("c_long").equals("")) {
+ my.append("\n\t"+rs.getString("c_long"));
+ }
+ my.append("\n</long>");
+
+ my.append("\n</request>");
+
+
+ }
+ }
+ catch (Exception e)
+ {
+ System.out.println(e);
+ }
+ finally {
+
+ if(rs != null) {
+ try {
+ rs.close();
+ }
+ catch (SQLException e) {
+ System.out.println("Unable to close the resultset object " + e);
+ }
+ }
+
+ if(statement != null) {
+ try {
+ statement.close();
+ }
+ catch (SQLException e) {
+ System.out.println("Unable to close the statement object " + e);
+ }
+ }
+
+ if(connection != null) {
+ try {
+ connection.close();
+ }
+ catch (SQLException e) {
+ System.out.println("Unable to close the connection object " + e);
+ }
+ }
+
+ }
+
+ //Accessing the response object and writing back
+ response.getWriter().write(my.toString());
+ }
+
+
+
+
+ public Object execute(Map arg0) {
+
+ return null;
+ }
+
+ public String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getName() {
+ // TODO Auto-generated method stub
+ return "Open311 Data Plugin";
+ }
+
+ public PluginProperty[] getPluginProperties() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getVersion() {
+ // TODO Auto-generated method stub
+ return "6";
+ }
+}
View
10 open311 plugin/src/main/resources/message/form/Map.properties
@@ -0,0 +1,10 @@
+form.map.editmap=Edit Map
+form.map.id=ID
+form.map.label=Label
+form.map.value=Value
+form.map.format=Format
+form.map.readonly=Readonly
+form.map.chooseValidator=Choose Validator
+form.map.validator=Validator
+form.map.workflowVariables=Workflow Variables
+form.map.workflowVariable=Workflow Variable
View
56 open311 plugin/src/main/resources/properties/form/map.json
@@ -0,0 +1,56 @@
+[{
+ title : '@@form.map.editmap@@',
+ properties : [{
+ name : 'id',
+ label : '@@form.map.id@@',
+ type : 'textfield',
+ required : 'True',
+ regex_validation : '^[a-zA-Z0-9_]+$',
+ validation_message : '@@form.map.invalidId@@'
+ },
+ {
+ name : 'label',
+ label : '@@form.map.label@@',
+ type : 'textfield',
+ required : 'True'
+ },
+ {
+ name : 'value',
+ label : '@@form.map.value@@',
+ type : 'textfield'
+ },
+ {
+ name : 'format',
+ label : '@@form.map.format@@',
+ type : 'textfield',
+ description : '@@form.map.format.eg@@'
+ },
+ {
+ name : 'readonly',
+ label : '@@form.map.readonly@@',
+ type : 'checkbox',
+ value : 'False',
+ options : [{
+ value : 'true',
+ label : ''
+ }]
+ }]
+},
+{
+ title : '@@form.map.chooseValidator@@',
+ properties : [{
+ name : 'validator',
+ label : '@@form.map.validator@@',
+ type : 'elementselect',
+ options_ajax : '[CONTEXT_PATH]/web/property/json/getElements?classname=org.joget.apps.form.model.FormValidator',
+ url : '[CONTEXT_PATH]/web/property/json/getPropertyOptions'
+ }]
+},
+{
+ title : '@@form.map.workflowVariables@@',
+ properties : [{
+ name : 'workflowVariable',
+ label : '@@form.map.workflowVariable@@',
+ type : 'textfield'
+ }]
+}]
View
24 open311 plugin/src/main/resources/templates/map.ftl
@@ -0,0 +1,24 @@
+<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;
+ key=ABQIAAAAImhJhTtTM8LB3dZ_vtAGKxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTxM2i4OyKToYMzrfRLbTsOI_lW1A" type="text/javascript"></script>
+<script type="text/javascript">
+
+function load1(){
+var map = new GMap(document.getElementById("map"));
+var lat1 = parseFloat("-89.947729");
+var longi1 = parseFloat("38.781521");
+var point = new GPoint(lat1,longi1);
+var marker = new GMarker(point);
+map.addControl(new GLargeMapControl());
+map.addControl(new GMapTypeControl());
+map.centerAndZoom(point, 3);
+GEvent.addListener(marker, "click", function() {
+marker.openInfoWindowHtml("<table width='215'><tr><td><a target='_blank' href='http://www.lcls.org/'>Lewis & Clark Library System</a></td></tr><tr><td><img src='http://www.lcls.org/images/galleries/tour/01-BuildingFromLot.JPG' border='0' width='195px' height='95' /></td></tr><tr><td>425 Goshen Road<br />Edwardsville,IL 62025<br />618-656-3216</td></tr></table><br /><a target='_blank' href='http://maps.google.com/maps?q=425 Goshen Road%20Edwardsville,%20IL'>Directions</a>");
+});
+map.addOverlay(marker);
+}
+ </script>
+
+<div id="${elementParamName!}" style="width: 900px; height: 500px" value="${key}"></div>
+<input type="button" onClick="load1();" value="Click ME"></input>
+
+
View
70 open311 plugin/target/classes/META-INF/MANIFEST.MF
@@ -0,0 +1,70 @@
+Manifest-Version: 1.0
+Export-Package: org.joget.open311.dataplugin;uses:="org.joget.apps.app
+ .service,org.joget.apps.form.model,org.joget.apps.form.service,org.os
+ gi.framework,org.joget.plugin.base,javax.servlet,javax.servlet.http";
+ version="5.0.0"
+Embed-Directory: dependency
+Ignore-Package: com.sun.jdmk.comm,javax.accessibility,com.opensymphony
+ .xwork.util,com.sun.org.apache.xerces.internal.parsers,java.util.jar,
+ oracle.xml.parser.v2,javax.swing.tree,com.sun.org.apache.xerces.inter
+ nal.util,javax.servlet.jsp.jstl.fmt,java.net,org.springframework.web.
+ servlet.support,org.springframework.web.servlet,javax.mail.internet,j
+ avax.management,javax.naming.spi,com.sun.org.apache.xerces.internal.x
+ ni.parser,javax.xml.stream,junit.framework,javax.swing,javax.swing.fi
+ lechooser,javax.swing.plaf,java.io,java.util.zip,javax.transaction.xa
+ ,oracle.xml.parser,org.apache.struts.util,java.lang,java.awt.event,ja
+ vax.swing.border,javax.naming,javax.servlet.jsp.jstl.core,java.awt.co
+ lor,org.xmlpull.v1,org.springframework.context,org.springframework.we
+ b.context,org.apache.taglibs.standard.tag.common.fmt,org.joget.plugin
+ .base,org.apache.taglibs.standard.lang.support,javax.imageio.metadata
+ ,java.lang.reflect,java.awt.font,org.joget.apps.app.service,javax.swi
+ ng.table,org.osgi.framework,java.awt.datatransfer,javax.mail,java.bea
+ ns,java.sql,java.awt.print,java.util.logging,javax.swing.text,com.ope
+ nsymphony.webwork.views.jsp,com.opensymphony.xwork,javax.jms,java.uti
+ l,org.apache.bcel.util,javax.imageio.stream,org.joget.apps.form.model
+ ,org.relaxng.datatype,org.apache.xml.resolver.readers,javax.imageio,c
+ om.sun.image.codec.jpeg,java.nio.charset,sun.io,java.math,com.sun.msv
+ .datatype.xsd,org.apache.bcel.generic,org.gjt.xpp,java.awt.image,org.
+ apache.xml.resolver,java.lang.ref,java.applet,javax.swing.event,org.j
+ oget.apps.form.service,java.awt,com.sun.msv.datatype,java.text,org.ap
+ ache.struts.config,org.apache.avalon.framework.logger,javax.xml.strea
+ m.events,java.security,org.springframework.web.servlet.mvc,javax.xml.
+ stream.util,org.apache.log,java.awt.image.renderable,org.apache.bcel.
+ classfile,java.security.cert,javax.sql,java.rmi,javax.transaction,jav
+ a.awt.geom,javax.xml.bind
+Bundle-ClassPath: .,dependency/displaytag-1.2.jar,dependency/xmlParser
+ APIs-2.6.2.jar,dependency/commons-beanutils-1.7.0.jar,dependency/log4
+ j-1.2.13.jar,dependency/xalan-2.7.0.jar,dependency/commons-collection
+ s-3.1.jar,dependency/jfreechart-1.0.13.jar,dependency/xom-1.1.jar,dep
+ endency/dom4j-1.6.1.jar,dependency/commons-pool-1.5.4.jar,dependency/
+ slf4j-log4j12-1.4.2.jar,dependency/xml-apis-1.3.03.jar,dependency/xer
+ cesImpl-2.8.1.jar,dependency/commons-lang-2.3.jar,dependency/json-200
+ 80701.jar,dependency/commons-logging-1.1.1.jar,dependency/slf4j-api-1
+ .4.2.jar,dependency/jcommon-1.0.16.jar,dependency/jsp-api-2.0.jar,dep
+ endency/itext-1.3.jar,dependency/jcl104-over-slf4j-1.4.2.jar,dependen
+ cy/jaxen-1.1-beta-8.jar,dependency/servlet-api-2.3.jar,dependency/jdo
+ m-1.0.jar,dependency/commons-dbcp-1.3.jar
+Built-By: ashish
+Tool: Bnd-1.43.0
+Bundle-Name: open311-request-plugin
+Created-By: Apache Maven Bundle Plugin
+DynamicImport-Package: *
+Build-Jdk: 1.6.0_24
+Bundle-Version: 6.0.0
+Bnd-LastModified: 1311696726799
+Embed-Transitive: true
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.joget.open311.dataplugin.DefaultActivator
+Bundle-SymbolicName: org.joget.open311.dataplugin
+Embed-StripGroup: true
+Import-Package: javax.servlet,javax.servlet.http,org.joget.apps.app.mo
+ del,org.joget.apps.app.service,org.joget.apps.datalist.model,org.joge
+ t.apps.datalist.service,org.joget.apps.form.lib,org.joget.apps.form.m
+ odel,org.joget.apps.form.service,org.joget.apps.list.service,org.joge
+ t.apps.userview.model,org.joget.apps.userview.service,org.joget.plugi
+ n.base,org.joget.plugin.property.model,org.joget.workflow.model,org.j
+ oget.workflow.model.service,org.joget.workflow.util,org.osgi.framewor
+ k;version="1.3.0"
+Embed-Dependency: !org.apache.felix*;scope=compile|runtime;inline=fals
+ e
+
View
10 open311 plugin/target/classes/message/form/Map.properties
@@ -0,0 +1,10 @@
+form.map.editmap=Edit Map
+form.map.id=ID
+form.map.label=Label
+form.map.value=Value
+form.map.format=Format
+form.map.readonly=Readonly
+form.map.chooseValidator=Choose Validator
+form.map.validator=Validator
+form.map.workflowVariables=Workflow Variables
+form.map.workflowVariable=Workflow Variable
View
BIN open311 plugin/target/classes/org/joget/open311/dataplugin/CustomFormField.class
Binary file not shown.
View
BIN open311 plugin/target/classes/org/joget/open311/dataplugin/DefaultActivator.class
Binary file not shown.
View
BIN open311 plugin/target/classes/org/joget/open311/dataplugin/Open311Data.class
Binary file not shown.
View
56 open311 plugin/target/classes/properties/form/map.json
@@ -0,0 +1,56 @@
+[{
+ title : '@@form.map.editmap@@',
+ properties : [{
+ name : 'id',
+ label : '@@form.map.id@@',
+ type : 'textfield',
+ required : 'True',
+ regex_validation : '^[a-zA-Z0-9_]+$',
+ validation_message : '@@form.map.invalidId@@'
+ },
+ {
+ name : 'label',
+ label : '@@form.map.label@@',
+ type : 'textfield',
+ required : 'True'
+ },
+ {
+ name : 'value',
+ label : '@@form.map.value@@',
+ type : 'textfield'
+ },
+ {
+ name : 'format',
+ label : '@@form.map.format@@',
+ type : 'textfield',
+ description : '@@form.map.format.eg@@'
+ },
+ {
+ name : 'readonly',
+ label : '@@form.map.readonly@@',
+ type : 'checkbox',
+ value : 'False',
+ options : [{
+ value : 'true',
+ label : ''
+ }]
+ }]
+},
+{
+ title : '@@form.map.chooseValidator@@',
+ properties : [{
+ name : 'validator',
+ label : '@@form.map.validator@@',
+ type : 'elementselect',
+ options_ajax : '[CONTEXT_PATH]/web/property/json/getElements?classname=org.joget.apps.form.model.FormValidator',
+ url : '[CONTEXT_PATH]/web/property/json/getPropertyOptions'
+ }]
+},
+{
+ title : '@@form.map.workflowVariables@@',
+ properties : [{
+ name : 'workflowVariable',
+ label : '@@form.map.workflowVariable@@',
+ type : 'textfield'
+ }]
+}]
View
24 open311 plugin/target/classes/templates/map.ftl
@@ -0,0 +1,24 @@
+<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;
+ key=ABQIAAAAImhJhTtTM8LB3dZ_vtAGKxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTxM2i4OyKToYMzrfRLbTsOI_lW1A" type="text/javascript"></script>
+<script type="text/javascript">
+
+function load1(){
+var map = new GMap(document.getElementById("map"));
+var lat1 = parseFloat("-89.947729");
+var longi1 = parseFloat("38.781521");
+var point = new GPoint(lat1,longi1);
+var marker = new GMarker(point);
+map.addControl(new GLargeMapControl());
+map.addControl(new GMapTypeControl());
+map.centerAndZoom(point, 3);
+GEvent.addListener(marker, "click", function() {
+marker.openInfoWindowHtml("<table width='215'><tr><td><a target='_blank' href='http://www.lcls.org/'>Lewis & Clark Library System</a></td></tr><tr><td><img src='http://www.lcls.org/images/galleries/tour/01-BuildingFromLot.JPG' border='0' width='195px' height='95' /></td></tr><tr><td>425 Goshen Road<br />Edwardsville,IL 62025<br />618-656-3216</td></tr></table><br /><a target='_blank' href='http://maps.google.com/maps?q=425 Goshen Road%20Edwardsville,%20IL'>Directions</a>");
+});
+map.addOverlay(marker);
+}
+ </script>
+
+<div id="${elementParamName!}" style="width: 900px; height: 500px" value="${key}"></div>
+<input type="button" onClick="load1();" value="Click ME"></input>
+
+

0 comments on commit 4ae40b6

Please sign in to comment.
Something went wrong with that request. Please try again.