Added start of demo data of tech demo
This commit is contained in:
parent
2872143028
commit
beb57fe92e
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<v:root xmlns:v="http://vasc.forwardfire.net/eld/vasc-lang.eld"
|
||||
xmlns:mm="http://vasc.forwardfire.net/eld/vasc-backend-metamodel.eld"
|
||||
>
|
||||
|
||||
|
||||
<mm:csvDataContext
|
||||
el.id="metaPeopleDS"
|
||||
file="meta-people.csv"
|
||||
/>
|
||||
<mm:metaModelBackend
|
||||
id="metaPeopleBackend"
|
||||
dataContextProvider="${metaPeopleDS}"
|
||||
table="meta_people"
|
||||
tableId="id"
|
||||
/>
|
||||
<v:entry id="metaPeople" backendId="metaPeopleBackend">
|
||||
<v:field id="id" list="false"/>
|
||||
<v:field id="name"/>
|
||||
<v:field id="age"/>
|
||||
<v:field id="gender" vascEntryFieldType="ListField">
|
||||
<v:vascSelectItemModelString data="male,female,unknown"/>
|
||||
</v:field>
|
||||
<v:field id="function" vascEntryFieldType="ListField">
|
||||
<v:vascSelectItemModelString data="manager,devver,sales"/>
|
||||
</v:field>
|
||||
</v:entry>
|
||||
|
||||
<mm:csvDataContext
|
||||
el.id="metaProjectDS"
|
||||
file="meta-project.csv"
|
||||
/>
|
||||
<mm:metaModelBackend
|
||||
id="metaProjectBackend"
|
||||
dataContextProvider="${metaProjectDS}"
|
||||
table="meta_project"
|
||||
tableId="id"
|
||||
/>
|
||||
<v:entry id="metaProject" backendId="metaProjectBackend">
|
||||
<v:field id="id" list="false"/>
|
||||
<v:field id="name"/>
|
||||
<v:field id="decription" vascEntryFieldType="TextAreaField"/>
|
||||
</v:entry>
|
||||
|
||||
</v:root>
|
|
@ -0,0 +1,10 @@
|
|||
id,name,gender,age,function
|
||||
1,"mike",male,18,manager
|
||||
2,"michael",male,19,manager-co
|
||||
3,"peter",male,18,devop
|
||||
4,"bob",male,17,devver
|
||||
5,"barbara, barb",female,18,devver
|
||||
6,"charlotte",female,18,devver
|
||||
7,"hillary",female,20,tester
|
||||
8,"vera",female,17,tester
|
||||
9,"carrie",female,17,sales
|
|
|
@ -0,0 +1,4 @@
|
|||
id,name,description
|
||||
1,"fix-website","Move all pages to plain text so it is printable when there is no power."
|
||||
2,"refactor-HJY","Make function HJY abstract and use generic logic to improve total cpu lag on system"
|
||||
3,"custum-graph","Big custumer foobar want really this killer graph woobly line point stuff."
|
|
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
|
||||
dn: cn=Mirjan Broek,os=Amsterdam,ou=user,o=forwardfire,c=net
|
||||
objectClass: inetOrgPerson
|
||||
cn: Mirjan Broek
|
||||
description: Prime Contractors
|
||||
mail: mirjan.broek@demo.vasc.forwardfire.net
|
||||
postalAddress: 233 Mobbs Circuit$Vermont VIC
|
||||
postalCode: 3133
|
||||
sn: Broek
|
||||
telephoneNumber: 622 7619
|
||||
title: Secretary
|
|
@ -0,0 +1,95 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<v:root xmlns:v="http://vasc.forwardfire.net/eld/vasc-lang.eld"
|
||||
xmlns:l="http://vasc.forwardfire.net/eld/vasc-backend-ldap.eld"
|
||||
>
|
||||
|
||||
<l:ldapConnectionProvider
|
||||
el.id="ldapSudoers"
|
||||
ldapHost="localhost"
|
||||
bindUser="uid=admin-sudo,ou=services,dc=example,dc=nl"
|
||||
bindPass="test"
|
||||
/>
|
||||
<l:ldapBackend
|
||||
id="ldapBackendSudoers"
|
||||
ldapConnectionProvider="${ldapSudoers}"
|
||||
baseDN="ou=sudoers,dc=example,dc=nl"
|
||||
keyAttribute="cn"
|
||||
ldapFilter="(&(objectClass=sudoRole))"
|
||||
/>
|
||||
<v:entry id="sudoers" backendId="ldapBackendSudoers">
|
||||
<v:field id="user" backendName="cn" readOnly="true"/>
|
||||
<v:field id="description" rolesEdit="admin" rolesList="all"/>
|
||||
<v:field id="sudoCommand" vascEntryFieldType="MultiTextField"/>
|
||||
<v:field id="sudoHost" vascEntryFieldType="MultiTextField"/>
|
||||
<v:field id="sudoUser" vascEntryFieldType="MultiTextField"/>
|
||||
<!--
|
||||
<v:ldapNextIdFunction name="nextUidNumber" ldapFilter="(&(objectClass=posixGroup))" ldapAttribute="gidnumber"/>
|
||||
|
||||
<v:listeners hook="post_create">
|
||||
<etc:loginToFtpServer/>
|
||||
</v:listeners>
|
||||
|
||||
<v:link fieldName="user" viewController="ldapUsers" parameterName="user_cn"/>
|
||||
<v:link fieldName="gidNumber" viewController="ldapGroups" parameterName="group_key,${baseDn}"/>
|
||||
|
||||
<v:detail fieldName="gidNumber" detailController="${ldapGroups}"/>
|
||||
-->
|
||||
</v:entry>
|
||||
|
||||
<l:ldapConnectionProvider
|
||||
el.id="ldapUsers"
|
||||
ldapHost="10.11.12.96"
|
||||
bindUser="uid=libnss,ou=services,dc=example,dc=nl"
|
||||
bindPass="test"
|
||||
/>
|
||||
<l:ldapBackend
|
||||
id="ldapBackendUsers"
|
||||
ldapConnectionProvider="${ldapUsers}"
|
||||
baseDN="ou=users,dc=example,dc=nl"
|
||||
keyAttribute="uid"
|
||||
ldapFilter="(&(objectClass=posixAccount))"
|
||||
/>
|
||||
<v:entry id="users" backendId="ldapBackendUsers">
|
||||
<v:field id="uid" />
|
||||
<v:field id="uidNumber" vascEntryFieldType="IntegerField"/>
|
||||
<v:field id="gidNumber" vascEntryFieldType="IntegerField"/>
|
||||
<v:field id="loginShell" list="false"/>
|
||||
<v:field id="homeDirectory" list="false"/>
|
||||
<v:field id="cn" list="false"/>
|
||||
<v:field id="givenName" />
|
||||
<v:field id="sn" />
|
||||
<v:field id="mailbox" list="false"/>
|
||||
<v:field id="mail" vascEntryFieldType="EmailField"/>
|
||||
<v:field id="mailActive" vascEntryFieldType="BooleanField"/>
|
||||
<v:field id="alias" vascEntryFieldType="MultiTextField" list="false"/>
|
||||
|
||||
<v:field id="autoResponseActive" vascEntryFieldType="BooleanField" />
|
||||
<v:field id="autoresponseMessage" vascEntryFieldType="TextAreaField" list="false"/>
|
||||
<v:field id="sambaAcctFlags" list="false"/>
|
||||
<v:field id="sambaPrimaryGroupSID" list="false"/>
|
||||
<v:field id="sambaSID" list="false"/>
|
||||
|
||||
</v:entry>
|
||||
|
||||
|
||||
<l:ldapConnectionProvider
|
||||
el.id="ldapMachines"
|
||||
ldapHost="localhost"
|
||||
bindUser="uid=samba,ou=services,dc=example,dc=nl"
|
||||
bindPass="test"
|
||||
/>
|
||||
<l:ldapBackend
|
||||
id="ldapBackendMachines"
|
||||
ldapConnectionProvider="${ldapMachines}"
|
||||
baseDN="ou=machines,dc=example,dc=nl"
|
||||
keyAttribute="uid"
|
||||
ldapFilter="(&(objectClass=sambaSamAccount))"
|
||||
/>
|
||||
<v:entry id="machines" backendId="ldapBackendMachines">
|
||||
<v:field id="uid" />
|
||||
<v:field id="sambaAcctFlags"/>
|
||||
<v:field id="sambaSID" />
|
||||
<v:field id="uidNumber" />
|
||||
</v:entry>
|
||||
|
||||
</v:root>
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<v:root xmlns:v="http://vasc.forwardfire.net/eld/vasc-lang.eld"
|
||||
xmlns:mm="http://vasc.forwardfire.net/eld/vasc-backend-metamodel.eld"
|
||||
xmlns:j="http://vasc.forwardfire.net/eld/vasc-backend-jdbc.eld"
|
||||
>
|
||||
|
||||
|
||||
<j:jdbcConnectionProvider
|
||||
el.id="dbRssFeeds"
|
||||
driverClassName="org.postgresql.Driver"
|
||||
dbUrl="jdbc:postgresql://localhost/vasc_testpg"
|
||||
dbUser="test"
|
||||
dbPassword="test"
|
||||
/>
|
||||
<j:jdbcBackend
|
||||
id="rssChannelDB"
|
||||
jdbcConnectionProvider="${dbRssFeeds}"
|
||||
idColumnName="id"
|
||||
sqlList="SELECT * FROM channel LIMIT 100"
|
||||
sqlDelete="DELETE FROM channel WHERE id = ?0"
|
||||
sqlPersist="INSERT INTO channel (name,url,importing,etc) VALUES (?0,?1,?2,?3,?4)"
|
||||
sqlMerge="UPDATE channel (name,url) VALUE (?0,?1)"
|
||||
/>
|
||||
|
||||
<v:entry id="rssChannel" backendId="rssChannelDB">
|
||||
<v:field id="id" readOnly="true"/>
|
||||
<v:field id="name"/>
|
||||
<v:field id="url"/>
|
||||
<v:field id="importing" vascEntryFieldType="BooleanField"/>
|
||||
<v:field id="last_parsed" vascEntryFieldType="DateField" />
|
||||
<v:field id="last_checked" vascEntryFieldType="DateField"/>
|
||||
|
||||
<v:field id="parser_locale" list="false"/>
|
||||
<v:field id="column_mapping" list="false"/>
|
||||
</v:entry>
|
||||
|
||||
|
||||
|
||||
</v:root>
|
|
@ -0,0 +1 @@
|
|||
All *.xml in this dir are automaticly started.
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
Readme for Vasc Tech Demo application.
|
||||
|
||||
To start:
|
||||
|
||||
execute: run.sh or run.bat
|
|
@ -0,0 +1,108 @@
|
|||
package net.forwardfire.vasc.demo.tech.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.Enumeration;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.forwardfire.vasc.core.VascController;
|
||||
|
||||
import org.apache.catalina.startup.Tomcat;
|
||||
|
||||
public class TomcatManager {
|
||||
|
||||
private Logger logger = null;
|
||||
private Tomcat tomcat = null;
|
||||
private VascController vascController = null;
|
||||
|
||||
public TomcatManager() {
|
||||
logger = Logger.getLogger(TomcatManager.class.getName());
|
||||
}
|
||||
|
||||
public void start() throws Exception {
|
||||
Tomcat tomcat = new Tomcat();
|
||||
|
||||
String webPort = System.getenv("PORT");
|
||||
if(webPort == null || webPort.isEmpty()) {
|
||||
webPort = "8899";
|
||||
}
|
||||
tomcat.setPort(Integer.valueOf(webPort));
|
||||
|
||||
if (System.getProperty("java.class.path").contains("classes")) {
|
||||
String webappPathLocation = "../vasc-demo-tech-web/src/main/webapp/";
|
||||
String deployPath = new File(webappPathLocation).getAbsolutePath();
|
||||
logger.info("Deploy demo app from workspace path: "+deployPath);
|
||||
tomcat.addWebapp("/demo",deployPath);
|
||||
} else {
|
||||
|
||||
File techWarFile = null;
|
||||
for (File file:new File("lib").listFiles()) {
|
||||
if (file.getName().endsWith("war")) {
|
||||
techWarFile = file;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (techWarFile==null) {
|
||||
throw new NullPointerException("Could not locate war file in lib directory.");
|
||||
}
|
||||
File destDir = new File("tomcat.wars"+File.separator+techWarFile.getName());
|
||||
if (destDir.exists()==false) {
|
||||
destDir.mkdirs();
|
||||
JarFile jar = new JarFile(techWarFile);
|
||||
Enumeration<JarEntry> jars = jar.entries();
|
||||
while (jars.hasMoreElements()) {
|
||||
java.util.jar.JarEntry file = jars.nextElement();
|
||||
java.io.File f = new java.io.File(destDir+File.separator+file.getName());
|
||||
if (file.isDirectory()) {
|
||||
f.mkdir();
|
||||
continue;
|
||||
}
|
||||
InputStream is = jar.getInputStream(file);
|
||||
FileOutputStream fos = new FileOutputStream(f);
|
||||
while (is.available() > 0) {
|
||||
fos.write(is.read()); // slow copy
|
||||
}
|
||||
fos.close();
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
String deployPath = destDir.getAbsolutePath();
|
||||
logger.info("Deploy war path: "+deployPath);
|
||||
tomcat.addWebapp("/demo",deployPath);
|
||||
}
|
||||
|
||||
instance = this;
|
||||
|
||||
tomcat.start();
|
||||
}
|
||||
|
||||
public void stop() throws Exception {
|
||||
if (tomcat==null) {
|
||||
return;
|
||||
}
|
||||
tomcat.stop();
|
||||
instance = null;
|
||||
}
|
||||
|
||||
static private TomcatManager instance = null;
|
||||
static public TomcatManager getInstance() {
|
||||
return instance; // hackje to rm mvn 1-1 dep with ui
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the vascController
|
||||
*/
|
||||
public VascController getVascController() {
|
||||
return vascController;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param vascController the vascController to set
|
||||
*/
|
||||
public void setVascController(VascController vascController) {
|
||||
this.vascController = vascController;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue