From: Vásáry Dániel Date: Tue, 26 Sep 2017 09:11:03 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=5233260c07662f98c8b42109cd03c8756b6eeac6;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30468 --- diff --git a/server/-configuration/.project b/server/-configuration/.project new file mode 100644 index 00000000..f306833b --- /dev/null +++ b/server/-configuration/.project @@ -0,0 +1,11 @@ + + + -configuration + + + + + + + + diff --git a/server/-configuration/20170531-todo.txt b/server/-configuration/20170531-todo.txt new file mode 100644 index 00000000..bdeb53f9 --- /dev/null +++ b/server/-configuration/20170531-todo.txt @@ -0,0 +1,15 @@ +Ami kuka: +-Documents +-user.jobengine.osgi.helper +-user.jobengine.osgi.service +-user.jobengine.osgi.web + +Feladatok: +-DB2 test adatbázis létrehozása user.jobengine.osgi.db/database/db_create.sql alapján - KÉSZ +--dependencies beállítása a legújabb Jetty/Jersey/Jackson hármasra +-Új bundle: user.jobengine.osgi.rest: ez a JobEngineWebService funkcióját valósítja meg. +-Bundle függõségek tracker helyett DS alapokra +-Jetty custom http/https konfiguráció + +-Jetty vagy REST service JWL támogatás beépítése + diff --git a/server/-configuration/build-mediacube-dependencies.launch b/server/-configuration/build-mediacube-dependencies.launch new file mode 100644 index 00000000..849b528e --- /dev/null +++ b/server/-configuration/build-mediacube-dependencies.launch @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/build-mediacube-modules.launch b/server/-configuration/build-mediacube-modules.launch new file mode 100644 index 00000000..92c41509 --- /dev/null +++ b/server/-configuration/build-mediacube-modules.launch @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/build-mediacube-product.launch b/server/-configuration/build-mediacube-product.launch new file mode 100644 index 00000000..2b855886 --- /dev/null +++ b/server/-configuration/build-mediacube-product.launch @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/deploy-mediacube-remote.launch b/server/-configuration/deploy-mediacube-remote.launch new file mode 100644 index 00000000..b353c1dd --- /dev/null +++ b/server/-configuration/deploy-mediacube-remote.launch @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/jetty.xml b/server/-configuration/jetty/etc/jetty.xml new file mode 100644 index 00000000..f85a955c --- /dev/null +++ b/server/-configuration/jetty/etc/jetty.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/keystore b/server/-configuration/jetty/etc/keystore new file mode 100644 index 00000000..95d7f4c7 Binary files /dev/null and b/server/-configuration/jetty/etc/keystore differ diff --git a/server/-configuration/jetty/etc/localhost.jks b/server/-configuration/jetty/etc/localhost.jks new file mode 100644 index 00000000..95d7f4c7 Binary files /dev/null and b/server/-configuration/jetty/etc/localhost.jks differ diff --git a/server/-configuration/jetty/etc/login.conf b/server/-configuration/jetty/etc/login.conf new file mode 100644 index 00000000..7f38fa8f --- /dev/null +++ b/server/-configuration/jetty/etc/login.conf @@ -0,0 +1,5 @@ +loginModule { + user.jobengine.osgi.service.LoginModule required + debug="true" + option="1"; +}; \ No newline at end of file diff --git a/server/-configuration/jetty/etc/login.properties b/server/-configuration/jetty/etc/login.properties new file mode 100644 index 00000000..4b91dd7b --- /dev/null +++ b/server/-configuration/jetty/etc/login.properties @@ -0,0 +1,4 @@ +me=me,me,roleA +lol=lol,user,admin +password=password,user,admin +user=user,user,admin diff --git a/server/-configuration/jetty/etc/login_propertyfile.conf b/server/-configuration/jetty/etc/login_propertyfile.conf new file mode 100644 index 00000000..3829c9b1 --- /dev/null +++ b/server/-configuration/jetty/etc/login_propertyfile.conf @@ -0,0 +1,5 @@ +loginModule { +org.eclipse.jetty.plus.jaas.spi.PropertyFileLoginModule required +debug="true" +file="/etc/login.properties"; +}; \ No newline at end of file diff --git a/server/-configuration/jetty/etc/sampkey.jks b/server/-configuration/jetty/etc/sampkey.jks new file mode 100644 index 00000000..e8da3a67 Binary files /dev/null and b/server/-configuration/jetty/etc/sampkey.jks differ diff --git a/server/-configuration/jetty/etc/user-jetty-deployer.xml b/server/-configuration/jetty/etc/user-jetty-deployer.xml new file mode 100644 index 00000000..ba61d105 --- /dev/null +++ b/server/-configuration/jetty/etc/user-jetty-deployer.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern + .*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$ + + + + + + + + + + + jetty.deploy.monitoredPath + + / + + + + + + jetty.deploy.defaultsDescriptorPath + + /etc/webdefault.xml + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/user-jetty-http-redirect.xml b/server/-configuration/jetty/etc/user-jetty-http-redirect.xml new file mode 100644 index 00000000..701042ca --- /dev/null +++ b/server/-configuration/jetty/etc/user-jetty-http-redirect.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https + 8443 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/user-jetty-http.xml b/server/-configuration/jetty/etc/user-jetty-http.xml new file mode 100644 index 00000000..1de4649a --- /dev/null +++ b/server/-configuration/jetty/etc/user-jetty-http.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/user-jetty-https.xml b/server/-configuration/jetty/etc/user-jetty-https.xml new file mode 100644 index 00000000..71a08377 --- /dev/null +++ b/server/-configuration/jetty/etc/user-jetty-https.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + http/1.1 + + + + + + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/user-jetty-ssl-context.xml b/server/-configuration/jetty/etc/user-jetty-ssl-context.xml new file mode 100644 index 00000000..26309180 --- /dev/null +++ b/server/-configuration/jetty/etc/user-jetty-ssl-context.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + / + + + + + / + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/user-jetty-ssl.xml b/server/-configuration/jetty/etc/user-jetty-ssl.xml new file mode 100644 index 00000000..a079c1f6 --- /dev/null +++ b/server/-configuration/jetty/etc/user-jetty-ssl.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/jetty/etc/user-jetty.xml b/server/-configuration/jetty/etc/user-jetty.xml new file mode 100644 index 00000000..0ba38381 --- /dev/null +++ b/server/-configuration/jetty/etc/user-jetty.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5000 + + + + diff --git a/server/-configuration/jetty/etc/webdefault.xml b/server/-configuration/jetty/etc/webdefault.xml new file mode 100644 index 00000000..d54d76f3 --- /dev/null +++ b/server/-configuration/jetty/etc/webdefault.xml @@ -0,0 +1,534 @@ + + + + + + + + + + + + + + + + + + + + + + + Default web.xml file. + This file is applied to a Web application before it's own WEB_INF/web.xml file + + + + + + + + org.eclipse.jetty.servlet.listener.ELContextCleaner + + + + + + + + org.eclipse.jetty.servlet.listener.IntrospectorCleaner + + + + + + + + + + + + + + + + + default + org.eclipse.jetty.servlet.DefaultServlet + + aliases + false + + + acceptRanges + true + + + dirAllowed + true + + + welcomeServlets + false + + + redirectWelcome + false + + + maxCacheSize + 256000000 + + + maxCachedFileSize + 200000000 + + + maxCachedFiles + 2048 + + + gzip + false + + + etags + false + + + useFileMappedBuffer + true + + + + 0 + + + + default + / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jsp + org.eclipse.jetty.jsp.JettyJspServlet + + logVerbosityLevel + DEBUG + + + fork + false + + + xpoweredBy + false + + + compilerTargetVM + 1.7 + + + compilerSourceVM + 1.7 + + + 0 + + + + jsp + *.jsp + *.jspf + *.jspx + *.xsp + *.JSP + *.JSPF + *.JSPX + *.XSP + + + + + + + + 30 + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + + + + + + ar + ISO-8859-6 + + + be + ISO-8859-5 + + + bg + ISO-8859-5 + + + ca + ISO-8859-1 + + + cs + ISO-8859-2 + + + da + ISO-8859-1 + + + de + ISO-8859-1 + + + el + ISO-8859-7 + + + en + ISO-8859-1 + + + es + ISO-8859-1 + + + et + ISO-8859-1 + + + fi + ISO-8859-1 + + + fr + ISO-8859-1 + + + hr + ISO-8859-2 + + + hu + ISO-8859-2 + + + is + ISO-8859-1 + + + it + ISO-8859-1 + + + iw + ISO-8859-8 + + + ja + Shift_JIS + + + ko + EUC-KR + + + lt + ISO-8859-2 + + + lv + ISO-8859-2 + + + mk + ISO-8859-5 + + + nl + ISO-8859-1 + + + no + ISO-8859-1 + + + pl + ISO-8859-2 + + + pt + ISO-8859-1 + + + ro + ISO-8859-2 + + + ru + ISO-8859-5 + + + sh + ISO-8859-5 + + + sk + ISO-8859-2 + + + sl + ISO-8859-2 + + + sq + ISO-8859-2 + + + sr + ISO-8859-5 + + + sv + ISO-8859-1 + + + tr + ISO-8859-9 + + + uk + ISO-8859-5 + + + zh + GB2312 + + + zh_TW + Big5 + + + + + + + + + Disable TRACE + / + TRACE + + + + + + Enable everything but TRACE + / + TRACE + + + + + diff --git a/server/-configuration/log4j2.xml b/server/-configuration/log4j2.xml new file mode 100644 index 00000000..8debc3cb --- /dev/null +++ b/server/-configuration/log4j2.xml @@ -0,0 +1,53 @@ + + + + log/mediacube.log + log/$${date:yyyy-MM}/chronos-%d{MM-dd-yyyy}-%i.log.gz + log/chronos-err.log + log/$${date:yyyy-MM}/chronos-err-%d{MM-dd-yyyy}-%i.log.gz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/-configuration/mediacube-dev.properties b/server/-configuration/mediacube-dev.properties new file mode 100644 index 00000000..eff84d65 --- /dev/null +++ b/server/-configuration/mediacube-dev.properties @@ -0,0 +1,26 @@ +#A user.dir mindig a test projekt mappaja, a relativ hivatkozasok ehhez kepest ertendok. +#JobEngine +jobengine.loglevel=INFO +jobengine.jobsteps.root=../user.jobengine.osgi.server/resources/executors +jobengine.jobtemplates.root=../user.jobengine.osgi.server/resources/templates +jobengine.jobsteps.alternate.root=../user.jobengine.executors/bin/user/jobengine/server/steps +jobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true; +jobengine.db.user=db2admin +jobengine.db.password=password +jobengine.octopus.api.address=http://10.10.1.11/api/v1 +jobengine.octopus.api.user=mam +jobengine.octopus.api.password=napocska +jobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; +jobengine.nosql.db.user=db2admin +jobengine.nosql.db.password=password +jobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; +jobengine.nexio.db.user=sa +jobengine.nexio.db.password=resolve +jobengine.rcc.host=localhost +jobengine.rcc.defaultlowresprofile=MediaCube-H264 +jobengine.transcoder.source=c\:_Moviehires +#System +jetty.home=../user.jobengine.osgi.rest/ +jetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml +log4j.configuration=../-configuration/log4j.properties +log4j.configurationFile=../-configuration/log4j2.xml \ No newline at end of file diff --git a/server/-configuration/run-mediacube-server-bsh.launch b/server/-configuration/run-mediacube-server-bsh.launch new file mode 100644 index 00000000..bcec7a0c --- /dev/null +++ b/server/-configuration/run-mediacube-server-bsh.launch @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/run-mediacube-server-localhost.launch b/server/-configuration/run-mediacube-server-localhost.launch new file mode 100644 index 00000000..d9c899b3 --- /dev/null +++ b/server/-configuration/run-mediacube-server-localhost.launch @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/run-mediacube-server.launch b/server/-configuration/run-mediacube-server.launch new file mode 100644 index 00000000..938c7026 --- /dev/null +++ b/server/-configuration/run-mediacube-server.launch @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/run-mediacube-server.launch- b/server/-configuration/run-mediacube-server.launch- new file mode 100644 index 00000000..c38aef75 --- /dev/null +++ b/server/-configuration/run-mediacube-server.launch- @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/run-mediacube-server2.launch- b/server/-configuration/run-mediacube-server2.launch- new file mode 100644 index 00000000..655f7c41 --- /dev/null +++ b/server/-configuration/run-mediacube-server2.launch- @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/run-mediacube-server2_adam.launch b/server/-configuration/run-mediacube-server2_adam.launch new file mode 100644 index 00000000..171e419b --- /dev/null +++ b/server/-configuration/run-mediacube-server2_adam.launch @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json new file mode 100644 index 00000000..9790b653 --- /dev/null +++ b/server/-configuration/scheduledjobs.json @@ -0,0 +1,36 @@ +{"joblist":[ + { + "active": false, + "name" : "Anyagok archiválása", + "template": "archivemedia.xml", + "executeimmediate": true, + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ {"name": "mediaFolder", "value": "/tmp", "type": "java.lang.String"} ] + }, + { + "active": false, + "name" : "NEXIO adatok szinkronizása", + "template": "nexio-sync.xml", + "executeimmediate": true, + "cronexpression": "0/20 * * ? * *" + }, + { + "active": false, + "name" : "Párhuzamosított teszt folyamat", + "template": "fake-concurrent.xml", + "executeimmediate": false, + "cronexpression": "0/10 * * ? * *", + "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] + }, + { + "active": false, + "name" : "Teszt folyamat", + "template": "fake.xml", + "executeimmediate": false, + "cronexpression": "0/10 * * ? * *", + "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] + } +]} + + + diff --git a/server/-dependencies/.project b/server/-dependencies/.project new file mode 100644 index 00000000..28da54b4 --- /dev/null +++ b/server/-dependencies/.project @@ -0,0 +1,11 @@ + + + -dependencies + + + + + + + + diff --git a/server/-dependencies/.tpignore b/server/-dependencies/.tpignore new file mode 100644 index 00000000..24d64373 --- /dev/null +++ b/server/-dependencies/.tpignore @@ -0,0 +1 @@ +/target/ diff --git a/server/-dependencies/jobengine.target b/server/-dependencies/jobengine.target new file mode 100644 index 00000000..e97ad059 --- /dev/null +++ b/server/-dependencies/jobengine.target @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +win32 +win32 +x86_64 +en_US + + +-Dosgi.requiredJavaVersion=1.8 -XX:+UseG1GC -XX:+UseStringDeduplication -Dosgi.requiredJavaVersion=1.8 -Xms256m -Xmx1024m -Dorg.eclipse.epp.logging.aeri.skipReports=true + + diff --git a/server/-dependencies/libs/db2jcc4.jar b/server/-dependencies/libs/db2jcc4.jar new file mode 100644 index 00000000..ab7516fa Binary files /dev/null and b/server/-dependencies/libs/db2jcc4.jar differ diff --git a/server/-dependencies/libs/db2jcc_license_cu.jar b/server/-dependencies/libs/db2jcc_license_cu.jar new file mode 100644 index 00000000..aae778fc Binary files /dev/null and b/server/-dependencies/libs/db2jcc_license_cu.jar differ diff --git a/server/-dependencies/libs/nosqljson.jar b/server/-dependencies/libs/nosqljson.jar new file mode 100644 index 00000000..959efb36 Binary files /dev/null and b/server/-dependencies/libs/nosqljson.jar differ diff --git a/server/-dependencies/libs/sqljdbc42.jar b/server/-dependencies/libs/sqljdbc42.jar new file mode 100644 index 00000000..61b3463e Binary files /dev/null and b/server/-dependencies/libs/sqljdbc42.jar differ diff --git a/server/-dependencies/pom.xml b/server/-dependencies/pom.xml new file mode 100644 index 00000000..cbdab181 --- /dev/null +++ b/server/-dependencies/pom.xml @@ -0,0 +1,275 @@ + + + 4.0.0 + hu.user.chronos + hu.user.chronos.dependencies + 1.0.0-SNAPSHOT + pom + + 1.7 + 1.7 + UTF-8 + UTF-8 + 9.3.9.v20160517 + + 2.23.2 + 2.5.5 + 1.5.9 + 2.5.0-b42 + 3.0.11.Final + + + + + org.apache.maven.plugins + maven-install-plugin + 2.4 + + + install0 + package + + install-file + + + libs/db2jcc4.jar + com.ibm + db2jcc4 + 4.19.26 + jar + + + + install1 + package + + install-file + + + libs/nosqljson.jar + com.ibm + nosql + 4.19.26 + jar + + + + install2 + package + + install-file + + + libs/sqljdbc42.jar + com.microsoft.sqlserver + sqljdbc + 6.0.8112-100 + jar + + + + + + org.reficio + p2-maven-plugin + 1.2.0-SNAPSHOT + + + default-cli + + + + org.apache.servicemix.bundles:org.apache.servicemix.bundles.jasper:6.0.53_1 + + + com.microsoft.sqlserver:sqljdbc:6.0.8112-100 + + + org.apache.aries:org.apache.aries.util:1.1.3 + + + org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle:1.0.8 + + + org.apache.logging.log4j:log4j-api:2.8.2 + + + org.apache.logging.log4j:log4j-core:2.8.2 + true + + + org.apache.logging.log4j:log4j-slf4j-impl:2.8.2 + + + org.apache.servicemix.bundles:org.apache.servicemix.bundles.quartz:2.3.0_2 + + + + + + + + org.apache.commons:commons-digester3:3.2 + + + jcifs:jcifs:1.3.17 + + + commons-net:commons-net:3.6 + + + org.jmock:jmock:2.6.0 + + + org.jmock:jmock-junit4:2.6.0 + + + com.ibm:nosql:4.19.26 + + + com.ibm:db2jcc4:4.19.26 + + + org.glassfish.hk2:hk2-api:${hk2.version} + + + org.glassfish.hk2:hk2-locator:${hk2.version} + + + org.glassfish.hk2:osgi-resource-locator:${hk2.version} + + + org.glassfish.hk2.external:asm-all-repackaged:${hk2.version} + + + org.glassfish.hk2.external:aopalliance-repackaged:${hk2.version} + + + org.glassfish.hk2.external:javax.inject:${hk2.version} + + + org.glassfish.hk2:hk2-utils:${hk2.version} + true + + + io.swagger:swagger-jersey2-jaxrs:${swagger-core-version} + + + org.glassfish.jersey.containers:jersey-container-servlet-core:${jersey.version} + + + org.glassfish.jersey.media:jersey-media-multipart:${jersey.version} + + + org.slf4j:slf4j-simple:1.6.3 + + + + com.auth0:java-jwt:3.2.0 + + + + javax.transaction:javax.transaction-api:1.2 + + + org.mortbay.jasper:apache-jsp:8.0.33 + true + + + org.mortbay.jasper:apache-el:8.0.33 + + + org.eclipse.jdt.core.compiler:ecj:4.4.2 + + + org.eclipse.tycho:org.eclipse.osgi:3.11.2.v20161107-1947 + + + + + + org.eclipse.jetty:jetty-jsp:9.2.22.v20170606 + true + + + org.eclipse.jetty.toolchain:jetty-schemas:3.1 + + + org.eclipse.jetty.osgi:jetty-osgi-boot:${jetty.version} + + + org.eclipse.jetty.osgi:jetty-osgi-boot-jsp:${jetty.version} + true + + + org.eclipse.jetty:jetty-client:${jetty.version} + + + org.eclipse.jetty:jetty-jndi:${jetty.version} + + + org.eclipse.jetty:jetty-continuation:${jetty.version} + + + org.eclipse.jetty:jetty-proxy:${jetty.version} + + + org.eclipse.jetty:jetty-servlets:${jetty.version} + + + org.eclipse.jetty:jetty-servlet:${jetty.version} + true + + + org.eclipse.jetty.websocket:websocket-api:${jetty.version} + + + org.eclipse.jetty.websocket:websocket-common:${jetty.version} + + + org.eclipse.jetty.websocket:websocket-servlet:${jetty.version} + + + org.eclipse.jetty.websocket:websocket-server:${jetty.version} + + + org.eclipse.jetty:apache-jsp:${jetty.version} + true + + + + javax.servlet.jsp:javax.servlet.jsp-api:2.3.0 + + + com.sun.org.apache:jaxp-ri:1.4 + + + + + org.jboss.resteasy:resteasy-jaxrs:${resteasy-version} + + + org.jboss.resteasy:resteasy-validator-provider-11:${resteasy-version} + + + org.jboss.resteasy:resteasy-multipart-provider:${resteasy-version} + + + org.jboss.resteasy:resteasy-jackson2-provider:${resteasy-version} + + + + + + + + + + + reficio + http://repo.reficio.org/maven/ + + + diff --git a/server/-modules/.project b/server/-modules/.project new file mode 100644 index 00000000..82360177 --- /dev/null +++ b/server/-modules/.project @@ -0,0 +1,11 @@ + + + -modules + + + + + + + + diff --git a/server/-modules/pom.xml b/server/-modules/pom.xml new file mode 100644 index 00000000..48678860 --- /dev/null +++ b/server/-modules/pom.xml @@ -0,0 +1,198 @@ + + + 4.0.0 + user.jobengine + MediaCube + 1.0.0 + pom + + ../user.jobengine.executors + ../user.jobengine.osgi.commons + ../user.jobengine.osgi.db + ../user.jobengine.osgi.server + ../user.jobengine.osgi.services + ../user.commons.log4j2 + ../user.tsm.client + ../-product + + + 1.0.0 + 1.0.0 + UTF-8 + + scp://root:password@10.10.1.26 + ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4 + ${project.build.directory} + /opt/mediacube/plugins + + + + + + eclipse-neon + http://download.eclipse.org/releases/neon + + p2 + + + + dependencies + p2 + file:${project.basedir}/../-dependencies/target/repository/ + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.5.0 + + + remote-deploy + deploy + + exec + + + ${project.build.directory} + winscp.com + + /command + "open ${remote.address} -hostkey=""${remote.hostkey}""" + "lcd ${local.location}" + "cd ${remote.location}" + "synchronize remote -filemask=*.jar|*/" + "exit" + + + + + + + org.eclipse.tycho + tycho-packaging-plugin + ${tycho.version} + + ${project.artifactId}_${project.version} + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho.version} + true + + + org.eclipse.tycho + target-platform-configuration + + consider + + + win32 + win32 + x86_64 + + + linux + gtk + x86_64 + + + + + + + + + + org.eclipse.tycho + target-platform-configuration + ${tycho.version} + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.eclipse.tycho + + + tycho-packaging-plugin + + + [1.0.0,) + + + validate-id + + validate-version + + build-qualifier + + build-qualifier-aggregator + + + + + + + + + + + org.apache.maven.plugins + + + maven-clean-plugin + + + [2.5,) + + + clean + + + + + + + + + + + + + + diff --git a/server/-product/.project b/server/-product/.project new file mode 100644 index 00000000..7bdc92b4 --- /dev/null +++ b/server/-product/.project @@ -0,0 +1,11 @@ + + + -product + + + + + + + + diff --git a/server/-product/.tpignore b/server/-product/.tpignore new file mode 100644 index 00000000..24d64373 --- /dev/null +++ b/server/-product/.tpignore @@ -0,0 +1 @@ +/target/ diff --git a/server/-product/DEPLOY-README.txt b/server/-product/DEPLOY-README.txt new file mode 100644 index 00000000..046da097 --- /dev/null +++ b/server/-product/DEPLOY-README.txt @@ -0,0 +1,64 @@ +Services global +--------------- + +Add system user: + useradd mclowres -d /mediacube/data/lowres -p Broadcas5T + +Configure auto start + chkconfig --level 35 SERVICENAME on + +Status + service smb status + +Restart + service smb restart + + + + +Samba +----- + +Config + /etc/samba/smb.conf + +Load config + smbcontrol all reload-config + +Add Samba user + (echo Broadcas5T; echo Broadcas5T) | smbpasswd -s -a mclowres + +Serving + \\10.10.1.26\mclowres\ + +Windows mapping + net use m: \\10.10.1.26\mclowres /user:mclowres Broadca5T /persistent:no + + + + +Nginx +----- + +Config + /etc/nginx/nginx.conf + +Current root folder: + /mediacube/data/lowres/www + +Video player test page + /mediacube/data/lowres/www/index.html = http://10.10.1.26:90 + +Lowres video folder + /mediacube/data/lowres/www/video + + + + +ISILON +------ + +Windows mapping + net use i: \\10.10.1.100\braavos /user:mediacube Broadca5T /persistent:no + net use r: \\10.10.1.100\braavos /user:readonly readonly /persistent:no + \ No newline at end of file diff --git a/server/-product/mediacube-osgi.bat b/server/-product/mediacube-osgi.bat new file mode 100644 index 00000000..93154ce1 --- /dev/null +++ b/server/-product/mediacube-osgi.bat @@ -0,0 +1,27 @@ +java -jar plugins/org.eclipse.osgi_3.11.3.v20170209-1843.jar ^ +-configuration configuration/config.ini ^ +-console ^ +-consoleLog ^ +-Dorg.eclipse.equinox.http.jetty.http.port=8080 ^ +-Dorg.eclipse.epp.logging.aeri.skipReports=true ^ +-Declipse.ignoreApp=true ^ +-Dosgi.noShutdown=true ^ +-Djetty.home=./configuration/etc ^ +-Djetty.etc.config.urls=user-jetty.xml,user-jetty-ssl.xml,user-jetty-ssl-context.xml,user-jetty-http.xml,user-jetty-https.xml ^ +-Dlog4j.configuration=./configuration/log4j.properties ^ +-Djobengine.loglevel=INFO ^ +-Djobengine.jobsteps.root=./configuration/executors ^ +-Djobengine.jobtemplates.root=./configuration/templates ^ +-Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true; ^ +-Djobengine.db.user=db2admin ^ +-Djobengine.db.password=password ^ +-Djobengine.octopus.api.address=http://10.10.1.21/api/v1 ^ +-Djobengine.octopus.api.user=mam ^ +-Djobengine.octopus.api.password=napocska ^ +-Djobengine.octopus.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; ^ +-Djobengine.octopus.db.user=db2admin ^ +-Djobengine.octopus.db.password=password ^ +-Djobengine.octopus.db.schema=test ^ +-Djobengine.rcc.host=localhost ^ +-Djobengine.rcc.defaultlowresprofile=MediaCube-H264 ^ +-Djobengine.transcoder.source=c:\_Movie\hires\ diff --git a/server/-product/mediacube.product b/server/-product/mediacube.product new file mode 100644 index 00000000..e83589c6 --- /dev/null +++ b/server/-product/mediacube.product @@ -0,0 +1,167 @@ + + + + + + + + + + -consoleLog -console + + #System +-Dorg.eclipse.equinox.http.jetty.http.port=8080 +-Dorg.eclipse.epp.logging.aeri.skipReports=true +-Declipse.ignoreApp=true +-Dosgi.noShutdown=true +-Djetty.home=./configuration/jetty +-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml +-Dlog4j.configurationFile=./configuration/log4j2.xml + +#JobEngine +-Djobengine.loglevel=INFO +-Djobengine.jobsteps.root=./configuration/executors +-Djobengine.jobtemplates.root=./configuration/templates +-Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.db.user=db2admin +-Djobengine.db.password=password +-Djobengine.octopus.api.address=http://10.10.1.21/api/v1 +-Djobengine.octopus.api.user=mam +-Djobengine.octopus.api.password=napocska +-Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.nosql.db.user=db2admin +-Djobengine.nosql.db.password=password +-Djobengine.nosql.db.schema=test +-Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; +-Djobengine.nexio.db.user=sa +-Djobengine.nexio.db.password=resolve +-Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl +-Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium +-Djobengine.jobscheduling.config=./configuration/scheduledjobs.json + + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts + + + + + + + + + + + + org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-product/mediacube.sh b/server/-product/mediacube.sh new file mode 100644 index 00000000..6b2335b0 --- /dev/null +++ b/server/-product/mediacube.sh @@ -0,0 +1 @@ +./mediacube & \ No newline at end of file diff --git a/server/-product/mediacube1 b/server/-product/mediacube1 new file mode 100644 index 00000000..e3b62eb8 --- /dev/null +++ b/server/-product/mediacube1 @@ -0,0 +1,174 @@ + + + + + + + + + + -consoleLog -console + + #System +-Dorg.eclipse.equinox.http.jetty.http.port=8080 +-Dorg.eclipse.epp.logging.aeri.skipReports=true +-Declipse.ignoreApp=true +-Dosgi.noShutdown=true +-Djetty.home=configuration/jetty +-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml +-Dlog4j.configuration=./configuration/log4j.properties +-Dlog4j.configurationFile=./configuration/log4j2.xml + +#JobEngine +-Djobengine.loglevel=INFO +-Djobengine.jobsteps.root=./configuration/executors +-Djobengine.jobtemplates.root=./configuration/templates +-Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.db.user=db2admin +-Djobengine.db.password=password +-Djobengine.octopus.api.address=http://10.10.1.21/api/v1 +-Djobengine.octopus.api.user=mam +-Djobengine.octopus.api.password=napocska +-Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.nosql.db.user=db2admin +-Djobengine.nosql.db.password=password +-Djobengine.nosql.db.schema=test +-Djobengine.rcc.host=localhost +-Djobengine.rcc.defaultlowresprofile="MediaCube-H264" +-Djobengine.transcoder.source=c:\_Movie\hires\ + + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts + + + + + + + + + + + + org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-product/mediacube2 b/server/-product/mediacube2 new file mode 100644 index 00000000..e752e35b --- /dev/null +++ b/server/-product/mediacube2 @@ -0,0 +1,175 @@ + + + + + + + + + + + -consoleLog -console + + #System +-Dorg.eclipse.equinox.http.jetty.http.port=8080 +-Dorg.eclipse.epp.logging.aeri.skipReports=true +-Declipse.ignoreApp=true +-Dosgi.noShutdown=true +-Djetty.home=configuration/jetty +-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml +-Dlog4j.configuration=./configuration/log4j.properties +-Dlog4j.configurationFile=./configuration/log4j2.xml + +#JobEngine +-Djobengine.loglevel=INFO +-Djobengine.jobsteps.root=./configuration/executors +-Djobengine.jobtemplates.root=./configuration/templates +-Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.db.user=db2admin +-Djobengine.db.password=password +-Djobengine.octopus.api.address=http://10.10.1.21/api/v1 +-Djobengine.octopus.api.user=mam +-Djobengine.octopus.api.password=napocska +-Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.nosql.db.user=db2admin +-Djobengine.nosql.db.password=password +-Djobengine.nosql.db.schema=test +-Djobengine.rcc.host=localhost +-Djobengine.rcc.defaultlowresprofile="MediaCube-H264" +-Djobengine.transcoder.source=c:\_Movie\hires\ + + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts + + + + + + + + + + + + + + + + org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/-product/pom.xml b/server/-product/pom.xml new file mode 100644 index 00000000..5473cf67 --- /dev/null +++ b/server/-product/pom.xml @@ -0,0 +1,160 @@ + + + 4.0.0 + + ../-modules + user.jobengine + MediaCube + 1.0.0 + + + user.jobengine.product + eclipse-repository + + + + + org.eclipse.tycho + tycho-p2-repository-plugin + ${tycho.version} + + true + + + + org.eclipse.tycho + tycho-p2-director-plugin + ${tycho.version} + + + materialize-products + + materialize-products + + + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + + copy-resources-1 + install + + copy-resources + + + ${project.build.directory}/products/MediaCube/win32/win32/x86_64/configuration + + + ${basedir}/../-configuration + + log4j2.xml + scheduledjobs.json + + + + + + + copy-resources-2 + install + + copy-resources + + + ${project.build.directory}/products/MediaCube/win32/win32/x86_64/configuration/executors + + + ${basedir}/../user.jobengine.executors/config + + + + + + copy-resources-3 + install + + copy-resources + + + ${project.build.directory}/products/MediaCube/win32/win32/x86_64/configuration/executors + + + ${basedir}/../user.jobengine.executors/bin/user/jobengine/server/steps + + + + + + copy-resources-4 + install + + copy-resources + + + ${project.build.directory}/products/MediaCube/win32/win32/x86_64/configuration/templates + + + ${basedir}/../user.jobengine.osgi.server/resources/templates + + + + + + copy-resources-5 + install + + copy-resources + + + ${project.build.directory}/products/MediaCube/win32/win32/x86_64/configuration/jetty/etc + + + ${basedir}/../-configuration/jetty/etc + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.5.0 + + + remote-deploy + deploy + + exec + + + ${project.build.directory}/products/MediaCube/win32/win32/x86_64/ + WinSCP.com + + /command + "open ${remote.address} -hostkey=""${remote.hostkey}""" + "exit" + + + + + + + + + + 10.10.1.26 + ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4 + + diff --git a/server/user.commons.log4j2/.classpath b/server/user.commons.log4j2/.classpath new file mode 100644 index 00000000..b862a296 --- /dev/null +++ b/server/user.commons.log4j2/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/server/user.commons.log4j2/.project b/server/user.commons.log4j2/.project new file mode 100644 index 00000000..832477b7 --- /dev/null +++ b/server/user.commons.log4j2/.project @@ -0,0 +1,28 @@ + + + user.commons.log4j2 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/server/user.commons.log4j2/.settings/org.eclipse.jdt.core.prefs b/server/user.commons.log4j2/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..295926d9 --- /dev/null +++ b/server/user.commons.log4j2/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/server/user.commons.log4j2/.settings/org.eclipse.pde.core.prefs b/server/user.commons.log4j2/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 00000000..b7e72d01 --- /dev/null +++ b/server/user.commons.log4j2/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +pluginProject.extensions=false +resolve.requirebundle=false diff --git a/server/user.commons.log4j2/.tpignore b/server/user.commons.log4j2/.tpignore new file mode 100644 index 00000000..24d64373 --- /dev/null +++ b/server/user.commons.log4j2/.tpignore @@ -0,0 +1 @@ +/target/ diff --git a/server/user.commons.log4j2/META-INF/MANIFEST.MF b/server/user.commons.log4j2/META-INF/MANIFEST.MF new file mode 100644 index 00000000..521fb644 --- /dev/null +++ b/server/user.commons.log4j2/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Log4j2 Appenders +Bundle-SymbolicName: user.commons.log4j2 +Bundle-Version: 1.0.0 +Fragment-Host: org.apache.logging.log4j.core;bundle-version="2.8.2" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: user.commons.log4j2.appender +Import-Package: javax.mail;version="1.5.0" diff --git a/server/user.commons.log4j2/build.properties b/server/user.commons.log4j2/build.properties new file mode 100644 index 00000000..41eb6ade --- /dev/null +++ b/server/user.commons.log4j2/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/server/user.commons.log4j2/pom.xml b/server/user.commons.log4j2/pom.xml new file mode 100644 index 00000000..daf78393 --- /dev/null +++ b/server/user.commons.log4j2/pom.xml @@ -0,0 +1,15 @@ + + + + ../-modules + user.jobengine + MediaCube + 1.0.0 + + 4.0.0 + user.commons.log4j2 + eclipse-plugin + 1.0.0 + \ No newline at end of file diff --git a/server/user.commons.log4j2/src/user/commons/log4j2/appender/HTMLMailAppender.java b/server/user.commons.log4j2/src/user/commons/log4j2/appender/HTMLMailAppender.java new file mode 100644 index 00000000..e40d4511 --- /dev/null +++ b/server/user.commons.log4j2/src/user/commons/log4j2/appender/HTMLMailAppender.java @@ -0,0 +1,162 @@ +package user.commons.log4j2.appender; + +import java.io.Serializable; + +import org.apache.logging.log4j.core.Appender; +import org.apache.logging.log4j.core.Core; +import org.apache.logging.log4j.core.Filter; +import org.apache.logging.log4j.core.Layout; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.appender.AbstractAppender; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.DefaultConfiguration; +import org.apache.logging.log4j.core.config.plugins.Plugin; +import org.apache.logging.log4j.core.config.plugins.PluginAttribute; +import org.apache.logging.log4j.core.config.plugins.PluginConfiguration; +import org.apache.logging.log4j.core.config.plugins.PluginElement; +import org.apache.logging.log4j.core.config.plugins.PluginFactory; +import org.apache.logging.log4j.core.config.plugins.validation.constraints.Required; +import org.apache.logging.log4j.core.config.plugins.validation.constraints.ValidPort; +import org.apache.logging.log4j.core.filter.ThresholdFilter; +import org.apache.logging.log4j.core.layout.HtmlLayout; +import org.apache.logging.log4j.core.util.Booleans; + +/** + * Send an e-mail when a specific logging event occurs, typically on errors or + * fatal errors. + * + *

+ * The number of logging events delivered in this e-mail depend on the value of + * BufferSize option. The SmtpAppender keeps only the last + * BufferSize logging events in its cyclic buffer. This keeps + * memory requirements at a reasonable level while still delivering useful + * application context. + * + * By default, an email message will formatted as HTML. This can be modified by + * setting a layout for the appender. + * + * By default, an email message will be sent when an ERROR or higher severity + * message is appended. This can be modified by setting a filter for the + * appender. + */ +@Plugin(name = "HTMLMailAppender", category = Core.CATEGORY_NAME, elementType = Appender.ELEMENT_TYPE, printObject = true) +public final class HTMLMailAppender extends AbstractAppender { + + private static final int DEFAULT_BUFFER_SIZE = 512; + + /** The SMTP Manager */ + private final SmtpManager manager; + + private HTMLMailAppender(final String name, final Filter filter, final Layout layout, + final SmtpManager manager, final boolean ignoreExceptions) { + super(name, filter, layout, ignoreExceptions); + this.manager = manager; + } + + /** + * Create a SmtpAppender. + * + * @param name + * The name of the Appender. + * @param to + * The comma-separated list of recipient email addresses. + * @param cc + * The comma-separated list of CC email addresses. + * @param bcc + * The comma-separated list of BCC email addresses. + * @param from + * The email address of the sender. + * @param replyTo + * The comma-separated list of reply-to email addresses. + * @param subject The subject of the email message. + * @param smtpProtocol The SMTP transport protocol (such as "smtps", defaults to "smtp"). + * @param smtpHost + * The SMTP hostname to send to. + * @param smtpPortStr + * The SMTP port to send to. + * @param smtpUsername + * The username required to authenticate against the SMTP server. + * @param smtpPassword + * The password required to authenticate against the SMTP server. + * @param smtpDebug + * Enable mail session debuging on STDOUT. + * @param bufferSizeStr + * How many log events should be buffered for inclusion in the + * message? + * @param layout + * The layout to use (defaults to HtmlLayout). + * @param filter + * The Filter or null (defaults to ThresholdFilter, level of + * ERROR). + * @param ignore If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise + * they are propagated to the caller. + * @return The SmtpAppender. + */ + @PluginFactory + public static HTMLMailAppender createAppender(@PluginConfiguration final Configuration config, + @PluginAttribute("name") @Required final String name, @PluginAttribute("to") final String to, + @PluginAttribute("cc") final String cc, @PluginAttribute("bcc") final String bcc, + @PluginAttribute("from") final String from, @PluginAttribute("replyTo") final String replyTo, + @PluginAttribute("subject") final String subject, + @PluginAttribute("smtpProtocol") final String smtpProtocol, + @PluginAttribute("smtpHost") final String smtpHost, + @PluginAttribute(value = "smtpPort", defaultString = "0") @ValidPort final String smtpPortStr, + @PluginAttribute("smtpUsername") final String smtpUsername, + @PluginAttribute(value = "smtpPassword", sensitive = true) final String smtpPassword, + @PluginAttribute("smtpDebug") final String smtpDebug, + @PluginAttribute("bufferSize") final String bufferSizeStr, + @PluginElement("Layout") Layout layout, @PluginElement("Filter") Filter filter, + @PluginAttribute("ignoreExceptions") final String ignore) { + if (name == null) { + LOGGER.error("No name provided for SmtpAppender"); + return null; + } + + final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true); + final int smtpPort = AbstractAppender.parseInt(smtpPortStr, 0); + final boolean isSmtpDebug = Boolean.parseBoolean(smtpDebug); + final int bufferSize = bufferSizeStr == null ? DEFAULT_BUFFER_SIZE : Integer.parseInt(bufferSizeStr); + + if (layout == null) { + layout = HtmlLayout.createDefaultLayout(); + } + if (filter == null) { + filter = ThresholdFilter.createFilter(null, null, null); + } + final Configuration configuration = config != null ? config : new DefaultConfiguration(); + + final SmtpManager manager = SmtpManager.getSmtpManager(configuration, to, cc, bcc, from, replyTo, subject, + smtpProtocol, smtpHost, smtpPort, smtpUsername, smtpPassword, isSmtpDebug, filter.toString(), + bufferSize); + if (manager == null) { + return null; + } + + return new HTMLMailAppender(name, filter, layout, manager, ignoreExceptions); + } + + /** + * Capture all events in CyclicBuffer. + * @param event The Log event. + * @return true if the event should be filtered. + */ + @Override + public boolean isFiltered(final LogEvent event) { + final boolean filtered = super.isFiltered(event); + if (filtered) { + manager.add(event); + } + return filtered; + } + + /** + * Perform SmtpAppender specific appending actions, mainly adding the event + * to a cyclic buffer and checking if the event triggers an e-mail to be + * sent. + * @param event The Log event. + */ + @Override + public void append(final LogEvent event) { + manager.sendEvents(getLayout(), event); + } +} diff --git a/server/user.commons.log4j2/src/user/commons/log4j2/appender/SmtpManager.java b/server/user.commons.log4j2/src/user/commons/log4j2/appender/SmtpManager.java new file mode 100644 index 00000000..a6bcba1c --- /dev/null +++ b/server/user.commons.log4j2/src/user/commons/log4j2/appender/SmtpManager.java @@ -0,0 +1,356 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package user.commons.log4j2.appender; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Date; +import java.util.Properties; + +import javax.activation.DataSource; +import javax.mail.Authenticator; +import javax.mail.Message; +import javax.mail.MessagingException; +import javax.mail.PasswordAuthentication; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetHeaders; +import javax.mail.internet.MimeBodyPart; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; +import javax.mail.internet.MimeUtility; +import javax.mail.util.ByteArrayDataSource; + +import org.apache.logging.log4j.LoggingException; +import org.apache.logging.log4j.core.Layout; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.appender.AbstractManager; +import org.apache.logging.log4j.core.appender.ManagerFactory; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.impl.Log4jLogEvent; +import org.apache.logging.log4j.core.impl.MutableLogEvent; +import org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer; +import org.apache.logging.log4j.core.layout.PatternLayout; +import org.apache.logging.log4j.core.net.MimeMessageBuilder; +import org.apache.logging.log4j.core.util.CyclicBuffer; +import org.apache.logging.log4j.core.util.NameUtil; +import org.apache.logging.log4j.core.util.NetUtils; +import org.apache.logging.log4j.message.ReusableMessage; +import org.apache.logging.log4j.util.PropertiesUtil; +import org.apache.logging.log4j.util.Strings; + +/** + * Manager for sending SMTP events. + */ +public class SmtpManager extends AbstractManager { + private static final SMTPManagerFactory FACTORY = new SMTPManagerFactory(); + + private final Session session; + + private final CyclicBuffer buffer; + + private volatile MimeMessage message; + + private final FactoryData data; + + private static MimeMessage createMimeMessage(final FactoryData data, final Session session, + final LogEvent appendEvent) throws MessagingException { + return new MimeMessageBuilder(session).setFrom(data.from).setReplyTo(data.replyto) + .setRecipients(Message.RecipientType.TO, data.to).setRecipients(Message.RecipientType.CC, data.cc) + .setRecipients(Message.RecipientType.BCC, data.bcc).setSubject(data.subject.toSerializable(appendEvent)) + .build(); + } + + protected SmtpManager(final String name, final Session session, final MimeMessage message, final FactoryData data) { + super(null, name); + this.session = session; + this.message = message; + this.data = data; + this.buffer = new CyclicBuffer<>(LogEvent.class, data.numElements); + } + + public void add(LogEvent event) { + if (event instanceof Log4jLogEvent && event.getMessage() instanceof ReusableMessage) { + ((Log4jLogEvent) event).makeMessageImmutable(); + } else if (event instanceof MutableLogEvent) { + event = ((MutableLogEvent) event).createMemento(); + } + buffer.add(event); + } + + public static SmtpManager getSmtpManager(final Configuration config, final String to, final String cc, + final String bcc, final String from, final String replyTo, final String subject, String protocol, + final String host, final int port, final String username, final String password, final boolean isDebug, + final String filterName, final int numElements) { + if (Strings.isEmpty(protocol)) { + protocol = "smtp"; + } + + final StringBuilder sb = new StringBuilder(); + if (to != null) { + sb.append(to); + } + sb.append(':'); + if (cc != null) { + sb.append(cc); + } + sb.append(':'); + if (bcc != null) { + sb.append(bcc); + } + sb.append(':'); + if (from != null) { + sb.append(from); + } + sb.append(':'); + if (replyTo != null) { + sb.append(replyTo); + } + sb.append(':'); + if (subject != null) { + sb.append(subject); + } + sb.append(':'); + sb.append(protocol).append(':').append(host).append(':').append("port").append(':'); + if (username != null) { + sb.append(username); + } + sb.append(':'); + if (password != null) { + sb.append(password); + } + sb.append(isDebug ? ":debug:" : "::"); + sb.append(filterName); + + final String name = "SMTP:" + NameUtil.md5(sb.toString()); + final Serializer subjectSerializer = PatternLayout.newSerializerBuilder().setConfiguration(config) + .setPattern(subject).build(); + + return getManager(name, FACTORY, new FactoryData(to, cc, bcc, from, replyTo, subjectSerializer, protocol, host, + port, username, password, isDebug, numElements)); + } + + /** + * Send the contents of the cyclic buffer as an e-mail message. + * @param layout The layout for formatting the events. + * @param appendEvent The event that triggered the send. + */ + public void sendEvents(final Layout layout, final LogEvent appendEvent) { + if (message == null) { + connect(appendEvent); + } + try { + final LogEvent[] priorEvents = buffer.removeAll(); + // LOG4J-310: log appendEvent even if priorEvents is empty + + final byte[] rawBytes = formatContentToBytes(priorEvents, appendEvent, layout); + + final String contentType = layout.getContentType(); + final String encoding = getEncoding(rawBytes, contentType); + final byte[] encodedBytes = encodeContentToBytes(rawBytes, encoding); + + final InternetHeaders headers = getHeaders(contentType, encoding); + final MimeMultipart mp = getMimeMultipart(encodedBytes, headers); + + sendMultipartMessage(message, mp); + } catch (final MessagingException | IOException | RuntimeException e) { + logError("Caught exception while sending e-mail notification.", e); + throw new LoggingException("Error occurred while sending email", e); + } + } + + protected byte[] formatContentToBytes(final LogEvent[] priorEvents, final LogEvent appendEvent, + final Layout layout) throws IOException { + final ByteArrayOutputStream raw = new ByteArrayOutputStream(); + writeContent(priorEvents, appendEvent, layout, raw); + return raw.toByteArray(); + } + + private void writeContent(final LogEvent[] priorEvents, final LogEvent appendEvent, final Layout layout, + final ByteArrayOutputStream out) throws IOException { + writeHeader(layout, out); + writeBuffer(priorEvents, appendEvent, layout, out); + writeFooter(layout, out); + } + + protected void writeHeader(final Layout layout, final OutputStream out) throws IOException { + final byte[] header = layout.getHeader(); + if (header != null) { + out.write(header); + } + } + + protected void writeBuffer(final LogEvent[] priorEvents, final LogEvent appendEvent, final Layout layout, + final OutputStream out) throws IOException { + // for (final LogEvent priorEvent : priorEvents) { + // final byte[] bytes = layout.toByteArray(priorEvent); + // out.write(bytes); + // } + + final byte[] bytes = layout.toByteArray(appendEvent); + out.write(bytes); + } + + protected void writeFooter(final Layout layout, final OutputStream out) throws IOException { + final byte[] footer = layout.getFooter(); + if (footer != null) { + out.write(footer); + } + } + + protected String getEncoding(final byte[] rawBytes, final String contentType) { + final DataSource dataSource = new ByteArrayDataSource(rawBytes, contentType); + return MimeUtility.getEncoding(dataSource); + } + + protected byte[] encodeContentToBytes(final byte[] rawBytes, final String encoding) + throws MessagingException, IOException { + final ByteArrayOutputStream encoded = new ByteArrayOutputStream(); + encodeContent(rawBytes, encoding, encoded); + return encoded.toByteArray(); + } + + protected void encodeContent(final byte[] bytes, final String encoding, final ByteArrayOutputStream out) + throws MessagingException, IOException { + try (final OutputStream encoder = MimeUtility.encode(out, encoding)) { + encoder.write(bytes); + } + } + + protected InternetHeaders getHeaders(final String contentType, final String encoding) { + final InternetHeaders headers = new InternetHeaders(); + headers.setHeader("Content-Type", contentType + "; charset=UTF-8"); + headers.setHeader("Content-Transfer-Encoding", encoding); + return headers; + } + + protected MimeMultipart getMimeMultipart(final byte[] encodedBytes, final InternetHeaders headers) + throws MessagingException { + final MimeMultipart mp = new MimeMultipart(); + final MimeBodyPart part = new MimeBodyPart(headers, encodedBytes); + mp.addBodyPart(part); + return mp; + } + + protected void sendMultipartMessage(final MimeMessage msg, final MimeMultipart mp) throws MessagingException { + synchronized (msg) { + msg.setContent(mp); + msg.setSentDate(new Date()); + Transport.send(msg); + } + } + + /** + * Factory data. + */ + private static class FactoryData { + private final String to; + private final String cc; + private final String bcc; + private final String from; + private final String replyto; + private final Serializer subject; + private final String protocol; + private final String host; + private final int port; + private final String username; + private final String password; + private final boolean isDebug; + private final int numElements; + + public FactoryData(final String to, final String cc, final String bcc, final String from, final String replyTo, + final Serializer subjectSerializer, final String protocol, final String host, final int port, + final String username, final String password, final boolean isDebug, final int numElements) { + this.to = to; + this.cc = cc; + this.bcc = bcc; + this.from = from; + this.replyto = replyTo; + this.subject = subjectSerializer; + this.protocol = protocol; + this.host = host; + this.port = port; + this.username = username; + this.password = password; + this.isDebug = isDebug; + this.numElements = numElements; + } + } + + private synchronized void connect(final LogEvent appendEvent) { + if (message != null) { + return; + } + try { + message = createMimeMessage(data, session, appendEvent); + } catch (final MessagingException e) { + logError("Could not set SmtpAppender message options", e); + message = null; + } + } + + /** + * Factory to create the SMTP Manager. + */ + private static class SMTPManagerFactory implements ManagerFactory { + + @Override + public SmtpManager createManager(final String name, final FactoryData data) { + final String prefix = "mail." + data.protocol; + + final Properties properties = PropertiesUtil.getSystemProperties(); + properties.put("mail.transport.protocol", data.protocol); + if (properties.getProperty("mail.host") == null) { + // Prevent an UnknownHostException in Java 7 + properties.put("mail.host", NetUtils.getLocalHostname()); + } + + if (null != data.host) { + properties.put(prefix + ".host", data.host); + } + if (data.port > 0) { + properties.put(prefix + ".port", String.valueOf(data.port)); + } + + final Authenticator authenticator = buildAuthenticator(data.username, data.password); + if (null != authenticator) { + properties.put(prefix + ".auth", "true"); + } + + final Session session = Session.getInstance(properties, authenticator); + session.setProtocolForAddress("rfc822", data.protocol); + session.setDebug(data.isDebug); + return new SmtpManager(name, session, null, data); + } + + private Authenticator buildAuthenticator(final String username, final String password) { + if (null != password && null != username) { + return new Authenticator() { + private final PasswordAuthentication passwordAuthentication = new PasswordAuthentication(username, + password); + + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return passwordAuthentication; + } + }; + } + return null; + } + } +} diff --git a/server/user.jobengine.executors/.classpath b/server/user.jobengine.executors/.classpath new file mode 100644 index 00000000..3d1f8e3a --- /dev/null +++ b/server/user.jobengine.executors/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/server/user.jobengine.executors/.externalToolBuilders/executor_copy.launch b/server/user.jobengine.executors/.externalToolBuilders/executor_copy.launch new file mode 100644 index 00000000..bd1f5f2d --- /dev/null +++ b/server/user.jobengine.executors/.externalToolBuilders/executor_copy.launch @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/server/user.jobengine.executors/.project b/server/user.jobengine.executors/.project new file mode 100644 index 00000000..1a808f87 --- /dev/null +++ b/server/user.jobengine.executors/.project @@ -0,0 +1,38 @@ + + + user.jobengine.executors + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/executor_copy.launch + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/server/user.jobengine.executors/.settings/org.eclipse.jdt.core.prefs b/server/user.jobengine.executors/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..838bd9d6 --- /dev/null +++ b/server/user.jobengine.executors/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/server/user.jobengine.executors/.tpignore b/server/user.jobengine.executors/.tpignore new file mode 100644 index 00000000..24d64373 --- /dev/null +++ b/server/user.jobengine.executors/.tpignore @@ -0,0 +1 @@ +/target/ diff --git a/server/user.jobengine.executors/META-INF/MANIFEST.MF b/server/user.jobengine.executors/META-INF/MANIFEST.MF new file mode 100644 index 00000000..e8590cca --- /dev/null +++ b/server/user.jobengine.executors/META-INF/MANIFEST.MF @@ -0,0 +1,14 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: user.jobengine.executors +Bundle-SymbolicName: user.jobengine.executors +Bundle-Version: 1.0.0 +Export-Package: user.jobengine.server.steps +Require-Bundle: user.jobengine.osgi.commons;bundle-version="1.0.0", + user.tsm.client;bundle-version="1.2.0", + org.apache.commons.lang;bundle-version="2.6.0", + user.jobengine.osgi.server;bundle-version="1.0.0", + user.jobengine.osgi.db, + com.ibm.nosql;bundle-version="4.19.26", + org.apache.logging.log4j.api;bundle-version="2.8.2" +Bundle-ClassPath: . diff --git a/server/user.jobengine.executors/build.properties b/server/user.jobengine.executors/build.properties new file mode 100644 index 00000000..a241a561 --- /dev/null +++ b/server/user.jobengine.executors/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +bin.includes = META-INF/,\ + . +source.. = src/ diff --git a/server/user.jobengine.executors/config/config.xml b/server/user.jobengine.executors/config/config.xml new file mode 100644 index 00000000..1662a216 --- /dev/null +++ b/server/user.jobengine.executors/config/config.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/deploy-steps-to-bsh.bat b/server/user.jobengine.executors/deploy-steps-to-bsh.bat new file mode 100644 index 00000000..ecdafacc --- /dev/null +++ b/server/user.jobengine.executors/deploy-steps-to-bsh.bat @@ -0,0 +1,30 @@ +@ECHO OFF + +SET REMOTE_HOST=10.10.1.26 +SET REMOTE_LOCATION=/opt/mediacube/configuration/executors +SET REMOTE_SERVER_HOSTKEY=ssh-rsa 2048 7e:0a:bb:8b:38:0f:22:c3:81:d4:1a:44:f3:91:ea:1f +SET REMOTE_SERVER_ADDRESS=scp://root:password@%REMOTE_HOST% +SET LOCAL_STEPS_LOCATION=bin/user/jobengine/server/steps +SET LOCAL_CONFIG_LOCATION=config + + ECHO *** Begin deploy steps to server %REMOTE_HOST% *** + ECHO --- Deploying + + WinSCP.com /command ^ + "open %REMOTE_SERVER_ADDRESS% -hostkey=""%REMOTE_SERVER_HOSTKEY%""" ^ + "cd %REMOTE_LOCATION%" ^ + "lcd %LOCAL_STEPS_LOCATION%" ^ + "synchronize remote" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd %LOCAL_CONFIG_LOCATION%" ^ + "synchronize remote -filemask=config.xml" ^ + "exit" + + ECHO *** Completed *** +@ECHO ON + + diff --git a/server/user.jobengine.executors/deploy-steps-to-bsh.launch b/server/user.jobengine.executors/deploy-steps-to-bsh.launch new file mode 100644 index 00000000..f6a5a703 --- /dev/null +++ b/server/user.jobengine.executors/deploy-steps-to-bsh.launch @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/server/user.jobengine.executors/deploy.xml b/server/user.jobengine.executors/deploy.xml new file mode 100644 index 00000000..1741cf6c --- /dev/null +++ b/server/user.jobengine.executors/deploy.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/pom.xml b/server/user.jobengine.executors/pom.xml new file mode 100644 index 00000000..6624f7af --- /dev/null +++ b/server/user.jobengine.executors/pom.xml @@ -0,0 +1,15 @@ + + + + ../-modules + user.jobengine + MediaCube + 1.0.0 + + 4.0.0 + user.jobengine.executors + eclipse-plugin + 1.0.0 + \ No newline at end of file diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/AFakeStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/AFakeStep.java new file mode 100644 index 00000000..717d11ab --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/AFakeStep.java @@ -0,0 +1,23 @@ +package user.jobengine.server.steps; + +import user.jobengine.server.IJobRuntime; + +public class AFakeStep extends JobStep { + int count = 10; + + @StepEntry + public Object[] execute(IJobRuntime jobRuntime) { + try { + for (int i = 0; i < count; i++) { + if (!canContinue()) + break; + Thread.sleep(100); + jobRuntime.incrementProgress((i + 1)*count); + } + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/ArchiveItemJobCreatorStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/ArchiveItemJobCreatorStep.java new file mode 100644 index 00000000..ad1aa2d4 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/ArchiveItemJobCreatorStep.java @@ -0,0 +1,43 @@ +package user.jobengine.server.steps; + +import java.util.ArrayList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.ListUtils; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +/** + * Elinditja minden mediara az archivalo es lowres tanszkodolo jobokat. + * @author robi + */ +public class ArchiveItemJobCreatorStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(ArrayList wrapperList, IJobEngine jobEngine, IJobRuntime jobRuntime) { + try { + for (MediaFileWrapper wr : wrapperList) { + try { + //START ARCHIVEMEDIA JOB + IJobRuntime runtime1 = jobEngine.submit("tsmbackupmediawrapper.xml", "TSMBackupMedia", + ListUtils.asMap("mediaWrapper", wr)); + + //START LOWRES TRANSCODER JOB + IJobRuntime runtime2 = jobEngine.submit("lowrestranscodemedia.xml", "LowresTranscodeMedia", + ListUtils.asMap("mediaWrapper", wr)); + } catch (Exception e1) { + wr.getCatchedFile().delete(); + throw e1; + } + } + + } catch (Exception e) { + logger.error("", e); + } + return new Object[] {}; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/ArchiveListBuilderStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/ArchiveListBuilderStep.java new file mode 100644 index 00000000..f9a76c11 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/ArchiveListBuilderStep.java @@ -0,0 +1,118 @@ +package user.jobengine.server.steps; + +import java.io.File; +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.JSONUtil; +import com.ibm.nosql.json.api.BasicDBObject; + +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +/** + * Az archivalhato mediak listazasa MediaFileWrapper objektumokban. + * A listazott media allomanyokat megjeloli .catched signal allomannyal, + * hogy a legkozelebbi listazas figyelmen kivul hagyja. + * @author robi + */ +public class ArchiveListBuilderStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(String mediaFolder, IJobEngine jobEngine, IJobRuntime jobRuntime) { + final ArrayList wrapperList = new ArrayList(); + + try { + //final String mediaFolder = "/tmp"; + final String storeFolder = ".STORE"; + final String mediaExt = ".mxf"; + final String jsonExt = ".json"; + final String catchedExt = ".catched"; + final File storeFolderFile = new File(mediaFolder + File.separator + storeFolder); + + //filename filter + DirectoryStream.Filter filter = new DirectoryStream.Filter() { + @Override + public boolean accept(Path path) throws IOException { + boolean ret = false; + File file = path.toFile(); + + //check extension and dir attrib + if (!file.isDirectory() && file.getName().toLowerCase().endsWith(mediaExt.toLowerCase())) { + File jsonFile = new File( + storeFolderFile.getAbsolutePath() + File.separator + file.getName() + jsonExt); + File catchedFile = new File( + storeFolderFile.getAbsolutePath() + File.separator + file.getName() + catchedExt); + //check json + if (jsonFile.exists()) { + + //check json content + String jsonContent = new String(Files.readAllBytes(Paths.get(jsonFile.getAbsolutePath()))); + BasicDBObject dbo = (BasicDBObject) JSONUtil.jsonToDbObject(jsonContent); + String itemHouseID = dbo.getString("itemHouseID"); + if (itemHouseID != null && !"".equals(itemHouseID)) { + //check catched file existence + if (!catchedFile.exists()) { + //write catchedfile + Files.write(Paths.get(catchedFile.getAbsolutePath()), "catched".getBytes("utf-8"), + StandardOpenOption.CREATE); + + MediaFileWrapper mfw = new MediaFileWrapper(); + mfw.setMediaFile(file); + mfw.setJsonFile(jsonFile); + mfw.setCatchedFile(catchedFile); + mfw.setJsonContent(jsonContent); + wrapperList.add(mfw); + + ret = true; + } else { + //file has been already catched + logger.warn(file.getName() + " file is already catched."); + } + } else { + //there is no houseID in json file + logger.warn("There is houseID member in json meta file: " + jsonFile.getName()); + } + } else { + //there is no json file + logger.warn("There is no json meta for this file: " + file.getName()); + } + } + return ret; + } + }; + + //list files + DirectoryStream directoryStream = null; + try { + directoryStream = Files.newDirectoryStream(Paths.get(mediaFolder), filter); + for (Path validMediaFile : directoryStream) { + //filter does everything + logger.info("Media file listed: " + validMediaFile.toString()); + } + }catch(Exception e){ + logger.error("", e); + throw e; + } finally { + if(directoryStream != null){ + directoryStream.close(); + } + } + + } catch (Exception e) { + logger.error("", e); + } + + return new Object[] { wrapperList }; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/DownloadStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/DownloadStep.java new file mode 100644 index 00000000..54fc00fe --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/DownloadStep.java @@ -0,0 +1,71 @@ +package user.jobengine.server.steps; + +import java.util.UUID; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; +import user.jobengine.server.JobEngineException; + +public class DownloadStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + StoreUri sourceUri = null; + + @StepEntry + public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, IJobEngine jobEngine, + IJobRuntime jobRuntime) throws Exception { + RemoteFile result = null; + final IJobRuntime runtime = jobRuntime; + IItemManager manager = jobEngine.getItemManager(); + Store systemStore = manager.getSystemStore(false); + + if (sourceStoreUri.getStoreId() == systemStore.getId()) { + logger.info("File is available on system store: " + sourceFileName); + sourceUri = systemStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL); + result = sourceUri.getRemoteFile(sourceFileName); + if (result == null) + throw new JobEngineException("RemoteFile is null"); + runtime.incrementProgress(100); + } else { + sourceUri = sourceStoreUri; + StoreUri target = systemStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL); + if (target == null) + throw new JobEngineException("Target StoreUri is null"); + + sourceUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + runtime.incrementProgress(evt.getProgress()); + logger.info("Progress:" + evt.getProgress()); + } + }); + sourceUri.addStatusListener(new IStatusEventListener() { + @Override + public void statusChanged(StatusEvent evt) { + evt.setCancel(!canContinue()); + } + }); + + result = sourceUri.transferFrom(target, sourceFileName, UUID.randomUUID().toString()); + } + return new Object[] { result }; + } + + @Override + public void cleanup() { + if (sourceUri != null) + sourceUri.clearListeners(); + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeStep.java new file mode 100644 index 00000000..62aff45c --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeStep.java @@ -0,0 +1,35 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.JSONUtil; +import com.ibm.nosql.json.api.BasicDBObject; + +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class FakeStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + int count = 10; + + @StepEntry + public Object[] execute(long itemID, IJobEngine jobEngine, IJobRuntime jobRuntime) { + try { + logger.info(IJobStep.INFO_MARKER, "Starting Fake step, parameter: {}", itemID); + String json = "{ houseID: '111222' }"; + BasicDBObject o = (BasicDBObject) JSONUtil.jsonToDbObject(json); + for (int i = 0; i < count; i++) { + if (!canContinue()) + break; + Thread.sleep(1000); + jobRuntime.incrementProgress((i + 1) * count); + // logger.info("Progress {}", jobRuntime.getProgress()); + } + } catch (Exception e) { + logger.error(e.getMessage()); + } + return new Object[] { itemID + 1 }; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/GetItemSourcesStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/GetItemSourcesStep.java new file mode 100644 index 00000000..722099f4 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/GetItemSourcesStep.java @@ -0,0 +1,41 @@ +package user.jobengine.server.steps; + +import java.util.ArrayList; +import java.util.List; + +import user.commons.ItemSource; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Scene; +import user.jobengine.db.SceneContent; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class GetItemSourcesStep extends JobStep { + + @StepEntry + public Object[] execute(List sourceFileName, long sceneId, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + List result = new ArrayList(); + final IJobRuntime runtime = jobRuntime; + IItemManager manager = jobEngine.getItemManager(); + if (manager != null && sceneId != 0 && sourceFileName == null) { + Scene scene = (Scene) manager.get(Scene.class, sceneId); + if (scene != null) { + for (SceneContent sceneContent : scene.getSceneContents()) { + ItemSource itemSource = new ItemSource(); + // itemSource.setName(sceneContent.getShot().getMedia().getMediaFiles().get(0).getRelativePath()); + itemSource.setId(sceneContent.getShot().getInPoint()); + itemSource.setId(sceneContent.getShot().getOutPoint()); + result.add(itemSource); + } + } + } else { + if (sourceFileName != null) { + ItemSource itemSource = new ItemSource(); + // itemSource.setName(sourceFileName); + result.add(itemSource); + } + } + runtime.incrementProgress(100); + return new Object[] { result }; + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/ImportWriteDataToDBStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/ImportWriteDataToDBStep.java new file mode 100644 index 00000000..14af8fa9 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/ImportWriteDataToDBStep.java @@ -0,0 +1,50 @@ +package user.jobengine.server.steps; + +import java.util.List; + +import user.jobengine.db.FileType; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Item; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; + +public class ImportWriteDataToDBStep extends JobStep { + + @StepEntry + public Object[] execute(Item item, List medias, IJobEngine jobEngine) { + try { + IItemManager manager = jobEngine.getItemManager(); + if (manager != null) { + configure(manager, item, medias); + item.add(); + } + } catch (Exception e) { + e.printStackTrace(); + } + Object[] result = new Object[]{ item }; + return result; + } + + private void configure(IItemManager manager, Item item, List medias) { + Store store = manager.getStore("Archívum gyorstár"); + item.setMedias(medias); + if (medias != null) { + for (Media media : medias) { + FileType fileType = manager.getFileType(media.getTitle()); + if (fileType == null) + fileType = manager.getFileType("bináris"); + List files = media.getMediaFiles(); + for (MediaFile file: files) { + file.setFileType(fileType); + file.setStoreId(store.getId()); + String relativePath = file.getRelativePath(); + String name = relativePath.substring(relativePath.lastIndexOf('\\') + 1); + file.setRelativePath(item.getHouseId()+ "/" + name); + } + } + } + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/ItemCreatorStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/ItemCreatorStep.java new file mode 100644 index 00000000..e6db120a --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/ItemCreatorStep.java @@ -0,0 +1,59 @@ +package user.jobengine.server.steps; + +import java.util.ArrayList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.jobengine.db.IItemManager; +import user.jobengine.db.Item; +import user.jobengine.db.Media; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; +import user.jobengine.server.JobEngineException; + +/** + * Itemek es mediak krealasa a MediaFileWrapper objektumok alapjan. + * @author robi + */ +public class ItemCreatorStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + private static final String ITEM_MANAGER_IS_NULL = "ItemManager is null"; + + @StepEntry + public Object[] execute(ArrayList wrapperList, IJobEngine jobEngine, IJobRuntime jobRuntime) { + + try { + for (MediaFileWrapper wr : wrapperList) { + try { + IItemManager itemManager = jobEngine.getItemManager(); + if (itemManager == null) + throw new JobEngineException(ITEM_MANAGER_IS_NULL); + Item item = itemManager.getItemByHouseID(wr.getJSONString(MediaFileWrapper.ITEM_HOUSEID)); + if (item == null) { + //add item + item = itemManager.createItem(MediaFileWrapper.ITEMTYPENAME, + wr.getJSONString(MediaFileWrapper.ITEM_TITLE), + wr.getJSONString(MediaFileWrapper.ITEM_DESCRIPTION), + wr.getJSONString(MediaFileWrapper.ITEM_HOUSEID)); + } + //add media + Media media = itemManager.createMedia(MediaFileWrapper.ITEMTYPENAME, + wr.getJSONString(MediaFileWrapper.MEDIA_TITLE), + wr.getJSONString(MediaFileWrapper.MEDIA_DESCRIPTION), + wr.getJSONString(MediaFileWrapper.MEDIA_HOUSE_ID)); + item.appendMedia(media); + wr.setItem(item); + wr.setMedia(media); + } catch (Exception e1) { + wr.getCatchedFile().delete(); + throw e1; + } + } + } catch (Exception e) { + logger.error("", e); + } + return new Object[] { wrapperList }; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaDBWriterStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaDBWriterStep.java new file mode 100644 index 00000000..a42ddc8a --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaDBWriterStep.java @@ -0,0 +1,29 @@ +package user.jobengine.server.steps; + +import java.util.List; + +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.JobEngineException; + +public class MediaDBWriterStep extends JobStep { + + @StepEntry + public Object[] execute(long itemId, Media media, List mediaFiles, IJobEngine jobEngine) throws Exception { + if (itemId == 0) + throw new JobEngineException("Item ID can't be 0."); + if (media == null) + throw new JobEngineException("Media can't be null."); + + IItemManager manager = jobEngine.getItemManager(); + media.setPersister(manager); + media.setItemId(itemId); + media.setMediaFiles(mediaFiles); + media.setIsPartialEnabled(true); + media.add(); + return null; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaDownloadStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaDownloadStep.java new file mode 100644 index 00000000..5b4704cb --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaDownloadStep.java @@ -0,0 +1,72 @@ +package user.jobengine.server.steps; + +import java.util.UUID; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; +import user.jobengine.db.IItemManager; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; +import user.jobengine.server.JobEngineException; + +public class MediaDownloadStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + StoreUri sourceUri = null; + + @StepEntry + public Object[] execute(MediaFile mediaFile, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + RemoteFile result = null; + final IJobRuntime runtime = jobRuntime; + IItemManager manager = jobEngine.getItemManager(); + Store systemStore = manager.getSystemStore(false); + + if (mediaFile.getStore().getId() == systemStore.getId()) { + logger.info("File is available on system store"); + sourceUri = systemStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL); + result = sourceUri.getRemoteFile(mediaFile.getRelativePath()); + if (result == null) + throw new JobEngineException("RemoteFile is null"); + runtime.incrementProgress(100); + } else { + sourceUri = mediaFile.getStore().getSourceStoreUri(RemoteStoreProtocol.FTP); + result = sourceUri.getRemoteFile(mediaFile.getRelativePath()); + StoreUri target = systemStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL); + if (target == null) + throw new JobEngineException("Target StoreUri is null"); + + sourceUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + runtime.incrementProgress(evt.getProgress()); + logger.info("Progress:" + evt.getProgress()); + } + }); + sourceUri.addStatusListener(new IStatusEventListener() { + @Override + public void statusChanged(StatusEvent evt) { + evt.setCancel(!canContinue()); + } + }); + + result = sourceUri.transferFrom(target, result, UUID.randomUUID().toString()); + } + return new Object[] { result }; + } + + @Override + public void cleanup() { + if (sourceUri != null) + sourceUri.clearListeners(); + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaUploadStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaUploadStep.java new file mode 100644 index 00000000..6bc92ce6 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/MediaUploadStep.java @@ -0,0 +1,75 @@ +package user.jobengine.server.steps; + +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; +import user.jobengine.db.IItemManager; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class MediaUploadStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + StoreUri sourceUri = null; + + @StepEntry + public Object[] execute(StoreUri targetUri, List mediaFiles, IJobEngine jobEngine, + IJobRuntime jobRuntime) throws Exception { + IItemManager manager = jobEngine.getItemManager(); + Store lowresStore = manager.getSystemStore(true); + MediaFile currentMediaFile = null; + if (mediaFiles != null) { + for (MediaFile mediaFile : mediaFiles) { + if (mediaFile.getStoreId() == lowresStore.getId()) { + currentMediaFile = mediaFile; + break; + } + + } + } + + if (currentMediaFile != null) { + Store sourceStore = currentMediaFile.getStore(); + sourceUri = sourceStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL); + if (sourceUri == null) + sourceUri = sourceStore.getSourceStoreUri(RemoteStoreProtocol.FTP); + if (sourceUri != null) { + final IJobRuntime runtime = jobRuntime; + sourceUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + runtime.incrementProgress(evt.getProgress()); + logger.info("Progress:" + evt.getProgress()); + } + }); + sourceUri.addStatusListener(new IStatusEventListener() { + @Override + public void statusChanged(StatusEvent evt) { + evt.setCancel(!canContinue()); + } + }); + + RemoteFile remoteFile = sourceUri.getRemoteFile(currentMediaFile.getRelativePath()); + sourceUri.transferFrom(targetUri, remoteFile, currentMediaFile.getRelativePath()); + } + } + return null; + } + + @Override + public void cleanup() { + if (sourceUri != null) + sourceUri.clearListeners(); + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/NexioDataMinerStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/NexioDataMinerStep.java new file mode 100644 index 00000000..48dff628 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/NexioDataMinerStep.java @@ -0,0 +1,43 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.nexio.NexioDataMiner; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.ProgressEvent; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class NexioDataMinerStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + private IProgressEventListener progressListener; + + @StepEntry + public Object[] execute(IJobEngine jobEngine, final IJobRuntime jobRuntime) { + NexioDataMiner dataMiner = null; + try { + progressListener = createListener(jobRuntime); + dataMiner = new NexioDataMiner(); + dataMiner.addProgressListener(progressListener); + dataMiner.run(); + } catch (Exception e) { + logger.error(e); + } finally { + if (dataMiner != null) + dataMiner.removeProgressListener(progressListener); + } + return null; + } + + private IProgressEventListener createListener(final IJobRuntime jobRuntime) { + return new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + logger.info("Progress changed to " + evt.getProgress() + "%"); + jobRuntime.incrementProgress(evt.getProgress()); + } + }; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/SelenioLowresTranscodeStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/SelenioLowresTranscodeStep.java new file mode 100644 index 00000000..4b3d4d1e --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/SelenioLowresTranscodeStep.java @@ -0,0 +1,193 @@ +package user.jobengine.server.steps; + +import java.net.URL; + +import javax.xml.namespace.QName; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.selenio.wsclient.AudioSource; +import user.commons.selenio.wsclient.Clip; +import user.commons.selenio.wsclient.ClipList; +import user.commons.selenio.wsclient.FileSnapshot; +import user.commons.selenio.wsclient.MediaFile; +import user.commons.selenio.wsclient.State; +import user.commons.selenio.wsclient.TranscodeDestination; +import user.commons.selenio.wsclient.TranscodeMgrWS; +import user.commons.selenio.wsclient.TranscodeMgrWSService; +import user.commons.selenio.wsclient.TranscodeRequest; +import user.commons.selenio.wsclient.TranscodeSource; +import user.commons.selenio.wsclient.TranscodeTask; +import user.commons.selenio.wsclient.VideoSource; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class SelenioLowresTranscodeStep extends JobStep { + + private static final Logger logger = LogManager.getLogger(); + + private TranscodeMgrWS port = null; + private String address = null; //"http://10.10.1.71:44000/TranscodeMgrWS?wsdl"; + private String projectFilePath = null; //"\\\\10.10.1.71\\Data\\Blueprints\\MP4_H264_AAC_v4.zenium"; + //private String sourceFilePath = "\\\\10.10.1.71\\Data\\Input\\test1.mxf"; + + public SelenioLowresTranscodeStep() { + try { + address = System.getProperty("jobengine.selenio.address"); + projectFilePath = System.getProperty("jobengine.selenio.projectfilepath"); + TranscodeMgrWSService service = new TranscodeMgrWSService(new URL(address), + new QName("http://ws.server.mediamanager.digitalrapids.ca/", "TranscodeMgrWSService")); + port = service.getTranscodeMgrWSPort(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @StepEntry + public Object[] execute(MediaFileWrapper wrapper, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + //UNC FILEPATH KELL!!!! + TranscodeRequest transcodeRequest = buildTranscodeRequest(projectFilePath, + //wrapper.getMediaFile().getAbsolutePath() + "\\\\10.10.1.71\\Data\\Input\\test1.mxf"); + TranscodeTask tt = port.submitTranscodeTask(transcodeRequest); + if (tt != null) { + + TranscodeTask ttq = port.getTranscodeTask(tt.getId()); + + //logger.info("Selenio progress is {}", ttq.getProgress()); + + // QUEUED, IN_PROGRESS, COMPLETE, FAILED, CANCELLED, POST_PROCESS, PRE_PROCESS, RESERVED; + while (ttq == null || State.QUEUED.equals(ttq.getState()) || State.IN_PROGRESS.equals(ttq.getState()) + || State.POST_PROCESS.equals(ttq.getState()) || State.PRE_PROCESS.equals(ttq.getState())) { + if (ttq == null) { + logger.error( + "Error in SelenioLowresTranscoderStep: The selenio returns with null for querying task: {}", + tt.getId()); + break; + } + + Double progress = ttq.getProgress(); + if (progress != null) { + logger.info("Selenio progress is {}", progress); + jobRuntime.incrementProgress((int) Math.round(ttq.getProgress() * 100)); + } + Thread.sleep(2000); + ttq = port.getTranscodeTask(tt.getId()); + + } + + if (State.COMPLETE.equals(ttq.getState())) { + + jobRuntime.incrementProgress(100); + + // IItemManager manager = jobEngine.getItemManager(); + // Store lowresSystemStore = manager.getStore("Lowres"); + // FileType ft = manager.getFileType("Lowres video"); + // + // OutputFiles of = ttq.getOutputFiles(); + // List mfList = of.getOutputFiles(); + // if (mfList.size() != 1) { + // throw new Exception( + // "Error in SelenioLowresTranscoderStep! There are more than 1 file in the response: " + // + tt.getId()); + // } + // user.commons.selenio.wsclient.MediaFile selenioMediaFile = mfList.get(0); + // File outFile = new File(selenioMediaFile.getFile()); + // user.jobengine.db.MediaFile mediaFile = manager.createMediaFile(outFile.getName(), ft, + // lowresSystemStore, wrapper.getMedia()); + // mediaFile.add(); + logger.info("SelenioLowresTranscoderStep: The transcoding has been completed for tash: " + tt.getId()); + + } else if (State.FAILED.equals(ttq.getState())) { + logger.error("Error in SelenioLowresTranscoderStep: The selenio failed for task: {} , {}, {}", + tt.getId(), tt.getEncodeDescription(), tt.getStatusDetail()); + } else if (State.CANCELLED.equals(ttq.getState())) { + logger.info("SelenioLowresTranscoderStep: The step has been cancelled for task: {}", tt.getId()); + } + + } else { + logger.error("Error in SelenioLowresTranscoderStep: The selenio returns with null for transcoding request: " + + wrapper.getMediaFile().getAbsolutePath()); + } + + return new Object[] {}; + } + + /** + * Build a TranscodeRequest. Use the values provided by the user. + */ + private TranscodeRequest buildTranscodeRequest(String projectFilePath, String sourceFilePath) + throws java.lang.Exception { + + // Use the TranscodeRequest Transcode Manager class to create a new, empty request. + TranscodeRequest transcodeRequest = new TranscodeRequest(); + + // Get the Stream project or Kayak Transcode Blueprint specified + // by the user. Store the file in a Transcode Manager FileSnapshot object. + // The FileSnapshot can store the path to a file as well as the file's contents. + FileSnapshot project = new FileSnapshot(); + project.setFullPath(projectFilePath); + + // Add the project or blueprint to the transcode request. This file will + // be used to process the media file input source. + transcodeRequest.setProject(project); + + // Create a clip list with the input source files provided by the end user. + // The TranscodeManager ClipList is encapsulated within a TranscodeSource object + // that is added to the TranscodeRequest. + + // Create an empty TranscodeSource object. + TranscodeSource transcodeSource = new TranscodeSource(); + + // Store the input file provided by the end user in a TranscodeManager + // MediaFile object. + MediaFile mediaFile = new MediaFile(); + mediaFile.setFile(sourceFilePath); + + /* + * Though this client only accepts one input file, only clip lists are + * processed by blueprints and projects. The file must + * be encapsulated within a ClipList before it is added to the + * TranscodeRequest. + */ + + // Create an empty Transcode Manager ClipList object. + ClipList clipList = new ClipList(); + + // Create Clip object for each input source file. + Clip clip = new Clip(); + + // A Clip always consists of one video file and at least one + // audio file. Store the source files in AudioSource and VideoSource + // Transcode Manager API objects. + AudioSource audioSource = new AudioSource(); + VideoSource videoSource = new VideoSource(); + + // In this case the client only accepts one file -- a video file. + // Video files can be used as the audio source of a clip as long + // as the file contains both elementary video and audio streams. + // + // Add the file to the AudioSource and VideoSource objects. + audioSource.setMediaFile(mediaFile); + videoSource.setMediaFile(mediaFile); + + // Add the AudioSource and VideoSource objects to the Clip. + // Add the Clip to the ClipList + clip.getAudioSource().add(audioSource); + clip.setVideoSource(videoSource); + clipList.getClip().add(clip); + + // Add the ClipList to the TranscodeSource + transcodeSource.setClipList(clipList); + + // Add the TranscodeSource to the Transcoderequest + transcodeRequest.setTranscodeSource(transcodeSource); + + TranscodeDestination transcodeDestination = new TranscodeDestination(); + transcodeDestination.setOutputWriteDirectory("\\\\10.10.1.26\\mclowres\\www\\video"); + transcodeRequest.setTranscodeDestination(transcodeDestination); + return transcodeRequest; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/SetArchivedStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/SetArchivedStep.java new file mode 100644 index 00000000..a1503f41 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/SetArchivedStep.java @@ -0,0 +1,48 @@ +package user.jobengine.server.steps; + +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; +import user.jobengine.server.JobEngineException; + +public class SetArchivedStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(Media media, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + if (media == null) + throw new JobEngineException("Missing Media parameter."); + IItemManager manager = jobEngine.getItemManager(); + if (manager == null) + throw new JobEngineException("Missing ItemManager."); + List mediaFiles = media.getMediaFiles(); + if (mediaFiles == null || mediaFiles.size() != 1) + throw new JobEngineException("Missing media file(s) from Media record."); + MediaFile mediaFile = null; + for (MediaFile mf : mediaFiles) { + //StoreUri storeUri = mf.getStore().getTargetStoreUri(RemoteStoreProtocol.TSM); + if (mf.getId() > 0) + continue; + mediaFile = mf; + } + if (mediaFile == null) + throw new JobEngineException("Missing archived media file with empty ID from Media record."); + + mediaFile.add(); + + media.setPersister(manager); + media.setArchived(new Timestamp(new Date().getTime())); + media.modify(); + logger.info("Media {} is archived at {}", mediaFile.getRelativePath(), media.getArchived()); + return null; + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupMediaWrapperStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupMediaWrapperStep.java new file mode 100644 index 00000000..e50bbeaa --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupMediaWrapperStep.java @@ -0,0 +1,97 @@ +package user.jobengine.server.steps; + +import java.io.File; +import java.io.IOException; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; +import user.jobengine.db.FileType; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; +import user.jobengine.server.JobEngineException; + +public class TSMBackupMediaWrapperStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + private Media media; + private IItemManager manager; + private File file; + private String sourceFile; + private String sourceFileName; + private Store targetStore; + private StoreUri targetStoreUri; + private FileType fileType; + + private void setAndCheck(MediaFileWrapper wrapper, IJobEngine jobEngine) throws JobEngineException, IOException { + media = wrapper.getMedia(); + if (media == null) + throw new JobEngineException("Missing Media in MediaFileWrapper parameter."); + manager = jobEngine.getItemManager(); + if (manager == null) + throw new JobEngineException("Missing ItemManager."); + file = wrapper.getMediaFile(); + if (file == null) + throw new JobEngineException("Missing File in MediaFileWrapper parameter."); + sourceFile = file.getCanonicalPath(); + if (!file.exists()) + throw new JobEngineException("File not exists: " + sourceFile); + sourceFileName = file.getName(); + targetStore = manager.getSystemStore(false); + if (targetStore == null) + throw new JobEngineException("Missing High-res system store."); + targetStoreUri = targetStore.getSourceStoreUri(RemoteStoreProtocol.TSM); + if (targetStoreUri == null) + throw new JobEngineException("Missing TSM store uri from High-res system store."); + fileType = manager.getFileType("High-res"); + if (fileType == null) + throw new JobEngineException("Missing High-res file type."); + } + + @StepEntry + public Object[] execute(MediaFileWrapper wrapper, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + try { + setAndCheck(wrapper, jobEngine); + + StoreUri sourceUri = manager.createStoreUri(RemoteStoreProtocol.LOCAL, file.getParent()); + + final IJobRuntime runtime = jobRuntime; + sourceUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + runtime.incrementProgress(evt.getProgress()); + } + }); + sourceUri.addStatusListener(new IStatusEventListener() { + @Override + public void statusChanged(StatusEvent evt) { + evt.setCancel(!canContinue()); + } + }); + RemoteFile remoteFile = sourceUri.transferFrom(targetStoreUri, sourceFileName, sourceFileName); + + MediaFile mediaFile = manager.createMediaFile(sourceFileName, fileType, targetStore, media); + media.appendMediaFile(mediaFile); + + manager.mergeItemStructure(wrapper.getItem()); + } catch (Exception e) { + wrapper.getCatchedFile().delete(); + throw e; + } + return new Object[] { wrapper.getItem().getMedias().get(0) }; + } + + @Override + public void cleanup() { + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java new file mode 100644 index 00000000..6864f48f --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java @@ -0,0 +1,158 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class TSMBackupStep extends JobStep { + // @StepEntry + // public Object[] execute(Media media, IJobEngine jobEngine, + // IJobRuntime jobRuntime) throws Exception { + // TSMClient tsm = null; + // tsm = new TSMClient("JobEngine"); + // tsm.connect(null, null); + // log_info("Connected to TSM"); + // try { + // log_info("Trying register filespace"); + // tsm.registerFilespace(File.separator + "JOBENGINE", "JOBENGINE", + // 'C', "JOBENGINE", 10L * 1024L * 1024L * 1024L, 0); + // } catch (Exception e) { + // log_info(e.getMessage()); + // } + // + // IItemManager manager = jobEngine.getItemManager(); + // final IJobRuntime runtime = jobRuntime; + // + // Store systemStore = manager.getSystemStore(false); + // Store mfStore = null; + // MediaFile mediaFile = null; + // for (MediaFile mf : media.getMediaFiles()) { + // mediaFile = mf; + // mfStore = mf.getStore(); + // if (mfStore.getId() == systemStore.getId()) + // break; + // } + // + // if (mediaFile == null) + // throw new Exception("Can not find HIRES media file"); + // if (mfStore == null) + // throw new Exception("Can not find HIRES store"); + // + // String path = mediaFile.getRelativePath(); + // int pos = path.lastIndexOf("/"); + // String fileName = pos > -1 ? path.substring(pos, path.length() - pos) + // : path; + // + // try { + // TSMBackupFileObject backupObject = new TSMBackupFileObject( + // File.separator + "JOBENGINE", File.separator + "JOBENGINE", + // File.separator + fileName); + // StoreUri uri = mfStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL); + // // TODO RemoteFile konverzi�, MediaFile-ba be�p�teni + // + // String sourceFilePath = DirectoryUtils.combine(uri.getFullPath(), + // fileName); + // final File file = new File(sourceFilePath); + // if (!file.exists()) + // throw new Exception("File not exists: " + sourceFilePath); + // final long fileSize = file.length(); + // log_info("Saving: " + sourceFilePath + ", size:" + fileSize); + // backupObject.setLocalFilePath(sourceFilePath); + // backupObject.setListener(new TSMObjectListener() { + // private long transferredBytes; + // private int lastProgress; + // + // public void bytesWorked(long bytes) { + // transferredBytes += bytes; + // int progress = fileSize == 0 ? 100 + // : (int) (transferredBytes * 100 / fileSize); + // if (progress > lastProgress + 4) { + // log_info("incrementProgress: " + progress); + // runtime.incrementProgress(progress); + // lastProgress = progress; + // } + // } + // }); + // runtime.incrementProgress(100); + // tsm.send(backupObject); + // } catch (Exception e) { + // throw new Exception(e); + // } finally { + // tsm.disconnect(); + // log_info("Disconnected"); + // } + // return null; + // } + + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(Media media, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + + RemoteFile result = null; + final IJobRuntime runtime = jobRuntime; + IItemManager manager = jobEngine.getItemManager(); + Store systemStore = manager.getSystemStore(false); + Store mfStore = null; + MediaFile mediaFile = null; + for (MediaFile mf : media.getMediaFiles()) { + mediaFile = mf; + mfStore = mf.getStore(); + if (mfStore.getId() == systemStore.getId()) + break; + } + + if (mediaFile == null) + throw new Exception("Can not find HIRES media file"); + if (mfStore == null) + throw new Exception("Can not find HIRES store"); + + String path = mediaFile.getRelativePath(); + logger.info("Relative path is: " + path); + if (path == null) + throw new Exception("Path is null!"); + int pos = path.lastIndexOf("/"); + // String sourceFileName = pos > -1 ? path.substring(pos, path.length() + // - pos) : path; + String sourceFileName = pos > -1 ? path.substring(pos + 1, path.length()) : path; + logger.info("SourceFileName is: " + sourceFileName); + if (sourceFileName == null) + throw new NullPointerException("Source FileName is null"); + + StoreUri sourceUri = mfStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL); + StoreUri target = new StoreUri(); + target.setProtocol(RemoteStoreProtocol.TSM); + logger.info("Target is: " + target.getProtocol()); + sourceUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + runtime.incrementProgress(evt.getProgress()); + } + }); + sourceUri.addStatusListener(new IStatusEventListener() { + @Override + public void statusChanged(StatusEvent evt) { + evt.setCancel(!canContinue()); + } + }); + result = sourceUri.transferFrom(target, sourceFileName, sourceFileName); + return new Object[] { result }; + } + + @Override + public void cleanup() { + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java new file mode 100644 index 00000000..915ffbf6 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java @@ -0,0 +1,81 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class TSMRestoreStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(Media media, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + + RemoteFile result = null; + final IJobRuntime runtime = jobRuntime; + IItemManager manager = jobEngine.getItemManager(); + Store systemStore = manager.getSystemStore(false); + Store mfStore = null; + MediaFile mediaFile = null; + for (MediaFile mf : media.getMediaFiles()) { + mediaFile = mf; + mfStore = mf.getStore(); + if (mfStore.getId() == systemStore.getId()) + break; + } + + if (mediaFile == null) + throw new Exception("Can not find HIRES media file"); + if (mfStore == null) + throw new Exception("Can not find HIRES store"); + + String path = mediaFile.getRelativePath(); + logger.info("Relative path is: " + path); + if (path == null) + throw new Exception("Path is null!"); + int pos = path.lastIndexOf("/"); + // String sourceFileName = pos > -1 ? path.substring(pos, + // path.length() - pos) : path; + String sourceFileName = pos > -1 ? path.substring(pos + 1, path.length()) : path; + logger.info("SourceFileName is: " + sourceFileName); + if (sourceFileName == null) + throw new NullPointerException("Source FileName is null"); + + StoreUri sourceUri = new StoreUri(); + sourceUri.setProtocol(RemoteStoreProtocol.TSM); + StoreUri target = mfStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL); + logger.info("Target is: " + target.getUri()); + sourceUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + runtime.incrementProgress(evt.getProgress()); + } + }); + sourceUri.addStatusListener(new IStatusEventListener() { + @Override + public void statusChanged(StatusEvent evt) { + evt.setCancel(!canContinue()); + } + }); + result = sourceUri.transferFrom(target, sourceFileName, "restored_" + sourceFileName); + return new Object[] { result }; + } + + @Override + public void cleanup() { + // if (sourceUri != null) + // sourceUri.clearListeners(); + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TemplateStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TemplateStep.java new file mode 100644 index 00000000..aedd21e7 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TemplateStep.java @@ -0,0 +1,17 @@ +package user.jobengine.server.steps; + +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class TemplateStep extends JobStep { + + @StepEntry + public Object[] execute(IJobEngine jobEngine, IJobRuntime jobRuntime) { + try { + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeStep.java new file mode 100644 index 00000000..d92312f7 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeStep.java @@ -0,0 +1,132 @@ +package user.jobengine.server.steps; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.FileTypeInfo; +import user.commons.FileTypeUtils; +import user.commons.ItemSource; +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.rcc.RCCClient; +import user.commons.rcc.RCCJob; +import user.commons.remotestore.DirectoryUtils; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.FileType; +import user.jobengine.db.IItemManager; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Store; +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; +import user.jobengine.server.JobEngineException; + +public class TranscodeStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(RemoteFile file, String transcoderProfile, IJobEngine jobEngine, IJobRuntime jobRuntime) + throws Exception { + if (file == null) + throw new JobEngineException("RemoteFile is null"); + + String transcoderHost = System.getProperty(IJobEngine.RCC_HOST); + RCCClient client = new RCCClient(transcoderHost); + String guid = client.getProfileId(transcoderProfile); + if (guid == null) { + logger.info("Transcoder profile not exists: " + transcoderProfile + ", using default"); + String profile = System.getProperty(IJobEngine.RCC_LOWRES_PROFILE); + logger.info("Profile : " + profile); + profile = StringUtils.strip(profile, "\""); + if (profile == null) + throw new JobEngineException( + "System default lowres profile is not configured (missing argument jobengine.rcc.defaultlowresprofile)"); + guid = client.getProfileId(profile); + if (guid == null) + throw new JobEngineException("Default profile not exists on remote host: " + "\"" + profile + "\""); + } + logger.info("Profile ok."); + IItemManager manager = jobEngine.getItemManager(); + Store systemStore = manager.getSystemStore(false); + Store lowresSystemStore = manager.getSystemStore(true); + logger.info("Stores ok."); + FileTypeInfo fti = FileTypeUtils.get(file.getExtension()); + logger.info("Filetype ok."); + + List mediaFiles = new ArrayList(); + MediaFile hires = new MediaFile(); + hires.setStore(systemStore); + hires.setRelativePath(file.getName()); + + FileType fileType = manager.getFileType(fti.getName()); + hires.setFileType(fileType); + mediaFiles.add(hires); + + if (fti.canTranscode()) { + logger.info("Can transcode ok."); + + StoreUri sourceStoreUri = systemStore.getSourceStoreUri(RemoteStoreProtocol.LOCAL); + if (sourceStoreUri == null) + throw new NullPointerException("Source store is not available."); + logger.info("Source store: " + sourceStoreUri.toString(true)); + + StoreUri targetStoreUri = lowresSystemStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL); + if (targetStoreUri == null) + throw new NullPointerException("Target store is not available."); + logger.info("Target store: " + targetStoreUri.toString(true)); + + String filePath = DirectoryUtils.combine(sourceStoreUri.toString(true), file.getName(), true, false); + logger.info("Source file: " + filePath); + + // For temporary use only!!! + List itemSources = new ArrayList(); + ItemSource itemSource = new ItemSource(); + itemSource.setName(filePath); + itemSources.add(itemSource); + // + + RCCJob job = new RCCJob(client, (new Date()).toString(), null, 0); + if (!job.submit(itemSources, targetStoreUri.toString(true), guid)) + throw new JobEngineException("Can not submit job."); + + while (canContinue()) { + job.refresh(); + if (!job.isRunning()) { + if (job.isSuccess()) { + jobRuntime.incrementProgress(100); + + MediaFile lores = new MediaFile(); + lores.setStore(lowresSystemStore); + lores.setFileType(fileType); + RemoteFile targetFile = job.getTargetFile(); + String name = targetFile.getName(); + name = DirectoryUtils.checkSlash("\\", name, false, false); + if (targetFile != null) + lores.setRelativePath(name); + mediaFiles.add(lores); + } else { + String message = String.format("Job status is %s. Error details: %s", job.getStatus(), + job.getErrorMessage()); + throw new JobEngineException(message); + } + break; + } + logger.info(job.getProgress()); + jobRuntime.incrementProgress(job.getProgress()); + Thread.sleep(2000); + } + + if (!canContinue()) + job.cancel(); + } else { + logger.info("Can not find transcode information for file type: " + file.getExtension()); + jobRuntime.incrementProgress(100); + } + + return new Object[] { mediaFiles }; + } +} diff --git a/server/user.jobengine.osgi.commons/.classpath b/server/user.jobengine.osgi.commons/.classpath new file mode 100644 index 00000000..069739a5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/server/user.jobengine.osgi.commons/.project b/server/user.jobengine.osgi.commons/.project new file mode 100644 index 00000000..18f84bee --- /dev/null +++ b/server/user.jobengine.osgi.commons/.project @@ -0,0 +1,33 @@ + + + user.jobengine.osgi.commons + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.ds.core.builder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/server/user.jobengine.osgi.commons/.settings/org.eclipse.jdt.core.prefs b/server/user.jobengine.osgi.commons/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..295926d9 --- /dev/null +++ b/server/user.jobengine.osgi.commons/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/server/user.jobengine.osgi.commons/.settings/org.eclipse.pde.core.prefs b/server/user.jobengine.osgi.commons/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 00000000..1443b689 --- /dev/null +++ b/server/user.jobengine.osgi.commons/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,5 @@ +#Wed Oct 19 11:23:42 CEST 2011 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false +resolve.requirebundle=false diff --git a/server/user.jobengine.osgi.commons/.tpignore b/server/user.jobengine.osgi.commons/.tpignore new file mode 100644 index 00000000..24d64373 --- /dev/null +++ b/server/user.jobengine.osgi.commons/.tpignore @@ -0,0 +1 @@ +/target/ diff --git a/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF new file mode 100644 index 00000000..496c2a54 --- /dev/null +++ b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF @@ -0,0 +1,43 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Commons +Bundle-SymbolicName: user.jobengine.osgi.commons;singleton:=true +Bundle-Version: 1.0.0 +Import-Package: org.apache.logging.log4j;version="2.8.2", + org.apache.logging.log4j.core;version="2.8.2", + org.jboss.resteasy.client.jaxrs, + org.osgi.framework;version="1.5.0" +DynamicImport-Package: * +Bundle-ClassPath: . +Service-Component: OSGI-INF/nexioAPI.xml, OSGI-INF/octopusAPI.xml +Export-Package: user.commons, + user.commons.logging, + user.commons.nexio, + user.commons.octopus, + user.commons.rcc, + user.commons.remotestore, + user.commons.selenio, + user.commons.selenio.wsclient, + user.commons.server.protocol, + user.commons.server.tcp, + user.commons.strings +Require-Bundle: org.apache.commons.lang;bundle-version="2.4.0", + user.tsm.client;bundle-version="1.2.0", + org.apache.commons.digester;bundle-version="3.2.0";visibility:=reexport, + jcifs;bundle-version="1.3.17", + org.jmock.junit4;bundle-version="2.6.0", + org.junit;bundle-version="4.12.0", + org.jmock;bundle-version="2.6.0", + org.apache.commons.net;bundle-version="3.6.0", + org.apache.commons.beanutils;bundle-version="1.8.3";visibility:=reexport, + com.ibm.nosql;bundle-version="4.19.26", + joda-time;bundle-version="2.2.0", + javax.ws.rs-api;bundle-version="2.0.1", + com.ibm.db2jcc4;bundle-version="4.19.26", + com.microsoft.sqlserver.sqljdbc;bundle-version="6.0.8112", + javax.annotation-api;bundle-version="1.2.0", + org.apache.httpcomponents.httpclient;bundle-version="4.2.6", + org.apache.httpcomponents.httpcore;bundle-version="4.2.5", + org.jboss.resteasy.jaxrs;bundle-version="3.0.11", + org.apache.commons.logging;bundle-version="1.1.1", + org.apache.commons.io;bundle-version="2.2.0" diff --git a/server/user.jobengine.osgi.commons/OSGI-INF/component.xml b/server/user.jobengine.osgi.commons/OSGI-INF/component.xml new file mode 100644 index 00000000..07ca966d --- /dev/null +++ b/server/user.jobengine.osgi.commons/OSGI-INF/component.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/server/user.jobengine.osgi.commons/OSGI-INF/nexioAPI.xml b/server/user.jobengine.osgi.commons/OSGI-INF/nexioAPI.xml new file mode 100644 index 00000000..35f177d6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/OSGI-INF/nexioAPI.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/server/user.jobengine.osgi.commons/OSGI-INF/octopusAPI.xml b/server/user.jobengine.osgi.commons/OSGI-INF/octopusAPI.xml new file mode 100644 index 00000000..36a5199f --- /dev/null +++ b/server/user.jobengine.osgi.commons/OSGI-INF/octopusAPI.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/server/user.jobengine.osgi.commons/build.properties b/server/user.jobengine.osgi.commons/build.properties new file mode 100644 index 00000000..ad9b7e05 --- /dev/null +++ b/server/user.jobengine.osgi.commons/build.properties @@ -0,0 +1,6 @@ +source.. = src/,\ + test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/ diff --git a/server/user.jobengine.osgi.commons/deploy.bat b/server/user.jobengine.osgi.commons/deploy.bat new file mode 100644 index 00000000..0c058dd3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/deploy.bat @@ -0,0 +1 @@ +echo "Futottam" \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/deploy.launch b/server/user.jobengine.osgi.commons/deploy.launch new file mode 100644 index 00000000..492a1866 --- /dev/null +++ b/server/user.jobengine.osgi.commons/deploy.launch @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.commons/launch/TestTSMClient.TestConnect.launch b/server/user.jobengine.osgi.commons/launch/TestTSMClient.TestConnect.launch new file mode 100644 index 00000000..24034817 --- /dev/null +++ b/server/user.jobengine.osgi.commons/launch/TestTSMClient.TestConnect.launch @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.commons/launch/TestTSMClient.launch b/server/user.jobengine.osgi.commons/launch/TestTSMClient.launch new file mode 100644 index 00000000..1aa69f10 --- /dev/null +++ b/server/user.jobengine.osgi.commons/launch/TestTSMClient.launch @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.commons/pom.xml b/server/user.jobengine.osgi.commons/pom.xml new file mode 100644 index 00000000..c02e675f --- /dev/null +++ b/server/user.jobengine.osgi.commons/pom.xml @@ -0,0 +1,14 @@ + + + + ../-modules + user.jobengine + MediaCube + 1.0.0 + + 4.0.0 + user.jobengine.osgi.commons + eclipse-plugin + 1.0.0 + \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/BaseType.java b/server/user.jobengine.osgi.commons/src/user/commons/BaseType.java new file mode 100644 index 00000000..a0395da8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/BaseType.java @@ -0,0 +1,17 @@ +package user.commons; + +public enum BaseType { + BIGINT, + BINARY, + BOOL, + CHAR, + DATETIME, + DECIMAL, + DOUBLE, + DOMAIN, + INT, + REAL, + TIME, + TEXT, + VARCHAR +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/Bytes.java b/server/user.jobengine.osgi.commons/src/user/commons/Bytes.java new file mode 100644 index 00000000..1789422a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/Bytes.java @@ -0,0 +1,35 @@ +package user.commons; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.util.Arrays; + +public class Bytes { + public static byte[] concatAll(byte[] first, byte[]... rest) { + int totalLength = first.length; + for (byte[] array : rest) { + totalLength += array.length; + } + byte[] result = Arrays.copyOf(first, totalLength); + int offset = first.length; + for (byte[] array : rest) { + System.arraycopy(array, 0, result, offset, array.length); + offset += array.length; + } + return result; + } + + public static byte[] toByteArray(long value) { + byte[] result = null; + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + DataOutputStream dos = new DataOutputStream(bos); + try { + dos.writeLong(value); + dos.flush(); + } catch (Exception e) { + e.printStackTrace(); + } + result = bos.toByteArray(); + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/CalendarUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/CalendarUtils.java new file mode 100644 index 00000000..f6202d32 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/CalendarUtils.java @@ -0,0 +1,316 @@ +package user.commons; + +import java.text.DateFormatSymbols; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +public class CalendarUtils { + private static Locale locale = Locale.getDefault(); + public static final String DATETIME_FORMAT_EN = "dd. MMM yyyy., EEE hh:mm a"; + public static final String DATETIME_FORMAT_HU = "yyyy. MMM dd., EEE HH:mm"; + public static final String DATETIME_SHORT_FORMAT_EN = "dd/MM/yyyy HH:mm"; + public static final String DATETIME_SHORT_FORMAT_HU = "yyyy.MM.dd HH:mm"; + public static final String DATE_FORMAT_EN = "dd. MMM yyyy."; + public static final String DATE_FORMAT_HU = "yyyy. MMM dd."; + public static final String DATE_WITH_DAY_FORMAT_EN = "dd. MMM yyyy., EEE"; + public static final String DATE_WITH_DAY_FORMAT_HU = "yyyy. MMMM dd., EEEE"; + public static final String YEAR_MONTH_FORMAT_EN = "MMMM yyyy."; + public static final String YEAR_MONTH_FORMAT_HU = "yyyy. MMM"; + public static final String DATETIME_FORMAT_HU_SEC = "yyyy. MMM dd., EEE HH:mm:ss"; + public static final String DATETIME_FORMAT_HU_SHORT_SEC = "yyyy.MM.dd HH:mm:ss"; + + public static Calendar createCalendar(Calendar base) { + Calendar result = getInstance(); + if (base != null) + result.setTime(base.getTime()); + return result; + } + + public static Calendar createCalendar(Calendar datePart, Calendar timePart) { + Calendar result = null; + if (timePart == null) { + result = createCalendar(datePart); + } else { + result = createCalendar(timePart.get(Calendar.HOUR), timePart.get(Calendar.MINUTE), + timePart.get(Calendar.SECOND), datePart); + } + return result; + } + + public static Calendar createCalendar(Calendar datePart, Date timePart) { + return createCalendar(datePart, createCalendar(timePart)); + } + + public static Calendar createCalendar(Date base) { + Calendar result = getInstance(); + if (base != null) + result.setTime(base); + return result; + } + + public static Calendar createCalendar(int hour, int minute) { + return createCalendar(hour, minute, null); + } + + public static Calendar createCalendar(int hour, int minute, Calendar base) { + return createCalendar(hour, minute, 0, base); + } + + public static Calendar createCalendar(int year, int month, int day) { + return createCalendar(year, month, day, 0, 0); + } + + public static Calendar createCalendar(int hour, int minute, int second, Calendar base) { + Calendar result = getInstance(); + if (base != null) + result.setTime(base.getTime()); + resetTime(result, hour, minute, second); + return result; + } + + public static Calendar createCalendar(int year, int month, int day, int hour, int minute) { + Calendar result = getInstance(); + result.set(Calendar.YEAR, year); + result.set(Calendar.MONTH, month); + result.set(Calendar.DAY_OF_MONTH, day); + resetTime(result, hour, minute); + return result; + } + + public static Calendar createCalendar(long packedTime) { + return createCalendar(packedTime, null); + } + + public static Calendar createCalendar(long packedTime, Calendar base) { + int hour = (int) packedTime / 60; + int minute = (int) packedTime % 60; + return createCalendar(hour, minute, base); + } + + public static Calendar createCalendar(String dateTime) throws ParseException { + Calendar result = getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat(DATETIME_FORMAT_HU_SHORT_SEC); + Date parsed = sdf.parse(dateTime); + result.setTime(parsed); + return result; + } + + public static Calendar createMonthZeroCalendar(Calendar base) { + return createMonthZeroCalendar(base == null ? null : base.getTime()); + } + + public static Calendar createMonthZeroCalendar(Date base) { + Calendar result = createZeroCalendar(base); + int dayIndex = getMonthDay(result); + result.add(Calendar.DAY_OF_YEAR, -1 * dayIndex + 1); + return result; + } + + public static Calendar createWeekZeroCalendar(Calendar base) { + return createWeekZeroCalendar(base == null ? null : base.getTime()); + } + + public static Calendar createWeekZeroCalendar(Date base) { + Calendar result = createZeroCalendar(base); + result.set(Calendar.DAY_OF_WEEK, result.getFirstDayOfWeek()); + return result; + } + + public static Calendar createZeroCalendar() { + return createZeroCalendar((Date) null); + } + + public static Calendar createZeroCalendar(Calendar base) { + return createZeroCalendar(base == null ? null : base.getTime()); + } + + public static Calendar createZeroCalendar(Date base) { + Calendar result = createCalendar(base); + resetTime(result, 0, 0); + return result; + } + + public static int distanceInMinutes(Calendar date1, Calendar date2) { + // Joda + // DateTime dt1 = new DateTime(date1.getTime()); + // DateTime dt2 = new DateTime(date2.getTime()); + // int result = Minutes.minutesBetween(dt1, dt2).getMinutes(); + // if (result < 0) + // result = -1 * result; + // + // return result; + + long distance = 0; + if (date2 != null && date1 != null) { + distance = date1.getTimeInMillis() - date2.getTimeInMillis(); + if (distance < 0) + distance = -1 * distance; + } + return (int) (distance / (60 * 1000)); + } + + public static boolean equals(Calendar calendar1, Calendar calendar2) { + boolean result = calendar1 == null && calendar2 == null; + if (!result && calendar1 != null && calendar2 != null) + result = calendar1.equals(calendar2); + return result; + } + + public static int getDayIndex(Calendar calendar, Locale locale) { + int result = calendar.get(Calendar.DAY_OF_WEEK) - 2; + if (result < 0) + result = 6; + return result; + } + + public static long getEndOfDate(Calendar base) { + long result = 0; + if (base != null) { + base.set(Calendar.HOUR, base.getActualMaximum(Calendar.HOUR)); + base.set(Calendar.MINUTE, base.getActualMaximum(Calendar.MINUTE)); + result = base.getTimeInMillis(); + } + return result; + } + + public static Calendar getInstance() { + return Calendar.getInstance(); + } + + public static int getMonth(Calendar calendar) { + return calendar.get(Calendar.MONTH); + } + + public static int getMonthDay(Calendar calendar) { + return calendar.get(Calendar.DAY_OF_MONTH); + } + + public static List getShortMonths() { + List result = new ArrayList<>(); + DateFormatSymbols symbols = new DateFormatSymbols(locale); + String[] shortMonths = symbols.getShortMonths(); + for (String month : shortMonths) { + if (month != null && month.length() > 0) + result.add(month); + } + return result; + } + + public static List getShortWeekdays() { + List result = new ArrayList<>(); + DateFormatSymbols symbols = new DateFormatSymbols(locale); + String[] shortWeekdays = symbols.getShortWeekdays(); + for (String day : shortWeekdays) { + if (day != null && day.length() > 0) + result.add(day); + } + return result; + } + + public static long getStartOfDate(Calendar base) { + long result = 0; + if (base != null) { + base.set(Calendar.HOUR, base.getActualMinimum(Calendar.HOUR)); + base.set(Calendar.MINUTE, base.getActualMinimum(Calendar.MINUTE)); + result = base.getTimeInMillis(); + } + return result; + } + + public static int getYear(Calendar calendar) { + return calendar.get(Calendar.YEAR); + } + + public static boolean isFuture(Calendar base) { + Calendar now = getInstance(); + return now.compareTo(base) < 0; + } + + public static boolean isOverlapping(Calendar start1, Calendar end1, Calendar start2, Calendar end2) { + return start1.before(end2) && start2.before(end1); + } + + public static boolean isSameDay(Calendar left, Calendar right) { + return left.get(Calendar.YEAR) == right.get(Calendar.YEAR) + && left.get(Calendar.DAY_OF_YEAR) == right.get(Calendar.DAY_OF_YEAR); + } + + public static boolean isToday(Calendar base) { + Calendar now = getInstance(); + return now.get(Calendar.YEAR) == base.get(Calendar.YEAR) && now.get(Calendar.MONTH) == base.get(Calendar.MONTH) + && now.get(Calendar.DAY_OF_MONTH) == base.get(Calendar.DAY_OF_MONTH); + } + + public static void resetTime(Calendar calendar, int hour, int minute) { + resetTime(calendar, hour, minute, 0); + } + + public static void resetTime(Calendar calendar, int hour, int minute, int second) { + calendar.set(Calendar.HOUR, hour); + calendar.set(Calendar.HOUR_OF_DAY, hour); + calendar.set(Calendar.MINUTE, minute); + calendar.set(Calendar.SECOND, second); + calendar.set(Calendar.MILLISECOND, 0); + } + + public static String toDateString(Calendar calendar) { + String pattern = locale.getLanguage().equals("hu") ? DATE_FORMAT_HU : DATE_FORMAT_EN; + return toString(calendar, pattern); + } + + public static String toDateWithDayString(Calendar calendar) { + String pattern = locale.getLanguage().equals("hu") ? DATE_WITH_DAY_FORMAT_HU : DATE_WITH_DAY_FORMAT_EN; + return toString(calendar, pattern); + } + + public static String toDateWithDayString(Calendar calendar, Locale locale) { + String pattern = locale.getLanguage().equals("hu") ? DATE_WITH_DAY_FORMAT_HU : DATE_WITH_DAY_FORMAT_EN; + return toString(calendar, pattern, locale); + } + + public static String toHunString(Calendar calendar) { + SimpleDateFormat format = new SimpleDateFormat(DATETIME_FORMAT_HU_SEC); + return calendar == null ? "Calendar is null" : format.format(calendar.getTime()); + } + + public static String toShortString(Calendar calendar) { + String pattern = locale.getLanguage().equals("hu") ? DATETIME_SHORT_FORMAT_HU : DATETIME_SHORT_FORMAT_EN; + return toString(calendar, pattern); + } + + public static String toShortString(Calendar calendar, Locale locale) { + String pattern = locale.getLanguage().equals("hu") ? DATETIME_SHORT_FORMAT_HU : DATETIME_SHORT_FORMAT_EN; + return toString(calendar, pattern, locale); + } + + public static String toString(Calendar calendar) { + String pattern = locale.getLanguage().equals("hu") ? DATETIME_FORMAT_HU : DATETIME_FORMAT_EN; + return toString(calendar, pattern); + } + + public static String toString(Calendar calendar, Locale locale) { + String pattern = locale.getLanguage().equals("hu") ? DATETIME_FORMAT_HU : DATETIME_FORMAT_EN; + return toString(calendar, pattern, locale); + } + + public static String toString(Calendar calendar, String pattern) { + SimpleDateFormat format = new SimpleDateFormat(pattern, locale); + return calendar == null ? "Calendar is null" : format.format(calendar.getTime()); + } + + public static String toString(Calendar calendar, String pattern, Locale locale) { + SimpleDateFormat format = new SimpleDateFormat(pattern, locale); + return calendar == null ? "Calendar is null" : format.format(calendar.getTime()); + } + + public static String toYearMonthString(Calendar calendar) { + String pattern = locale.getLanguage().equals("hu") ? YEAR_MONTH_FORMAT_HU : YEAR_MONTH_FORMAT_EN; + return toString(calendar, pattern); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/CommonsException.java b/server/user.jobengine.osgi.commons/src/user/commons/CommonsException.java new file mode 100644 index 00000000..c7b2c237 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/CommonsException.java @@ -0,0 +1,12 @@ +package user.commons; + +/** + * Commons kivétel. + */ +public class CommonsException extends RuntimeException { + private static final long serialVersionUID = -2357518580850559771L; + + public CommonsException(String message) { + super(message); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/CommonsProperties.java b/server/user.jobengine.osgi.commons/src/user/commons/CommonsProperties.java new file mode 100644 index 00000000..26fc3a9a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/CommonsProperties.java @@ -0,0 +1,89 @@ +package user.commons; + +import java.util.Hashtable; +import java.util.Map; + +/** + * Hashtable alapú paraméter tároló. + * A paraméterek típus helyesen írhatóak be és vehetõek ki. + */ +public class CommonsProperties { + static public void checkParameter(String name, double parameter) { + if (parameter == 0) { + String msg = name + " cannot be 0."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, int parameter) { + if (parameter == 0) { + String msg = name + " cannot be 0."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, long parameter) { + if (parameter == 0) { + String msg = name + " cannot be 0."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, Object parameter) { + if (parameter == null) { + String msg = name + " cannot be null."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, String parameter) { + if (parameter == null) { + String msg = name + " cannot be null."; + throw new NullPointerException(msg); + } + if (parameter.trim().equals("")) { + String msg = name + " cannot be empty."; + throw new IllegalArgumentException(msg); + } + } + + protected Map properties = new Hashtable(); + + public void add(String key, Object value) { + properties.put(key, value); + } + + public Object get(String key) { + if (properties.containsKey(key) == false) + throw new CommonsException("Key not available: " + key); + return properties.get(key); + } + + public boolean getBool(String key) { + Object value = get(key); + if (!(value instanceof Boolean)) + throw new CommonsException("Property doesn't contains Boolean value: " + key); + return Boolean.parseBoolean(value.toString()); + } + + public int getInt(String key) { + Object value = get(key); + if (!(value instanceof Integer)) + throw new CommonsException("Property doesn't contains Integer value." + key); + return Integer.parseInt(value.toString()); + } + + public long getLong(String key) { + Object value = get(key); + if (!(value instanceof Long)) + throw new CommonsException("Property doesn't contains Long value." + key); + return Long.parseLong(value.toString()); + } + + public String getString(String key) { + Object value = get(key); + if (!(value instanceof String)) + throw new CommonsException("Property doesn't contains String value." + key); + return value.toString(); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/EntityBase.java b/server/user.jobengine.osgi.commons/src/user/commons/EntityBase.java new file mode 100644 index 00000000..aed36025 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/EntityBase.java @@ -0,0 +1,107 @@ +package user.commons; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class EntityBase implements IEntityBase { + protected long id; + protected final static Logger logger = LogManager.getLogger(); + protected IEntityPersister persister; + + @Override + public void add() { + if (persister != null) + persister.add(this); + else { + throw new NullPointerException("Persister cannot be null!"); + } + } + + protected void checkParameter(String name, BaseType type) { + if (type == null) + throw new NullPointerException(name + " cannot be null."); + } + + void checkParameter(String name, double parameter) { + if (parameter == 0) + throw new IllegalArgumentException(name + " cannot be 0."); + } + + protected void checkParameter(String name, IEntityBase entity) { + checkParameter(name, entity, false); + } + + protected void checkParameter(String name, IEntityBase entity, boolean nonZero) { + if (entity == null) + throw new NullPointerException(name + " cannot be null."); + if (nonZero == true) { + if (entity.getId() != 0) + throw new IllegalArgumentException("Appending " + name + " with non 0 ID is prohibited."); + } else { + if (entity.getId() == 0) + throw new IllegalArgumentException(name + " ID cannot be 0."); + } + } + + public void checkParameter(String name, long parameter) { + checkParameter(name, parameter, false); + } + + @Override + public void checkParameter(String name, long parameter, boolean nonZero) { + if (nonZero == true) { + if (parameter != 0) + throw new IllegalArgumentException(name + " must be 0."); + } else { + if (parameter == 0) + throw new IllegalArgumentException(name + " cannot be 0."); + } + } + + protected void checkParameter(String name, String parameter) { + if (parameter == null) + throw new NullPointerException(name + " cannot be null."); + if (parameter.trim().equals("")) + throw new IllegalArgumentException(name + " cannot be empty."); + } + + @Override + public long getId() { + return id; + } + + @Override + public void modify() { + if (persister != null) + persister.modify(this); + else { + throw new NullPointerException("Persister cannot be null!"); + } + + } + + @Override + public void remove() { + if (persister != null) + persister.remove(this); + else { + throw new NullPointerException("Persister cannot be null!"); + } + } + + @Override + public void setId(long id) { + this.id = id; + } + + @Override + public void setPersister(IEntityPersister persister) { + this.persister = persister; + } + /* + @Override + public int compareTo(Object arg0) { + return 0; + } + */ +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/FileTypeInfo.java b/server/user.jobengine.osgi.commons/src/user/commons/FileTypeInfo.java new file mode 100644 index 00000000..e3ab88ca --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/FileTypeInfo.java @@ -0,0 +1,19 @@ +package user.commons; + +public class FileTypeInfo { + private final String name; + private final boolean canTranscode; + + FileTypeInfo(String name, boolean canTranscode) { + this.name = name; + this.canTranscode = canTranscode; + } + + public String getName() { + return name; + } + + public boolean canTranscode() { + return canTranscode; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/FileTypeUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/FileTypeUtils.java new file mode 100644 index 00000000..f51e9fa6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/FileTypeUtils.java @@ -0,0 +1,44 @@ +package user.commons; + +import java.util.HashMap; +import java.util.Map; + +@SuppressWarnings("serial") +public class FileTypeUtils { + + private static Map fileTypes; + private static FileTypeInfo defaultFileTypeInfo; + + public static String FILETYPE_FILM = "film"; + public static String FILETYPE_MUSIC = "hanganyag"; + public static String FILETYPE_OTHER = "egyéb"; + static { + fileTypes = new HashMap() { + { + put("avi", new FileTypeInfo(FILETYPE_FILM, true)); + put("mpg", new FileTypeInfo(FILETYPE_FILM, true)); + put("mp4", new FileTypeInfo(FILETYPE_FILM, true)); + put("mkv", new FileTypeInfo(FILETYPE_FILM, true)); + put("mpeg", new FileTypeInfo(FILETYPE_FILM, true)); + put("h264", new FileTypeInfo(FILETYPE_FILM, true)); + put("mov", new FileTypeInfo(FILETYPE_FILM, true)); + put("ts", new FileTypeInfo(FILETYPE_FILM, true)); + put("mxf", new FileTypeInfo(FILETYPE_FILM, true)); + put("wav", new FileTypeInfo(FILETYPE_MUSIC, false)); + put("mp3", new FileTypeInfo(FILETYPE_MUSIC, false)); + } + }; + + defaultFileTypeInfo = new FileTypeInfo(FILETYPE_OTHER, false); + } + + public static FileTypeInfo get(String extension) { + FileTypeInfo result = defaultFileTypeInfo; + if (extension != null) { + String value = extension.toLowerCase(); + if (fileTypes.containsKey(value)) + result = fileTypes.get(value); + } + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/IEntityBase.java b/server/user.jobengine.osgi.commons/src/user/commons/IEntityBase.java new file mode 100644 index 00000000..c157493f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/IEntityBase.java @@ -0,0 +1,56 @@ +package user.commons; + +/** + * Az adatbázis modell entitások alap olytálya. + * + * @author User + * + * Ahol erre szukseg van ott ezek a beanek inkabb implementaljak + * maguknak a Comparable interfacet + * extends Comparable + * + */ +public interface IEntityBase { + void setPersister(IEntityPersister persister); + + /** + * Az adatbázisban létrehoz egy új entitást. + */ + void add(); + + /** + * Visszaadja az entitás azonosítóját + * + * @return long azonosító + */ + long getId(); + + /** + * Az adatbázisban módosít egy már létezõ objektumot. + */ + void modify(); + + /** + * Az adatbázisból eltávolít egy objektumot. + */ + void remove(); + + /** + * A kapott id alapján beállítja az entitás azonosítóját. + * + * @param id + */ + void setId(long id); + + /** + * A bementi paramétert ellenõrzi le. Amennyiben a nonZero igaz, akkor a + * paraméternek nullának kell lenni, Ha nonZero hamis, akkor a paraméternek + * nullától különbözõnek kell lenni. + * + * @param name + * @param parameter + * @param nonZero + * @throws IllegalArgumentException + */ + void checkParameter(String name, long parameter, boolean nonZero); +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/IEntityPersister.java b/server/user.jobengine.osgi.commons/src/user/commons/IEntityPersister.java new file mode 100644 index 00000000..c4865e50 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/IEntityPersister.java @@ -0,0 +1,40 @@ +package user.commons; + +public interface IEntityPersister { + + /*** + * Az adatb�zisban l�trehoz egy �j entit�st + * + * @param entity + * Perziszt�land� objektum + */ + void add(IEntityBase entity); + + /*** + * Elk�r az adatb�zisb�l egy objektumot + * + * @param classInfo + * Az objektum t�pusa + * @param id + * Egyedi azonos�t� + * @return Perziszt�lt objektum p�ld�ny + */ + IEntityBase get(Class classInfo, long id); + + /*** + * Az adatb�zisban m�dos�t egy m�r l�tez� objektumot + * + * @param entity + * A perziszt�land� objektum + */ + void modify(IEntityBase entity); + + /*** + * Elt�vol�t egy objektumot az adatb�zisb�l + * + * @param entity + * Az elt�vol�tand� objektum + */ + void remove(IEntityBase entity); + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/IJob.java b/server/user.jobengine.osgi.commons/src/user/commons/IJob.java new file mode 100644 index 00000000..5539265f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/IJob.java @@ -0,0 +1,58 @@ +package user.commons; + +import java.sql.Timestamp; +import java.util.Map; + +public interface IJob extends IEntityBase { + + String getDescription(); + + Timestamp getFinished(); + + String getName(); + + String getOwner(); + + long getParentJobId(); + + int getPriority(); + + int getProgress(); + + Timestamp getScheduledTime(); + + JobStatus getStatus(); + + Timestamp getSubmitted(); + + String getTemplate(); + + void IncrementPriority(); + + void NotifyUpdate(); + + void setDescription(String description); + + void setFinished(Timestamp finished); + + void setName(String name); + + void setOwner(String owner); + + void setParameters(Map parameters); + + void setParentJobId(long parentJobId); + + void setPriority(int priority); + + void setProgress(int progress); + + void setScheduledTime(Timestamp scheduledTime); + + void setStatus(JobStatus status); + + void setSubmitted(Timestamp submitted); + + void setTemplate(String template); + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ItemSource.java b/server/user.jobengine.osgi.commons/src/user/commons/ItemSource.java new file mode 100644 index 00000000..8d56ff96 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ItemSource.java @@ -0,0 +1,33 @@ +package user.commons; + +public class ItemSource extends Syncable { + + private String name = null; + private long[] tcIn; + private long[] tcOut; + + public long[] getTcIn() { + return tcIn; + } + + public void setTcIn(long[] tcIn) { + this.tcIn = tcIn; + } + + public long[] getTcOut() { + return tcOut; + } + + public void setTcOut(long[] tcOut) { + this.tcOut = tcOut; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/Job.java b/server/user.jobengine.osgi.commons/src/user/commons/Job.java new file mode 100644 index 00000000..d0f18f66 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/Job.java @@ -0,0 +1,179 @@ +package user.commons; + +import java.sql.Timestamp; +import java.util.Map; +import java.util.concurrent.atomic.AtomicLong; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +public class Job extends Syncable implements IJob, Comparable { + + protected final static AtomicLong counter1 = new AtomicLong(); + protected volatile int priority; + + protected String name = null; + protected String owner = null; + protected volatile JobStatus status = null; + protected volatile String description = null; + protected String template = null; + protected volatile Timestamp submitted = null; + protected volatile Timestamp finished = null; + protected volatile int progress; + private Timestamp scheduledTime; + private long parentJobId; + + public Job() { + priority = 0; + } + + /* + @Override + public int compareTo(IJob other) { + int res = 0; + // if (other.getPriority2() != priority2) + // res = (priority2 < other.getPriority2() ? 1 : -1); + // else + // res = (priority1 < other.getPriority1() ? -1 : 1); + return res; + } + */ + /** + * 1. szempont prioritas + * 2. szempont azonos prioritasnal a rogzites datuma + */ + @Override + public int compareTo(IJob job0) { + int ret = (this.priority - job0.getPriority()); + if ((ret == 0) && (this.submitted != null) && (job0.getSubmitted() != null)) { + ret = (int) (job0.getSubmitted().getTime() - this.submitted.getTime()); + } + return ret; + } + + @Override + public String getDescription() { + return description; + } + + @Override + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getFinished() { + return finished; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getOwner() { + return owner; + } + + @Override + public long getParentJobId() { + return parentJobId; + } + + @Override + public int getPriority() { + return priority; + } + + @Override + public int getProgress() { + return progress; + } + + @Override + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getScheduledTime() { + return scheduledTime; + } + + @Override + public JobStatus getStatus() { + return status; + } + + @Override + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getSubmitted() { + return submitted; + } + + @Override + public String getTemplate() { + return template; + } + + @Override + public void IncrementPriority() { + priority++; + } + + @Override + public void NotifyUpdate() { + } + + @Override + public void setDescription(String description) { + this.description = description; + } + + @Override + public void setFinished(Timestamp finished) { + this.finished = finished; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public void setOwner(String owner) { + this.owner = owner; + } + + @Override + public void setParameters(Map parameters) { + } + + @Override + public void setParentJobId(long parentJobId) { + this.parentJobId = parentJobId; + } + + @Override + public void setPriority(int priority) { + this.priority = priority; + } + + @Override + public void setProgress(int progress) { + this.progress = progress; + } + + @Override + public void setScheduledTime(Timestamp scheduledTime) { + this.scheduledTime = scheduledTime; + } + + @Override + public void setStatus(JobStatus status) { + this.status = status; + } + + @Override + public void setSubmitted(Timestamp submitted) { + this.submitted = submitted; + } + + @Override + public void setTemplate(String template) { + this.template = template; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/JobStatus.java b/server/user.jobengine.osgi.commons/src/user/commons/JobStatus.java new file mode 100644 index 00000000..3715d823 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/JobStatus.java @@ -0,0 +1,59 @@ +package user.commons; + +/** + * Folyamat állapota. + */ +public enum JobStatus { + /** + * Futtatható - a folyamat az ütemező várakozási sorában található, az + * ütemező a megfelelő időben futtatja a gépi kódú utasításokat. + */ + RUNABLE(0x0001), + /** + * Felfüggesztett - a folyamat egy manuális felfüggesztés-kérés hatására + * felfüggesztett állapotba került. + */ + SUSPENDED(0x0002), + /** + * Vége - a folyamat futása befejeződött. + */ + FINISHED(0x0004), + /** + * Végrehajtás alatt - a folyamat végrehajtó futtatja a lépést. + */ + EXECUTING(0x0008), + /** + * Megszakított állapot. + */ + CANCELED(0x0010), + /** + * Végrehajtóra vár - a folyamat aktuális utasítása végrehajtót igényel, + * annak várakozási sorában található. + */ + WAIT_EXECUTOR(0x0101), + /** + * Felfüggesztésre vár - a folyamat felfüggesztés kérelmet kapott, de még + * nem történt meg a felfüggesztés. + */ + WAIT_SUSPEND(0x0102), + /** + * Válaszra vár - a folyamat egy felhasználói üzenet végrehajtása után, + * annak megválaszolására vár. + */ + WAIT_USERMESSAGE(0x0104), + /** + * Megszakításra vár - a folyamat megszakítási kérelmet kapott, annak + * lefutását várja. A megszakítási folyamat eredménye CANCELED állapot lesz. + */ + WAIT_CANCEL(0x0108); + + private final int value; + + JobStatus(int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ListUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/ListUtils.java new file mode 100644 index 00000000..b8e117c8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ListUtils.java @@ -0,0 +1,128 @@ +package user.commons; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ListUtils { + private final static Logger logger = LogManager.getLogger(); + private static final String METHOD_GETID = "getId"; + + public interface IMapKeyMaker { + K getKey(T item); + } + + public static List addAll(List target, Collection source) { + List result = target; + if (!isEmpty(source)) { + if (result == null) + result = new ArrayList<>(); + result.addAll(source); + } + + return result; + } + + @SuppressWarnings("unchecked") + + public static List cast(Collection collection) { + return (List) (List) collection; + } + + public static boolean contains(Collection collection, T item) { + return indexOf(collection, item) > -1; + } + + public static T get(Collection collection, T item) { + T result = null; + try { + long id = getId(item); + for (T current : collection) { + if (getId(current) == id) { + result = current; + break; + } + } + } catch (Exception e) { + logger.error(e.getMessage()); + } + return result; + } + + private static long getId(Object pojo) throws NoSuchMethodException, SecurityException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException { + Method method = pojo.getClass().getMethod(METHOD_GETID); + long result = (long) method.invoke(pojo); + return result; + } + + public static int indexOf(Collection collection, long id) { + int result = -1; + try { + int index = 0; + for (T current : collection) { + if (getId(current) == id) { + result = index; + break; + } + index++; + } + } catch (Exception e) { + logger.error(e.getMessage()); + } + return result; + } + + public static int indexOf(Collection collection, T item) { + int result = -1; + try { + long id = getId(item); + result = indexOf(collection, id); + } catch (Exception e) { + logger.error(e.getMessage()); + } + return result; + } + + public static boolean isEmpty(Collection collection) { + return collection == null || collection.isEmpty(); + } + + public static boolean isEmpty(Map map) { + return map == null || map.isEmpty(); + } + + public static ConcurrentHashMap map(Collection collection, IMapKeyMaker keyMaker) { + ConcurrentHashMap result = null; + if (collection != null && keyMaker != null) { + result = new ConcurrentHashMap<>(); + for (T item : collection) + result.put(keyMaker.getKey(item), item); + } + return result; + } + + public static void replace(List collection, int index, T item) { + collection.remove(index); + collection.add(index, item); + } + + public static Map asMap(Object... items) throws Exception { + Map result = new HashMap<>(); + if (items.length % 2 != 0) + throw new Exception("Even number of parameters is required."); + for (int i = 0; i < items.length; i = i + 2) { + result.put(String.valueOf(items[i]), items[i + 1]); + } + return result; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/RemoteFile.java b/server/user.jobengine.osgi.commons/src/user/commons/RemoteFile.java new file mode 100644 index 00000000..32cf46a4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/RemoteFile.java @@ -0,0 +1,66 @@ +package user.commons; + +import java.io.Serializable; +import java.sql.Timestamp; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +@SuppressWarnings("serial") +public class RemoteFile extends EntityBase implements Serializable { + private String name; + private Timestamp created; + private Timestamp modify; + private long size; + private boolean isFolder = false;; + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return created; + } + + public boolean getIsFolder() { + return isFolder; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getModify() { + return modify; + } + + public String getName() { + return name; + } + + public long getSize() { + return size; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public void setIsFolder(boolean isFolder) { + this.isFolder = isFolder; + } + + public void setModify(Timestamp modify) { + this.modify = modify; + } + + public void setName(String name) { + this.name = name; + } + + public void setSize(long size) { + this.size = size; + } + + public String getExtension() { + String result = null; + if (name != null) { + if (name.contains(".")) + result = name.substring(name.lastIndexOf(".") + 1); + } + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/SequenceGenerator.java b/server/user.jobengine.osgi.commons/src/user/commons/SequenceGenerator.java new file mode 100644 index 00000000..47f5e5ac --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/SequenceGenerator.java @@ -0,0 +1,31 @@ +package user.commons; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; + +public class SequenceGenerator { + static private String persistFile = "c:\\id.generator"; + static private long id = 0; + + static public long getId() { + try { + DataInputStream inStream = new DataInputStream(new FileInputStream(persistFile)); + id = inStream.readLong(); + inStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + id++; + + try { + DataOutputStream outStream = new DataOutputStream(new FileOutputStream(persistFile)); + outStream.writeLong(id); + } catch (Exception e) { + e.printStackTrace(); + } + return id; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/StoreUri.java b/server/user.jobengine.osgi.commons/src/user/commons/StoreUri.java new file mode 100644 index 00000000..d6870457 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/StoreUri.java @@ -0,0 +1,346 @@ +package user.commons; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Serializable; +import java.util.List; + +import javax.swing.event.EventListenerList; + +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.remotestore.DeliveryMethod; +import user.commons.remotestore.DirectoryUtils; +import user.commons.remotestore.IDirectoryLister; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.IStatusEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteFileHandler; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.StatusEvent; + +@SuppressWarnings("serial") +public class StoreUri extends EntityBase implements Serializable { + private final static Logger logger = LogManager.getLogger(); + private final int BUFFER_SIZE = 1000000; + private String uri = null; + private long storeId = 0; + private boolean isStream = false; + private boolean isSource = false; + private boolean isTarget = false; + private String filter; + private String userName; + private String password; + private String rootPath; + private String currentPath; + private Integer portNumber; + private RemoteStoreProtocol protocol; + private DeliveryMethod delivery; + private EventListenerList progressListenerList; + private EventListenerList statusListenerList; + private int percent; + + public StoreUri() { + super(); + this.progressListenerList = new EventListenerList(); + this.statusListenerList = new EventListenerList(); + } + + public void addProgressListener(IProgressEventListener listener) { + progressListenerList.add(IProgressEventListener.class, listener); + } + + public void addStatusListener(IStatusEventListener listener) { + statusListenerList.add(IStatusEventListener.class, listener); + } + + public void clearListeners() { + this.progressListenerList = new EventListenerList(); + this.statusListenerList = new EventListenerList(); + } + + public RemoteFile copy(IDirectoryLister inputLister, IDirectoryLister outputLister, RemoteFile source, + String targetName) throws Exception { + RemoteFile result = null; + long uploadedBytes = 0; + int byteCount = 0; + byte[] buffer = new byte[BUFFER_SIZE]; + + InputStream inputStream = inputLister.getInputStream(source); + if (inputStream == null) + throw new Exception("InputStream is null!"); + + result = new RemoteFile(); + // Kitesztelni a helyes f�jlv�gz�d�seket! + String targetFileName = targetName; + if (StringUtils.isEmpty(targetFileName)) + targetFileName = source.getName(); + else { + String name = source.getName(); + int sep1 = name.lastIndexOf("."); + int sep2 = targetFileName.lastIndexOf("."); + if (sep2 == -1) + targetFileName = targetFileName + name.substring(sep1); + } + result.setName(targetFileName); + result.setSize(source.getSize()); + OutputStream outputStream = outputLister.getOutputStream(result); + if (outputStream == null) + throw new Exception("OutputStream is null!"); + + ProgressEvent progressEvent = new ProgressEvent(this, 0); + StatusEvent statusEvent = new StatusEvent(this); + + long size = source.getSize(); + BufferedInputStream in = new BufferedInputStream(inputStream, BUFFER_SIZE); + BufferedOutputStream out = new BufferedOutputStream(outputStream, BUFFER_SIZE); + + try { + int lastPercent = 0; + while ((byteCount = in.read(buffer, 0, BUFFER_SIZE)) != -1) { + out.write(buffer, 0, byteCount); + + uploadedBytes += byteCount; + percent = (int) (uploadedBytes * 100 / size); + if (percent - lastPercent > 1) { + progressEvent.setProgress(percent); + fireProgressEvent(progressEvent); + lastPercent = percent; + } + + fireStatusEvent(statusEvent); + if (statusEvent.isCancel()) + break; + } + progressEvent.setProgress(100); + fireProgressEvent(progressEvent); + out.flush(); + } finally { + try { + out.close(); + in.close(); + inputLister.cleanUp(); + outputLister.cleanUp(); + } catch (IOException e) { + } + } + result.setSize(uploadedBytes); + return result; + } + + public void fireProgressEvent(ProgressEvent evt) { + Object[] listeners = progressListenerList.getListenerList(); + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == IProgressEventListener.class) + ((IProgressEventListener) listeners[i + 1]).progressChanged(evt); + } + } + + public void fireStatusEvent(StatusEvent evt) { + Object[] listeners = statusListenerList.getListenerList(); + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == IStatusEventListener.class) + ((IStatusEventListener) listeners[i + 1]).statusChanged(evt); + } + } + + public String getCurrentPath() { + return currentPath; + } + + public String getFilter() { + return filter; + } + + // public String getFullPath() { + // return getFullPath(true); + // } + // + // public String getFullPath(boolean trimProtocol) { + // String uri = DirectoryUtils.checkSlash("/", getUri(), false, true); + // String root = DirectoryUtils.checkSlash("/", getRootPath(), false, true); + // String currentPath = DirectoryUtils.checkSlash("/", getCurrentPath(), + // false, true); + // String result = uri + root + currentPath; + // if (trimProtocol) + // result = result.substring(result.indexOf("://") + 3); + // return result.replace("\\", "/"); + // } + + public String getPassword() { + return password; + } + + public Integer getPortNumber() { + return portNumber; + } + + public List getRemoteFiles() throws Exception { + List result = null; + IDirectoryLister lister = RemoteFileHandler.createLister(this); + if (lister != null) + result = lister.list(); + return result; + } + + public String getRootPath() { + return rootPath; + } + + public long getStoreId() { + return this.storeId; + } + + public String getUri() { + return this.uri; + } + + public String getUserName() { + return userName; + } + + public boolean isSource() { + return isSource; + } + + public boolean isStream() { + return isStream; + } + + public boolean isTarget() { + return isTarget; + } + + public void removeProgressListener(IProgressEventListener listener) { + progressListenerList.remove(IProgressEventListener.class, listener); + } + + public void removeStatusListener(IStatusEventListener listener) { + statusListenerList.remove(IStatusEventListener.class, listener); + } + + public void setCurrentPath(String currentPath) { + this.currentPath = currentPath; + } + + public void setFilter(String filter) { + this.filter = filter; + } + + public void setPassword(String password) { + this.password = password; + } + + public void setPortNumber(Integer portNumber) { + this.portNumber = portNumber; + } + + public void setRootPath(String rootPath) { + this.rootPath = rootPath; + } + + public void setSource(boolean isSource) { + this.isSource = isSource; + } + + public void setStoreId(long storeId) { + this.storeId = storeId; + } + + public void setStream(boolean isStream) { + this.isStream = isStream; + } + + public void setTarget(boolean isTarget) { + this.isTarget = isTarget; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public RemoteFile getRemoteFile(String fileName) { + RemoteFile result = null; + try { + IDirectoryLister inputLister = RemoteFileHandler.createLister(this); + if (inputLister == null) + throw new Exception("InputLister is null."); + result = inputLister.get(fileName); + } catch (Exception e) { + logger.error(e); + } + return result; + } + + public RemoteFile transferFrom(StoreUri targetStoreUri, RemoteFile remoteFile, String targetName) throws Exception { + IDirectoryLister inputLister = RemoteFileHandler.createLister(this); + if (inputLister == null) + throw new Exception("InputLister is null."); + IDirectoryLister outputLister = RemoteFileHandler.createLister(targetStoreUri); + if (outputLister == null) + throw new Exception("OutputLister is null."); + return copy(inputLister, outputLister, remoteFile, targetName); + } + + public RemoteFile transferFrom(StoreUri targetStoreUri, String fileName, String targetName) throws Exception { + logger.info("transferFrom"); + IDirectoryLister inputLister = RemoteFileHandler.createLister(this); + if (inputLister == null) + throw new Exception("InputLister is null."); + logger.info("InputLister is selected!"); + RemoteFile remoteFile = inputLister.get(fileName); + if (remoteFile == null) + throw new Exception("RemoteFile is null."); + // N�v �s m�ret ki�rat�sa + logger.info("RemoteFile:" + remoteFile.getName() + " " + remoteFile.getSize()); + IDirectoryLister outputLister = RemoteFileHandler.createLister(targetStoreUri); + if (outputLister == null) + throw new Exception("OutputLister is null."); + logger.info("OutputLister is selected!"); + + return copy(inputLister, outputLister, remoteFile, targetName); + } + + @Override + public String toString() { + String result = null; + try { + result = toString(false); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + public String toString(boolean skipProtocol) throws Exception { + String result = skipProtocol ? uri : protocol.getValue() + uri; + result = DirectoryUtils.combine(result, rootPath); + result = DirectoryUtils.combine(result, currentPath); + return result; + } + + public RemoteStoreProtocol getProtocol() { + return protocol; + } + + public void setProtocol(RemoteStoreProtocol protocol) { + this.protocol = protocol; + } + + public DeliveryMethod getDelivery() { + return delivery; + } + + public void setDelivery(DeliveryMethod delivery) { + this.delivery = delivery; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/Syncable.java b/server/user.jobengine.osgi.commons/src/user/commons/Syncable.java new file mode 100644 index 00000000..0c904233 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/Syncable.java @@ -0,0 +1,58 @@ +package user.commons; + +import java.util.concurrent.locks.AbstractQueuedSynchronizer; + +/** + * Szinkronizációs õsosztály. + */ +public class Syncable extends EntityBase { + + private static class Sync extends AbstractQueuedSynchronizer { + private static final long serialVersionUID = -4772120276674016655L; + + private static final int COMPLETED = 1; + + void innerDone() { + compareAndSetState(0, COMPLETED); + releaseShared(0); + } + + Object innerGet() throws InterruptedException { + acquireSharedInterruptibly(0); + return new Integer(5); + } + + protected int tryAcquireShared(int arg) { + return getState() == COMPLETED ? 1 : -1; + } + + protected boolean tryReleaseShared(int arg) { + return true; + } + } + + private final Sync sync = new Sync(); + + /** + * Folyamat szinkronizálás blokkolásának feloldása. Unit tesztek + * támogatására készült. A akkor hívódik meg, amikor a folyamat feldolgozása + * véget ért egy teszt szempontjából. Ekkor a get() hívás, amit egy másik + * szál korábban kezdeményezett, visszatér, feloldva az hívó szál futásának + * blokkolását. + */ + public void done() { + sync.innerDone(); + } + + /** + * A folyamat futásának kivárása. A hívó szál addig blokkolódik, amig a + * done() hívás meg nem történik, ekkor visszatér. + * + * @return Ellenõrzõ objektum. + * @throws InterruptedException + */ + public Object get() throws InterruptedException { + return sync.innerGet(); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/TSMStoreUri.java b/server/user.jobengine.osgi.commons/src/user/commons/TSMStoreUri.java new file mode 100644 index 00000000..4f5551dc --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/TSMStoreUri.java @@ -0,0 +1,55 @@ +package user.commons; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.tsm.client.TSMClient; +import user.tsm.client.TSMException; + +public class TSMStoreUri extends StoreUri { + + private final static Logger logger = LogManager.getLogger(); + + public void test() { + TSMClient server = null; + try { + server = new TSMClient("JobEngine"); + //server.connect("jobengine", "password"); + server.connect(null, null); + logger.info("Connected"); + + // TSMBackupFileObject backupObject = new TSMBackupFileObject("/TSMJAPITEST2", "\\HLTEST", "\\LLTEST2"); + // backupObject.setLocalFilePath("c:/projects/sport1/S2M00010_P"); + // backupObject.setListener(new TSMObjectListener() { + // public void bytesWorked(long bytes) { + // System.out.println(bytes); + // } + // }); + // server.send(backupObject); + server.disconnect(); + System.out.println("Disconnected"); + logger.info("Disconnected"); + } catch (TSMException e) { + logger.error(e.getMessage()); + if ((server != null) && (server.isConnected())) + server.disconnect(); + + } catch (Exception e) { + e.printStackTrace(); + if ((server != null) && (server.isConnected())) + server.disconnect(); + } + } + + @Override + public RemoteFile transferFrom(StoreUri targetStoreUri, RemoteFile remoteFile, String targetName) throws Exception { + return remoteFile; + } + + @Override + public RemoteFile transferFrom(StoreUri targetStoreUri, String fileName, String targetName) throws Exception { + + return null; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/TimestampAdapter.java b/server/user.jobengine.osgi.commons/src/user/commons/TimestampAdapter.java new file mode 100644 index 00000000..33451082 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/TimestampAdapter.java @@ -0,0 +1,18 @@ +package user.commons; + +import java.sql.Timestamp; +import java.util.Date; +import javax.xml.bind.annotation.adapters.XmlAdapter; + +public class TimestampAdapter + extends XmlAdapter { + + public Date marshal(Timestamp v) { + return new Date(v.getTime()); + } + + public Timestamp unmarshal(Date v) { + return new Timestamp( + v.getTime()); + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/digester/DigestItem.java b/server/user.jobengine.osgi.commons/src/user/commons/digester/DigestItem.java new file mode 100644 index 00000000..ea2f47ec --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/digester/DigestItem.java @@ -0,0 +1,24 @@ +package user.commons.digester; + +public class DigestItem { + private Object value; + private String path; + + public DigestItem(String path, Object value) { + this.path = path; + this.value = value; + } + + public Object getValue() { + return value; + } + + public String getPath() { + return path; + } + + @Override + public String toString() { + return path + " (" + value.getClass().getSimpleName() + ")"; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/digester/Digester.java b/server/user.jobengine.osgi.commons/src/user/commons/digester/Digester.java new file mode 100644 index 00000000..5376f9f5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/digester/Digester.java @@ -0,0 +1,138 @@ +package user.commons.digester; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class Digester extends Stack { + + private static final long serialVersionUID = 1L; + private ClassLoader classLoader; + private Map> actions; + + public Digester() { + classLoader = this.getClass().getClassLoader(); + actions = new Hashtable>(); + } + + public ClassLoader getClassLoader() { + return classLoader; + } + + public void setClassLoader(ClassLoader classLoader) { + this.classLoader = classLoader; + } + + private List getActions(String name) { + if (!actions.containsKey(name)) + actions.put(name, new ArrayList()); + return actions.get(name); + } + + public void addObjectCreate(String name, Class type) { + List list = getActions(name); + list.add(new ObjectCreateAction(this, type)); + } + + public void addSetNext(String name, String function) { + List list = getActions(name); + list.add(new SetNextAction(this, function)); + } + + public void addSetProperties(String name) { + List list = getActions(name); + list.add(new SetPropertiesAction(this)); + } + + private void cleanup() { + if (size() > 1) { + DigestItem item = pop(); + String path = item.getPath(); + boolean clean = path.equals(currentpath) || !currentpath.contains(path); + if (clean) { + cleanup(); + } else + push(item); + } + } + + private String currentpath = ""; + private void execute(String key, Node node) throws Exception { + //System.out.println("Currentpath: " + currentpath + ", running: " + key); + cleanup(); + //System.out.println("Cleaned stack: " + toString()); + + List actionList = actions.get(key); + for (DigesterAction action : actionList) + action.execute(node); + + //System.out.println("Actual stack: " + toString() + "\n"); + } + + private void digest(Node node) throws Exception { + if (currentpath.length() > 0) + currentpath += "/"; + currentpath += node.getNodeName(); + boolean execute = false; + for (String key : actions.keySet()) { + String name = key; + if (key.startsWith("*")) { + name = key.replace("*", ""); + execute = currentpath.endsWith(name); + } else { + execute = currentpath.equals(name); + } + + if (execute) { + execute(key, node); + break; + } + } + } + + private List enumerateNodes(Node node) throws Exception { + List result = new ArrayList(); + if (node.getNodeType() != Node.TEXT_NODE) { + result.add(node); + digest(node); + } + NodeList nodeList = node.getChildNodes(); + for (int i = 0; i < nodeList.getLength(); i++) { + Node child = nodeList.item(i); + if (child.getNodeType() != Node.TEXT_NODE) + result.addAll(enumerateNodes(child)); + } + int index = currentpath.lastIndexOf('/'); + if (index > -1) { + currentpath = currentpath.substring(0, index); + } + return result; + } + + public Object parse(InputStream stream) throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document xmlDocument = db.parse(stream); + enumerateNodes(xmlDocument.getFirstChild()); + //List nodes = enumerateNodes(xmlDocument.getFirstChild()); + //System.out.println(nodes.size()); + + Object result = null; + if (size() > 0) { + DigestItem item = get(0); + result = item.getValue(); + clear(); + } + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/digester/DigesterAction.java b/server/user.jobengine.osgi.commons/src/user/commons/digester/DigesterAction.java new file mode 100644 index 00000000..1c8c7c7f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/digester/DigesterAction.java @@ -0,0 +1,37 @@ +package user.commons.digester; + +import org.w3c.dom.Node; + + +public abstract class DigesterAction { + + protected final Digester digester; + + public DigesterAction(Digester digester) { + this.digester = digester; + } + + public abstract void execute(Node node) throws Exception; + + protected Object getInstance(String name) throws Exception { + ClassLoader loader = digester.getClassLoader(); + Class type = loader.loadClass(name); + return type.newInstance(); + } + + protected String getPath(Node node) { + String result = node.getNodeName(); + Node actual = node; + Node previous = null; + while (true) { + actual = actual.getParentNode(); + if (actual.equals(previous) || actual.getNodeType() == Node.DOCUMENT_NODE) + break; + result = actual.getNodeName() + "/" + result; + previous = actual; + } + + return result; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/digester/ObjectCreateAction.java b/server/user.jobengine.osgi.commons/src/user/commons/digester/ObjectCreateAction.java new file mode 100644 index 00000000..a7decff2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/digester/ObjectCreateAction.java @@ -0,0 +1,22 @@ +package user.commons.digester; + +import org.w3c.dom.Node; + +public class ObjectCreateAction extends DigesterAction { + + private final Class type; + + public ObjectCreateAction(Digester digester, Class type) { + super(digester); + this.type = type; + } + + @Override + public void execute(Node node) throws Exception { + Object obj = getInstance(type.getName()); + DigestItem item = new DigestItem(getPath(node), obj); + digester.push(item); + //System.out.println("Created " + type.getSimpleName()); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/digester/SetNextAction.java b/server/user.jobengine.osgi.commons/src/user/commons/digester/SetNextAction.java new file mode 100644 index 00000000..86abeb02 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/digester/SetNextAction.java @@ -0,0 +1,45 @@ +package user.commons.digester; + +import java.lang.reflect.Method; + +import org.w3c.dom.Node; + +public class SetNextAction extends DigesterAction { + + private final String function; + + public SetNextAction(Digester digester, String function) { + super(digester); + this.function = function; + } + + @Override + public void execute(Node node) throws Exception { + if (digester.size() > 1) { + DigestItem slave = digester.pop(); + DigestItem master = digester.pop(); + Object slaveObject = slave.getValue(); + Object masterObject = master.getValue(); + + Class type = masterObject.getClass(); + Method[] methods = type.getMethods(); + boolean found = false; + for (Method method : methods) { + if (method.getName().equals(function)) { + digester.push(master); + method.invoke(masterObject, slaveObject); + found = true; + if (node != null && node.hasChildNodes()) + digester.push(slave); +// } else +// System.out.println(slaveObject.getClass().getSimpleName() + " cleaned by SetNextAction"); + break; + } + } + if (!found) + throw new Exception(type.getSimpleName() + " has no function " + function); + } else + throw new Exception("Stack is not contain enough objects. SetNextAction not possible."); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/digester/SetPropertiesAction.java b/server/user.jobengine.osgi.commons/src/user/commons/digester/SetPropertiesAction.java new file mode 100644 index 00000000..8c26ff49 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/digester/SetPropertiesAction.java @@ -0,0 +1,55 @@ +package user.commons.digester; + +import java.lang.reflect.Method; + +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +public class SetPropertiesAction extends DigesterAction { + + public SetPropertiesAction(Digester digester) { + super(digester); + } + + @Override + public void execute(Node node) throws Exception { + if (digester.size() > 0) { + DigestItem master = digester.pop(); + Object masterObject = master.getValue(); + NamedNodeMap attribs = node.getAttributes(); + for (int i = 0; i< attribs.getLength(); i++) + setValue(masterObject, attribs.item(i)); + digester.push(master); + } + } + + private void setValue(Object obj, Node valueNode) throws Exception { + String name = valueNode.getNodeName(); + Object value = valueNode.getNodeValue(); + String function = "set" + name.toLowerCase(); + + Class type = obj.getClass(); + Method[] methods = type.getMethods(); +// boolean found = false; + for (Method method : methods) { + if (method.getName().toLowerCase().equals(function)) { + Class types[] = method.getParameterTypes(); + if (types.length > 0) { + Class paramtype = types[0]; + if (!paramtype.equals(String.class)) { + if (paramtype.equals(int.class)) + value = Integer.parseInt(value.toString()); + if (paramtype.equals(long.class)) + value = Long.parseLong(value.toString()); + } + method.invoke(obj, value); +// found = true; + break; + } + } + } +// if (!found) +// System.out.println("Can not set property " + name + " on " + type.getSimpleName()); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/DataChannel.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/DataChannel.java new file mode 100644 index 00000000..d725f669 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/DataChannel.java @@ -0,0 +1,123 @@ +package user.commons.ftp; + +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; + +/** + * Adatcsatorna segédosztály. + * A kliens és a server is használja. + * Az aktív/passzív átviteli módtól függõen hozza létre a kapcsolatot. + * + * @author vasary + */ +public class DataChannel { + + static public DataChannel fromPort(String params) { + final String[] p = params.split(","); + if (p.length < 6) + throw new FtpException("Parameter not contains enough information."); + + int[] values = new int[6]; + InetAddress address = null; + try { + for (int i = 0; i < values.length; i++) { + values[i] = Integer.parseInt(p[i]); + } + address = InetAddress.getByName(values[0] + "." + values[1] + "." + values[2] + "." + values[3]); + } catch (Exception e) { + throw new FtpException(e.getMessage()); + } + + if (values[4] < 0 || values[4] > 255 || values[4] < 0 || values[4] > 255) { + throw new FtpException("Parameter contains illegal port specification."); + } + int port = (values[4] << 8) + values[5]; + + return new DataChannel(address, port); + } + + private InetAddress address = null; + private boolean passive = false; + private ServerSocket passiveDataSocket = null; + private int port = 0; + + private final String PORT = "%1$d,%2$d,%3$d,%4$d,%5$d,%6$d"; + + DataChannel() { + try { + this.passiveDataSocket = new ServerSocket(0); + //this.passiveDataSocket.setReuseAddress(true); set this, if using fixed port (firewall implementation) + this.port = passiveDataSocket.getLocalPort(); + this.address = InetAddress.getLocalHost(); + } catch (final Exception e) { + e.printStackTrace(); + } + this.passive = true; + } + + DataChannel(InetAddress address, int port) { + this.address = address; + this.port = port; + this.passive = false; + } + + public InetAddress getAddress() { + return address; + } + + private byte[] getAddressBytes() { + byte[] bytes = address.getAddress(); + for (int i = 0; i < 4; i++) { + if (bytes[i] < 0) + bytes[i] += 256; + } + return bytes; + } + + public Socket getDataSocket() { + Socket socket = null; + try { + if (passive) { + passiveDataSocket.setSoTimeout(FtpConstants.DataSocketTimeOut); + socket = passiveDataSocket.accept(); + } else { + socket = new Socket(address, port); + socket.setSoTimeout(FtpConstants.DataSocketTimeOut); + } + Thread.sleep(FtpConstants.ClientReactionTimeOut); + } catch (Exception e) { + throw new FtpException(e.getMessage()); + } + return socket; + } + + public Socket getClientDataSocket() { + Socket socket = null; + try { + if (passive) { + passiveDataSocket.setSoTimeout(FtpConstants.DataSocketTimeOut); + socket = passiveDataSocket.accept(); + } else { + socket = new Socket(address, port); + socket.setSoTimeout(FtpConstants.DataSocketTimeOut); + } + } catch (Exception e) { + throw new FtpException(e.getMessage()); + } + return socket; + } + + public int getPort() { + return port; + } + + public String getPortString() { + byte[] bytes = getAddressBytes(); + return String.format(PORT, bytes[0], bytes[1], bytes[2], bytes[3], (getPort() & 0xff00) >> 8, getPort() & 0x00ff); + } + + public boolean isPassive() { + return passive; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FileEvent.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FileEvent.java new file mode 100644 index 00000000..27274ec4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FileEvent.java @@ -0,0 +1,36 @@ +package user.commons.ftp; + +import java.util.EventObject; + +/** + * File eseménykezelõ. + * + * @author vasary + */ +public class FileEvent extends EventObject { + private static final long serialVersionUID = 1L; + private int percentComplete = 0; + private boolean cancel = false; + + public FileEvent(Object source, int percent) { + super(source); + this.percentComplete = percent; + } + + public void cancel() { + cancel = true; + } + + public int getPercentComplete() { + return percentComplete; + } + + public boolean isCanceled() { + return cancel; + } + + void setProgress(int percent) { + this.percentComplete = percent; + } +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FileEventListener.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FileEventListener.java new file mode 100644 index 00000000..c00530ec --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FileEventListener.java @@ -0,0 +1,16 @@ +package user.commons.ftp; + +import java.util.EventListener; +/** + * Ftp kliens file események. + * Egy file fel- és letöltésekor hívódik meg. + * Tartalmazza a folyamat százalékos állapotát. + * Visszajelzéssel megszakítható a folyamat. + * + * @author vasary + */ +public interface FileEventListener extends EventListener { + public void fileUpload(FileEvent evt); + public void fileDownload(FileEvent evt); +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpClient.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpClient.java new file mode 100644 index 00000000..0f2fb37f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpClient.java @@ -0,0 +1,386 @@ +package user.commons.ftp; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.event.EventListenerList; +import user.commons.ftp.FtpConstants.Command; + +/** + * Ftp kliens. + * A protokolnál magasabb szintû tagfüggvények támogatják az egyszerû fájl átvitelt. + * + * @author vasary + */ +public class FtpClient { + private DataInputStream inputStream = null; + private FtpResponse lastResponse = null; + private DataOutputStream outputStream = null; + private Socket socket = null; + private DataChannel dataChannel = null; + private boolean passive = false; + private EventListenerList listenerList = new EventListenerList(); + + public FtpClient() { + } + + public void addFileListener(FileEventListener listener) { + listenerList.add(FileEventListener.class, listener); + } + + public void connect(String host, int port) { + try + { + socket = new Socket(host, port); + inputStream = new DataInputStream(socket.getInputStream()); + outputStream = new DataOutputStream(socket.getOutputStream()); + } catch (Exception e) { + System.out.println("Connection error: " + e.getMessage()); + return; + } + + lastResponse = getResponse(); + if (lastResponse.getCode() != 220) + throw new FtpException("Connect unsucessfull."); + } + + public boolean cwd(String dir) { + writeRequest(Command.CWD, dir); + lastResponse = getResponse(); + if (lastResponse.getCode() == 250) + return true; + return false; + } + + public void disconnect() { + writeRequest(Command.QUIT); + lastResponse = getResponse(); + try { + if (inputStream != null) + inputStream.close(); + if (outputStream != null) + outputStream.close(); + if (isConnected()) + socket.close(); + } catch (Exception e) { + throw new FtpException("Error closeing connection: " + e.getMessage()); + } + } + + public void download(String target, String destination) { + if (passive == false) { + if (!port()) + throw new FtpException("PORT command is unsuccessful!"); + } + long fileSize = getSize(target); + writeRequest(Command.RETR, target); + lastResponse = getResponse(); + if (lastResponse.getCode() != 125) + throw new FtpException("Unable to get file."); + Socket dataSocket = null; + InputStream inputSteam = null; + OutputStream outputSteam = null; + FileEvent evt = new FileEvent(this, 0); + try { + dataSocket = dataChannel.getClientDataSocket(); + final byte buf[] = new byte[FtpConstants.BufferSize]; + File f = new File(destination); + inputSteam = new BufferedInputStream(dataSocket.getInputStream(), FtpConstants.BufferSize); + outputSteam = new BufferedOutputStream(new FileOutputStream(f), FtpConstants.BufferSize); + int byteCount = 0; + int prevPercent = 0; + long downloadedBytes = 0; + + fireFileDownloadEvent(evt); + if (!evt.isCanceled()) { + while ((byteCount = inputSteam.read(buf)) > 0) { + outputSteam.write(buf, 0, byteCount); + downloadedBytes += byteCount; + if (fileSize == 0) + continue; + int percent = (int) (downloadedBytes * 100 / fileSize); + if (percent - prevPercent >= 5) { + prevPercent = percent; + evt.setProgress(percent); + fireFileDownloadEvent(evt); + if (evt.isCanceled()) + break; + } + } + } + } catch (Exception e) { + throw new FtpException(e.getMessage()); + } finally { + try{ + if (inputSteam != null) + inputSteam.close(); + if (outputSteam != null) + outputSteam.close(); + if (dataSocket != null) + dataSocket.close(); + } catch (Exception e) {} + } + lastResponse = getResponse(); + if (lastResponse.getCode() != 226 && !evt.isCanceled()) + throw new FtpException("Unexpected termination of data transmission."); + } + + protected void fireFileDownloadEvent(FileEvent evt) { + Object[] listeners = listenerList.getListenerList(); + for (int i=0; i flist(String params) { + List formatted = new ArrayList(); + String[] lines = list(params, false); + for (String line: lines) { + formatted.add(new FtpFile(line)); + } + return formatted; + } + + private FtpResponse getResponse() { + final byte buf[] = new byte[FtpConstants.BufferSize]; + int byteCount = 0; + String line = ""; + try { + while ((byteCount = inputStream.read(buf)) > 0) { + line += new String(buf, 0, byteCount); + if (line.endsWith(FtpConstants.EOL)) + break; + } + } catch (Exception e) { + System.out.println("getResponse" + e.getMessage()); + } + return new FtpResponse(line); + } + + public long getSize(String target) { + writeRequest(Command.SIZE, target); + lastResponse = getResponse(); + if (lastResponse.getCode() != 213) + throw new FtpException("Unable to get file size."); + return Long.parseLong(lastResponse.getMessage()); + } + + boolean isConnected() { + if (socket == null) + return false; + return socket.isBound() && !socket.isClosed(); + } + + public String[] list(String params) { + return list(params, false); + } + + private String[] list(String params, boolean namesOnly) { + if (passive == false) { + if (!port()) + throw new FtpException("PORT command is unsuccessful!"); + } + + if (namesOnly) + writeRequest(Command.NLST, params); + else + writeRequest(Command.LIST, params); + + lastResponse = getResponse(); + if (lastResponse.getCode() != 150) + throw new FtpException("Unable to receive data."); + + Socket dataSocket = null; + BufferedInputStream inputStream = null; + String line = ""; + try { + final byte buf[] = new byte[FtpConstants.BufferSize]; + dataSocket = dataChannel.getClientDataSocket(); + inputStream = new BufferedInputStream(dataSocket.getInputStream(), FtpConstants.BufferSize); + int byteCount = 0; + while ((byteCount = inputStream.read(buf)) > 0) { + line += new String(buf, 0, byteCount); + } + } catch (Exception e) { + throw new FtpException(e.getMessage()); + }finally { + try { + if (inputStream != null) + inputStream.close(); + if (dataSocket != null) + dataSocket.close(); + } catch (Exception e) {} + } + lastResponse = getResponse(); + if (lastResponse.getCode() != 226) + throw new FtpException("Unexpected termination of data transmission."); + return line.length() == 0 ? null : line.split(FtpConstants.EOL); + } + + public void login(String user, String password) { + writeRequest(Command.USER, user); + lastResponse = getResponse(); + if (lastResponse.getCode() == 331) + writeRequest(Command.PASS, password); + lastResponse = getResponse(); + if (lastResponse.getCode() != 230) + throw new FtpException("Login unsuccessful."); + } + + public boolean mkDir(String dir) { + writeRequest(Command.MKD, dir); + lastResponse = getResponse(); + if (lastResponse.getCode() == 250) + return true; + return false; + } + + public String[] nlist(String params) { + return list(params, true); + } + + public void pasv() { + if (passive == true) + return; + writeRequest(Command.PASV); + lastResponse = getResponse(); + if (lastResponse.getCode() != 227) + throw new FtpException("Entering passive mode is unsuccessful!"); + + String msg = lastResponse.getMessage(); + int start = msg.indexOf("(") + 1; + int end = msg.indexOf(")"); + if (start == 0 || end == 0 || end < start) + throw new FtpException("Entering passive mode is unsuccessful! Wrong server reply: " + lastResponse.getMessage()); + msg = msg.substring(start, end); + dataChannel = DataChannel.fromPort(msg); + passive = true; + } + + protected boolean port() { + dataChannel = new DataChannel(); + writeRequest(Command.PORT, dataChannel.getPortString()); + lastResponse = getResponse(); + if (lastResponse.getCode() == 200) + return true; + return false; + } + + public String pwd() { + writeRequest(Command.PWD); + lastResponse = getResponse(); + if (lastResponse.getCode() == 257) { + String msg = lastResponse.getMessage(); + String[] chunks = msg.split("\""); + if (chunks.length > 2) + return chunks[1]; + } + return null; + } + + public void removeFileListener(FileEventListener listener) { + listenerList.remove(FileEventListener.class, listener); + } + + public boolean rmDir(String dir) { + writeRequest(Command.RMD, dir); + lastResponse = getResponse(); + if (lastResponse.getCode() == 250) + return true; + return false; + } + + public void upload(String target, String destination) { + if (passive == false) { + if (!port()) + throw new FtpException("PORT command is unsuccessful!"); + } + writeRequest(Command.STOR, destination); + lastResponse = getResponse(); + if (lastResponse.getCode() != 125) + throw new FtpException("Unable to put file."); + Socket dataSocket = null; + InputStream inputSteam = null; + OutputStream outputSteam = null; + FileEvent evt = new FileEvent(this, 0); + try { + dataSocket = dataChannel.getClientDataSocket(); + final byte buf[] = new byte[FtpConstants.BufferSize]; + File f = new File(target); + inputSteam = new BufferedInputStream(new FileInputStream(f), FtpConstants.BufferSize); + outputSteam = new BufferedOutputStream(dataSocket.getOutputStream(), FtpConstants.BufferSize); + int byteCount = 0; + int prevPercent = 0; + long uploadedBytes = 0; + fireFileUploadEvent(evt); + if (!evt.isCanceled()) { + while ((byteCount = inputSteam.read(buf)) > 0) { + outputSteam.write(buf, 0, byteCount); + uploadedBytes += byteCount; + int percent = (int) (uploadedBytes * 100 / f.length()); + if (percent - prevPercent >= 5) { + prevPercent = percent; + evt.setProgress(percent); + fireFileUploadEvent(evt); + if (evt.isCanceled()) + break; + } + } + } + } catch (Exception e) { + throw new FtpException(e.getMessage()); + } finally { + try{ + if (inputSteam != null) + inputSteam.close(); + if (outputSteam != null) + outputSteam.close(); + if (dataSocket != null) + dataSocket.close(); + } catch (Exception e) {} + } + lastResponse = getResponse(); + if (lastResponse.getCode() != 226 && !evt.isCanceled()) + throw new FtpException("Unexpected termination of data transmission."); + } + protected void writeRequest(Command command) { + writeRequest(command, null); + } + + protected void writeRequest(Command command, String params) { + try { + String message = command.toString(); + message += (params == null) ? "" : " " + params; + outputStream.writeBytes(message + FtpConstants.EOL); + } catch (IOException e) { + System.out.println(String.format("CLIENT# ", e.getMessage())); + } + } +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpConstants.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpConstants.java new file mode 100644 index 00000000..38f2e061 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpConstants.java @@ -0,0 +1,105 @@ +package user.commons.ftp; + +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +/** + * Konstansok, minták. + * A kliens és a server által használt üzenetek, válaszok, + * felsorolások, formázáshoz használ minták. + * + * @author vasary + */ +public class FtpConstants { + public enum Command { + NOTIMPLEMENTED, + NLST, + LIST, + PORT, + USER, + PASS, + QUIT, + PWD, + XPWD, + XMKD, + MKD, + TYPE, + DELE, + HELP, + STOR, + RETR, + PASV, + SYST, + SIZE, + RMD, + XRMD, + CWD, + CDUP, + MDTM + } + + static public final String MSG125 = "125 opening BINARY data connection"; + static public final String MSG150 = "150 opening ASCII data connection"; + static public final String MSG200 = "200 ok"; + static public final String MSG200BINARY = "200 always BINARY"; + static public final String MSG200PORT = "200 received PORT"; + static public final String MSG213 = "213 %1$d"; + static public final String MSG213STIRNG = "213 %1$s"; + static public final String MSG215 = "215 Windows_NT"; + static public final String MSG221 = "221 goodbye"; + static public final String MSG230 = "230 logged in"; + static public final String MSG220 = "220 Welcome!"; + static public final String MSG226 = "226 closing data connection"; + static public final String MSG227 = "227 Entering Passive Mode (%1$s)"; + static public final String MSG226STOR = "226 closing data connection for %1$s, %2$d bytes uploaded"; + static public final String MSG250 = "250 \"%1$s\" is working directory"; + static public final String MSG250DELETE = "250 \"%1$s\" deleted"; + static public final String MSG250CREATED = "250 \"%1$s\" created"; + static public final String MSG257 = "257 \"%1$s\" is working directory"; + static public final String MSG331 = "331 password required"; + public static final String MSG332 = "332 need account for login"; + static public final String MSG500 = "500 command is unrecognized"; + static public final String MSG501 = "501 syntax error in parameters"; + static public final String MSG502 = "502 command is not implemented"; + static public final String MSG503 = "503 bad sequence of commands"; + static public final String MSG530 = "530 user cannot log in"; + static public final String MSG532 = "532 no write permission"; + static public final String MSG550 = "550 bad path %1$s"; + static public final String MSG550PERMISSION = "550 no permission"; + static public final String MSG550EXISTS = "550 %1$s already exists"; + static public final String MSG550NOEXISTS = "550 %1$s not exists"; + static public final String MSG550DIRECTORY = "550 %1$s is a directory, cannot delete"; + static public final String MSG550FILE = "550 %1$s is a file, cannot RMD"; + static public final String MSG550NOTEMPTY = "550 %1$s directory is not empty"; + static public final String MSG214 = "214-Recognized commands:" + FtpConstants.EOL + "%1$s" + FtpConstants.EOL + "214 end"; + + static public final String EOL = "\r\n"; + static public final String EOD = File.separator; + static public final int BufferSize = 1024; + + static public final String LISTFORMAT = "%3$s %1$12s %2$s" + FtpConstants.EOL; + static public final SimpleDateFormat MDTMFormatter = new SimpleDateFormat("yyyyMMddHHmmss.SSS", Locale.ENGLISH); + static public final SimpleDateFormat LDTMFormatter = new SimpleDateFormat("MM-dd-yy KK:mmaa", Locale.ENGLISH); + static public final int DataSocketTimeOut = 1000; + static public final long ClientReactionTimeOut = 10; + + static public String getLDTMString(long tick) { + return LDTMFormatter.format(new Date(tick)); + } + + static public Date getLDTMDate(String date) { + Date ret = null; + try { + ret = LDTMFormatter.parse(date); + } catch (Exception e) {} + return ret; + } + + static public String terminatedDir(String dir) { + if (dir == null) + return EOD; + return dir.endsWith(EOD) ? dir : dir + EOD; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpException.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpException.java new file mode 100644 index 00000000..06e41147 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpException.java @@ -0,0 +1,15 @@ +package user.commons.ftp; + +/** + * Ftp kivétel. + * A kliens és a server is ezt használja. + * + * @author vasary + */ +public class FtpException extends RuntimeException { + private static final long serialVersionUID = -2357518580850559771L; + + public FtpException(String message) { + super(message); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpFile.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpFile.java new file mode 100644 index 00000000..a609fbb9 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpFile.java @@ -0,0 +1,63 @@ +package user.commons.ftp; + +import java.util.Date; + +/** + * Virtuális file objektum. + * Az Ftp kliens plusz szolgáltatása, hogy az flist() fügvény, + * ilyen objektumokból álló listát ad vissza. ld. + * + * @author vasary + */ +public class FtpFile { + private String name = null; + private String directory = null; + private boolean isDirectory = false; + private long size = 0; + private Date lastModified = null; + + public FtpFile(String ftpReply) { + String s = ftpReply; + try { + int patternLen = FtpConstants.LDTMFormatter.toPattern().length(); + lastModified = FtpConstants.getLDTMDate(s.substring(0, patternLen)); + s = s.substring(patternLen); + isDirectory = s.contains("") ? true : false; + if (isDirectory) { + s = s.replace("", "").trim(); + name = s; + } else { + s = s.trim(); + String[] x = s.split(" "); + if (x.length > 1) { + size = Long.parseLong(x[0]); + name = s.replace(x[0], "").trim(); + } else { + name = s; + } + } + } catch (Exception e) { + throw new FtpException(e.getMessage()); + } + } + + public String getDirectory() { + return directory; + } + + public Date getLastModified() { + return lastModified; + } + + public String getName() { + return name; + } + + public long getSize() { + return size; + } + + public boolean isDirectory() { + return isDirectory; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpFileFilter.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpFileFilter.java new file mode 100644 index 00000000..0c1f4709 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpFileFilter.java @@ -0,0 +1,55 @@ +package user.commons.ftp; + +import java.io.File; +import java.io.FileFilter; + +/** + * Ftp file lista filter. + * A LIST parancs paraméterébõl FileFilter-t készít a szûréshez. + * + * @author vasary + */ +public class FtpFileFilter implements FileFilter { + private String params = null; + private boolean forDirectories = false; + + FtpFileFilter(String params, boolean forDirectories) { + this.params = params; + this.forDirectories = forDirectories; + } + + public boolean accept(File file) { + boolean ret = false; + String name = file.getName(); + + if (forDirectories) + ret = file.isDirectory(); + else + ret = file.isFile(); + + if (ret == false) + return ret; + + if (params == null || params.trim().length() == 0) + return ret; + + if (params.startsWith("*")) { + ret &= name.endsWith(params.replace("*", "")); + return ret; + } + + if (params.endsWith("*")) { + ret &= name.startsWith(params.replace("*", "")); + return ret; + } + + if (params.contains("*")) { + String[] p = params.split("\\*"); + if (p.length == 2) + ret &= name.startsWith(p[0]) && name.endsWith(p[1]); + } else + ret &= file.getName().equals(params); + + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpProtocol.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpProtocol.java new file mode 100644 index 00000000..8df0c297 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpProtocol.java @@ -0,0 +1,608 @@ +package user.commons.ftp; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Date; +import java.util.Locale; + +import user.commons.ftp.FtpConstants.Command; +import user.commons.ftp.FtpServerProperties.FtpUser; + +/** + * Ftp protokol implementáció. + * A protokol leírásnak megfelelõen a beérkezõ parancsra végrehajtja a + * kért mûveletet, és a szabályoknak megfelelõen válaszol. + * + * @author vasary + */ +public class FtpProtocol { + static private String ROOT = null; + static private String currentDir = null; + private FtpSession session = null; + private DataChannel dataChannel = null; + private FtpServerProperties properties = null; + private FtpUser currentUser = null; + + FtpProtocol(FtpSession session) { + this.session = session; + this.properties = session.getServer().getProperties(); + Welcome(); + } + + protected boolean checkParams(String params) { + if (params == null || params.trim().length() == 0) + return false; + return true; + } + + protected void Confirm() { + writeReply(FtpConstants.MSG200); + } + + protected void ConfirmClose() { + writeReply(FtpConstants.MSG221); + } + + private void Cwd(String params) { + if (!setCurrentDir(params)) { + writeReply(String.format(FtpConstants.MSG550, params)); + return; + } + writeReply(String.format(FtpConstants.MSG250, getRelativeDir())); + } + + protected void Delete(String params) { + if (!checkParams(params)) { + writeReply(FtpConstants.MSG501); + return; + } + File file = new File(getCurrentDir() + params); + if (!file.exists()) { + writeReply(String.format(FtpConstants.MSG550NOEXISTS, params)); + return; + } + if (file.isDirectory()) { + writeReply(String.format(FtpConstants.MSG550DIRECTORY, params)); + return; + } + try { + file.delete(); + } catch (Exception e) { + writeReply(FtpConstants.MSG550PERMISSION); + } + writeReply(String.format(FtpConstants.MSG250DELETE, params)); + } + + protected String getCurrentDir() { + if (currentDir.endsWith(FtpConstants.EOD)) + return currentDir; + return currentDir + FtpConstants.EOD; + } + + protected File getDir(String dir) { + if (dir == null) + return null; + File ret = null; + String decodedDir = dir.replace("%20", " "); + File root = null; + if (dir.startsWith("/")) + root = new File(getRootDir() + decodedDir); + else if (dir.equals(".")) + root = new File(getRootDir()); + else + root = new File(getCurrentDir() + decodedDir); + + String newDir = null; + try { + newDir = root.getCanonicalPath(); + if (!newDir.endsWith(FtpConstants.EOD)) + newDir += FtpConstants.EOD; + } catch (IOException e) { + return ret; + } + + if (newDir.toUpperCase().startsWith(getRootDir().toUpperCase())) + ret = new File(newDir); + + return ret; + } + + private String getRelativeDir() { + String path = getCurrentDir().replace(getRootDir(), FtpConstants.EOD); + return path.replace(FtpConstants.EOD, "/"); + } + + protected String getRootDir() { + if (ROOT.endsWith(FtpConstants.EOD)) + return ROOT; + return ROOT + FtpConstants.EOD; + } + + protected void Help() { + StringBuilder sb = new StringBuilder(); + for (FtpConstants.Command command : FtpConstants.Command.values()) { + if (command == Command.NOTIMPLEMENTED) + continue; + sb.append(command.toString()); + sb.append(" "); + } + writeReply(String.format(FtpConstants.MSG214, sb.toString())); + } + + protected void List(String params, boolean namesOnly) { + if (dataChannel == null) { + writeReply(FtpConstants.MSG503); + return; + } + + File dir = new File(getCurrentDir()); + File chdir = getDir(params); + File[] dirs = null; + File[] files = null; + String filter = null; + + if (chdir != null && chdir.isDirectory()) { + // paraméterben megadott könyvtár listázás + dir = chdir; + } else { + if (params != null && params.contains("/")) { + // paraméterben megadott könyvtár és szûrõ + String[] param = params.split("/"); + if (param.length > 1) { + filter = param[param.length - 1]; + chdir = getDir(params.replace(filter, "")); + if (chdir != null && chdir.isDirectory()) + dir = chdir; + } + } else { + // aktuális munkakönyvtár listázás + filter = params; + } + } + + dirs = dir.listFiles(new FtpFileFilter(filter, true)); + files = dir.listFiles(new FtpFileFilter(filter, false)); + + Arrays.sort(dirs, new Comparator() { + public int compare(File f1, File f2) { + return f1.getName().compareToIgnoreCase(f2.getName()); + } + }); + + Arrays.sort(files, new Comparator() { + public int compare(File f1, File f2) { + return f1.getName().compareToIgnoreCase(f2.getName()); + } + }); + + writeReply(FtpConstants.MSG150); + Socket dataSocket = null; + OutputStream outputStream = null; + String name = null; + try { + dataSocket = dataChannel.getDataSocket(); + outputStream = new BufferedOutputStream(dataSocket + .getOutputStream(), FtpConstants.BufferSize); + for (File d : dirs) { + if (namesOnly) + name = d.getName() + FtpConstants.EOL; + else + name = String.format(FtpConstants.LISTFORMAT, "", d + .getName(), FtpConstants.getLDTMString(d + .lastModified())); + outputStream.write(name.getBytes()); + } + for (File f : files) { + if (namesOnly) + name = f.getName() + FtpConstants.EOL; + else + name = String.format(Locale.ENGLISH, + FtpConstants.LISTFORMAT, f.length(), f.getName(), + FtpConstants.getLDTMString(f.lastModified())); + outputStream.write(name.getBytes()); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (outputStream != null) + outputStream.close(); + if (dataSocket != null) + dataSocket.close(); + } catch (Exception e) { + } + } + writeReply(FtpConstants.MSG226); + } + + private void Mdtm(String params) { + String path = params.replace("%20", " "); + if (path.equals("")) { + writeReply(FtpConstants.MSG501); + return; + } + File f = new File(getCurrentDir() + params); + if (f.exists()) + writeReply(String.format(FtpConstants.MSG213STIRNG, + FtpConstants.MDTMFormatter + .format(new Date(f.lastModified())))); + else + writeReply(String.format(FtpConstants.MSG550, params)); + } + + protected void Mkd(String params) { + if (!checkParams(params)) { + writeReply(FtpConstants.MSG501); + return; + } + File dir = new File(getCurrentDir() + params); + if (dir.exists()) { + writeReply(String.format(FtpConstants.MSG550EXISTS, params)); + return; + } + try { + if (dir.mkdir()) { + writeReply(String.format(FtpConstants.MSG250CREATED, params)); + } else { + writeReply(String.format(FtpConstants.MSG550, params)); + } + } catch (Exception e) { + writeReply(FtpConstants.MSG550PERMISSION); + } + } + + protected void NotImplemented() { + writeReply(FtpConstants.MSG502); + } + + private void Pass(String params) { + if (currentUser == null) { + writeReply(FtpConstants.MSG530); + return; + } + currentUser.authenticate(params); + if (currentUser.isAuthenticated()) { + setRoot(properties.getServerRoot()+ currentUser.getHome()); + writeReply(FtpConstants.MSG230); + return; + } + currentUser = null; + writeReply(FtpConstants.MSG530); + } + + protected void Pasv() { + dataChannel = new DataChannel(); + writeReply(String.format(FtpConstants.MSG227, dataChannel.getPortString())); + } + + public void Port(String params) { + if (!checkParams(params)) { + WrongParameters(); + return; + } + dataChannel = DataChannel.fromPort(params); + writeReply(FtpConstants.MSG200PORT); + } + + public boolean ProcessCommand(String line) { + String[] input = line.split(" "); + if (input.length == 0) { + Unrecognized(); + return true; + } + Command cmd = Command.NOTIMPLEMENTED; + try { + cmd = Command.valueOf(input[0].trim().toUpperCase()); + } catch (IllegalArgumentException e) { + System.out.println("Command is not implemented."); + } + int commandLen = input[0].length(); + String params = (line.length() > commandLen + 1) ? line.substring( + commandLen + 1).trim() : null; + switch (cmd) { + case USER: { + User(params); + break; + } + case PASS: { + Pass(params); + break; + } + case PORT: { + Port(params); + break; + } + case LIST: { + List(params, false); + break; + } + case NLST: { + List(params, true); + break; + } + case PWD: + case XPWD: { + Pwd(); + break; + } + case CWD: { + Cwd(params); + break; + } + case MKD: + case XMKD: { + Mkd(params); + break; + } + case TYPE: { + Type(); + break; + } + case DELE: { + Delete(params); + break; + } + case HELP: { + Help(); + break; + } + case STOR: { + Stor(params); + break; + } + case RETR: { + Retr(params); + break; + } + case PASV: { + Pasv(); + break; + } + case SYST: { + Syst(); + break; + } + case SIZE: { + Size(params); + break; + } + case RMD: + case XRMD: { + Rmd(params); + break; + } + case CDUP: { + Cwd(".."); + break; + } + case MDTM: { + Mdtm(params); + break; + } + case QUIT: { + ConfirmClose(); + return false; + } + default: { + NotImplemented(); + break; + } + } + return true; + } + + private void Pwd() { + writeReply(String.format(FtpConstants.MSG257, getRelativeDir())); + } + + protected void Retr(String params) { + if (!checkParams(params)) { + writeReply(FtpConstants.MSG501); + return; + } + if (dataChannel == null) { + writeReply(FtpConstants.MSG503); + return; + } + File file = new File(getCurrentDir() + params); + if (!file.exists() || file.isDirectory()) { + writeReply(String.format(FtpConstants.MSG550, params)); + return; + } + writeReply(FtpConstants.MSG125); + Socket dataSocket = null; + InputStream inputStream = null; + OutputStream outputStream = null; + try { + dataSocket = dataChannel.getDataSocket(); + final byte buf[] = new byte[FtpConstants.BufferSize]; + inputStream = new BufferedInputStream(new FileInputStream(file), + FtpConstants.BufferSize); + outputStream = new BufferedOutputStream(dataSocket + .getOutputStream(), FtpConstants.BufferSize); + int byteCount = 0; + while ((byteCount = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, byteCount); + } + } catch (Exception e) { + writeReply(FtpConstants.MSG550PERMISSION); + return; + } finally { + try { + if (inputStream != null) + inputStream.close(); + if (outputStream != null) + outputStream.close(); + if (dataSocket != null) + dataSocket.close(); + } catch (Exception e) { + } + } + writeReply(FtpConstants.MSG226); + } + + private void Rmd(String params) { + if (!checkParams(params)) { + writeReply(FtpConstants.MSG501); + return; + } + File file = new File(getCurrentDir() + params); + if (!file.exists()) { + writeReply(String.format(FtpConstants.MSG550NOEXISTS, params)); + return; + } + if (file.isFile()) { + writeReply(String.format(FtpConstants.MSG550FILE, params)); + return; + } + if (file.list().length != 0) { + writeReply(String.format(FtpConstants.MSG550NOTEMPTY, params)); + return; + } + try { + file.delete(); + } catch (Exception e) { + writeReply(FtpConstants.MSG550PERMISSION); + } + writeReply(String.format(FtpConstants.MSG250DELETE, params)); + } + + protected boolean setCurrentDir(String dir) { + File newWorking = getDir(dir); + if (newWorking != null && newWorking.isDirectory()) { + try { + currentDir = newWorking.getCanonicalPath(); + } catch (IOException e) { + return false; + } + return true; + } + return false; + } + + public void setRoot(String root) { + File path = new File(root); + try { + + String filePath = path.getCanonicalPath(); + filePath = FtpConstants.terminatedDir(filePath); + if (path.exists() && path.isFile()) + throw new FtpException("User home directory is a file: " + filePath); + if (!path.exists()) { + path.mkdirs(); + System.out.println("Home directory for user " + currentUser.getName() + " created: " + filePath); + } + ROOT = filePath; + currentDir = filePath; + } catch (Exception e) { + throw new FtpException(e.getMessage()); + } + } + + protected void Size(String params) { + if (!checkParams(params)) { + writeReply(FtpConstants.MSG550PERMISSION); + return; + } + File file = new File(getCurrentDir() + params); + if (!file.exists()) { + writeReply(String.format(FtpConstants.MSG550NOEXISTS, params)); + return; + } + if (file.isDirectory()) + writeReply(FtpConstants.MSG550PERMISSION); + else + writeReply(String.format(FtpConstants.MSG213, file.length())); + } + + protected void Stor(String params) { + if (!checkParams(params)) { + writeReply(FtpConstants.MSG501); + return; + } + if (dataChannel == null) { + writeReply(FtpConstants.MSG503); + return; + } + File file = new File(getCurrentDir() + params); + + if (file.isDirectory()) { + writeReply(String.format(FtpConstants.MSG550, params)); + return; + } + writeReply(FtpConstants.MSG125); + Socket dataSocket = null; + InputStream inputStream = null; + OutputStream outputStream = null; + try { + dataSocket = dataChannel.getDataSocket(); + final byte buf[] = new byte[FtpConstants.BufferSize]; + inputStream = new BufferedInputStream(dataSocket.getInputStream(), + FtpConstants.BufferSize); + outputStream = new BufferedOutputStream(new FileOutputStream(file), + FtpConstants.BufferSize); + int byteCount = 0; + while ((byteCount = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, byteCount); + } + } catch (Exception e) { + writeReply(FtpConstants.MSG532 + e.getMessage()); + return; + } finally { + try { + if (inputStream != null) + inputStream.close(); + if (outputStream != null) + outputStream.close(); + if (dataSocket != null) + dataSocket.close(); + } catch (Exception e) { + } + } + writeReply(String + .format(FtpConstants.MSG226STOR, params, file.length())); + } + + protected void Syst() { + writeReply(FtpConstants.MSG215); + } + + protected void Type() { + writeReply(FtpConstants.MSG200BINARY); + } + + protected void Unrecognized() { + writeReply(FtpConstants.MSG500); + } + + protected void User(String params) { + currentUser = properties.getFtpUser(params); + writeReply(FtpConstants.MSG331); + } + + protected void Welcome() { + writeReply(FtpConstants.MSG220); + } + + protected void writeReply(String reply) { + try { + System.out.println("SERVER# " + reply); + session.getOutputStream().writeBytes(reply + FtpConstants.EOL); + } catch (Exception e) { + System.out.println("writeReply: " + e.getMessage()); + } + } + + protected void WrongParameters() { + writeReply(FtpConstants.MSG501); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpResponse.java new file mode 100644 index 00000000..473f944e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpResponse.java @@ -0,0 +1,30 @@ +package user.commons.ftp; + +/** + * Ftp server válasz. + * Az Ftp kliens használja, a válaszüzenetek kód/szöveg szeparálására. + * + * @author vasary + */ +public class FtpResponse { + private String message = null; + private int code = 0; + + FtpResponse(String message) { + String[] msg = message.split(" "); + try { + this.code = Integer.parseInt(msg[0]); + this.message = message.replace(msg[0] + " ", "").trim(); + } catch (Exception e) {} + + System.out.println(String.format("CLIENT# (%1$d) %2$s", this.code, this.message)); + } + + public String getMessage() { + return message; + } + + public int getCode() { + return code; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpServer.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpServer.java new file mode 100644 index 00000000..fa1e9b14 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpServer.java @@ -0,0 +1,72 @@ +package user.commons.ftp; + +import java.io.*; +import java.net.*; + +/** + * Ftp server. + * Saját szálon fut, és minden kapcsolathoz külön session szálat indít. + * + * @author vasary + */ +public class FtpServer extends Thread{ + private ServerSocket serverSocket = null; + private String name = "FtpServer Main Thread"; + private FtpServerProperties properties = null; + + FtpServer() { + try { + properties = new FtpServerProperties(); + serverSocket = new ServerSocket(properties.getPort()); + System.out.println("Server listening on port " + serverSocket.getLocalPort()); + } catch (IOException e) { + System.out.println("Exception on new ServerSocket: " + e); + } + } + + FtpServer(FtpServerProperties properties) { + if (properties == null) + throw new FtpException("Properties cannot be null."); + try { + this.properties = properties; + serverSocket = new ServerSocket(properties.getPort()); + System.out.println("Server listening on port " + serverSocket.getLocalPort()); + } catch (IOException e) { + System.out.println("Exception on new ServerSocket: " + e); + } + } + + public FtpServerProperties getProperties() { + return properties; + } + + public void run() { + this.setName(name); + while (true) { + if (serverSocket == null || serverSocket.isClosed()) + break; + Socket socket = null; + try { + socket = serverSocket.accept(); + } catch (Exception e) { + if (serverSocket == null || serverSocket.isClosed()) + break; + e.printStackTrace(); + } + System.out.println("New client connected."); + FtpSession t = new FtpSession(this, socket); + System.out.println("Starting a server side client thread."); + t.start(); + } + } + + public void shutdown() { + try { + if (serverSocket != null && !serverSocket.isClosed()) + serverSocket.close(); + this.interrupt(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpServerProperties.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpServerProperties.java new file mode 100644 index 00000000..ebc3b6ee --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpServerProperties.java @@ -0,0 +1,123 @@ +package user.commons.ftp; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import user.commons.CommonsProperties; +/** +* Ftp server beállítások. +* SERVERROOT - Gyökér könyvtár. A felhasználók home könyvtárai ez alatt jönnek létre. +* PORT - Port szám, amin a server fogadja a kapcsolatokat. +* USERS - FtpUser lista. + * + * @author vasary + */ +public class FtpServerProperties extends CommonsProperties { + + /** + * Ftp felhasználó. + * A home SERVERROOT-hoz képest relatív (chroot). + * + * @author vasary + */ + public class FtpUser { + private String name = null; + private String password = null; + private String home = null; + private boolean authenticated = false; + + FtpUser(String name, String password, String home) { + if (name == null || name.length() == 0) + throw new FtpException("User name cannot be null or empty."); + if (home == null) + throw new FtpException("User home directory cannot be null."); + this.name = name; + this.password = password; + this.home = home; + } + + void authenticate(String pwd) { + if ((this.password == null) || (this.password.equals(""))) { + this.authenticated = true; + return; + } + this.authenticated = this.password.equals(pwd); + } + + public String getHome() { + return home; + } + + public String getName() { + return name; + } + + public boolean isAuthenticated() { + return authenticated; + } + } + + static public final String USERS = "Users"; + static public final String SERVERROOT = "ServerRoot"; + static public final String PORT = "Port"; + + FtpServerProperties() { + super.add(SERVERROOT, "c:\\temp"); + super.add(PORT, 21); + super.add(USERS, getDefaultUsers()); + } + + public FtpServerProperties(int port, String serverRoot) { + CommonsProperties.checkParameter(SERVERROOT, serverRoot); + CommonsProperties.checkParameter(PORT, port); + File f = new File(serverRoot); + if (!f.exists() || !f.isDirectory()) + throw new FtpException("Server root is not valid: " + serverRoot); + super.add(SERVERROOT, serverRoot); + super.add(PORT, port); + super.add(USERS, getDefaultUsers()); + } + + public FtpServerProperties(int port, String serverRoot, List users) { + CommonsProperties.checkParameter(SERVERROOT, serverRoot); + CommonsProperties.checkParameter(PORT, port); + CommonsProperties.checkParameter(USERS, users); + super.add(SERVERROOT, serverRoot); + super.add(PORT, port); + super.add(USERS, users); + } + + protected List getDefaultUsers() { + List defaultUsers = new ArrayList(); + defaultUsers.add(new FtpUser("ftp", null, "anonymous")); + defaultUsers.add(new FtpUser("anonymous", null, "anonymous")); + defaultUsers.add(new FtpUser("elgekko", "elgekko", "")); + return defaultUsers; + } + + FtpUser getFtpUser(String name) { + if (name == null || name.length() == 0) + return null; + for (FtpUser user: getUsers()) { + if (user.getName().equals(name)) + return user; + } + return null; + } + + public int getPort() { + return getInt(PORT); + } + + public String getServerRoot(){ + String root = getString(SERVERROOT); + return FtpConstants.terminatedDir(root); + } + + @SuppressWarnings("unchecked") + public List getUsers(){ + Object o = get(USERS); + return (List) o; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpSession.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpSession.java new file mode 100644 index 00000000..6480b3b5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/FtpSession.java @@ -0,0 +1,64 @@ +package user.commons.ftp; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.net.Socket; + +/** + * Ftp server oldali kliens session, a bejövõ parancsok kezelésére. + * Saját szálon fut, és minden kapcsolathoz külön session tartozik. + * Quit parancsra, vagy kliens oldali kapcsolat lezárás esetén kilép. + * + * @author vasary + */ +class FtpSession extends Thread { + private Socket socket = null; + private DataInputStream inputStream = null; + private DataOutputStream outputStream = null; + private String name = "FtpServer Main Thread for %1$s"; + private FtpServer server = null; + + FtpSession(FtpServer server, Socket socket) { + this.server = server; + this.socket = socket; + } + + public DataOutputStream getOutputStream() { + return this.outputStream; + } + + public FtpServer getServer() { + return this.server; + } + + public void run() { + this.setName(String.format(name, socket.getRemoteSocketAddress())); + + System.out.print("Trying to create streams..."); + try { + byte[] buf = new byte[FtpConstants.BufferSize]; + inputStream = new DataInputStream(socket.getInputStream()); + outputStream = new DataOutputStream(socket.getOutputStream()); + System.out.println("created."); + FtpProtocol protocol = new FtpProtocol(this); + + while (true) { + int byteCount = 0; + String line = ""; + while ((byteCount = inputStream.read(buf)) > 0) { + line += new String(buf, 0, byteCount); + if (line.contains(FtpConstants.EOL)) + break; + } + line = line.trim(); + System.out.println(line); + if (!protocol.ProcessCommand(line)) + break;//QUIT parancsra kilépés! + } + + } catch (Exception e) { + System.out.println("Ftp session error: " + e.getMessage()); + return; + } + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/IProgressEventListener.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/IProgressEventListener.java new file mode 100644 index 00000000..c25cbba8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/IProgressEventListener.java @@ -0,0 +1,15 @@ +package user.commons.ftp; + +import java.util.EventListener; +/** + * Ftp kliens file események. + * Egy file fel- és letöltésekor hívódik meg. + * Tartalmazza a folyamat százalékos állapotát. + * Visszajelzéssel megszakítható a folyamat. + * + * @author vasary + */ +public interface IProgressEventListener extends EventListener { + public void progressChanged(ProgressEvent evt); +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/ProgressEvent.java b/server/user.jobengine.osgi.commons/src/user/commons/ftp/ProgressEvent.java new file mode 100644 index 00000000..4b3212f6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/ProgressEvent.java @@ -0,0 +1,40 @@ +package user.commons.ftp; + +import java.util.EventObject; + +/** + * File eseménykezelõ. + * + * @author vasary + */ +public class ProgressEvent extends EventObject { + private static final long serialVersionUID = 1L; + private int progress = 0; + public int getProgress() { + return progress; + } + + private boolean cancel = false; + + public boolean isCancel() { + return cancel; + } + + public void setCancel(boolean cancel) { + this.cancel = cancel; + } + + public ProgressEvent(Object source, int percent) { + super(source); + this.progress = percent; + } + + public void cancel() { + cancel = true; + } + + public void setProgress(int progress) { + this.progress = progress; + } +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/ftp/TODO.txt b/server/user.jobengine.osgi.commons/src/user/commons/ftp/TODO.txt new file mode 100644 index 00000000..f121e904 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/ftp/TODO.txt @@ -0,0 +1,7 @@ +-Hiányzó parancsok és átviteli módok implementálása + http://www.faqs.org/rfcs/rfc959.html + RNFR, RNTO, SMNT, STOU, ACCT, REIN, ABOR, STRU, MODE, APPE, ALLO, REST, SITE, STAT +-Proxy és fix adatcsatorna port támogatás +-FXP +-Log +-Integrált autentikáció diff --git a/server/user.jobengine.osgi.commons/src/user/commons/logging/InMemoryAppender.java b/server/user.jobengine.osgi.commons/src/user/commons/logging/InMemoryAppender.java new file mode 100644 index 00000000..13d0315f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/logging/InMemoryAppender.java @@ -0,0 +1,75 @@ +package user.commons.logging; + +public class InMemoryAppender { + +} +//public class InMemoryAppender extends AppenderSkeleton { +// private class WatchDog extends Thread { +// private volatile boolean shutdown = false; +// +// public void run() { +// while (!shutdown) { +// try { +// if (events != null) { +// int upperIndex = events.size() - historySize; +// if (upperIndex > 0) { +// List remove = events.subList(0, upperIndex); +// events.removeAll(remove); +// } +// Thread.sleep(watchCleanupPeriod); +// } +// } catch (Exception e) { +// logger.error(e); +// } +// } +// } +// +// void shutDown() { +// shutdown = true; +// } +// } +// +// private final static Logger logger = LogUtils.getLogger(InMemoryAppender.class); +// private int historySize = 1000; +// private int watchCleanupPeriod = 1000; +// private List events = Collections.synchronizedList(new ArrayList()); +// private final WatchDog watchDog; +// +// public InMemoryAppender() { +// watchDog = new WatchDog(); +// watchDog.start(); +// } +// +// @Override +// public void close() { +// if (watchDog != null) +// watchDog.shutDown(); +// events.clear(); +// } +// +// @Override +// public boolean requiresLayout() { +// return false; +// } +// +// @Override +// protected void append(LoggingEvent event) { +// String n = event.getLoggerName(); +// if (!getClass().getCanonicalName().equals(n)) { +// events.add(new LogEvent(event)); +// } +// } +// +// public List getEvents(LogLevel level) { +// List result = new ArrayList(); +// for (LogEvent event : events){ +// if (level == null) +// result.add(event); +// else +// if (event.getLevel().getLevelValue() >= level.getLevelValue()) +// result.add(event); +// } +// +// return result; +// } +//} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/logging/LogEvent.java b/server/user.jobengine.osgi.commons/src/user/commons/logging/LogEvent.java new file mode 100644 index 00000000..1e1eff09 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/logging/LogEvent.java @@ -0,0 +1,62 @@ +package user.commons.logging; + +import java.sql.Timestamp; + +public class LogEvent { + private Timestamp created; + private String message; + private String source; + private LogLevel level; + + public LogEvent() { + + } + + // LogEvent(LoggingEvent event) { + // created = new Timestamp(event.getTimeStamp()); + // message = event.getMessage() == null ? null : event.getMessage() + // .toString(); + // source = event.getLoggerName(); + // switch (event.getLevel().toInt()) { + // case Level.TRACE_INT: + // level = LogLevel.TRACE; + // break; + // case Level.ALL_INT: + // level = LogLevel.ALL; + // break; + // case Level.DEBUG_INT: + // level = LogLevel.DEBUG; + // break; + // case Level.ERROR_INT: + // level = LogLevel.ERROR; + // break; + // case Level.FATAL_INT: + // level = LogLevel.FATAL; + // break; + // case Level.INFO_INT: + // level = LogLevel.INFO; + // break; + // case Level.WARN_INT: + // level = LogLevel.WARN; + // break; + // } + // // System.out.println("Level : " + level + " : " + + // // event.getLevel().toInt()); + // } + + public Timestamp getCreated() { + return created; + } + + public String getMessage() { + return message; + } + + public String getSource() { + return source; + } + + public LogLevel getLevel() { + return level; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/logging/LogLevel.java b/server/user.jobengine.osgi.commons/src/user/commons/logging/LogLevel.java new file mode 100644 index 00000000..6d49fc38 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/logging/LogLevel.java @@ -0,0 +1,31 @@ +package user.commons.logging; + +/* + public static final int ALL_INT -2147483648 + public static final int DEBUG_INT 10000 + public static final int ERROR_INT 40000 + public static final int FATAL_INT 50000 + public static final int INFO_INT 20000 + public static final int OFF_INT 2147483647 + public static final int WARN_INT 30000 + public static final int TRACE_INT 5000 + */ + +public enum LogLevel { + FATAL(50000), ERROR(40000), WARN(30000), INFO(20000), DEBUG(10000), TRACE( + 5000), ALL(-2147483648); + + private int levelValue; + + LogLevel() { + } + + LogLevel(int levelValue) { + this.levelValue = levelValue; + } + + public int getLevelValue() { + return levelValue; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/logging/LogUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/logging/LogUtils.java new file mode 100644 index 00000000..52453a50 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/logging/LogUtils.java @@ -0,0 +1,54 @@ +package user.commons.logging; + +public class LogUtils { + private final static String LOGCONFIG = "log4j.configuration"; + public final static String LOGLEVEL = "jobengine.loglevel"; + private final static InMemoryAppender memoryAppender = new InMemoryAppender(); + private static boolean configured; + + public static InMemoryAppender getMemoryAppender() { + return memoryAppender; + } + + // public static Logger getLogger(Class clazz) { + // Logger result = null; + // try { + // Logger root = Logger.getRootLogger(); + // + // // Configure and watch + // String configFilePath = System.getProperty(LOGCONFIG); + // if (!configured && !StringUtils.isEmpty(configFilePath)) { + // File configFile = new File(configFilePath); + // if (configFile.exists()) { + // PropertyConfigurator.configureAndWatch(configFile.getAbsolutePath(), 3000); + // configured = true; + // } + // } + // + // // Check if root logger configured + // if (!configured && System.getProperty(LOGLEVEL) != null) { + // root.setLevel(Level.toLevel(System.getProperty(LOGLEVEL))); + // if (!root.getAllAppenders().hasMoreElements()) { + // root.addAppender(new ConsoleAppender(new PatternLayout("%p %c# %m%n"))); + // } + // root.info("Logging to console"); + // configured = true; + // } + // + // // create logger + // result = Logger.getLogger(clazz); + // result.addAppender(memoryAppender); + // + // } catch (Exception e) { + // e.printStackTrace(); + // } + // + // return result; + // } + // + // public static void logProperties() { + // Logger logger = LogUtils.getLogger(LogUtils.class); + // for (Object key : System.getProperties().keySet()) + // logger.info(key + "," + System.getProperties().get(key)); + // } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java new file mode 100644 index 00000000..0f7c16a2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioAPI.java @@ -0,0 +1,12 @@ +package user.commons.nexio; + +import java.util.Date; +import java.util.List; + +import com.ibm.nosql.json.api.DBObject; + +public interface INexioAPI { + + List getItems(Date modified, boolean itemsWithAgency); + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioChangeListener.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioChangeListener.java new file mode 100644 index 00000000..a741b51e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/INexioChangeListener.java @@ -0,0 +1,13 @@ +package user.commons.nexio; + +import com.ibm.nosql.json.api.BasicDBObject; + +public interface INexioChangeListener { + + void onCreate(BasicDBObject data); + + void onDelete(BasicDBObject data); + + void onUpdate(BasicDBObject data); + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioAPI.java new file mode 100644 index 00000000..ffdf9d83 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioAPI.java @@ -0,0 +1,37 @@ +package user.commons.nexio; + +import java.util.Date; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBList; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBCursor; +import com.ibm.nosql.json.api.DBObject; + +import user.commons.nosql.NoSQLUtils; + +public class NexioAPI implements INexioAPI { + private static final Logger logger = LogManager.getLogger(); + + @Override + public List getItems(Date modified, boolean itemsWithAgency) { + List result = null; + DB db; + try { + db = NoSQLUtils.getDB(); + DBCollection collection = db.getCollection(NexioDataMiner.CLIP_COLLECTION_NAME); + DBCursor find = collection.find().sort(new BasicDBObject("modified", new BasicDBList(-1, "$date"))); + if (find.hasNext()) + result = find.toArray(); + } catch (Exception e) { + logger.error(e); + } + return result; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java new file mode 100644 index 00000000..2ae78ece --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java @@ -0,0 +1,319 @@ +package user.commons.nexio; + +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.swing.event.EventListenerList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.joda.time.DateTime; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; + +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBCursor; + +import user.commons.ListUtils; +import user.commons.nexio.api.Clip; +import user.commons.nexio.api.ClipEvent; +import user.commons.nexio.api.ClipEventListener; +import user.commons.nexio.api.ClipEventType; +import user.commons.nexio.api.Controller; +import user.commons.nexio.server.protocol.GetExtendedFieldCommand; +import user.commons.nexio.server.protocol.Connection; +import user.commons.nosql.NoSQLUtils; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.ProgressEvent; + +/** + * NexioWSServlet hozza letre. + * Indulaskor betolti a teljes nexio clip listat mongodb-be. + * Beregisztralja magat ClipEventListener-nek. + * Az erkezo esemenyekkel updateli a mongo adatbazist (es a memoriat is) + * Az erkezo esemenyekrol eldonti, hogy add, update, vagy delete esemeny volt e + * Az uj, atalakitott esemenyt tovabbkuldi a feliratkozoknak (NexioWSServlet) + * @author robi + */ + +public class NexioClipEventDispatcher implements ClipEventListener{ + + private static final Logger logger = LogManager.getLogger(); + + private static final String ID = "id"; + private static final String VIDEO_FORMAT = "videoformat"; + private static final String VIDEO_BITRATE = "videobitrate"; + private static final String FILESIZE = "filesize"; + + private static final String SQLSERVER_JDBC_SQL_SERVER_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; + private static final String JOBENGINE_NEXIO_DB_PASSWORD = "jobengine.nexio.db.password"; + private static final String JOBENGINE_NEXIO_DB_USER = "jobengine.nexio.db.user"; + private static final String JOBENGINE_NEXIO_DB_URL = "jobengine.nexio.db.url"; + private static final String DURATION = "duration"; + private static final String START = "start"; + private static final String MODIFIEDTIMESTAMP = "modifiedtimestamp"; + private static final String EXTAGENCY = "extagency"; + private static final String RECORDDATE = "recorddate"; + private static final String LONGNAMEID = "longnameid"; + public static final String CLIP_COLLECTION_NAME = "nexioclips"; + private EventListenerList progressListenerList; + private ProgressEvent progressEvent = new ProgressEvent(this, 0); + private INexioChangeListener nexioChangeListener; + private DB db; + //R + private String NEXIO_HOST = System.getProperty("nexio.host"); //"10.228.43.18"; //echo: "10.10.1.55"; vmware: "10.228.43.18" + private Controller controller = null; + static private final byte[] GET_SPECIAL_ID_ATTRIBUTES_REQ = { (byte) 0xC8, (byte)0x84}; + + //BEGIN OF R + + //KONSTRUKTOR + public NexioClipEventDispatcher() { + try{ + //nexio init + this.controller = new Controller(NEXIO_HOST); + this.controller.connect(); + this.controller.getMediabase().getMediaListener().addClipEventListener(this); + logger.info("NexioClipEventDispatcher nexio server is connected."); + + this.progressListenerList = new EventListenerList(); + this.db = NoSQLUtils.getDB(); + this.dropAllClipsFromMongo(); + this.ensureIndexes(); + + //load clips into mongo + this.copyClipsIntoMongo(); + + }catch(Exception exc){ + logger.error("", exc); + } + } + + /** + * Nexio-bol kezdeti clip attoltes mongodb-be. + * @throws Exception + */ + private void copyClipsIntoMongo() throws Exception{ + Map emptyMap = new HashMap(); + Iterator clips = controller.getMediabase().getClips(); + while (clips.hasNext()) { + Clip clip = clips.next(); + BasicDBObject jsonClip = convertClipToJSON(clip); + this.saveClipIntoMongo(jsonClip, emptyMap); + } + } + + + private BasicDBObject convertClipToJSON(Clip clip) throws Exception{ + BasicDBObject jsClip = new BasicDBObject(); + jsClip.put(ID, clip.getId().get()); //Unique internal ID + jsClip.put(LONGNAMEID, clip.getXid().get()); //Extended ID (Filename) + jsClip.put(DURATION, clip.getDuration()); + jsClip.put(MODIFIEDTIMESTAMP, new DateTime(clip.getModifiedTimestamp().getTimeInMillis())); + jsClip.put(VIDEO_FORMAT, clip.getVideoFormat()); + jsClip.put(VIDEO_BITRATE, clip.getVideoBitrate()); + jsClip.put(FILESIZE, clip.getFileSize()); + jsClip.put(EXTAGENCY, clip.getExtendedField(GetExtendedFieldCommand.FN_AGENCY)); + //jsClip.put(RECORDDATE, new DateTime(rs.getString(i++)).toDate()); + //jsClip.put(EXTAGENCY, rs.getString(i++)); + //jsClip.put(START, rs.getString(i++)); + //System.out.println(String.format("ID = '%s'\tXID = '%s'\tDuration = '%s'\tModified = '%s'\tVideoFormat = '%s'\tVideoBitrate = '%s'", id, xid, duration, modifiedTimestamp.getTime(), videoFormat, videoBitrate)); + return jsClip; + } + + + @Override + public void clipEventPerformed(ClipEvent evt){ + try{ + if(isValidClip(evt.getClip())){ + BasicDBObject jsClip = convertClipToJSON(evt.getClip()); + if(evt.getEventType() == ClipEventType.CLIP_ADDED){ + //cache??? + Map mongoClips = loadClipsFromMongo(); + saveClipIntoMongo(jsClip, mongoClips); + }else + if(evt.getEventType() == ClipEventType.CLIP_DELETED){ + removeDeleted(jsClip); + } + } + }catch(Exception exc){ + logger.error("", exc); + } + } + + + /* + Nem foglalkozunk a clippel ha: + C8 84 Get Special ID Attributes + REQ: C8 84 + 8-byte(ID), + RESP: D284 MASK(2 byte, unsigned int, MSB first) vagy D0 84 if no matching ID handle is found + 0x0200 Not Ready to Play Indicates the first audio buffer of the media has not yet been written to disk. A controller should wait to load and play any clips with this attribute set. + 0x0400 Not Ready to Transfer Indicates the ID is currently in record or being written to disk + 0x0800 Not Ready to Archive Indicates the ID is currently in record or being written to disk + 0x1000 Transfer in Progress Indicates the ID is currently being transferred or imported into the system +*/ + private boolean isValidClip(Clip clip) throws Exception{ + boolean ret = false; + try{ + Connection connection = this.controller.getConnection(); + connection.write(GET_SPECIAL_ID_ATTRIBUTES_REQ); + connection.flush(); + byte[] buffer = new byte[2]; + connection.read(buffer, 0, 2); + if("D284".equals(bytesToHex(buffer))){ + buffer = new byte[2]; + int c= connection.read(buffer, 0, 2); + if(c == 2){ + int mask = ((buffer[0] << 8) & 0xFF00) | (buffer[1] & 0x00FF); + if((mask & 0x1E00) == 0){ //0x0200 + 0x0400 + 0x0800 + 0x1000 + ret = true; + } + + } + } + }catch(Exception exc){ + logger.error("", exc); + } + +/* + + int c = connection.read(buffer, 0, 2); + //2 bytes hosszan az idokozben hozzaadott id-k szamossaga + if (c < 2) { + throw new ProtocolException("c, 2, 2"); + } + //MSB, LSB + + return nofIds; + */ + return ret; + } + + //END OF R + + + + //create mongo index on longnameid + private void ensureIndexes() { + DBCollection collection = db.getCollection(CLIP_COLLECTION_NAME); + if (collection.count() == 0) + collection.ensureIndex(LONGNAMEID); + } + + + private void removeDeleted(BasicDBObject clipToDelete){ + DBCollection collection = db.getCollection(NexioClipEventDispatcher.CLIP_COLLECTION_NAME); + collection.remove(clipToDelete); + onDelete(clipToDelete); + } + + private Map loadClipsFromMongo() { + Map result = new HashMap<>(); + DBCollection collection = db.getCollection(NexioClipEventDispatcher.CLIP_COLLECTION_NAME); + DBCursor find = collection.find(); + if (find.hasNext()) { + List clips = ListUtils.cast(find.toArray()); + result = ListUtils.map(clips, item -> item.getString(LONGNAMEID)); + for (BasicDBObject clip : clips) + result.put(clip.getString(LONGNAMEID), clip); + } + return result; + } + + + private void saveClipIntoMongo(BasicDBObject clip, Map localClips) { + DBCollection collection = db.getCollection(CLIP_COLLECTION_NAME); + String name = clip.getString(LONGNAMEID); + BasicDBObject localClip = localClips.get(name); + if (localClip == null) { + collection.save(clip); + onCreate(clip); + } else { + clip.put("_id", localClip.get("_id")); + if (!clip.equals(localClip)) { + collection.save(clip); + onUpdate(clip); + } + } + } + + public void dropAllClipsFromMongo() { + db.getCollection(CLIP_COLLECTION_NAME).drop(); + } + + + + public void setNexioChangeListener(INexioChangeListener nexioChangeListener) { + this.nexioChangeListener = nexioChangeListener; + } + + + //dispatch events to NexioWSServlet + public void onCreate(BasicDBObject data) { + logger.debug("onCreate clip: " + data); + if (nexioChangeListener != null) + nexioChangeListener.onCreate(data); + } + + public void onDelete(BasicDBObject data) { + logger.debug("onDelete clip: " + data); + if (nexioChangeListener != null) + nexioChangeListener.onDelete(data); + } + + public void onUpdate(BasicDBObject data) { + logger.debug("onUpdate clip: " + data); + if (nexioChangeListener != null) + nexioChangeListener.onUpdate(data); + } + + public void addProgressListener(IProgressEventListener listener) { + progressListenerList.add(IProgressEventListener.class, listener); + } + + public void removeProgressListener(IProgressEventListener listener) { + progressListenerList.remove(IProgressEventListener.class, listener); + } + + + /* + BasicDBObject clip = new BasicDBObject(); + clip.put(LONGNAMEID, rs.getString(i++)); + clip.put(RECORDDATE, new DateTime(rs.getString(i++)).toDate()); + clip.put(EXTAGENCY, rs.getString(i++)); + clip.put(MODIFIEDTIMESTAMP, new DateTime(rs.getString(i++)).toDate()); + clip.put(START, rs.getString(i++)); + clip.put(DURATION, rs.getLong(i++)); + result.put(clip.getString(LONGNAMEID), clip); + int progress = idx * 50 / count; + if (progress - progressEvent.getProgress() > 0) { + progressEvent.setProgress(progress); + fireProgressEvent(progressEvent); + } +*/ + + static private final char[] hexArray = "0123456789ABCDEF".toCharArray(); + public static String bytesToHex(byte[] bytes) { + char[] hexChars = new char[bytes.length * 2]; + for ( int j = 0; j < bytes.length; j++ ) { + int v = bytes[j] & 0xFF; + hexChars[j * 2] = hexArray[v >>> 4]; + hexChars[j * 2 + 1] = hexArray[v & 0x0F]; + } + return new String(hexChars); + } + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDataMiner.java new file mode 100644 index 00000000..7df5813b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDataMiner.java @@ -0,0 +1,265 @@ +package user.commons.nexio; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.swing.event.EventListenerList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.joda.time.DateTime; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; +import org.osgi.framework.ServiceReference; + +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBCursor; + +import user.commons.ListUtils; +import user.commons.nosql.NoSQLUtils; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.ProgressEvent; + +public class NexioDataMiner implements Runnable, INexioChangeListener { + private static final Logger logger = LogManager.getLogger(); + private static final String SQLSERVER_JDBC_SQL_SERVER_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; + private static final String JOBENGINE_NEXIO_DB_PASSWORD = "jobengine.nexio.db.password"; + private static final String JOBENGINE_NEXIO_DB_USER = "jobengine.nexio.db.user"; + private static final String JOBENGINE_NEXIO_DB_URL = "jobengine.nexio.db.url"; + private static final String DURATION = "duration"; + private static final String START = "start"; + private static final String MODIFIEDTIMESTAMP = "modifiedtimestamp"; + private static final String EXTAGENCY = "extagency"; + private static final String RECORDDATE = "recorddate"; + private static final String LONGNAMEID = "longnameid"; + public static final String CLIP_COLLECTION_NAME = "nexioclips"; + private static String url, user, pass; + private EventListenerList progressListenerList; + private ProgressEvent progressEvent = new ProgressEvent(this, 0); + private INexioChangeListener nexioChangeListener; + private DB db; + + static { + url = System.getProperty(JOBENGINE_NEXIO_DB_URL); + user = System.getProperty(JOBENGINE_NEXIO_DB_USER); + pass = System.getProperty(JOBENGINE_NEXIO_DB_PASSWORD); + } + + public NexioDataMiner() { + this.progressListenerList = new EventListenerList(); + db = NoSQLUtils.getDB(); + ensureIndexes(); + } + + public void addProgressListener(IProgressEventListener listener) { + progressListenerList.add(IProgressEventListener.class, listener); + } + + public void removeProgressListener(IProgressEventListener listener) { + progressListenerList.remove(IProgressEventListener.class, listener); + } + + private static Connection getSQLConnection() throws ClassNotFoundException, SQLException { + Connection result = null; + Class.forName(SQLSERVER_JDBC_SQL_SERVER_DRIVER); + result = DriverManager.getConnection(url, user, pass); + return result; + } + + public Map queryClips(Connection con) { + Map result = new HashMap<>(); + int count = queryClipsCount(con); + logger.debug("Clips count is {}", count); + + String querySQL = "SELECT c.longnameid, CONVERT(NVARCHAR(30), c.recorddate, 126) as recordate, c.extagency, CONVERT(NVARCHAR(30), cd.modifiedtimestamp, 126) as modifiedtimestamp, cd.start, cd.duration FROM ClipsTbl c LEFT OUTER JOIN ClipsDomainsTbl cd ON (cd.longnameid = c.longnameid)"; + logger.debug("Executing statement: {}", querySQL); + try (PreparedStatement stmt = con.prepareStatement(querySQL); ResultSet rs = stmt.executeQuery();) { + int idx = 1; + while (rs.next()) { + int i = 1; + BasicDBObject clip = new BasicDBObject(); + clip.put(LONGNAMEID, rs.getString(i++)); + clip.put(RECORDDATE, new DateTime(rs.getString(i++)).toDate()); + clip.put(EXTAGENCY, rs.getString(i++)); + clip.put(MODIFIEDTIMESTAMP, new DateTime(rs.getString(i++)).toDate()); + clip.put(START, rs.getString(i++)); + clip.put(DURATION, rs.getLong(i++)); + result.put(clip.getString(LONGNAMEID), clip); + int progress = idx * 50 / count; + if (progress - progressEvent.getProgress() > 0) { + progressEvent.setProgress(progress); + fireProgressEvent(progressEvent); + } + + } + } catch (Exception e) { + logger.error(e); + } + return result; + } + + private int queryClipsCount(Connection con) { + int count = 0; + String countSQL = "SELECT COUNT(longnameid) as count FROM ClipsTbl"; + try (PreparedStatement stmt = con.prepareStatement(countSQL); ResultSet rs = stmt.executeQuery();) { + if (rs.next()) + count = rs.getInt(1); + } catch (Exception e) { + logger.error(e); + } + return count; + } + + private void fireProgressEvent(ProgressEvent evt) { + logger.debug("Progress changed to " + evt.getProgress() + "%"); + Object[] listeners = progressListenerList.getListenerList(); + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == IProgressEventListener.class) + ((IProgressEventListener) listeners[i + 1]).progressChanged(evt); + } + } + + @Override + public void run() { + try (Connection con = getSQLConnection()) { + setChangeListener(); + + Map remoteClips = queryClips(con); + Map localClips = readClips(); + removeDeleted(remoteClips, localClips); + + storeClips(remoteClips, localClips); + setNexioChangeListener(null); + } catch (Exception e) { + logger.error(e); + } + } + + private void setChangeListener() { + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + if (bundle != null) { + BundleContext bundleContext = bundle.getBundleContext(); + if (bundleContext != null) { + ServiceReference reference = bundleContext + .getServiceReference(INexioChangeListener.class); + if (reference != null) { + INexioChangeListener service = bundleContext.getService(reference); + setNexioChangeListener(service); + } + } + + } + } + + private void ensureIndexes() { + DBCollection collection = db.getCollection(CLIP_COLLECTION_NAME); + if (collection.count() == 0) + collection.ensureIndex(LONGNAMEID); + } + + private void removeDeleted(Map remoteClips, Map localClips) { + Set remoteNames = new HashSet<>(remoteClips.keySet()); + Set localNames = new HashSet<>(localClips.keySet()); + localNames.removeAll(remoteNames); + if (localNames.isEmpty()) + logger.debug("Nothing to remove"); + + DBCollection collection = db.getCollection(NexioDataMiner.CLIP_COLLECTION_NAME); + for (String name : localNames) { + logger.debug("Removing {}", name); + + BasicDBObject clip = localClips.get(name); + collection.remove(clip); + onDelete(clip); + } + } + + private Map readClips() { + Map result = new HashMap<>(); + DBCollection collection = db.getCollection(NexioDataMiner.CLIP_COLLECTION_NAME); + DBCursor find = collection.find(); + if (find.hasNext()) { + List clips = ListUtils.cast(find.toArray()); + result = ListUtils.map(clips, item -> item.getString(LONGNAMEID)); + for (BasicDBObject clip : clips) + result.put(clip.getString(LONGNAMEID), clip); + } + return result; + } + + private void storeClips(Map remoteClips, Map localClips) { + logger.trace("Enter"); + int idx = 1; + for (BasicDBObject clip : remoteClips.values()) { + storeClip(clip, localClips); + int progress = 50 + (idx * 50 / remoteClips.size()); + if (progress - progressEvent.getProgress() > 0) { + progressEvent.setProgress(progress); + fireProgressEvent(progressEvent); + } + idx++; + } + logger.trace("Exit"); + } + + private void storeClip(BasicDBObject clip, Map localClips) { + logger.trace("Enter"); + DBCollection collection = db.getCollection(CLIP_COLLECTION_NAME); + String name = clip.getString(LONGNAMEID); + BasicDBObject localClip = localClips.get(name); + if (localClip == null) { + logger.debug("Adding {}", name); + collection.save(clip); + onCreate(clip); + } else { + clip.put("_id", localClip.get("_id")); + if (!clip.equals(localClip)) { + logger.debug("Updating {}", name); + collection.save(clip); + onUpdate(clip); + } + } + logger.trace("Exit"); + } + + public void reset() { + db.getCollection(CLIP_COLLECTION_NAME).drop(); + } + + public void setNexioChangeListener(INexioChangeListener nexioChangeListener) { + this.nexioChangeListener = nexioChangeListener; + } + + @Override + public void onCreate(BasicDBObject data) { + logger.debug("onCreate clip: " + data); + if (nexioChangeListener != null) + nexioChangeListener.onCreate(data); + } + + @Override + public void onDelete(BasicDBObject data) { + logger.debug("onDelete clip: " + data); + if (nexioChangeListener != null) + nexioChangeListener.onDelete(data); + } + + @Override + public void onUpdate(BasicDBObject data) { + logger.debug("onUpdate clip: " + data); + if (nexioChangeListener != null) + nexioChangeListener.onUpdate(data); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Clip.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Clip.java new file mode 100644 index 00000000..a25a6935 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Clip.java @@ -0,0 +1,24 @@ +package user.commons.nexio.api; + +import user.commons.nexio.server.protocol.*; +import java.io.IOException; +import java.util.Calendar; + +public interface Clip { + public int getDuration() throws ClipNotFoundException, IOException, ProtocolException; + + public int getVideoFormat() throws ClipNotFoundException, IOException, ProtocolException; + + public int getVideoBitrate() throws ClipNotFoundException, IOException, ProtocolException; + + public Id getId(); + + public Calendar getModifiedTimestamp() throws ClipNotFoundException, IOException, ProtocolException; + + public Xid getXid() throws ClipNotFoundException, IOException, ProtocolException; + + public long getFileSize() throws ClipNotFoundException, IOException, ProtocolException; + + public byte[] getExtendedField(byte[] fieldNumber) throws IOException, ProtocolException; + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEvent.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEvent.java new file mode 100644 index 00000000..eca3e1e6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEvent.java @@ -0,0 +1,30 @@ +package user.commons.nexio.api; + +public class ClipEvent { + + private Clip clip = null; + private ClipEventType eventType = null; + + public ClipEvent(){ + } + + public ClipEvent(Clip _clip, ClipEventType _eventType){ + this.clip = clip; + this.eventType = _eventType; + } + + public Clip getClip() { + return clip; + } + public void setClip(Clip clip) { + this.clip = clip; + } + + public ClipEventType getEventType() { + return eventType; + } + public void setEventType(ClipEventType eventType) { + this.eventType = eventType; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEventListener.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEventListener.java new file mode 100644 index 00000000..d7e45126 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEventListener.java @@ -0,0 +1,5 @@ +package user.commons.nexio.api; + +public interface ClipEventListener { + public void clipEventPerformed(ClipEvent evt); +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEventType.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEventType.java new file mode 100644 index 00000000..ad96dbb9 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipEventType.java @@ -0,0 +1,15 @@ +package user.commons.nexio.api; + +public enum ClipEventType { + + CLIP_ADDED, + CLIP_DELETED; + + public String value() { + return name(); + } + + public static ClipEventType fromValue(String v) { + return valueOf(v); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipImpl.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipImpl.java new file mode 100644 index 00000000..447e1ad7 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipImpl.java @@ -0,0 +1,158 @@ +package user.commons.nexio.api; + +import user.commons.nexio.server.protocol.*; +import java.io.IOException; +import java.util.Calendar; + +class ClipImpl implements Clip { + + private static final String PROTOCOL = "protocol"; + private static final String ID = "id"; + private static final String XID = "xid"; + private static final String METADATA = "metadata"; + private Id id = null; + private Xid xid = null; + private final NexioServerProtocol protocol; + private byte[] metadata = null; + private Calendar timestamp = null; + private long fileSize = -1; + + ClipImpl(NexioServerProtocol protocol, Id id) { + if (protocol == null) { + throw new NullPointerException(PROTOCOL); + } + if (id == null) { + throw new NullPointerException(ID); + } + this.protocol = protocol; + this.id = id; + } + + public ClipImpl(NexioServerProtocol protocol, Id id, byte[] metadata) { + this(protocol, id); + if (metadata == null) { + throw new NullPointerException(METADATA); + } + this.metadata = metadata; + } + + ClipImpl(NexioServerProtocol protocol, Id id, Xid xid) { + this(protocol, id); + if (xid == null) { + throw new NullPointerException(XID); + } + this.xid = xid; + } + + private void checkClipExists(Object o) throws ClipNotFoundException { + // Nexio returns with "ID handle not found" when the clip has been + // deleted. + if (o == null) { + throw new ClipNotFoundException(id); + } + } + + @Override + public int getDuration() throws ClipNotFoundException, IOException, ProtocolException { + if (metadata == null) { + metadata = protocol.executeGetIDMetadata(id); + checkClipExists(metadata); + } + return metadata[16] + (metadata[17] << 8) + (metadata[18] << 16) + + (metadata[19] << 24); + } + + /** + @return + 0x00 Not supported + 0x01 Not supported + 0x02 MPEG2 4:2:0 + 0x03 MPEG2 4:2:2 + 0x04 DVCAM version of DV25 + 0x05 DVCPRO version of DV25 + 0x06 DV50, DVCPRO HD, or DNxHD + 0x07 Uncompressed KRGB 8 bits + 0x08 Uncompressed K 16 bits + 0x09 IMX (MPEG 4:2:2), CBG (constrained bytes per GOP) + 0x0A H.264 4:2:0 + 0x0B H.264 4:2:2 + 0x0C H.264 4:2:0 CBG (e.g. AVC-Intra class 50) + 0x0D H.264 4:2:2 CBG (e.g. AVC-Intra class 100) + 0x0E Reserved + 0x0F Audio-only (no video) + */ + @Override + public int getVideoFormat() throws ClipNotFoundException, IOException, ProtocolException{ + if (metadata == null) { + metadata = protocol.executeGetIDMetadata(id); + checkClipExists(metadata); + } + return metadata[8]; + } + + + + @Override + public int getVideoBitrate() throws ClipNotFoundException, IOException, ProtocolException{ + int ret = 0; + if (metadata == null) { + metadata = protocol.executeGetIDMetadata(id); + checkClipExists(metadata); + } + //Exact report of the compressed bit rate of the video portion of the clip. + //The 2 bytes are returned LSB first. This information replaces information provided + //in Data #11 as of the NEXIO 6.0 Software Release + ret = metadata[20] + (metadata[21] << 8); + if(ret == 0){ + //Use the information in this field only if the Exact Video Bit Rate = 0 (Data #20-21). + //It reports the compressed bit rate of the video portion of the clip. + //See note below for interpreting values >50 Mb/s. + ret = metadata[11]; + } + return ret; + } + + + + + @Override + public Id getId() { + return id; + } + + @Override + public Calendar getModifiedTimestamp() throws ClipNotFoundException, + IOException, ProtocolException { + if (timestamp == null) { + timestamp = protocol + .executeGetExtendedFieldGetModifiedTimestamp(id); + checkClipExists(timestamp); + } + return timestamp; + } + + @Override + public Xid getXid() throws ClipNotFoundException, IOException, + ProtocolException { + if (xid == null) { + xid = protocol.executeGetExtendedIDFromIDHandle(id); + checkClipExists(xid); + } + return xid; + } + + @Override + public long getFileSize() throws ClipNotFoundException, IOException, ProtocolException { + if (fileSize == -1) { + fileSize = protocol.executeGetIDFileSizeCommand(id); + checkClipExists(fileSize > -1 ? new Long(fileSize) : null); + } + return fileSize; + } + + @Override + public byte[] getExtendedField(byte[] fieldNumber) throws IOException, ProtocolException{ + return protocol.executeGetExtendedFieldCommand(id, fieldNumber); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipNotFoundException.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipNotFoundException.java new file mode 100644 index 00000000..ffdae408 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipNotFoundException.java @@ -0,0 +1,16 @@ +package user.commons.nexio.api; + +import user.commons.nexio.server.protocol.*; + +public class ClipNotFoundException extends Exception { + + private static final String OBJECT_NOT_FOUND_MESSAGE = "Object (%s) not found."; + /** + * + */ + private static final long serialVersionUID = 9051559294453607276L; + + public ClipNotFoundException(Id id) { + super(String.format(OBJECT_NOT_FOUND_MESSAGE, id)); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Controller.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Controller.java new file mode 100644 index 00000000..c8ae94bf --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Controller.java @@ -0,0 +1,48 @@ +package user.commons.nexio.api; + +import user.commons.nexio.server.protocol.*; +import java.io.IOException; +import java.net.UnknownHostException; + +public class Controller { + + private Connection connection = null; + private String host = null; + private int port = 0; + private Mediabase mediabase = null; + + public Controller(String host) { + this(host, 557); + } + + public Controller(String host, int port) { + this.host = host; + this.port = port; + } + + public void connect() throws UnknownHostException, IOException { + connection = TCPConnection.getInstance(host, port); + mediabase = new MediabaseImpl(new NexioServerProtocolImpl(connection)); + } + + public void disconnect() throws IOException { + connection.disconnect(); + } + + public Mediabase getMediabase() { + return mediabase; + } + + public String getHost(){ + return this.host; + } + + public int getPort(){ + return this.port; + } + + public Connection getConnection(){ + return this.connection; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/MediaListener.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/MediaListener.java new file mode 100644 index 00000000..482e2085 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/MediaListener.java @@ -0,0 +1,250 @@ +package user.commons.nexio.api; + +import java.util.ArrayList; +import java.util.Iterator; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.nexio.server.protocol.Connection; +import user.commons.nexio.server.protocol.Id; +import user.commons.nexio.server.protocol.TCPConnection; + +/** + * Szeparalt konnekcion feliratkozik a nexio change notification eventekre. + * 1. send CHANGE_NOTIFICATION_REQ + mask (add+delete) + * 2. read (2 bytes) ACK + * 3. blocking read (4 bytes) CHANGE_NOTIFICATION_RESP 4 bytes, + * az utolso biten mondja meg, hogy add vagy delete NN(notification number) + * 4. send ACK + * 5. send LIST_FIRST_ID_LIST_ADDED vagy LIST_FIRST_ID_LIST_DELETED a 3. pont NN valasza alapjan + * 6. read LIST_FIRST.. response (2 bytes), elvart valasz: D84C + * 7. read first id (8 bytes) + * 8. send LIST_NEXT_ID_LIST + * 8b. read list next.. response(2 bytes) elvart valasz: D84D, ha nincs tobb akkor: D04D -> 9. pont + * 8c. read NEXT ID (8 bytes) ha D84D volt a 9. pont valasza + * 8d. vissza 8. pontra + * 9. ismetles a 3. ponttol + * @author robi + */ + +public class MediaListener implements Runnable{ + + static private final char[] hexArray = "0123456789ABCDEF".toCharArray(); + static private final Logger logger = LogManager.getLogger(); + //MASK REQ RESP_NOT_NUM + //00 00 00 01 0x00 IDs in Added List BC=0x01, NN=0x00, DATA=none + //00 00 00 02 0x01 IDs in Deleted List BC=0x01, NN=0x01, DATA=none + static private final byte[] CHANGE_NOTIFICATION_REQ = { (byte) 0xC4, (byte)0xA5, 0,0,0,0x03}; //C4A5 + MASK=ADD+DELETE + //10 01 response immediately + static private final byte[] ACK = { (byte) 0x10, (byte)0x01}; + //CF A6 BC NN DATA NN=0 -> IDs are in added list, NN=1 -> IDs are in deleted list + static private final byte[] CHANGE_NOTIFICATION_RESP = { (byte) 0xCF, (byte)0xA6}; + //List First ID List (C1 4C) + static private final byte[] LIST_FIRST_ID_LIST_ADDED = { (byte) 0xC1, (byte)0x4C, (byte)0x02}; //2 added, 3 deleted + static private final byte[] LIST_FIRST_ID_LIST_DELETED = { (byte) 0xC1, (byte)0x4C, (byte)0x03}; //2 added, 3 deleted + //List First ID List (C0 4D) + static private final byte[] LIST_NEXT_ID_LIST = { (byte) 0xC0, (byte)0x4D}; + + static private final String LIST_FIRST_ID_LIST_FOUND = "D84C"; + static private final String LIST_FIRST_ID_LIST_NOT_FOUND = "D04C"; + + static private final String LIST_NEXT_ID_LIST_FOUND = "D84D"; + static private final String LIST_NEXT_ID_LIST_NOT_FOUND = "D04D"; + + static private final int NN_ID_ADDED = 0; + static private final int NN_ID_DELETED = 1; + + private ArrayList clipEventListeners = new ArrayList(); + private boolean isRunning = false; + private Mediabase mediaBase = null; + + private int nexioPort = 557; + private String nexioHost = null; + private Connection connection = null; + + //KONSTRUKTOR + public MediaListener(Mediabase _mediaBase, String _nexioHost, int _nexioPort){ + this.mediaBase = _mediaBase; + this.nexioHost = _nexioHost; + this.nexioPort = _nexioPort; + startListener(); + } + + public void startListener(){ + try{ + createNexioConnection(); + this.isRunning = true; + Thread t = new Thread(this, "MediaListener"); + t.start(); + logger.info("Nexio MediaListener is starting..."); + }catch(Exception exc){ + logger.error("", exc); + } + } + + public void stopListener(){ + this.isRunning = false; + } + + + + public void run(){ + try{ + //SEND CHANGE NOTIFICATION REQ + writeBytes(CHANGE_NOTIFICATION_REQ); + + //ACK + byte[] buffer = readBytes(2); + logger.info("Nexio MediaListener is waiting for events.."); + + while(isRunning){ + try{ + //CHANGE_NOTIFICATION_RESP (BLOCKING READ!) + buffer = readBytes(4); //CFA6 BC NN->0=added, 1=deleted + int notificationNumber = buffer[3]; + logger.debug("Nexio MediaListener notification: " + bytesToHex(buffer)); + + //SEND ACK +// writeBytes(ACK); + + //LIST_FIRST_ID_LIST + /* + 0x01 Main ID Handle List D8 4C ID + 0x02 ID Handles Added List D8 4C ID + 0x03 ID Handles Deleted List D8 4C ID + 0x11 Main Extended ID List DF 4C BC XID * + 0x12 Extended IDs Added List DF 4C BC XID * + 0x13 Extended IDs Deleted List DF 4C BC XID * + 0x21 Main ID Handle/Extended ID List DF 4C BC ID XID * + 0x22 ID Handles/Extended IDs Added List DF 4C BC ID XID * + 0x23 ID Handles/Extended IDs Deleted List DF 4C BC ID XID * + */ + if(notificationNumber == NN_ID_ADDED){ + writeBytes(LIST_FIRST_ID_LIST_ADDED); + }else + if(notificationNumber == NN_ID_DELETED){ + //SEND ACK + writeBytes(ACK); + writeBytes(LIST_FIRST_ID_LIST_DELETED); + } + + //LIST_FIRST_ID_LIST response + buffer = readBytes(2); + if(LIST_FIRST_ID_LIST_FOUND.equals(bytesToHex(buffer))){ + + //read first id + buffer = readBytes(8); + String stringId = new String(buffer); + logger.debug("Nexio MediaListener first id: " + stringId); + fireEvent(stringId, notificationNumber); + + //read next ids + writeBytes(LIST_NEXT_ID_LIST); + for(buffer=readBytes(2); LIST_NEXT_ID_LIST_FOUND.equals(bytesToHex(buffer)) && isRunning; buffer=readBytes(2)){ + + byte[] idBuffer = readBytes(8); + stringId = new String(idBuffer); + logger.debug("Nexio MediaListener next id: " + stringId); + fireEvent(stringId, notificationNumber); + + writeBytes(LIST_NEXT_ID_LIST); + } + logger.debug("Nexio MediaListener end of id list: " + bytesToHex(buffer)); + //SEND ACK + writeBytes(ACK); + + }else + if(LIST_FIRST_ID_LIST_NOT_FOUND.equals(bytesToHex(buffer))){ + logger.debug("Nexio MediaListener LIST_FIRST_ID_LIST ID not found!"); + }else{ + logger.debug("Nexio MediaListener unknown answer has arrived for LIST_FIRST_ID_LIST: " + bytesToHex( buffer)); + } + }catch(Exception exc){ + logger.error("", exc); + } + } + this.connection.disconnect(); + }catch(Exception e){ + logger.error("", e); + } + } + + private void fireEvent(String idString, int notificationNumber) throws Exception{ + Id id = new Id(idString); + ClipEvent evt = null; + if(notificationNumber == NN_ID_ADDED){ + evt = new ClipEvent(mediaBase.getClip(id), ClipEventType.CLIP_ADDED); + }else + if(notificationNumber == NN_ID_DELETED){ + evt = new ClipEvent(mediaBase.getClip(id), ClipEventType.CLIP_DELETED); + } + for(ClipEventListener cel : this.clipEventListeners){ + cel.clipEventPerformed(evt); + } + } + + private byte[] readBytes(int numberOfBytes) throws Exception{ + try{ + byte[] ret = new byte[numberOfBytes]; + this.connection.read(ret, 0, numberOfBytes); + return ret; + }catch(Exception e){ + restartListener(); + throw e; + } + } + + private void writeBytes(byte[] toWrite) throws Exception{ + try{ + this.connection.write(toWrite); + this.connection.flush(); + }catch(Exception e){ + restartListener(); + throw e; + } + } + + + private void createNexioConnection() throws Exception{ + this.connection = TCPConnection.getInstance(this.nexioHost, this.nexioPort); + logger.info("Nexio MediaListener is connected to NEXIO " + this.nexioHost + " : " + this.nexioPort); + } + + + private void restartListener() throws Exception{ + this.isRunning = false; + Thread.sleep(3000); + try{ + Thread.currentThread().interrupt(); + }catch(Exception e){} + try{ + if(this.connection != null){ + this.connection.disconnect(); + } + }catch(Exception e){} + //new connection / new thread + startListener(); + } + + + public void addClipEventListener(ClipEventListener listener){ + this.clipEventListeners.add(listener); + } + + public void removeClipEventListener(ClipEventListener listener){ + this.clipEventListeners.remove(listener); + } + + public static String bytesToHex(byte[] bytes) { + char[] hexChars = new char[bytes.length * 2]; + for ( int j = 0; j < bytes.length; j++ ) { + int v = bytes[j] & 0xFF; + hexChars[j * 2] = hexArray[v >>> 4]; + hexChars[j * 2 + 1] = hexArray[v & 0x0F]; + } + return new String(hexChars); + } + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Mediabase.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Mediabase.java new file mode 100644 index 00000000..d9529906 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Mediabase.java @@ -0,0 +1,16 @@ +package user.commons.nexio.api; + +import user.commons.nexio.server.protocol.*; +import java.io.IOException; +import java.util.Iterator; + +public interface Mediabase { + + public Clip getClip(Id id) throws IOException, ProtocolException; + + public Clip getClip(Xid xid) throws IOException, ProtocolException; + + public Iterator getClips() throws IOException, ProtocolException; + + public MediaListener getMediaListener(); +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/MediabaseImpl.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/MediabaseImpl.java new file mode 100644 index 00000000..6fc16c39 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/MediabaseImpl.java @@ -0,0 +1,98 @@ +package user.commons.nexio.api; + +import user.commons.nexio.server.protocol.*; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +class MediabaseImpl implements Mediabase { + + private static final String ID = "id"; + private final NexioServerProtocol protocol; + private MediaListener mediaListener = null; + + //KONSTRUKTOR + public MediabaseImpl(NexioServerProtocol protocol) { + this.protocol = protocol; + this.mediaListener = new MediaListener(this, protocol.getConnection().getHost(), protocol.getConnection().getPort()); + } + + @Override + public Clip getClip(Id id) throws IOException, ProtocolException { + if (id == null) { + throw new NullPointerException(ID); + } + byte[] metadata = protocol.executeGetIDMetadata(id); + if (metadata == null) { + return null; + } + return new ClipImpl(protocol, id, metadata); + } + + @Override + public Clip getClip(Xid xid) throws IOException, ProtocolException { + Id id = protocol.executeGetIDHandleFromExtendedID(xid); + if (id == null) { + return null; + } + return new ClipImpl(protocol, id, xid); + } + + @Override + public Iterator getClips() throws IOException, ProtocolException { + return new Itr(); + } + + @Override + public MediaListener getMediaListener() { + return this.mediaListener; + } + + + private class Itr implements Iterator { + + private Clip next; + + public Itr() throws IOException, ProtocolException { + Id id = protocol.executeListFirstIDHandle(); + next = id != null ? new ClipImpl(protocol, id) : null; + } + + @Override + public boolean hasNext() { + return next != null; + } + + @Override + public Clip next() { + if (next == null) { + return null; + } + final Clip c = next; + try { + Id id = protocol.executeListNextIDHandle(); + + //next = id != null ? new ClipImpl(protocol, id) : null; + if(id != null){ + next = new ClipImpl(protocol, id); + }else{ + next = null; + } + } catch (IOException e) { + throw new RuntimeException(e); + } catch (ProtocolException e) { + throw new RuntimeException(e); + } + + return c; + } + + @Override + public void remove() { + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/samples/ListMetabaseContents.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/samples/ListMetabaseContents.java new file mode 100644 index 00000000..47cf63f2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/api/samples/ListMetabaseContents.java @@ -0,0 +1,409 @@ +package user.commons.nexio.api.samples; + +import user.commons.nexio.server.protocol.*; +import user.commons.nexio.api.*; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Iterator; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class ListMetabaseContents implements ClipEventListener{ + + static private final char[] hexArray = "0123456789ABCDEF".toCharArray(); + static private final Logger logger = LogManager.getLogger(); + //MASK REQ RESP_NOT_NUM + //00 00 00 01 0x00 IDs in Added List BC=0x01, NN=0x00, DATA=none + //00 00 00 02 0x01 IDs in Deleted List BC=0x01, NN=0x01, DATA=none // 1+2 + static private final byte[] CHANGE_NOTIFICATION_REQ = { (byte) 0xC4, (byte)0xA5, 0,0,0,0x03}; //C4A5 + MASK=ADD+DELETE + //10 01 response immediately + static private final byte[] ACK = { (byte) 0x10, (byte)0x01}; + //CF A6 BC NN DATA NN=0 -> IDs are in added list, NN=1 -> IDs are in deleted list + static private final byte[] CHANGE_NOTIFICATION_RESP = { (byte) 0xCF, (byte)0xA6}; + //List First ID List (C1 4C) + static private final byte[] LIST_FIRST_ID_LIST_ADDED = { (byte) 0xC1, (byte)0x4C, (byte)0x02}; //2 added, 3 deleted + static private final byte[] LIST_FIRST_ID_LIST_DELETED = { (byte) 0xC1, (byte)0x4C, (byte)0x03}; //2 added, 3 deleted + //List First ID List (C0 4D) + static private final byte[] LIST_NEXT_ID_LIST = { (byte) 0xC0, (byte)0x4D}; + + + static private final String LIST_FIRST_ID_LIST_NOT_FOUND = "D04C"; + static private final String LIST_NEXT_ID_LIST_NOT_FOUND = "D04D"; + + static private final String LIST_FIRST_ID_LIST_FOUND = "D84C"; + static private final String LIST_NEXT_ID_LIST_FOUND = "D84D"; + //static private final String LIST_FIRST_ID_LIST_FOUND = "DF4C"; //0x22, 0x23 foundhoz + //static private final String LIST_NEXT_ID_LIST_FOUND = "D84D"; //0x22, 0x23 foundhoz + + + static private final int NN_ID_ADDED = 0; + static private final int NN_ID_DELETED = 1; + + private ArrayList clipEventListeners = new ArrayList(); + private boolean isRunning = false; + private Mediabase mediaBase = null; + + private int nexioPort = 557; + private String nexioHost = "10.228.43.18"; //echo: "10.10.1.55"; vmware: "10.228.43.18" + private Connection connection = null; + + + + //KONSTRUKTOR + public ListMetabaseContents(){ + try{ + this.isRunning = true; + createNexioConnection(); + this.testAddDelete(); + +/* + Controller controller = new Controller(nexioHost); + controller.connect(); + System.out.println("Connected."); +*/ + +/* + Iterator clips = mediabase.getClips(); + while (clips.hasNext()) { + Clip clip = clips.next(); + // Unique internal ID + String id = clip.getId().get(); + // Extended ID (Filename) + String xid = clip.getXid().get(); + // Number of frames + long duration = clip.getDuration(); + // Timestamp of last modification + Calendar modifiedTimestamp = clip.getModifiedTimestamp(); + //Video Format + int videoFormat = clip.getVideoFormat(); + //Video Bitrate + int videoBitrate = clip.getVideoBitrate(); + + System.out.println(String.format("ID = '%s'\tXID = '%s'\tDuration = '%s'\tModified = '%s'\tVideoFormat = '%s'\tVideoBitrate = '%s'", + id, xid, duration, modifiedTimestamp.getTime(), videoFormat, videoBitrate)); + } + + //Clip clip = mediabase.getClip(new Xid("xdcam-pal-d10-imx30-8")); + //long duration2 = clip.getDuration(); + //System.out.println(clip + " dur: "+ duration2); +*/ + + }catch(Exception exc){ + exc.printStackTrace(); + } + } + + public void clipEventPerformed(ClipEvent evt){ + System.out.println("clipEventPerformed " + evt.getEventType() + ", " + evt.getClip()); + } + + + public void testAddDelete(){ + try{ + //SEND CHANGE NOTIFICATION REQ + writeBytes(CHANGE_NOTIFICATION_REQ); + + //ACK + byte[] buffer = readBytes(2); + System.out.println("Nexio MediaListener is waiting for events.."); + + while(isRunning){ + try{ + //CHANGE_NOTIFICATION_RESP (BLOCKING READ!) + //TEST CODE + if(buffer.length == 2){ + buffer = readBytes(4); //CFA6 BC NN->0=added, 1=deleted + } + + int notificationNumber = buffer[3]; + System.out.println("Nexio MediaListener notification: " + bytesToHex(buffer)); + + //SEND ACK +// writeBytes(ACK); + + //LIST_FIRST_ID_LIST + /* + 0x01 Main ID Handle List D8 4C ID + 0x02 ID Handles Added List D8 4C ID + 0x03 ID Handles Deleted List D8 4C ID + 0x11 Main Extended ID List DF 4C BC XID * + 0x12 Extended IDs Added List DF 4C BC XID * + 0x13 Extended IDs Deleted List DF 4C BC XID * + 0x21 Main ID Handle/Extended ID List DF 4C BC ID XID * + 0x22 ID Handles/Extended IDs Added List DF 4C BC ID XID * + 0x23 ID Handles/Extended IDs Deleted List DF 4C BC ID XID * + */ + if(notificationNumber == NN_ID_ADDED){ + writeBytes(LIST_FIRST_ID_LIST_ADDED); + }else + if(notificationNumber == NN_ID_DELETED){ +writeBytes(ACK); + writeBytes(LIST_FIRST_ID_LIST_DELETED); + } + + //LIST_FIRST_ID_LIST response + buffer = readBytes(2); + if(LIST_FIRST_ID_LIST_FOUND.equals(bytesToHex(buffer))){ +/* + * //extended id version 0x22, 0x23 + //found 2, BC 1, ID 8, XID {BC-8} + buffer = readBytes(1); + int bc = buffer[0]; + buffer = readBytes(8); + String stringId = new String(buffer); + buffer = readBytes(bc-8); + String xid = new String(buffer); + System.out.println("Nexio MediaListener first id: " + stringId + ", xid: " + xid); +*/ + + //found 2, ID 8 + //read first id + buffer = readBytes(8); + String stringId = new String(buffer); + System.out.println("Nexio MediaListener first id: " + stringId); + //fireEvent(stringId, notificationNumber); + + //read next ids + writeBytes(LIST_NEXT_ID_LIST); + + for(buffer=readBytes(2); LIST_NEXT_ID_LIST_FOUND.equals(bytesToHex(buffer)) && isRunning; buffer=readBytes(2)){ + + byte[] idBuffer = readBytes(8); + stringId = new String(idBuffer); + System.out.println("Nexio MediaListener next id: " + stringId); + //fireEvent(stringId, notificationNumber); + +/* + //extended id 0x22, 0x23 versions + //found 2, BC 1, ID 8, XID {BC-8} + buffer = readBytes(1); + bc = buffer[0]; + buffer = readBytes(8); + stringId = new String(buffer); + buffer = readBytes(bc-8); + xid = new String(buffer); + System.out.println("Nexio MediaListener next id: " + stringId + ", xid: " + xid); +*/ + writeBytes(LIST_NEXT_ID_LIST); + } + System.out.println("Nexio MediaListener end of id list: " + bytesToHex(buffer)); + +writeBytes(ACK); + + //TEST CODE + if(bytesToHex(buffer).equals("CFA6")){ + buffer = readBytes(2); + byte[] newBuffer = new byte[]{(byte)0xCF,(byte)0xA6, buffer[0], buffer[1]}; + buffer = newBuffer; + } + + + }else + if(LIST_FIRST_ID_LIST_NOT_FOUND.equals(bytesToHex(buffer))){ + System.out.println("Nexio MediaListener LIST_FIRST_ID_LIST ID not found!"); + }else{ + System.out.println("Nexio MediaListener unknown answer has arrived for LIST_FIRST_ID_LIST: " + bytesToHex( buffer)); + } + }catch(Exception exc){ + exc.printStackTrace(); + } + } + this.connection.disconnect(); + }catch(Exception e){ + e.printStackTrace(); + } + } + + + private byte[] readBytes(int numberOfBytes) throws Exception{ + try{ + byte[] ret = new byte[numberOfBytes]; + this.connection.read(ret, 0, numberOfBytes); + return ret; + }catch(Exception e){ + //restartListener(); + throw e; + } + } + + private void writeBytes(byte[] toWrite) throws Exception{ + try{ + //testcode calc checksum +/* + byte[] finalbytes = Arrays.copyOf(toWrite, toWrite.length + 1); + long chksum = 0; + for(int c=0; c IDs are in added list, NN=1 -> IDs are in deleted list + byte[] CHANGE_NOTIFICATION_RESP = { (byte) 0xCF, (byte)0xA6}; + + //List First ID List (C1 4C) + byte[] LIST_FIRST_ID_LIST_ADDED = { (byte) 0xC1, (byte)0x4C, (byte)0x02}; //2 added, 3 deleted + byte[] LIST_FIRST_ID_LIST_DELETED = { (byte) 0xC1, (byte)0x4C, (byte)0x03}; //2 added, 3 deleted + + //List First ID List (C0 4D) + byte[] LIST_NEXT_ID_LIST = { (byte) 0xC0, (byte)0x4D}; + + + Connection connection = TCPConnection.getInstance(NEXIO_HOST, 557); +// connection.write(ID_LIST); +// connection.flush(); + + connection.write(CHANGE_NOTIFICATION_REQ); + connection.flush(); + //ACK + byte[] buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + + + while("1".equals("1")){ + + //CHANGE_NOTIFICATION_RESP (blocking read) + buffer = new byte[4]; + c = connection.read(buffer,0,4); //CFA6 BC NN -> 0=added, 1=deleted + System.out.println("change notification resp: " + bytesToHex(buffer)); + + //ACK sending back + connection.write(ACK); + connection.flush(); + + //LIST_FIRST_ID_LIST + + //0x01 Main ID Handle List D8 4C ID + //0x02 ID Handles Added List D8 4C ID + //0x03 ID Handles Deleted List D8 4C ID + //0x11 Main Extended ID List DF 4C BC XID * + //0x12 Extended IDs Added List DF 4C BC XID * + //0x13 Extended IDs Deleted List DF 4C BC XID * + //0x21 Main ID Handle/Extended ID List DF 4C BC ID XID * + //0x22 ID Handles/Extended IDs Added List DF 4C BC ID XID * + //0x23 ID Handles/Extended IDs Deleted List DF 4C BC ID XID * + + if(buffer[3] == 0){ + connection.write(LIST_FIRST_ID_LIST_ADDED); + System.out.println("NN ADDED"); + }else + if(buffer[3] == 1){ + connection.write(LIST_FIRST_ID_LIST_DELETED); + System.out.println("NN DELETED"); + } + connection.flush(); + + //READ FIRST ID + buffer = new byte[2]; + c = connection.read(buffer, 0, 2); + if("D84C".equals(bytesToHex(buffer))){ + System.out.println("reading first id..."); + + //added or deleted + buffer = new byte[8]; + c = connection.read(buffer, 0, 8); + System.out.println("FIRST ID: " + new String(buffer)); + + //C0 4D List Next ID List + connection.write(LIST_NEXT_ID_LIST); + connection.flush(); + + buffer = new byte[2]; + //D04D amikor elfogy + for(connection.read(buffer, 0, 2); bytesToHex(buffer).equals("D84D"); connection.read(buffer, 0, 2)){ + + buffer = new byte[8]; + c = connection.read(buffer, 0, 8); + System.out.println("NEXT ID: " + new String(buffer)); + + connection.write(LIST_NEXT_ID_LIST); + connection.flush(); + + buffer = new byte[2]; + } + //System.out.println("LIST_NEXT_ID_LIST RESP: " + bytesToHex(buffer)); + }else + if(bytesToHex(buffer).equals("D04C")){ + System.out.println("No one found for first ID!"); + }else{ + System.out.println("Error in list first id list response: " + bytesToHex( buffer)); + } + } + + + //int i = connection.read(); + connection.disconnect(); +*/ + } + + + + private static Id getNextId(Connection connection) throws IOException, ProtocolException{ + byte[] buffer = new byte[8]; + int c = connection.read(buffer, 0, 8); + if (c != 8){ + return null; //throw getException_InvalidResponseLength(c, 8, 8); + }else{ + return new Id(new String(buffer)); + } + } + + + private static int getNOFIds(Connection connection) throws IOException, ProtocolException{ + byte[] buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + //2 bytes hosszan az idokozben hozzaadott id-k szamossaga + if (c < 2) { + throw new ProtocolException("c, 2, 2"); + } + //MSB, LSB + int nofIds = ((buffer[0] << 8) & 0xFF00) | (buffer[1] & 0x00FF); //00000001 10010000 + return nofIds; + } + + + public static String bytesToHex(byte[] bytes) { + char[] hexChars = new char[bytes.length * 2]; + for ( int j = 0; j < bytes.length; j++ ) { + int v = bytes[j] & 0xFF; + hexChars[j * 2] = hexArray[v >>> 4]; + hexChars[j * 2 + 1] = hexArray[v & 0x0F]; + } + return new String(hexChars); + } + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Command.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Command.java new file mode 100644 index 00000000..694088bc --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Command.java @@ -0,0 +1,47 @@ +package user.commons.nexio.server.protocol; + +public abstract class Command { + + private static final String INVALID_RESPONSE_INVALID_XID_LENGTH = "Invalid response, invalid XID length. (expected = %d, xid = '%s')"; + private static final String INVALID_RESPONSE_LENGTH = "Invalid response length, "; + private static final String FORMAT1 = "%02X%02X"; + private static final String EXPECTED_GOT = " expected, got "; + private static final String INVALID_RESPONSE_HEADER_EXPECTED = "Invalid response header, "; + + protected final Connection connection; + + public Command(Connection connection) { + this.connection = connection; + } + + protected ProtocolException getException_InvalidResponseHeader(byte[] buffer, String... expecteds) { + String r = ""; + int l = expecteds.length; + for (int i = 0; i < l; i++) { + r += expecteds[i]; + if (i != l - 1) { + r += " or "; + } + } + + return new ProtocolException( + INVALID_RESPONSE_HEADER_EXPECTED + r + EXPECTED_GOT + String.format(FORMAT1, buffer[0], buffer[1])); + } + + protected ProtocolException getException_InvalidResponseLength(int length, int... expecteds) { + String r = ""; + int l = expecteds.length; + for (int i = 0; i < l; i++) { + r += expecteds[i]; + if (i != l - 1) { + r += " or "; + } + } + return new ProtocolException(INVALID_RESPONSE_LENGTH + r + EXPECTED_GOT + length); + } + + protected ProtocolException getException_InvalidXIDLength(int length, String xid) { + return new ProtocolException(String.format(INVALID_RESPONSE_INVALID_XID_LENGTH, length, xid)); + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Connection.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Connection.java new file mode 100644 index 00000000..a9c76690 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Connection.java @@ -0,0 +1,31 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; + +public interface Connection { + + /** + * + * @throws IOException + */ + public void disconnect() throws IOException; + + public void flush() throws IOException; + + public int read(byte[] b) throws IOException; + + // Reads up to len bytes of data from the input stream into an array of + // bytes. + public int read(byte[] b, int off, int len) throws IOException; + + public int read() throws IOException; + + public void write(byte[] b) throws IOException; + + public void write(int b) throws IOException; + + public String getHost(); + + public int getPort(); + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedFieldCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedFieldCommand.java new file mode 100644 index 00000000..41efde69 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedFieldCommand.java @@ -0,0 +1,125 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.Calendar; + + +/* +Number Field Description Max Size + +0 Record Date/Time A FILETIME structure representing the time and date stamp + of when the media was recorded 8 +1 Codec Where Recorded The video server name and channel where the media was recorded 19 +2 Legacy Field Used only in Nexio Browse 1.0 and older low-res systems to link + a low-res clip to its matching high-res clip’s 8-byte ID handle. 8 +3 UMID Unique Media Identifier 64 +4 Video Info Extended video format and frame rate in a bit-wise algorithm + of 128 bits 16 +5 Video Codec FourCC Value The FourCC value used in MOV files to identify the video format + of the media (as of Nexio 8.0) 4 +6 Legacy Field 128-bit global unique identifier 16 +7 User Name UNICODE-stored field indicating the individual logged in + to the Nexio system at record time 64 +8 Department UNICODE-stored field typically indicating the department + of the individual logged in at record time 64 +9 Title UNICODE-stored field typically indicating + a title associated with the clip 64 +10 Reserved Reserved 12 +11 Link UNICODE-stored field for use with ClipSync feature that stores + the ID of media linked to the current ID for in sync dual playback 64 +12 Description UNICODE-stored 120-character user entry text field + for storing detail about media 240 +13 Agency UNICODE-stored 15-character user entry text field + for storing detail about media 30 +14 User-definable Field #1 UNICODE-stored 25-character user entry field 50 +15 User-definable Field #2 UNICODE-stored 25-character user entry field 50 +16 User-definable Field #3 UNICODE-stored 25-character user entry field 50 +17 User-definable Field #4 UNICODE-stored 25-character user entry field 50 +18 External Controller UID A field reserved for external controllers needing a place + to store their own unique identifiers 16 +19 Video ARC A series of seven 2-byte values defining a clip’s video + aspect ratio conversion when loaded into + a channel of opposite resolution. + This field also sets whether to override existing AFD data and whether + to override an SD clip’s native aspect ratio. 14 +20 Modified Timestamp A FILETIME structure representing the time and date stamp when + the media was last modified. See below for list of protocol + commands which trigger this timestamp. 8 +21 Video QA Status Results of video quality analysis as performed by + the QuiC software application 2 +22 User Segments In Use Used for managing the information stored + in user data segments, part of the DTA modes. + The 2 bytes represent a bitmask of “in use” user data slots 2 +23 Audio Track Compression Info A series of 1-byte data per audio track (up to 32 tracks) to indicate + each track’s compression type and channel count 32 +24 Audio Track Tag Info A series of 1-byte data per audio track (up to 32 tracks) + to identify the content of each track using special audio tags 32*/ +public class GetExtendedFieldCommand extends Command { + + private final static byte[] GET_EXTENDED_FIELD = { (byte) 0xc9, (byte) 0xc3 }; + public final static byte[] FN_RECORD_DATETIME = {(byte)0}; + public final static byte[] FN_CODEC_WHERE_RECORDED = {(byte)1}; + public final static byte[] FN_LEGACY_FIELD = {(byte)2}; + public final static byte[] FN_UMID = {(byte)3}; + public final static byte[] FN_VIDEO_INFO = {(byte)4}; + public final static byte[] FN_VIDEO_CODEC_FOURCC_VALUE = {(byte)5}; + public final static byte[] FN_LEGACY_FIELD128BIT = {(byte)6}; + public final static byte[] FN_USER_NAME = {(byte)7}; + public final static byte[] FN_DEPARTMENT = {(byte)8}; + public final static byte[] FN_TITLE = {(byte)9}; + public final static byte[] FN_LINK = {(byte)11}; + public final static byte[] FN_DESCRIPTION = {(byte)12}; + public final static byte[] FN_AGENCY = {(byte)13}; + public final static byte[] FN_USER_DEFINABLE_FIELD_1 = {(byte)14}; + public final static byte[] FN_USER_DEFINABLE_FIELD_2 = {(byte)15}; + public final static byte[] FN_USER_DEFINABLE_FIELD_3 = {(byte)16}; + public final static byte[] FN_USER_DEFINABLE_FIELD_4 = {(byte)17}; + public final static byte[] FN_EXTERNAL_CONTROLLER_UID = {(byte)18}; + public final static byte[] FN_VIDEO_ARC = {(byte)19}; + public final static byte[] FN_MODIFIED_TIMESTAMP = {(byte)20}; + public final static byte[] FN_VIDEO_QA_STATUS = {(byte)21}; + public final static byte[] FN_USER_SEGMENTS_IN_USE = {(byte)22}; + public final static byte[] FN_AUDIO_TRACK_COMPRESSION_INFO = {(byte)23}; + public final static byte[] FN_AUDIO_TRACK_TAG_INFO = {(byte)24}; + + private byte[] buffer; + + public GetExtendedFieldCommand(Connection connection) { + super(connection); + } + + + public byte[] execute(Id id, byte[] fieldNumber) throws IOException, ProtocolException { + + byte[] ret = null; + + connection.write(GET_EXTENDED_FIELD); + connection.write(id.get().getBytes()); + connection.write(fieldNumber); + connection.flush(); + + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + if (c < 2) { + throw getException_InvalidResponseLength(c, 2, 2); + } + + // Not found + if (buffer[0] == (byte) 0xd0 && buffer[1] == (byte) 0xc3) { + throw new ProtocolException("ID handle is not found!"); + } else + // 1. Found + if (buffer[0] == (byte) 0xdf && buffer[1] == (byte) 0xc3) { + // 2. read NOF BYTES + buffer = new byte[1]; + c = connection.read(buffer, 0, 1); + int toRead = buffer[0]; + ret = new byte[toRead]; + connection.read(ret, 0, toRead); + } + return ret; + } +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedFieldGetModifiedTimestampCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedFieldGetModifiedTimestampCommand.java new file mode 100644 index 00000000..26f6867e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedFieldGetModifiedTimestampCommand.java @@ -0,0 +1,79 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.Calendar; + +public class GetExtendedFieldGetModifiedTimestampCommand extends Command { + + private final static byte[] GET_EXTENDED_FIELD = { (byte) 0xc9, (byte) 0xc3 }; + private final static byte[] EXTENDED_FIELD_NUMBER = { (byte) 20 }; + + private byte[] buffer; + private byte filetime[]; + + public GetExtendedFieldGetModifiedTimestampCommand(Connection connection) { + super(connection); + } + + private Calendar convertFromFILETIME(byte[] filetime) { + Calendar result = Calendar.getInstance(); + + ByteBuffer b = ByteBuffer.wrap(filetime); + b.order(ByteOrder.LITTLE_ENDIAN); + int lo = b.asIntBuffer().get(0); + int hi = b.asIntBuffer().get(1); + + long wFILETIME = ((long) hi << 32) + lo; + + final long EPOCH_DIFF = 11644473600000L; + final long ms_since_16010101 = wFILETIME / (10000); + final long ms_since_19700101 = ms_since_16010101 - EPOCH_DIFF; + + result.setTimeInMillis(ms_since_19700101); + + return result; + } + + public Calendar execute(Id id) throws IOException, ProtocolException { + + Calendar ret = null; + + connection.write(GET_EXTENDED_FIELD); + connection.write(id.get().getBytes()); + connection.write(EXTENDED_FIELD_NUMBER); + connection.flush(); + + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + if (c < 2) { + throw getException_InvalidResponseLength(c, 2, 2); + } + + // Not found + if (buffer[0] == (byte) 0xd0 && buffer[1] == (byte) 0xc3) { + throw new ProtocolException("ID handle is not found!"); + } else + // 1. Found + if (buffer[0] == (byte) 0xdf && buffer[1] == (byte) 0xc3) { + + // 2. read NOF BYTES + buffer = new byte[1]; + c = connection.read(buffer, 0, 1); + + int toRead = buffer[0]; + if (toRead != 8) { + throw new ProtocolException("Invalid ModifiedTimeStamp's data length: " + toRead); + } else { + filetime = new byte[8]; + c = connection.read(filetime, 0, 8); + if (c != 8) { + throw getException_InvalidResponseLength(c, 8, 8); + } + ret = convertFromFILETIME(filetime); + } + } + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java new file mode 100644 index 00000000..26c6723e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetExtendedIDFromIDHandleCommand.java @@ -0,0 +1,56 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; + +public class GetExtendedIDFromIDHandleCommand extends Command { + + private static final String INVALID_RESPONSE = "Invalid response length, response should be 2-258 characters long, but 1 got"; + private final static byte[] GET_EXTENDED_ID_FROM_ID_HANDLE = { (byte) 0xc8, (byte) 0xc3 }; + private byte[] buffer; + + public GetExtendedIDFromIDHandleCommand(Connection connection) { + super(connection); + } + + public Xid execute(Id id) throws IOException, ProtocolException { + + Xid ret = null; + + connection.write(GET_EXTENDED_ID_FROM_ID_HANDLE); + connection.write(id.get().getBytes()); + connection.flush(); + + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + if (c < 2) { + throw new ProtocolException(INVALID_RESPONSE); + } + + // Not found + if (buffer[0] == (byte) 0xd0 && buffer[1] == (byte) 0xc3) { + throw new ProtocolException("ID handle is not found!"); + } + + // 1. Found + if (buffer[0] == (byte) 0xdf && buffer[1] == (byte) 0xc3) { + + // 2. read NOF BYTES + buffer = new byte[1]; + c = connection.read(buffer, 0, 1); + + // 3. read data + int toRead = buffer[0]; + buffer = new byte[toRead]; + c = connection.read(buffer, 0, toRead); + + if (c != toRead) { + throw getException_InvalidXIDLength(toRead, new String(buffer)); + } + + ret = new Xid(new String(buffer)); + } + + return ret; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDFileSizeCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDFileSizeCommand.java new file mode 100644 index 00000000..b32c1cca --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDFileSizeCommand.java @@ -0,0 +1,53 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +public class GetIDFileSizeCommand extends Command { + + private static final String INVALID_RESPONSE = "Invalid response length, response should be 2-258 characters long, but I got less than 2"; + // private final static byte[] GET_ID_FILE_SIZE = { (byte) 0xc8, (byte) 0xc9 + // }; //BY default size type: APPROX + private final static byte[] GET_ID_FILE_SIZE = { (byte) 0xca, (byte) 0xc9 }; // BY + // TYPE + + private final static byte[] TYPE_EXACT_DISK_SIZE = { (byte) 0x00, (byte) 0x05 }; + private final static byte[] TYPE_APPROXIMATE_TRANSFER_SIZE = { (byte) 0x00, (byte) 0x06 }; + + private byte[] buffer; + + public GetIDFileSizeCommand(Connection connection) { + super(connection); + } + + public long execute(Id id) throws IOException, ProtocolException { + long ret = 0; + + connection.write(GET_ID_FILE_SIZE); + connection.write(id.get().getBytes()); + + connection.write(TYPE_EXACT_DISK_SIZE); + connection.flush(); + + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + + if (c < 2) + throw new ProtocolException(INVALID_RESPONSE); + + if (buffer[0] != (byte) 0xd8 || buffer[1] != (byte) 0xc9) { + throw new ProtocolException("ID handle is not found!"); + } else { + buffer = new byte[8]; + c = connection.read(buffer, 0, 8); + if (c != 8) + throw new ProtocolException(INVALID_RESPONSE); + ByteBuffer bbuffer = ByteBuffer.wrap(buffer); + // bbuffer = bbuffer.order(ByteOrder.LITTLE_ENDIAN); + ret = bbuffer.getLong(); + } + + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDHandleFromExtendedIDCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDHandleFromExtendedIDCommand.java new file mode 100644 index 00000000..6d6e666b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDHandleFromExtendedIDCommand.java @@ -0,0 +1,49 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; + +public class GetIDHandleFromExtendedIDCommand extends Command { + + private final static byte[] GET_ID_HANDLE_FROM_EXTENDED_ID = { (byte) 0xcf, (byte) 0xc4 }; + private byte[] buffer; + + public GetIDHandleFromExtendedIDCommand(Connection connection) { + super(connection); + } + + public Id execute(Xid xid) throws IOException, ProtocolException { + + Id ret = null; + + connection.write(GET_ID_HANDLE_FROM_EXTENDED_ID); + String x = xid.get(); + connection.write(x.length()); + connection.write(x.getBytes()); + connection.flush(); + + // read response code + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + if (c < 2) { + throw getException_InvalidResponseLength(c, 2, 10); + } + // Get ID + if (buffer[0] == (byte) 0xd8 && buffer[1] == (byte) 0xc4) { + buffer = new byte[8]; + c = connection.read(buffer, 0, 8); + if (c != 8) { + throw getException_InvalidResponseLength(c, 8, 8); + } + ret = new Id(new String(buffer)); + } else + // Ex.ID not found + if (buffer[0] == (byte) 0xd0 && buffer[1] == (byte) 0xc4) { + // Ezt nem kell dobni mert a getClip() lekezeli ha null-t kap + // vissza. + // throw new ProtocolException("Extended ID handle is not found! : " + // + x); + } + + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDMetadataCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDMetadataCommand.java new file mode 100644 index 00000000..991ec129 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/GetIDMetadataCommand.java @@ -0,0 +1,47 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; + +public class GetIDMetadataCommand extends Command { + + private final static byte[] GET_ID_METADATA = { (byte) 0xc8, (byte) 0x4a }; + private byte[] buffer; + + public GetIDMetadataCommand(Connection connection) { + super(connection); + // buffer = new byte[98]; + } + + public byte[] execute(Id id) throws IOException, ProtocolException { + + byte[] ret = null; + + connection.write(GET_ID_METADATA); + connection.write(id.get().getBytes()); + connection.flush(); + + // read response code + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + if (c < 2) { + throw getException_InvalidResponseLength(c, 2, 2); + } + + // response + if (buffer[0] == (byte) 0xdf && buffer[1] == (byte) 0x5f) { + buffer = new byte[95]; + c = connection.read(buffer, 0, 95); + if (c != 95) { + throw getException_InvalidResponseLength(c, 95, 95); + } else { + ret = buffer; + } + } else + // not found + if (buffer[0] == (byte) 0xd0 && buffer[1] == (byte) 0x00) { + throw new ProtocolException("ID handle is not found!"); + } + + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Id.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Id.java new file mode 100644 index 00000000..18428725 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Id.java @@ -0,0 +1,22 @@ +package user.commons.nexio.server.protocol; + +public class Id extends StringParameter { + + private static final String ID = "ID = "; + + public Id(String id) { + super(id); + if (id == null) { + throw new NullPointerException("id must not be null"); + } + if (id.length() != 8) { + throw new IllegalArgumentException("id must be 8 characters long"); + } + } + + @Override + public String toString() { + return ID + value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ListFirstIDHandleCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ListFirstIDHandleCommand.java new file mode 100644 index 00000000..41c45d12 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ListFirstIDHandleCommand.java @@ -0,0 +1,44 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; + +public class ListFirstIDHandleCommand extends Command { + + private final static byte[] LIST_FIRST_ID_HANDLE = { (byte) 0xa0, 0x14 }; + private byte[] buffer; + + public ListFirstIDHandleCommand(Connection connection) { + super(connection); + } + + public Id execute() throws IOException, ProtocolException { + + Id ret = null; + + connection.write(LIST_FIRST_ID_HANDLE); + connection.flush(); + + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + if (c < 2) { + throw getException_InvalidResponseLength(c, 2, 2); + } + + // found + if (buffer[0] == (byte) 0x88 && buffer[1] == (byte) 0x14) { + buffer = new byte[8]; + c = connection.read(buffer, 0, 8); + if (c != 8) { + throw getException_InvalidResponseLength(c, 8, 8); + } + ret = new Id(new String(buffer)); + } else + // not found + if (buffer[0] == (byte) 0x80 && buffer[1] == (byte) 0x14) { + // throw new ProtocolException("ID handle not found!"); + } + + return ret; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ListNextIDHandleCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ListNextIDHandleCommand.java new file mode 100644 index 00000000..971833cd --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ListNextIDHandleCommand.java @@ -0,0 +1,42 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; + +public class ListNextIDHandleCommand extends Command { + + private final static byte[] LIST_NEXT_ID_HANDLE = { (byte) 0xa0, 0x15 }; + private byte[] buffer; + + public ListNextIDHandleCommand(Connection connection) { + super(connection); + } + + public Id execute(StringParameter... parameters) throws IOException, ProtocolException { + + Id ret = null; + + connection.write(LIST_NEXT_ID_HANDLE); + connection.flush(); + + buffer = new byte[2]; + int c = connection.read(buffer, 0, 2); + if (c < 2) { + throw getException_InvalidResponseLength(c, 2, 2); + } + // Found + if (buffer[0] == (byte) 0x88 && buffer[1] == (byte) 0x14) { + buffer = new byte[8]; + c = connection.read(buffer, 0, 8); + if (c != 8) { + throw getException_InvalidResponseLength(c, 8, 8); + } + ret = new Id(new String(buffer)); + } else + // not found + if (buffer[0] == (byte) 0x80 && buffer[1] == (byte) 0x14) { + // no more ID + } + + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/NexioServerProtocol.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/NexioServerProtocol.java new file mode 100644 index 00000000..eb80becc --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/NexioServerProtocol.java @@ -0,0 +1,29 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; +import java.util.Calendar; +import java.util.List; + +public interface NexioServerProtocol { + + public Calendar executeGetExtendedFieldGetModifiedTimestamp(Id id) throws IOException, ProtocolException; + + public Xid executeGetExtendedIDFromIDHandle(Id id) throws IOException, ProtocolException; + + public Id executeGetIDHandleFromExtendedID(Xid xid) throws IOException, ProtocolException; + + public byte[] executeGetIDMetadata(Id id) throws IOException, ProtocolException; + + public Id executeListFirstIDHandle() throws IOException, ProtocolException; + + public Id executeListNextIDHandle() throws IOException, ProtocolException; + + public long executeGetIDFileSizeCommand(Id id) throws IOException, ProtocolException; + + public byte executePortStatusCommand() throws IOException, ProtocolException; + + public byte[] executeGetExtendedFieldCommand(Id id, byte[] fieldNumber) throws IOException, ProtocolException; + + public Connection getConnection(); + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/NexioServerProtocolImpl.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/NexioServerProtocolImpl.java new file mode 100644 index 00000000..f8361ab2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/NexioServerProtocolImpl.java @@ -0,0 +1,86 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; +import java.util.Calendar; +import java.util.List; + +public class NexioServerProtocolImpl implements NexioServerProtocol { + + private GetExtendedIDFromIDHandleCommand getExtendedIDFromIDHandleCommand = null; + private GetIDMetadataCommand getIDMetadataCommand = null; + private GetIDHandleFromExtendedIDCommand getIDHandleFromExtendedIDCommand = null; + private GetExtendedFieldGetModifiedTimestampCommand getExtendedFieldGetModifiedTimestampCommand = null; + private ListFirstIDHandleCommand listFirstIDHandleCommand = null; + private ListNextIDHandleCommand listNextIDHandleCommand = null; + private GetIDFileSizeCommand getIDFileSizeCommand = null; + private PortStatusCommand portStatusCommand = null; + private GetExtendedFieldCommand getExtendedFieldCommand = null; + + private Connection connection = null; + + public NexioServerProtocolImpl(Connection _connection) { + this.connection = _connection; + getExtendedIDFromIDHandleCommand = new GetExtendedIDFromIDHandleCommand(connection); + getIDMetadataCommand = new GetIDMetadataCommand(connection); + getIDHandleFromExtendedIDCommand = new GetIDHandleFromExtendedIDCommand(connection); + getExtendedFieldGetModifiedTimestampCommand = new GetExtendedFieldGetModifiedTimestampCommand(connection); + listFirstIDHandleCommand = new ListFirstIDHandleCommand(connection); + listNextIDHandleCommand = new ListNextIDHandleCommand(connection); + getIDFileSizeCommand = new GetIDFileSizeCommand(connection); + portStatusCommand = new PortStatusCommand(connection); + getExtendedFieldCommand = new GetExtendedFieldCommand(connection); + } + + @Override + public Calendar executeGetExtendedFieldGetModifiedTimestamp(Id id) throws IOException, ProtocolException { + return getExtendedFieldGetModifiedTimestampCommand.execute(id); + } + + @Override + public Xid executeGetExtendedIDFromIDHandle(Id id) throws IOException, ProtocolException { + return getExtendedIDFromIDHandleCommand.execute(id); + } + + @Override + public Id executeGetIDHandleFromExtendedID(Xid xid) throws IOException, ProtocolException { + return getIDHandleFromExtendedIDCommand.execute(xid); + } + + @Override + public byte[] executeGetIDMetadata(Id id) throws IOException, ProtocolException { + return getIDMetadataCommand.execute(id); + } + + @Override + public Id executeListFirstIDHandle() throws IOException, ProtocolException { + return listFirstIDHandleCommand.execute(); + } + + @Override + public Id executeListNextIDHandle() throws IOException, ProtocolException { + return listNextIDHandleCommand.execute(); + } + + @Override + public long executeGetIDFileSizeCommand(Id id) throws IOException, ProtocolException { + return getIDFileSizeCommand.execute(id); + } + + @Override + public byte executePortStatusCommand() throws IOException, ProtocolException{ + return portStatusCommand.execute(); + } + + @Override + public byte[] executeGetExtendedFieldCommand(Id id, byte[] fieldNumber) throws IOException, ProtocolException{ + return getExtendedFieldCommand.execute(id, fieldNumber); + } + + + @Override + public Connection getConnection(){; + return this.connection; + } + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java new file mode 100644 index 00000000..96e8b894 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/PortStatusCommand.java @@ -0,0 +1,40 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +public class PortStatusCommand extends Command{ + + + private final static byte[] PORT_STATUS = { (byte) 0x30, (byte) 0x05, (byte) 0x02 }; + private static final String INVALID_RESPONSE = "Invalid response length, response should be 1 byte, but we got 0"; + + //Byte 1, Bit 1: IDS ADDED - New IDs have been added to the disk system by recording or + //transferring from an archive system, and the controller of the port has not yet asked for that list of the IDs. + public final static byte BIT_IDS_ADDED = (byte)2; + + //Byte 1, Bit 2: IDS DELETED - IDs have been deleted from the disk and the controller of the port has not yet asked + public final static byte BIT_IDS_DELETED = (byte)4; + + public PortStatusCommand(Connection connection) { + super(connection); + } + + public byte execute() throws IOException, ProtocolException { + + connection.write(PORT_STATUS); + //connection.write((byte)2); //STATUS 2 + connection.flush(); + + byte[] buffer = new byte[1]; + int c = connection.read(buffer, 0, 1); + + if(c < 1) + throw new ProtocolException(INVALID_RESPONSE); + + ByteBuffer bbuffer = ByteBuffer.wrap(buffer); + return bbuffer.get(); + } +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ProtocolException.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ProtocolException.java new file mode 100644 index 00000000..3dc8a197 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/ProtocolException.java @@ -0,0 +1,17 @@ +package user.commons.nexio.server.protocol; + +public class ProtocolException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 7424384809790392408L; + + public ProtocolException() { + this(null); + } + + public ProtocolException(String message) { + super(message); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/StringParameter.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/StringParameter.java new file mode 100644 index 00000000..ca02de99 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/StringParameter.java @@ -0,0 +1,22 @@ +package user.commons.nexio.server.protocol; + +public abstract class StringParameter { + + protected final String value; + + public StringParameter(String value) { + this.value = value; + } + + @Override + public boolean equals(Object other) { + if (other.getClass() != this.getClass()) { + return false; + } + return ((StringParameter) other).value == value; + } + + public String get() { + return value; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/TCPConnection.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/TCPConnection.java new file mode 100644 index 00000000..99ca5fdd --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/TCPConnection.java @@ -0,0 +1,78 @@ +package user.commons.nexio.server.protocol; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.net.UnknownHostException; +import java.util.Arrays; + +public class TCPConnection implements Connection { + + protected InputStream input; + protected OutputStream output; + protected Socket socket = null; + private String host = null; + private int port = 0; + + static public Connection getInstance(String host, int port) throws UnknownHostException, IOException { + return new TCPConnection(host, port); + } + + public TCPConnection(String _host, int _port) throws UnknownHostException, IOException { + this.host = _host; + this.port = _port; + socket = new Socket(host, port); + input = socket.getInputStream(); + output = socket.getOutputStream(); + } + + @Override + public void disconnect() throws IOException { + if (socket != null) { + socket.close(); + } + } + + @Override + public void flush() throws IOException { + output.flush(); + } + + @Override + public int read(byte[] b) throws IOException { + Arrays.fill(b, (byte) 0); + return input.read(b); + } + + @Override + // Reads up to len bytes of data from the input stream into an array of + // bytes. + public int read(byte[] b, int off, int len) throws IOException { + Arrays.fill(b, (byte) 0); + return input.read(b, off, len); + } + + public int read() throws IOException { + return input.read(); + } + + + @Override + public void write(byte[] b) throws IOException { + output.write(b); + } + + @Override + public void write(int b) throws IOException { + output.write(b); + } + + public String getHost(){ + return this.host; + } + + public int getPort(){ + return this.port; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Xid.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Xid.java new file mode 100644 index 00000000..6fd1a53d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/server/protocol/Xid.java @@ -0,0 +1,22 @@ +package user.commons.nexio.server.protocol; + +public class Xid extends StringParameter { + + private static final String XID = "XID = "; + + public Xid(String xid) { + super(xid); + if (xid == null) { + throw new NullPointerException("xid must not be null"); + } + int l = xid.length(); + if (l < 1 || l > 255) { + throw new IllegalArgumentException("xid must be 1-255 characters long"); + } + } + + @Override + public String toString() { + return XID + value; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java new file mode 100644 index 00000000..74b22230 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java @@ -0,0 +1,49 @@ +package user.commons.nosql; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBList; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.NoSQLClient; + +public class NoSQLUtils { + private static final Logger logger = LogManager.getLogger(); + public static final String Url, User, Pass; + + static { + Url = System.getProperty("jobengine.nosql.db.url"); + User = System.getProperty("jobengine.nosql.db.user"); + Pass = System.getProperty("jobengine.nosql.db.password"); + } + + public static DB getNoSQLDB(String url, String user, String pass) { + return NoSQLClient.getDB(Url, User, Pass); + } + + public static DB getDB() { + DB result = null; + try { + result = NoSQLClient.getDB(NoSQLUtils.Url, NoSQLUtils.User, NoSQLUtils.Pass); + } catch (Exception e) { + logger.error(e); + } + return result; + } + + public static List asList(BasicDBList obj) { + List result = null; + if (obj != null) + result = Arrays.asList(obj.toArray(new BasicDBObject[obj.size()])); + + if (result == null) + result = new ArrayList<>(); + return result; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java new file mode 100644 index 00000000..57e10ad0 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java @@ -0,0 +1,29 @@ +package user.commons.octopus; + +import java.util.Date; +import java.util.List; + +import com.ibm.nosql.json.api.DBObject; + +public interface IOctopusAPI { + + List getRundowns(Date scheduledDate); + + List getStories(long rundownID); + + List getStoriesByStoryFolderId(long storyFolderID); + + List getStoryFolders(); + + List getStoryFolders(long storyID); + + List getRundownByStoryID(long storyID); + + List getRundownsByPlaceHolderId(String placeHolderID); + + List getStoryFoldersByPlaceHolderId(String placeHolderID); + + List getStories(); + + List getStoriesByIDRegex(String id); +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/IUpdateWorker.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IUpdateWorker.java new file mode 100644 index 00000000..7a1bcde0 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IUpdateWorker.java @@ -0,0 +1,4 @@ +package user.commons.octopus; + +public interface IUpdateWorker { +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java new file mode 100644 index 00000000..73d869d0 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java @@ -0,0 +1,209 @@ +package user.commons.octopus; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.regex.Pattern; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.ibm.nosql.json.api.BasicDBList; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBCursor; +import com.ibm.nosql.json.api.DBObject; +import com.ibm.nosql.json.api.QueryBuilder; + +import user.commons.CalendarUtils; +import user.commons.nosql.NoSQLUtils; + +public class OctopusAPI implements IOctopusAPI { + private static final String RUNDOWN = "rundown"; + private static final Logger logger = LogManager.getLogger(); + private static final String ID = "id"; + private static final String STORY_FOLDER = "story_folder"; + public static final String RUNDOWN_COLLECTION_NAME = "rundowns"; + public static final String STORY_COLLECTION_NAME = "stories"; + public static final String STORY_FOLDER_COLLECTION_NAME = "story_folders"; + public static final String TIME_COLLECTION_NAME = "time"; + private DB db; + + public OctopusAPI() throws SQLException { + db = NoSQLUtils.getDB(); + } + + @Override + public List getRundowns(Date scheduledDate) { + List result = null; + DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); + Calendar calStart = CalendarUtils.createZeroCalendar(scheduledDate); + Calendar calStop = CalendarUtils.createZeroCalendar(scheduledDate); + calStop.add(Calendar.DAY_OF_MONTH, 1); + + DBObject query = null; + QueryBuilder builder = QueryBuilder.start(); + if (scheduledDate == null) { + query = builder.get(); + } else { + query = builder.and(QueryBuilder.start("scheduledStart").greaterThanEquals(calStart.getTime()).get(), + QueryBuilder.start("scheduledStart").lessThan(calStop.getTime()).get()).get(); + } + + logger.info(query); + DBCursor find = collection.find(query).sort(new BasicDBObject("scheduledStart", new BasicDBList(1, "$date"))); + if (find.hasNext()) + result = find.toArray(); + return result; + } + + @Override + public List getStories(long rundownID) { + List result = null; + DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); + // db.stories.find({ rundown: { $elemMatch: { id: 92950867 } }}) + + // { rundown: { $elemMatch: { id: 44622396 } }} + DBCursor find = collection.find( + new BasicDBObject(RUNDOWN, new BasicDBObject("$elemMatch", new BasicDBObject(ID, rundownID))), + new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(RUNDOWN, 1).append("type", 1). + append("mosObjects", 1)) + .sort(new BasicDBObject("name", 1)); + if (find.hasNext()) + result = find.toArray(); + return result; + } + + @Override + public List getStoryFolders() { + List result = null; + DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + DBCursor find = collection.find(); + if (find.hasNext()) + result = find.toArray(); + return result; + } + + @Override + public List getStoryFolders(long storyID) { + List result = null; + List queryedStory_FoldersFromStoryCollection = null; + DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); + DBCollection storyFolderCollection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + DBCursor find = storyCollection.find(new BasicDBObject("id", storyID), + new BasicDBObject(STORY_FOLDER, 1).append("_id", 0)); + result = getRundownsByReferences(find, storyFolderCollection, queryedStory_FoldersFromStoryCollection, + STORY_FOLDER); + return result; + } + + private List getRundownsByReferences(DBCursor find, DBCollection collection, + List referenceObjects, String referenceName) { + List result = null; + if (find.hasNext()) + referenceObjects = find.toArray(); + if (referenceObjects != null) { + List rundownIDs = getIDsFromReferences(referenceObjects, referenceName); + BasicDBObject query = (BasicDBObject) QueryBuilder.start().put("id").in(rundownIDs).get(); + find = collection.find(query); + if (find.hasNext()) + result = find.toArray(); + } + return result; + } + + private List getIDsFromReferences(List list, String referenceName) { + List result = new ArrayList<>(); + for (DBObject dbObject : list) { + BasicDBObject object = (BasicDBObject) dbObject; + BasicDBList l = (BasicDBList) object.get(referenceName); + BasicDBObject o = (BasicDBObject) l.get(0); + long id = o.getLong("id"); + result.add(id); + } + return result; + } + + @Override + public List getRundownByStoryID(long storyID) { + List result = null; + List queryedRundownsFromStoryCollection = null; + DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); + DBCollection rundownCollection = db.getCollection(RUNDOWN_COLLECTION_NAME); + DBCursor find = storyCollection.find(new BasicDBObject("id", storyID), + new BasicDBObject(RUNDOWN, 1).append("_id", 0)); + result = getRundownsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, RUNDOWN); + return result; + } + + @Override + public List getRundownsByPlaceHolderId(String placeHolderID) { + List result = null; + DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); + DBCollection rundownCollection = db.getCollection(RUNDOWN_COLLECTION_NAME); + List queryedRundownsFromStoryCollection = null; + BasicDBObject globalId = new BasicDBObject("globalId", placeHolderID); + BasicDBObject elemmatch = new BasicDBObject("$elemMatch", globalId); + BasicDBObject mosObjects = new BasicDBObject("mosObjects", elemmatch); + //db.testStoryCollection.find({"mosObjects": {$elemMatch: {"globalId": "OCTOPUS-ECHOTV-2429902"}}}) + DBCursor find = storyCollection.find(mosObjects, new BasicDBObject(RUNDOWN, 1).append("_id", 0)); + result = getRundownsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, RUNDOWN); + return result; + } + + //teszteletlen + @Override + public List getStoryFoldersByPlaceHolderId(String placeHolderID) { + List result = null; + DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME); + DBCollection rundownCollection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + List queryedRundownsFromStoryCollection = null; + BasicDBObject globalId = new BasicDBObject("globalId", placeHolderID); + BasicDBObject elemmatch = new BasicDBObject("$elemMatch", globalId); + BasicDBObject mosObjects = new BasicDBObject("mosObjects", elemmatch); + DBCursor find = storyCollection.find(mosObjects, new BasicDBObject(STORY_FOLDER, 1).append("_id", 0)); + result = getRundownsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, STORY_FOLDER); + return result; + } + + @Override + public List getStoriesByStoryFolderId(long storyFolderId) { + List result = null; + DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); + DBCursor find = collection.find( + new BasicDBObject(STORY_FOLDER, new BasicDBObject("$elemMatch", new BasicDBObject(ID, storyFolderId))), + new BasicDBObject(ID, 1).append("name", 1).append("modified", 1).append(STORY_FOLDER, 1).append("type", + 1).append("mosObjects", 1)) + .sort(new BasicDBObject("name", 1)); + if (find.hasNext()) + result = find.toArray(); + return result; + } + + @Override + public List getStories() { + List result = null; + DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); + DBCursor find = collection.find(); + if (find.hasNext()) + result = find.toArray(); + return result; + } + + @Override + public List getStoriesByIDRegex(String id) { + List result = null; + DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); + Pattern regex = Pattern.compile(id, Pattern.CASE_INSENSITIVE); + /*BasicDBObject query = new BasicDBObject("id", new BasicDBObject("$regex", id));*/ + BasicDBObject query = new BasicDBObject("id", Pattern.compile(id)); + logger.info(query); + DBCursor find = collection.find(query); + if (find.hasNext()) + result = find.toArray(); + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java new file mode 100644 index 00000000..ffce5c64 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java @@ -0,0 +1,481 @@ +package user.commons.octopus; + +import java.util.Date; +import java.util.HashSet; +import java.util.List; + +import javax.ws.rs.client.Invocation.Builder; +import javax.ws.rs.core.Response; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.jboss.resteasy.client.jaxrs.BasicAuthentication; +import org.jboss.resteasy.client.jaxrs.ResteasyClient; +import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder; +import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget; +import org.joda.time.DateTime; + +import com.ibm.nosql.json.JSONUtil; +import com.ibm.nosql.json.api.BasicDBList; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBObject; +import com.ibm.nosql.json.api.NoSQLClient; +import com.ibm.nosql.json.api.QueryBuilder; +import com.ibm.nosql.json.api.WriteResult; + +import user.commons.nosql.NoSQLUtils; + +public class OctopusDataMiner implements Runnable { + private static final Logger logger = LogManager.getLogger(); + private static final String SAVING_STORY_D = "Saving story %d"; + private static final String SAVEING_RUNDOWN_D = "Saveing rundown : %d"; + private static final String ACTUAL_MODIFIED_STRING_IS_NULL = "actualModifiedString is null"; + private static final String PROCESSING_MULTI_REFERENCED_STORY_ID = "Processing multi referenced StoryID "; + private static final String RUNDOWN2 = "rundown"; + private static final String POSITION = "position"; + private static final String STORY = "story"; + private static final String SCHEDULED_START = "scheduledStart"; + private static final String SLUGS = "slugs"; + private static final String CHECKING_RUNDOWN_S_D_D = "Checking Rundown %s (%d/%d)"; + private static final String STORIES_FIELDS = "stories, Story.modified, Story.name, Story.id,Story.mosObjects,Story.script,Story.type,customColumns,CustomColumn.label,CustomColumn.value"; + private static final String SLUGS_FIELDS = "slugs,Slug.story,Slug.position,Story.name,Story.id,Story.modified,Story.mosObjects,Story.script,Story.type,Story.customColumns,CustomColumn.label,CustomColumn.value"; + private static final String RUNDOWN = "Rundown"; + private static final String ID_NAME_MODIFIED_SCHEDULED_START = "id,name,modified,scheduledStart"; + private static final String OCTOPUS_DEVICE_NAME = "Octopus-Device-Name"; + private static final String OCTOPUS_DEVICE_ID = "Octopus-Device-Id"; + private static final String FIELDS = "fields"; + private static final String STORYFOLDER = "story_folder"; + private static final String MODIFIED = "modified"; + private static final String STORIES = "stories"; + private static final String ID = "id"; + private static final String CHECKING_STORY_FOLDER_S_D_D = "Checking StoryFolder %s (%d/%d)"; + private static final String EXIT = "Exit"; + private static final String RESULT = "result"; + private static final String STORY_FOLDER = "StoryFolder"; + private static final String ID_NAME_MODIFIED = "id,name,modified"; + private static final String ENTER = "Enter"; + private static final String FINISHED = "Finished"; + private static final String STARTING = "Starting"; + + public static final String RUNDOWN_COLLECTION_NAME = "rundowns"; + public static final String STORY_COLLECTION_NAME = STORIES; + public static final String STORY_FOLDER_COLLECTION_NAME = "story_folders"; + public static final String TIME_COLLECTION_NAME = "time"; + public static final String LASTUPDATE_TIME = "lastUpdateTime"; + + private DB db; + private ResteasyWebTarget webTarget; + private String apiUser; + private String apiPwd; + private HashSet storyIDs = new HashSet<>(); + + public OctopusDataMiner() { + String jdbcUrl = System.getProperty("jobengine.nosql.db.url"); + String dbUser = System.getProperty("jobengine.nosql.db.user"); + String dbPass = System.getProperty("jobengine.nosql.db.password"); + String schema = System.getProperty("jobengine.nosql.db.schema"); + db = NoSQLClient.getDB(jdbcUrl, dbUser, dbPass, schema); + + String apiAddress = System.getProperty("jobengine.octopus.api.address"); + apiUser = System.getProperty("jobengine.octopus.api.user"); + apiPwd = System.getProperty("jobengine.octopus.api.password"); + + ResteasyClient client = new ResteasyClientBuilder().build(); + webTarget = client.target(apiAddress).register(new BasicAuthentication(apiUser, apiPwd)); + } + + @Override + public void run() { + logger.info(STARTING); + try { + ensureIndexes(); + Date lastUpdateTime = getLastUpdateTime(); + setLastUpdateTime(new Date()); + BasicDBList rundowns = queryRundowns(lastUpdateTime); + if (rundowns != null) + storeRundowns(rundowns, lastUpdateTime); + BasicDBList storyFolders = queryStoryFolders(lastUpdateTime); + if (storyFolders != null) + storeStoryFolders(storyFolders, lastUpdateTime); + deleteOrphanStories(); + } catch (Exception e) { + logger.error(e); + } + logger.trace(FINISHED); + } + + private void deleteOrphanStories() { + try { + DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); + BasicDBObject query = (BasicDBObject) QueryBuilder.start().put("id").notIn(storyIDs.toArray()).get(); + WriteResult res = collection.remove(query); + logger.trace(String.format("Deleted orphan stories: %d", res.getN())); + } catch (Exception e) { + logger.error(e); + } + } + + private BasicDBList queryStoryFolders(Date lastUpdateTime) { + logger.trace(ENTER); + BasicDBList result = null; + String fields = ID_NAME_MODIFIED; + Response response = query(STORY_FOLDER, fields).get(); + String json = response.readEntity(String.class); + BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json); + if (resultObject != null) + result = asDBList(resultObject, RESULT); + + /*teszt*/ + List list = NoSQLUtils.asList(result); + for(BasicDBObject actual : list) { + String fullName = concatParentsToStoryFolder(actual, actual.getString("name")); + logger.info(String.format("fullname %s", fullName)); + actual.remove("name"); + actual.append("name", fullName); + } + + logger.trace(EXIT); + return result; + } + + private String concatParentsToStoryFolder(BasicDBObject actual, String name) { + String fields = "name,id,parent"; + Response response = query("StoryFolder/"+actual.getLong("id"), fields).get(); + String json = response.readEntity(String.class); + BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json); + BasicDBObject res = (BasicDBObject) resultObject.get("result"); + BasicDBObject parent = (BasicDBObject) res.get("parent"); + if(parent == null || parent.isEmpty()) + return name; + String parentName = parent.getString("name"); + String actualName = actual.getString("name"); + String newName = String.format("%s/%s", parentName, actualName); + return concatParentsToStoryFolder(parent, newName); + } + + private void storeStoryFolders(BasicDBList storyFolders, Date lastUpdateTime) { + logger.trace(ENTER); + List storyFolderList = NoSQLUtils.asList(storyFolders); + int idx = 1; + for (BasicDBObject storyFolder : storyFolderList) { + logger.info( + String.format(CHECKING_STORY_FOLDER_S_D_D, storyFolder.getLong(ID), storyFolderList.size(), idx)); + storeStoryFolder(storyFolder, lastUpdateTime); + idx++; + } + logger.trace(EXIT); + } + + private void storeStoryFolder(BasicDBObject storyFolder, Date lastUpdateTime) { + logger.trace(ENTER); + long storyFolderID = storyFolder.getLong(ID); + + BasicDBObject storyFoldersWithStories = queryStoryFolder(storyFolderID); + BasicDBList stories = asDBList(storyFoldersWithStories, STORIES); + if (stories != null) + storeStoryFolderStories(stories, storyFolderID, storyFolderID, lastUpdateTime); + storyFolder.put(MODIFIED, toDate(storyFolder, MODIFIED)); + DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + if (lastUpdateTime == null || (lastUpdateTime != null && isModifiedRundown(lastUpdateTime, storyFolder))) { + logger.trace(String.format("saving storyFolder %d", storyFolderID)); + collection.save(storyFolder); + } + logger.trace(EXIT); + } + + private void storeStoryFolderStories(BasicDBList stories, long storyFolderID, long referenceID, + Date lastUpdateTime) { + logger.trace(ENTER); + List list = NoSQLUtils.asList(stories); + for (BasicDBObject story : list) + storeStory(story, 0, referenceID, STORYFOLDER, lastUpdateTime); + logger.trace(EXIT); + } + + private Builder query(String path, String fields) { + ResteasyWebTarget target = webTarget.path(path).queryParam(FIELDS, fields); + Builder result = target.request().header(OCTOPUS_DEVICE_ID, apiUser).header(OCTOPUS_DEVICE_NAME, apiPwd); + return result; + } + + private BasicDBList queryRundowns(Date lastUpdateTime) { + logger.trace(ENTER); + BasicDBList result = null; + String fields = ID_NAME_MODIFIED_SCHEDULED_START; + Response response = query(RUNDOWN, fields).get(); + String json = response.readEntity(String.class); + BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json); + if (resultObject != null) + result = asDBList(resultObject, RESULT); + logger.trace(EXIT); + return result; + } + + private BasicDBObject queryRundown(long id) { + logger.trace(ENTER); + BasicDBObject result = null; + String fields = SLUGS_FIELDS; + Response response = query(String.format("%s/", RUNDOWN) + id, fields).get(); + String json = response.readEntity(String.class); + BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json); + if (resultObject != null) + result = asDBObject(resultObject, RESULT); + logger.trace(EXIT); + return result; + } + + private BasicDBObject queryStoryFolder(long id) { + logger.trace(ENTER); + BasicDBObject result = null; + String fields = STORIES_FIELDS; + Response response = query(String.format("%s/", STORY_FOLDER) + id, fields).get(); + String json = response.readEntity(String.class); + BasicDBObject resultObject = (BasicDBObject) JSONUtil.jsonToDbObject(json); + if (resultObject != null) + result = asDBObject(resultObject, RESULT); + logger.trace(EXIT); + return result; + } + + private void storeRundowns(BasicDBList rundowns, Date lastUpdateTime) { + logger.trace(ENTER); + List rundownsList = NoSQLUtils.asList(rundowns); + int idx = 1; + for (BasicDBObject rundown : rundownsList) { + logger.info(String.format(CHECKING_RUNDOWN_S_D_D, rundown.getLong(ID), rundownsList.size(), idx)); + storeRundown(rundown, lastUpdateTime); + idx++; + } + logger.trace(EXIT); + } + + private void storeRundown(BasicDBObject rundown, Date lastUpdateTime) { + logger.trace(ENTER); + long rundownID = rundown.getLong(ID); + + BasicDBObject rundownWithStories = queryRundown(rundownID); + BasicDBList stories = asDBList(rundownWithStories, SLUGS); + if (stories != null) + storeRundownStories(stories, rundownID, lastUpdateTime); + rundown.put(SCHEDULED_START, toDate(rundown, SCHEDULED_START)); + rundown.put(MODIFIED, toDate(rundown, MODIFIED)); + DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); + if (lastUpdateTime == null || (lastUpdateTime != null && isModifiedRundown(lastUpdateTime, rundown))) { + logger.info(String.format(SAVEING_RUNDOWN_D, rundownID)); + collection.save(rundown); + } + logger.trace(EXIT); + } + + private void storeRundownStories(BasicDBList slugs, long referenceID, Date lastUpdateTime) { + logger.trace(ENTER); + List slugsList = NoSQLUtils.asList(slugs); + for (BasicDBObject slug : slugsList) { + if (slug.containsKey(STORY)) + storeStory((BasicDBObject) slug.get(STORY), slug.getInt(POSITION), referenceID, RUNDOWN2, + lastUpdateTime); + } + logger.trace(EXIT); + } + + private void storeStory(BasicDBObject story, int position, long referenceID, String referenceName, + Date lastUpdateTime) { + logger.trace(ENTER); + try { + // a run v�g�n lek�rj�k az �sszes storyID-t az adatb�zisb�l + // �s ha van olyan eleme annak a list�nak, ami nincs benne a + // mem�ri�ban t�rolt storyIDs setben, t�r�lj�k adatb�zisb�l + long storyID = story.getLong(ID); + DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); + BasicDBObject modifiedStory = story; + // boolean trashed = story.getBoolean(TRASHED); + // modifiedStory.remove(TRASHED); + // nem m�k�dik + /* + * if (trashed) { modifiedStory = (BasicDBObject) + * collection.findOne(new BasicDBObject(ID, storyID), new + * BasicDBObject(_ID, 1)); collection.remove(modifiedStory); } else + */ + checkAndStoreStory(modifiedStory, lastUpdateTime, storyID, position, referenceID, referenceName, + collection); + } catch (Exception e) { + logger.error(e); + throw e; + } + logger.trace(EXIT); + } + + private void checkAndStoreStory(BasicDBObject modifiedStory, Date lastUpdateTime, long storyID, int position, + long referenceID, String referenceName, DBCollection collection) { + boolean isContains = storyIDs.contains(storyID); + if (!isContains) + storyIDs.add(storyID); + if (lastUpdateTime != null && !isModified(lastUpdateTime, modifiedStory, MODIFIED)) + return; + if (isContains) { + logger.trace(PROCESSING_MULTI_REFERENCED_STORY_ID + storyID); + modifiedStory = (BasicDBObject) collection.findOne(new BasicDBObject(ID, storyID)); + } + BasicDBList references = asDBList(modifiedStory, referenceName); + if (references == null) { + references = new BasicDBList(); + modifiedStory.append(referenceName, references); + } + references.add(new BasicDBObject(ID, referenceID).append(POSITION, position)); + logger.info(String.format(SAVING_STORY_D, storyID)); + collection.save(modifiedStory); + } + + private BasicDBList asDBList(BasicDBObject obj, String name) { + BasicDBList result = null; + if (obj.containsKey(name) && (obj.get(name) instanceof BasicDBList)) + result = (BasicDBList) obj.get(name); + return result; + } + + private BasicDBObject asDBObject(BasicDBObject obj, String name) { + BasicDBObject result = null; + if (obj.containsKey(name) && (obj.get(name) instanceof BasicDBObject)) + result = (BasicDBObject) obj.get(name); + return result; + } + + private Date toDate(BasicDBObject obj, String name) { + Date result = null; + if (obj.containsKey(name)) { + String dt = obj.getString(name); + if (dt != null) { + // create jodatime from date + DateTime jdt = new DateTime(dt); + result = jdt.toDate(); + } + } + return result; + } + + // private void insertStoryFoldersToDB2() { + // DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + // Set storyKeys = storyFolders.keySet(); + // for (String key : storyKeys) { + // BasicDBObject object = (BasicDBObject) storyFolders.get(key); + // BasicDBObject stories = (BasicDBObject) object.get("stories"); + // object.remove("stories"); + // if (stories.containsKey("id")) { + // long storyId = stories.getLong("id"); + // storyObjects.append(String.format("%d", storyId), stories); + // } + // collection.insert(object); + // } + // } + // + // private void getStoriesFromParent(BasicDBObject object) { + // try { + // BasicDBObject stories = (BasicDBObject) object.get("stories"); + // object.remove("stories"); + // Set subKeys = stories.keySet(); + // for (String string : subKeys) { + // BasicDBObject s = (BasicDBObject) stories.get(string); + // long storyId = s.getLong("id"); + // storyObjects.append(String.format("%d", storyId), s); + // } + // } catch (Exception e) { + // System.out.println(e.getMessage()); + // } + // } + // + // private void insertRundownsToDB2() { + // DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); + // Set rundownKeys = rundownDBObjects.keySet(); + // for (String key : rundownKeys) { + // BasicDBObject object = (BasicDBObject) rundownDBObjects.get(key); + // getStoriesFromParent(object); + // collection.insert(object); + // } + // } + // + // private void insertStoriesToDB2() { + // DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); + // Set storyKeys = storyObjects.keySet(); + // for (String key : storyKeys) { + // BasicDBObject object = (BasicDBObject) storyObjects.get(key); + // collection.insert(object); + // } + // } + // + // @SuppressWarnings("unchecked") + // private void setStoryFolders() { + // IConverter converter = new Converter(); + // converter.addDeserializer(BasicDBObject.class, new + // StoryFolderDeserializable()); + // String result = null; + // JerseyWebTarget storyFolderwebTarget = + // client.target(address).path("StoryFolder"); + // JerseyWebTarget target = storyFolderwebTarget.queryParam("fields", + // "id,name,modified,stories,Story.name,Story.id,Story.modified,Story.scriptXml,Story.type"); + // JerseyInvocation.Builder builder = target + // .request( + // "?fields=id,name,modified,stories,Story.name,Story.id,Story.modified,Story.scriptXml,Story.type") + // .header("Octopus-Device-Id", user).header("Octopus-Device-Name", pwd); + // Response response = builder.get(); + // result = response.readEntity(String.class); + // result = replaceString(result, RESULT_STARTER_STRING); + // storyFolders = converter.convertBasicDBObjectFromJson(result); + // } + + public void clear() { + db.getCollection(RUNDOWN_COLLECTION_NAME).remove(); + db.getCollection(STORY_COLLECTION_NAME).remove(); + db.getCollection(STORY_FOLDER_COLLECTION_NAME).remove(); + db.getCollection(TIME_COLLECTION_NAME).remove(); + } + + private void ensureIndexes() { + DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); + if (collection.count() == 0) + collection.ensureIndex(ID); + collection = db.getCollection(RUNDOWN_COLLECTION_NAME); + if (collection.count() == 0) { + collection.ensureIndex(ID); + collection.ensureIndex(SCHEDULED_START); + } + collection = db.getCollection(STORY_COLLECTION_NAME); + if (collection.count() == 0) + collection.ensureIndex(ID); + } + + private Date getLastUpdateTime() { + Date result = null; + DBCollection collection = db.getCollection(TIME_COLLECTION_NAME); + DBObject timeObject = collection.findOne(); + if (timeObject != null) + result = (Date) timeObject.get(LASTUPDATE_TIME); + return result; + } + + public void setLastUpdateTime(Date lastUpdateTime) { + DBCollection collection = db.getCollection(OctopusAPI.TIME_COLLECTION_NAME); + DBObject timeObject = collection.findOne(); + if (timeObject == null) + timeObject = new BasicDBObject(); + timeObject.put(LASTUPDATE_TIME, lastUpdateTime); + + collection.save(timeObject); + } + + private boolean isModified(Date date, BasicDBObject object, String name) { + Date actualModifiedString = toDate(object, name); + if (actualModifiedString == null) + logger.trace(ACTUAL_MODIFIED_STRING_IS_NULL); + int result = date.compareTo(actualModifiedString); + return result <= 0; + } + + private boolean isModifiedRundown(Date date, BasicDBObject object) { + Date modified = (Date) object.get(MODIFIED); + int result = date.compareTo(modified); + return result <= 0; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/UpdateWorker.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/UpdateWorker.java new file mode 100644 index 00000000..6ebcc64d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/UpdateWorker.java @@ -0,0 +1,143 @@ +package user.commons.octopus; + +public class UpdateWorker implements IUpdateWorker { + // + // private IOctopusFilter octopus; + // private static DB db; + // private BasicDBObject storyObjects = new BasicDBObject(); + // private ScheduledExecutorService scheduleExecutorService; + // private TimerTask scheduledTask; + // private boolean isRunning; + // + // public UpdateWorker(IOctopusFilter octopus, DB db) { + // this.octopus = octopus; + // this.db = db; + // scheduleExecutorService = Executors.newScheduledThreadPool(1); + // scheduledTask = scheduledTask(); + // } + // + // @Override + // public void update() { + // Timestamp timeStamp = octopus.getTimeStamp(); + // Date insertDate = new Date(timeStamp.getTime()); + // updateRundowns(insertDate); + // updateStoryFolders(insertDate); + // updateStories(); + // OctopusAPI.storeLastUpdateTime(insertDate.getTime()); + // } + // + // private void updateStories() { + // Set keys = storyObjects.keySet(); + // for (String key : keys) { + // BasicDBObject story = (BasicDBObject) storyObjects.get(key); + // boolean trashed = story.getBoolean("trashed"); + // if (trashed) + // removeStory(story); + // else + // updateObject(story, OctopusAPI.STORY_COLLECTION_NAME); + // } + // } + // + // private void removeStory(BasicDBObject story) { + // long id = story.getLong("id"); + // DBCollection collection = db.getCollection(OctopusAPI.STORY_COLLECTION_NAME); + // BasicDBObject find = new BasicDBObject(); + // find.append("id", id); + // DBCursor cursor = collection.find(find); + // if (cursor.hasNext()) + // collection.remove(cursor.next()); + // } + // + // private void updateRundowns(Date insertDate) { + // BasicDBObject rundownDBObjects = octopus.getRundownObjects(insertDate); + // Set rundownKeys = rundownDBObjects.keySet(); + // for (String rundownKey : rundownKeys) { + // BasicDBObject object = (BasicDBObject) rundownDBObjects.get(rundownKey); + // getStoriesFromRundownParent(object); + // updateObject(object, OctopusAPI.RUNDOWN_COLLECTION_NAME); + // } + // } + // + // private void updateObject(BasicDBObject object, String collectionName) { + // long id = object.getLong("id"); + // DBCollection collection = db.getCollection(collectionName); + // BasicDBObject find = new BasicDBObject(); + // find.append("id", id); + // DBCursor cursor = collection.find(find); + // + // if (cursor.hasNext()) { + // DBObject objectInDb = cursor.next(); + // collection.update(objectInDb, object); + // } + // } + // + // private void updateStoryFolders(Date insertDate) { + // BasicDBObject storyFolders = octopus.getStoryFolders(insertDate); + // Set rundownKeys = storyFolders.keySet(); + // for (String rundownKey : rundownKeys) { + // BasicDBObject object = (BasicDBObject) storyFolders.get(rundownKey); + // getStoriesFromStoryFolderParent(object); + // updateObject(object, OctopusAPI.STORY_FOLDER_COLLECTION_NAME); + // } + // } + // + // private void getStoriesFromRundownParent(BasicDBObject object) { + // try { + // BasicDBObject stories = (BasicDBObject) object.get("stories"); + // object.remove("stories"); + // Set subKeys = stories.keySet(); + // for (String string : subKeys) { + // BasicDBObject s = (BasicDBObject) stories.get(string); + // long storyId = s.getLong("id"); + // storyObjects.append(String.format("%d", storyId), s); + // } + // } catch (Exception e) { + // System.out.println(e.getMessage()); + // } + // } + // + // private void getStoriesFromStoryFolderParent(BasicDBObject object) { + // /* + // * try { BasicDBObject stories = (BasicDBObject) object.get("stories"); + // * object.remove("stories"); Set subKeys = stories.keySet(); for + // * (String string : subKeys) { BasicDBObject s = (BasicDBObject) + // * stories.get(string); long storyId = s.getLong("id"); + // * storyObjects.append(String.format("%d", storyId), s); } } catch + // * (Exception e) { System.out.println(e.getMessage()); } + // */ + // try { + // BasicDBObject stories = (BasicDBObject) object.get("stories"); + // object.remove("stories"); + // long storyId = stories.getLong("id"); + // storyObjects.append(String.format("%d", storyId), stories); + // } catch (Exception e) { + // System.out.println(e.getMessage()); + // } + // } + // + // @Override + // public void startTask() { + // isRunning = true; + // scheduleExecutorService.scheduleAtFixedRate(scheduledTask, 5, 15, TimeUnit.MINUTES); + // } + // + // private TimerTask scheduledTask() { + // return new TimerTask() { + // + // @Override + // public void run() { + // update(); + // } + // }; + // } + // + // @Override + // public void shutdownTask() { + // scheduleExecutorService.shutdown(); + // isRunning = false; + // } + // + // public boolean isRunning() { + // return isRunning; + // } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ConnectionPool.java b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ConnectionPool.java new file mode 100644 index 00000000..bcae09f6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ConnectionPool.java @@ -0,0 +1,70 @@ +package user.commons.pool.orig; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + + +/** + * Adatbázis kapcsolat erõforrás kezelõ. + * + */ +public class ConnectionPool extends ResourcePool { + public ConnectionPool(ConnectionPoolProperties properties) { + super(properties); + } + + public Connection borrowObject() { + return (Connection) super.borrowObject(); + } + + protected boolean checkObject(Object resourceObject) { + Connection connection = (Connection) resourceObject; + boolean closed = false; + try { + closed = connection.isClosed(); + } catch (SQLException e) { + } + return closed; + } + + protected Connection createObject() { + ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties(); + Connection connection = null; + try { + Class.forName(cpp.getDriverName()); + DriverManager.setLoginTimeout(cpp.getTimeout()); + connection = DriverManager.getConnection(cpp.getUrl(), cpp.getUserName(), cpp.getPassword()); + connection.setAutoCommit(cpp.getAutoCommit()); + } catch (Exception e) { + throw new PoolException(e.getMessage()); + } + return connection; + } + + protected void releaseObject(Object resourceObject) { + validateObject(resourceObject); + Connection connection = (Connection) resourceObject; + try { + if (connection == null) + return; + if (connection.isClosed() == false) { + connection.close(); + } + connection = null; + } catch (Exception e) { + throw new PoolException(e.getMessage()); + } + } + + public void lendObject(Connection connection) { + super.lendObject(connection); + } + + protected void validateObject(Object resourceObject) { + super.validateObject(resourceObject); + if (!(resourceObject instanceof Connection)) { + throw new IllegalArgumentException("Only Connection class is acceptable."); + } + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ConnectionPoolProperties.java b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ConnectionPoolProperties.java new file mode 100644 index 00000000..94b4f75d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ConnectionPoolProperties.java @@ -0,0 +1,51 @@ +package user.commons.pool.orig; + +import user.commons.CommonsProperties; + +public class ConnectionPoolProperties extends CommonsProperties { + static public final String AUTOCOMMIT = "AutoCommit"; + static public final String DRIVERNAME = "DriverName"; + static public final String PASSWORD = "Password"; + static public final String TIMEOUT = "Timeout"; + static public final String URL = "ConnectionUrl"; + static public final String USERNAME = "UserName"; + + public ConnectionPoolProperties(String driver, String url, String userName, String password, boolean autoCommit, int timeout) { + CommonsProperties.checkParameter(DRIVERNAME, driver); + CommonsProperties.checkParameter(URL, url); + CommonsProperties.checkParameter(USERNAME, userName); + CommonsProperties.checkParameter(PASSWORD, password); + CommonsProperties.checkParameter(AUTOCOMMIT, autoCommit); + CommonsProperties.checkParameter(TIMEOUT, timeout); + super.add(DRIVERNAME, driver); + super.add(URL, url); + super.add(USERNAME, userName); + super.add(PASSWORD, password); + super.add(AUTOCOMMIT, autoCommit); + super.add(TIMEOUT, timeout); + } + + public boolean getAutoCommit(){ + return getBool(AUTOCOMMIT); + } + + public String getDriverName(){ + return getString(DRIVERNAME); + } + + public String getPassword(){ + return getString(PASSWORD); + } + + public int getTimeout() { + return getInt(TIMEOUT); + } + + public String getUrl(){ + return getString(URL); + } + + public String getUserName(){ + return getString(USERNAME); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ContextPool.java b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ContextPool.java new file mode 100644 index 00000000..5deca666 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ContextPool.java @@ -0,0 +1,103 @@ +package user.commons.pool.orig; + + +/* +import java.lang.reflect.InvocationTargetException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +import sqlj.runtime.ref.DefaultContext; +*/ +/** + * Adatbázis kontextus erõforrás kezelõ. + * + */ +public class ContextPool extends ResourcePool { + public ContextPool(ConnectionPoolProperties properties) { + super(properties); + } +/* + public DefaultContext borrowObject() { + DefaultContext context = (DefaultContext) super.borrowObject(); + DefaultContext.setDefaultContext(context); + return context; + } + + protected boolean checkObject(Object resourceObject) { + DefaultContext context = (DefaultContext) resourceObject; + return context.isClosed(); + } + + protected DefaultContext createObject() { + ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties(); + Connection connection = null; + DefaultContext context = null; + try { + Class.forName(cpp.getDriverName()); + } catch (ClassNotFoundException e) { + throw new PoolException(e.getMessage()); + } + + try { + DriverManager.setLoginTimeout(cpp.getTimeout()); + connection = DriverManager.getConnection(cpp.getUrl(), cpp.getUserName(), cpp.getPassword()); + connection.setAutoCommit(cpp.getAutoCommit()); + context = new DefaultContext(connection); + } catch (SQLException e) { + throw new PoolException(e.getMessage()); + } catch (RuntimeException e) { + Throwable cause = e.getCause(); + if(cause instanceof InvocationTargetException) { + Throwable targetException = ((InvocationTargetException)cause).getTargetException(); + targetException.printStackTrace(); + } + } + return context; + } + + protected void releaseObject(Object value) { + validateObject(value); + DefaultContext context = (DefaultContext) value; + try { + if (context == null) + return; + if (context.isClosed() == false) { + context.close(); + } + context = null; + } catch (Exception e) { + throw new PoolException(e.getMessage()); + } + } + + public void lendObject(DefaultContext context) { + super.lendObject(context); + } + + protected void validateObject(Object resourceObject) { + super.validateObject(resourceObject); + if (!(resourceObject instanceof DefaultContext)) { + throw new IllegalArgumentException("Only DefaultContext class is acceptable."); + } + } +*/ + + @Override + protected boolean checkObject(Object resourceObject) { + // TODO Auto-generated method stub + return false; + } + + @Override + protected Object createObject() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected void releaseObject(Object resourceObject) { + // TODO Auto-generated method stub + + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/PoolException.java b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/PoolException.java new file mode 100644 index 00000000..ed59f502 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/PoolException.java @@ -0,0 +1,12 @@ +package user.commons.pool.orig; + +/** + * Pool kivétel. + */ +public class PoolException extends RuntimeException { + private static final long serialVersionUID = 874798532700307318L; + + public PoolException(String message) { + super(message); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ResourcePool.java b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ResourcePool.java new file mode 100644 index 00000000..fbd845c6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/pool/orig/ResourcePool.java @@ -0,0 +1,166 @@ +package user.commons.pool.orig; + +import java.util.LinkedList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.CommonsProperties; + +/** + * Er�forr�s kezel�. + *
+ * Az implement�ci�ban meghat�rozott t�pus� er�forr�s objektumb�l + * ig�ny szerint l�trehoz annyit, amennyi enged�lyezett. + *
+ * Az er�forr�s objektumok k�lcs�n�zhet�ek, visszaadhat�ak + * thread-safe m�don. + *
+ * Mind�g a legr�gebben haszn�lt objektumot k�lcs�nzi ki. + *
+ * Ha elfogy a k�lcs�n�zhet� objektum, v�rakoztat. + */ + +abstract public class ResourcePool { + private static final Logger logger = LogManager.getLogger(); + static public final String POOLSIZE = "PoolSize"; + protected LinkedList pool = null; + private CommonsProperties properties = null; + private int resourceCounter = 0; + + /** + * Konstruktor a pool l�trehoz�s�ra. + * @param properties + * Be�ll�t�sok. + */ + protected ResourcePool(CommonsProperties properties) { + if (properties == null) + throw new NullPointerException("Pool property map cannot be null."); + this.properties = properties; + resourceCounter = this.properties.getInt(POOLSIZE); + } + + /** + * Er�forr�s objektum k�lcs�nz�se. + * @return + * Kik�lcs�nz�tt er�forr�s objektum. + * Visszet�r�s el�tt a checkObject-el ellen�rzi, hogy haszn�lhat� e az objektum. + * Ha nem �jat, hoz l�tre. + */ + protected Object borrowObject() { + if (pool == null) + pool = new LinkedList(); + + Object resourceObject = null; + + for (;;) { + synchronized (this) { + resourceObject = pool.poll(); + } + if (resourceObject != null) + break; + if (resourceCounter > 0) { + synchronized (this) { + resourceObject = createObject(); + resourceCounter--; + } + break; + } + + System.out.println("Waiting for resource."); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + } + + if (resourceObject != null && checkObject(resourceObject) == true) { + synchronized (this) { + System.out.println("Resource not passed the check. Recreating."); + if (pool.contains(resourceObject)) + pool.remove(resourceObject); + resourceObject = createObject(); + } + } + logger.trace(String.format("Borrow, pool size: %1$d, counter: %2$d", pool.size(), resourceCounter)); + return resourceObject; + } + + /** + * Ellen�rzi, hogy haszn�lhat� e az objektum. + * Implement�ci� f�gg�! + * @param resourceObject + * Ellen�rizend� objektum. + * @return + * true ha m�r nem haszn�lhat� + */ + abstract protected boolean checkObject(Object resourceObject); + + /** + * Az �sszes nem kik�lcs�nz�tt er�forr�s objektumot, + * a releaseObject h�v�ssal felszabad�tja. + */ + public void close() { + if (pool == null) + return; + Object resourceObject = null; + synchronized (this) { + while ((resourceObject = pool.poll()) != null) { + releaseObject(resourceObject); + } + } + pool = null; + } + + /** + * L�trehozza az er�forr�s objektumot. + * Implement�ci� f�gg�! + * @return + * A l�trehozott er�forr�s objektum. + */ + abstract protected Object createObject(); + + /** + * Param�terek lek�rdez�se. + * @return + * CommonsProperties t�pus� param�ter objektum. + */ + protected CommonsProperties getProperties() { + return properties; + } + + /** + * K�lcs�nvett er�forr�s objektum visszaszolg�ltat�sa. + * T�pus �s null pointer elle�rz�s a validateObject seg�ts�g�vel. + * @param value + * Er�forr�s objektum. + */ + protected void lendObject(Object value) { + if (pool == null) { + throw new IllegalStateException("Pool never initialized, or closed. Did you missed something?"); + } + validateObject(value); + synchronized (this) { + pool.add(value); + } + logger.trace(String.format("Lend, pool size: %1$d, counter: %2$d", pool.size(), resourceCounter)); + } + + /** + * Er�forr�s objektum felszabad�t�sa (kapcsolat lez�r�s, + * haszn�lt er�forr�sok felszabad�t�sa). + * Implement�ci� f�gg�! + * @param resourceObject + * A sz�ban forg� objektum. + */ + abstract protected void releaseObject(Object resourceObject); + + /** + * Ellen�rzi, hogy az objektum t�pusa megfelel� e. + */ + protected void validateObject(Object value) { + if (value == null) { + throw new NullPointerException("Object is null."); + } + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/Job.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/Job.java new file mode 100644 index 00000000..465c425a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/Job.java @@ -0,0 +1,54 @@ +package user.commons.rcc; + +public class Job { + private String name; + private String guid; + private String state; + private String status; + private int progress; + + public String getGuid() { + return guid; + } + + public String getName() { + return name; + } + + public int getProgress() { + return progress; + } + + public String getState() { + return state; + } + + public String getStatus() { + return status; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public void setName(String name) { + this.name = name; + } + + public void setProgress(int progress) { + this.progress = progress; + } + + public void setState(String state) { + this.state = state; + } + + public void setStatus(String status) { + this.status = status; + } + + @Override + public String toString() { + return String.format("Job name %s, state %s, status %s, progress %d", name, state, status, getProgress()); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/JobStatusList.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/JobStatusList.java new file mode 100644 index 00000000..b2ef73eb --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/JobStatusList.java @@ -0,0 +1,42 @@ +package user.commons.rcc; + +import java.util.ArrayList; +import java.util.List; + +public class JobStatusList { + private List jobs = new ArrayList(); + private int numberOfJobs = 0; + private int totalNumberOfJobs = 0; + + public int size() { + return jobs.size(); + } + + public void add(Job job) { + jobs.add(job); + } + + public void setNumberOfJobs(int numberOfJobs) { + this.numberOfJobs = numberOfJobs; + } + + public int getNumberOfJobs() { + return numberOfJobs; + } + + public void setTotalNumberOfJobs(int totalNumberOfJobs) { + this.totalNumberOfJobs = totalNumberOfJobs; + } + + public int getTotalNumberOfJobs() { + return totalNumberOfJobs; + } + + @Override + public String toString() { + String result = String.format("JobStatusList number of jobs %d, total number of jobs %d\n", numberOfJobs, totalNumberOfJobs); + for (Job job : jobs) + result += job + "\n"; + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCClient.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCClient.java new file mode 100644 index 00000000..d572ad65 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCClient.java @@ -0,0 +1,274 @@ +package user.commons.rcc; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.ItemSource; + +/*** + * Rhozet Carbon Coder illeszt�s. + */ +public class RCCClient { + private static final Logger logger = LogManager.getLogger(); + private String hostName = null; + private int port = 0; + private Map profileList = null; + private Socket client; + private InputStreamReader inputStream; + private PrintStream outputStream; + + /*** + * Rhozet Carbon Coder illeszt�s l�trehoz�sa. A kommunik�ci� a TCP/1120 + * porton zajlik. + * + * @param host + * A t�voli transzk�dol� alrendszer h�l�zati neve, vagy IP c�me + */ + + public RCCClient(String host) { + this.port = 1120; + this.hostName = "localhost"; + if (StringUtils.isEmpty(host)) { + logger.info("RCC server not specified, defaulting to localhost:1120"); + } else { + String data[] = host.split("\\:"); + if (data.length == 1) { + this.hostName = host; + logger.info("RCC server port not specified, defaulting to port 1120"); + } + if (data.length == 2) { + this.hostName = data[0]; + this.port = Integer.parseInt(data[1]); + } + } + } + + /*** + * Transzk�dol�si folyamat megszak�t�sa. + * + * @param id + * A megszak�tand� folyamat azonos�t�ja. + * @return RCCResponseJobCommand t�pus� v�lasz + */ + public RCCResponseJobCommand cancelJob(String id) { + RCCResponseJobCommand result = null; + RCCMessage msg = new RCCMessageJobCommand(id, "Stop"); + result = new RCCResponseJobCommand(communicate(msg)); + return result; + } + + void close() { + try { + if (outputStream != null) + outputStream.close(); + if (inputStream != null) + inputStream.close(); + if (client != null) + client.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + String communicate(RCCMessage msg) { + return communicate(msg.toString()); + } + + String communicate(String msg) { + String result = ""; + int messageSize = 0; + try { + logger.debug("SEND: " + msg); + open(); + outputStream.print(msg); + int i = 0; + int whitespace = 0; + while ((i = inputStream.read()) > -1) { + char ch = (char) i; + result += ch; + whitespace += ch == ' ' ? 1 : 0; + if (whitespace == 2) + break; + } + + String[] tags = result.split("\\ "); + messageSize = Integer.parseInt(tags[1]); + + char[] buffer = new char[1024]; + int bytes = 0; + int allBytes = 0; + while (allBytes != messageSize) { + bytes = inputStream.read(buffer, 0, buffer.length); + if (bytes > 0) { + allBytes += bytes; + result += new String(buffer).substring(0, bytes); + } + } + result = result.trim(); + logger.debug("RECEIVE: " + result); + } catch (SocketTimeoutException e) { + throw new RCCException("Couldn't connect to remote host " + getHostName() + ":" + getPort()); + } catch (Exception e) { + throw new RCCException(e); + } finally { + close(); + } + return result; + } + + /*** + * Transzk�dol�si folyamat ind�t�sa. + * + * @param jobName + * A folyamat tetsz�leges neve. + * @param inputFilePath + * A forr�s m�dia el�r�si �tja. + * @param outputDir + * A c�l m�dia kimeneti mapp�ja. + * @param profileGuid + * A profil azonos�t�ja. + * @param id + * Jelenleg nem haszn�lt mez�. �rt�ke tetsz�leges, pl. 0 + * @param priority + * Priorit�s. �rt�ke 0-9 k�z�tt a priorit�st hat�rozza meg, 255 + * eset�n azonnali ind�t�st. + * @return + */ + public String cueueJobByGuid(String jobName, List itemSource, String outputDir, String profileGuid, + long id, int priority) { + String result = null; + RCCMessage msg = new RCCMessageJobQueue(jobName, itemSource, outputDir, profileGuid, id, priority); + RCCResponseJobCueue response = new RCCResponseJobCueue(communicate(msg)); + if (response.getSuccess()) + result = response.getID(); + return result; + } + + public String getHostName() { + return hostName; + } + + public JobStatusList getJobsStatusList() { + JobStatusList result = null; + RCCMessage msg = new RCCMessageJobStatusList(); + RCCResponseJobStatusList response = new RCCResponseJobStatusList(communicate(msg)); + result = response.getJobStatusList(); + return result; + } + + public int getPort() { + return port; + } + + /*** + * Profil azonos�t�j�nak lek�rdez�se n�v alapj�n. + * + * @param name + * A profil neve. + * @return Eredm�nyk�nt a profil azopnos�t�j�t kapjuk, sz�veges t�pusra + * konvert�lva. + */ + public String getProfileId(String name) { + String result = null; + getProfileList(); + if (profileList != null && profileList.containsKey(name)) + result = profileList.get(name); + return result; + } + + /*** + * Profilok lek�rdez�se a t�voli eszk�zr�l. + * + * @return Az eredm�ny egy azonos�t� kulcsokb�l �s a profilok nev�b�l �ll� + * lista. + */ + public Map getProfileList() { + if (profileList == null) { + RCCMessage msg = new RCCMessageProfile(); + RCCResponseProfile response = new RCCResponseProfile(communicate(msg)); + profileList = response.getProfileList(); + } + String[] array = profileList.keySet().toArray(new String[0]); + Arrays.sort(array); + List keys = Arrays.asList(array); + for (String key : keys) + logger.trace(key + "|" + profileList.get(key)); + + return profileList; + } + + void open() throws IOException { + client = new Socket(); + client.connect(new InetSocketAddress(this.hostName, this.port), 1000); + inputStream = new InputStreamReader(client.getInputStream(), "UTF-8"); + outputStream = new PrintStream(client.getOutputStream(), false, "UTF-8"); + } + + public RCCResponseJobCommand pauseJob(String id) { + RCCResponseJobCommand result = null; + RCCMessage msg = new RCCMessageJobCommand(id, "Pause"); + result = new RCCResponseJobCommand(communicate(msg)); + return result; + } + + /*** + * + * @param id + * @return + */ + public RCCResponseJobCommand getJobDetails(String id) { + RCCResponseJobCommand result = null; + RCCMessage msg = new RCCMessageJobCommand(id, "Query"); + result = new RCCResponseJobCommand(communicate(msg)); + return result; + } + + /*** + * Adott azonos�t�j� folyamat �llapot�nak lek�rdez�se. + * + * @param id + * Folyamat azonos�t�ja. + * @return Az eredm�ny egy RCCResponseJobCommand objektum, ami t�bbek k�z�tt + * a folyamat st�tusz�t �s a feldolgozotts�g sz�zal�kos �rt�k�t is + * tartalmazza. + */ + public RCCResponseJobCommand queryStatus(String id) { + RCCResponseJobCommand result = null; + RCCMessage msg = new RCCMessageJobCommand(id, "QueryInfo"); + result = new RCCResponseJobCommand(communicate(msg)); + return result; + } + + public RCCResponseJobCommand resumeJob(String id) { + RCCResponseJobCommand result = null; + RCCMessage msg = new RCCMessageJobCommand(id, "Resume"); + result = new RCCResponseJobCommand(communicate(msg)); + return result; + } + + /*** + * Profil param�tereinek lek�rdez�se. + * + * @param id + * A profil azonos�t�ja. + * @return Az eredm�ny RCCResponseProfileCommand t�pus� objektum, ami a + * r�szletes inform�ci�kat hordozza. + */ + public RCCResponseProfileCommand getProfileDetails(String id) { + RCCResponseProfileCommand result = null; + RCCMessage msg = new RCCMessageProfileCommand(id, "QueryConfigInfo"); + result = new RCCResponseProfileCommand(communicate(msg)); + return result; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCException.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCException.java new file mode 100644 index 00000000..ba409217 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCException.java @@ -0,0 +1,14 @@ +package user.commons.rcc; + +public class RCCException extends RuntimeException { + private static final long serialVersionUID = 1L; + + public RCCException(Exception e) { + super(e); + } + + public RCCException(String message) { + super(message); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCJob.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCJob.java new file mode 100644 index 00000000..b4519985 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCJob.java @@ -0,0 +1,166 @@ +package user.commons.rcc; + +import java.util.List; + +import user.commons.ItemSource; +import user.commons.RemoteFile; + +/*** + * Traszkódolási folyamat. + */ +public class RCCJob { + private String name; + private String guid; + private String status; + private int progress; + private final RCCClient client; + private final Object data; + private final long id; + private String errorMessage; + + /*** + * Új folyamat példányosítása. + * + * @param client + * A kapcsolódáshoz használt kliens. + * @param name + * A folyamat tetszõleges elnevezése. + * @param data + * Jelenleg nem használt. Értéke tetszõleges, pl. null. + * @param id + * Jelenleg nem használt. Értéke tetszõleges, pl. 0. + */ + public RCCJob(RCCClient client, String name, Object data, long id) { + this.client = client; + this.name = name; + this.data = data; + this.id = id; + } + + public Object getData() { + return data; + } + + /*** + * Legutolsó hibaüzenet szövege. + * + * @return + */ + public String getErrorMessage() { + return errorMessage; + } + + /*** + * Egyedi azonosító. + * + * @return A transzkóder által generál egyedi folyamat azonosító. + */ + public String getGuid() { + return guid; + } + + public long getId() { + return id; + } + + /*** + * @return Folyamat neve. + */ + public String getName() { + return name; + } + + /*** + * @return Folyamat feldolgozottság százalékos értéke. + */ + public int getProgress() { + return progress; + } + + /*** + * @return Folyamat státusza. + */ + public String getStatus() { + return status; + } + + /*** + * @return Igaz értéket ad, ha hiba történt a folyamatban. + */ + public boolean isError() { + return status.equals("ERROR"); + } + + /*** + * @return Igaz értéket ad, ha a folyamat fut. + */ + public boolean isRunning() { + refresh(); + return !status.equals("FAILED") && !status.equals("ERROR") && !status.equals("STOPPED") && !status.equals("COMPLETED"); + } + + /*** + * @return Igaz értéket ad, ha a folyamat sikeresen véget ért. + */ + public boolean isSuccess() { + return status.equals("COMPLETED"); + } + + /*** + * Frissítés. A folyamat paraméterei aktualizálódnak. + */ + public void refresh() { + if (client != null) { + try { + RCCResponseJobCommand response = client.queryStatus(guid); + progress = Integer.parseInt(response.getProgress()); + errorMessage = response.getErrorMessage(); + status = response.getStatus(); + } catch (Exception e) { + throw new RCCException("Couldn't get job status"); + } + } + } + + /*** + * A folyamat megszakítása. + */ + public void cancel() { + if (client != null) + client.cancelJob(guid); + } + + /*** + * Folyamat indítása, elküldése a transzkóder alrendszernek. + * + * @param inputFilePath + * A forrás média elérési útja. + * @param outputDir + * A cél média kimeneti mappája. + * @param profileGuid + * A profil azonosítója. + * @return Igaz értéket ad, ha sikerült a folyamat elküldése. + */ + public boolean submit(String inputFilePath, String outputDir, String profileGuid) { + if (client != null) + guid = client.cueueJobByGuid(name, null, outputDir, profileGuid, id, 0); + return guid != null; + } + + public boolean submit(List itemSource, String outputDir, String profileGuid) { + if (client != null) + guid = client.cueueJobByGuid(name, itemSource, outputDir, profileGuid, id, 0); + return guid != null; + } + + @Override + public String toString() { + return String.format("%s job details: status %s, progress %d", name, status, getProgress()); + } + + public RemoteFile getTargetFile() { + RCCResponseJobCommand response = client.getJobDetails(guid); + return response.getTargetFile(); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessage.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessage.java new file mode 100644 index 00000000..61ee015f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessage.java @@ -0,0 +1,76 @@ +package user.commons.rcc; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class RCCMessage +{ + Document xmlDocument = null; + Element root = null; + + public RCCMessage() + { + try + { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + DOMImplementation impl = db.getDOMImplementation(); + xmlDocument = impl.createDocument(null,null,null); + + root = xmlDocument.createElement("cnpsXML"); + xmlDocument.appendChild(root); + + root.setAttribute("CarbonAPIVer", "1.2"); + } + catch(Exception e) + { + e.printStackTrace(); + } + } + + public void setTaskType(String taskType) + { + if (root == null) return; + root.setAttribute("TaskType", taskType); + } + + String getTemplateData() + { + return ""; + } + + public String toString() + { + try + { + DOMSource domSource = new DOMSource(xmlDocument); + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + //transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); + transformer.setOutputProperty(OutputKeys.ENCODING,"UTF-8"); + //transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + java.io.StringWriter sw = new java.io.StringWriter(); + StreamResult sr = new StreamResult(sw); + transformer.transform(domSource, sr); + String xml = sw.toString(); + + return "CarbonAPIXML1 " + xml.length() + " " + xml; + } + catch (Exception e) + { + e.printStackTrace(); + } + + return null; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobCommand.java new file mode 100644 index 00000000..b3c51422 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobCommand.java @@ -0,0 +1,17 @@ +package user.commons.rcc; + +import org.w3c.dom.Element; + +public class RCCMessageJobCommand extends RCCMessage { + + public RCCMessageJobCommand(String guid, String command) { + super(); + if (xmlDocument == null || root == null) + return; + setTaskType("JobCommand"); + Element jobcommand = xmlDocument.createElement("JobCommand"); + jobcommand.setAttribute("Command", command); + jobcommand.setAttribute("GUID", guid); + root.appendChild(jobcommand); + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobQueue.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobQueue.java new file mode 100644 index 00000000..acab4fd0 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobQueue.java @@ -0,0 +1,107 @@ +package user.commons.rcc; + +import java.util.List; + +import org.w3c.dom.Element; + +import user.commons.ItemSource; + +public class RCCMessageJobQueue extends RCCMessage { + public RCCMessageJobQueue(String jobName, List itemSources, String outputDir, String profileGUID, long id, int priority) { + /* + * super(); + * + * if (xmlDocument == null || root == null) return; + * + * setTaskType("JobQueue"); + * + * root.setAttribute("JobName", jobName); + * + * Element sources = xmlDocument.createElement("Sources"); Element + * smodule0 = xmlDocument.createElement("Module_0"); + * smodule0.setAttribute("Filename", itemSources.get(0).getName()); + * + * sources.appendChild(smodule0); root.appendChild(sources); + * + * Element destinations = xmlDocument.createElement("Destinations"); + * Element dmodule0 = xmlDocument.createElement("Module_0"); + * dmodule0.setAttribute("ModuleGUID", profileGUID); Element moduledata + * = xmlDocument.createElement("ModuleData"); + * moduledata.setAttribute("CML_P_BaseFileName", "%s"); + * moduledata.setAttribute("CML_P_Path", outputDir); + * + * dmodule0.appendChild(moduledata); destinations.appendChild(dmodule0); + * root.appendChild(destinations); + * + * Element projectsettings = + * xmlDocument.createElement("ProjectSettings"); + * projectsettings.setAttribute("Priority.DWD", + * Integer.toString(priority)); + * + * root.appendChild(projectsettings); + */ + super(); + + if (xmlDocument == null || root == null) + return; + + setTaskType("JobQueue"); + + root.setAttribute("JobName", jobName); + Element sources = xmlDocument.createElement("Sources"); + for (int i = 0; i < itemSources.size(); i++) { + Element smodule = xmlDocument.createElement("Module_" + i); + Element moduleData = xmlDocument.createElement("ModuleData"); + + Element stTable = xmlDocument.createElement("StreamTypeTable"); + moduleData.appendChild(stTable); + stTable.setAttribute("StreamType_0.DWD", "0"); + stTable.setAttribute("StreamPtr_0.DWD", "0"); + stTable.setAttribute("StreamSelector_0.DWD", "0"); + stTable.setAttribute("StreamType_1.DWD", "0"); + stTable.setAttribute("StreamPtr_1.DWD", "0"); + stTable.setAttribute("StreamSelector_1.DWD", "2"); + + Element sourceModules = xmlDocument.createElement("SourceModules"); + Element multiSrcModule = xmlDocument.createElement("MultiSrcModule_0"); + ItemSource itemSource = itemSources.get(i); + multiSrcModule.setAttribute("Filename", itemSource.getName()); + multiSrcModule.setAttribute("MultiSource.DWD", "0"); + sourceModules.appendChild(multiSrcModule); + moduleData.appendChild(sourceModules); + smodule.appendChild(moduleData); + smodule.setAttribute("Inpoint.QWD", "-1"); + smodule.setAttribute("Outpoint.QWD", "-1"); + smodule.setAttribute("MultiSource.DWD", "1"); + long[] tcIn = itemSource.getTcIn(); + if (tcIn != null && tcIn.length > 0) { + Element inOutPoints = xmlDocument.createElement("InOutPoints"); + for (int j = 0; j < tcIn.length; j++) { + inOutPoints.setAttribute("Inpoint_" + j + ".QWD", String.valueOf(tcIn[j])); + inOutPoints.setAttribute("Outpoint_" + j + ".QWD", String.valueOf(itemSource.getTcOut()[j])); + } + smodule.appendChild(inOutPoints); + } + sources.appendChild(smodule); + } + root.appendChild(sources); + + Element destinations = xmlDocument.createElement("Destinations"); + Element dmodule0 = xmlDocument.createElement("Module_0"); + dmodule0.setAttribute("ModuleGUID", profileGUID); + Element moduledata = xmlDocument.createElement("ModuleData"); + moduledata.setAttribute("CML_P_BaseFileName", "%s"); + moduledata.setAttribute("CML_P_Path", outputDir); + + dmodule0.appendChild(moduledata); + destinations.appendChild(dmodule0); + root.appendChild(destinations); + + Element projectsettings = xmlDocument.createElement("ProjectSettings"); + projectsettings.setAttribute("Stitching.DWD", "1"); + projectsettings.setAttribute("Priority.DWD", Integer.toString(priority)); + + root.appendChild(projectsettings); + + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobStatusList.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobStatusList.java new file mode 100644 index 00000000..b3f75070 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageJobStatusList.java @@ -0,0 +1,20 @@ +package user.commons.rcc; +import org.w3c.dom.Element; + +public class RCCMessageJobStatusList extends RCCMessage +{ + public RCCMessageJobStatusList() + { + super(); + + if (xmlDocument == null || root == null) return; + + setTaskType("JobStatusList"); + + Element filter = xmlDocument.createElement("Filter"); + root.appendChild(filter); + + Element listsettings = xmlDocument.createElement("ListSettings"); + root.appendChild(listsettings); + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageProfile.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageProfile.java new file mode 100644 index 00000000..d8f3c0e1 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageProfile.java @@ -0,0 +1,20 @@ +package user.commons.rcc; +import org.w3c.dom.Element; + +public class RCCMessageProfile extends RCCMessage +{ + public RCCMessageProfile() + { + super(); + + if (xmlDocument == null || root == null) return; + + setTaskType("ProfileList"); + Element elem = xmlDocument.createElement("ProfileAttributes"); + root.appendChild(elem); + + //Destination, Filter_Audio, Filter_Video, Setting, Connection + //de csak a Destination müxik + elem.setAttribute("ProfileType", "Destination"); + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageProfileCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageProfileCommand.java new file mode 100644 index 00000000..23adb7af --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCMessageProfileCommand.java @@ -0,0 +1,17 @@ +package user.commons.rcc; + +import org.w3c.dom.Element; + +public class RCCMessageProfileCommand extends RCCMessage { + + public RCCMessageProfileCommand(String guid, String command) { + super(); + if (xmlDocument == null || root == null) + return; + setTaskType("ProfileCommand"); + Element jobcommand = xmlDocument.createElement("ProfileCommand"); + jobcommand.setAttribute("Command", command); + jobcommand.setAttribute("GUID", guid); + root.appendChild(jobcommand); + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponse.java new file mode 100644 index 00000000..a951dc22 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponse.java @@ -0,0 +1,78 @@ +package user.commons.rcc; + +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +public class RCCResponse { + protected static final Logger logger = LogManager.getLogger(); + int checkLength = 0; + Document xmlDocument = null; + boolean isSuccess = false; + protected String response = null; + + RCCResponse(String response) { + + //logger.info(response); + + this.response = response.replace("CarbonAPIXML1 ", ""); + int pos = this.response.indexOf(" "); + checkLength = Integer.parseInt(this.response.substring(0, pos)); + this.response = this.response.substring(pos + 1); + // if (checkLength == this.responseXML.length()) mi�rt nem ugyan az??? + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + this.xmlDocument = db.parse(new InputSource(new StringReader(this.response))); + Node reply = getNode("Reply"); + this.isSuccess = Boolean.parseBoolean(getValue(reply, "Success")); + + } catch (Exception e) { + throw new RCCException(e); + } + } + + Node getNode(String name) { + Node result = null; + NodeList nodeList = xmlDocument.getElementsByTagName(name); + result = (nodeList.getLength() == 1) ? nodeList.item(0) : null; + if (result == null) + throw new RCCException("Missing single node <" + name + ">"); + return result; + } + + Node tryGetNode(String name) { + Node result = null; + NodeList nodeList = xmlDocument.getElementsByTagName(name); + result = (nodeList.getLength() > 0) ? nodeList.item(0) : null; + return result; + } + + boolean getSuccess() { + return this.isSuccess; + } + + protected String getValue(Node node, String name) { + String result = null; + if (node != null) { + NamedNodeMap attribs = node.getAttributes(); + if (attribs != null) { + Node attrib = attribs.getNamedItem(name); + result = attrib == null ? null : attrib.getNodeValue(); + } + if (result == null) + throw new RCCException("Attribute missing: " + node.getNodeName() + " ~ " + name); + } + return result; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobCommand.java new file mode 100644 index 00000000..c37ed052 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobCommand.java @@ -0,0 +1,69 @@ +package user.commons.rcc; + +import java.io.File; + +import org.w3c.dom.Node; + +import user.commons.RemoteFile; + +public class RCCResponseJobCommand extends RCCResponse { + private Node jobInfoNode = null; + + RCCResponseJobCommand(String responseXML) { + super(responseXML); + } + + Node getJobInfoNode() { + if (jobInfoNode == null) + jobInfoNode = getNode("JobInfo"); + return jobInfoNode; + } + + public String getStatus() { + String result = null; + try { + result = getValue(getJobInfoNode(), "Status"); + } catch (Exception e) { + logger.error(e); + } + return result; + } + + public String getErrorMessage() { + String result = ""; + try { + Node node = getNode("Errors"); + result = getValue(node.getFirstChild(), "Error"); + } catch (Exception e) { + logger.error(e); + } + return result; + } + + public String getProgress() { + String result = null; + try { + result = getValue(getJobInfoNode(), "Progress.DWD"); + } catch (Exception e) { + logger.error(e); + } + return result; + } + + public RemoteFile getTargetFile() { + RemoteFile result = null; + Node targetFilesNode = tryGetNode("TargetFiles"); + if (targetFilesNode != null) { + String path = getValue(targetFilesNode, "File_0"); + if (path != null) { + result = new RemoteFile(); + File f = new File(path); + result.setName(f.getName()); + String sizetxt = getValue(targetFilesNode, "FileSize_0.QWD"); + long size = Long.parseLong(sizetxt); + result.setSize(size); + } + } + return result; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobCueue.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobCueue.java new file mode 100644 index 00000000..f3c8a15d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobCueue.java @@ -0,0 +1,29 @@ +package user.commons.rcc; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +class RCCResponseJobCueue extends RCCResponse +{ + RCCResponseJobCueue(String responseXML) + { + super(responseXML); + } + + String getID() + { + String ret = null; + try + { + Node reply = getNode("Reply"); + NamedNodeMap attribs = reply.getAttributes(); + if (attribs.getLength() == 0) throw new Exception("Reply attributes missing."); + ret = attribs.getNamedItem("GUID").getNodeValue(); + } + catch(Exception e) + { + e.printStackTrace(); + } + + return ret; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobStatusList.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobStatusList.java new file mode 100644 index 00000000..b67610b8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseJobStatusList.java @@ -0,0 +1,33 @@ +package user.commons.rcc; + +public class RCCResponseJobStatusList extends RCCResponse { + + RCCResponseJobStatusList(String response) { + super(response); + } + + public JobStatusList getJobStatusList() { + JobStatusList result = null; + try { +// Digester digester = new Digester(); +// digester.setRules(new ExtendedBaseRules()); +// digester.addObjectCreate("Reply/JobStatusList", JobStatusList.class); +// digester.addSetProperties("Reply/JobStatusList", new String[]{ +// "NrOfJobs.DWD", "TotalNrOfJobs.DWD" +// }, new String[]{ +// "numberOfJobs", "totalNumberOfJobs" +// }); +// digester.addObjectCreate("Reply/JobStatusList/?", Job.class); +// digester.addSetProperties("Reply/JobStatusList/?", new String[]{ +// "Name", "GUID", "State", "Status", "Progress.DWD" +// }, new String[]{ +// "name", "guid", "state", "status", "progress" +// }); +// digester.addSetNext("Reply/JobStatusList/?", "add"); +// result = (JobStatusList) digester.parse(new ByteArrayInputStream(response.getBytes())); + } catch (Exception e) { + //System.out.println(e.getMessage()); + } + return result; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseProfile.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseProfile.java new file mode 100644 index 00000000..a69ca53f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseProfile.java @@ -0,0 +1,44 @@ +package user.commons.rcc; +import java.util.HashMap; +import java.util.Map; + +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +class RCCResponseProfile extends RCCResponse +{ + RCCResponseProfile(String responseXML) + { + super(responseXML); + } + + Map getProfileList() + { + Map profileList = new HashMap(); + if (!this.isSuccess) return profileList; + + try + { + NodeList nodeList = xmlDocument.getElementsByTagName("ProfileList"); + if (nodeList.getLength() != 1) throw new Exception("No codec information returned."); + + NodeList codecNodes = nodeList.item(0).getChildNodes(); + + for (int i = 0; i < codecNodes.getLength(); i++) + { + Node codec = codecNodes.item(i); + NamedNodeMap attribs = codec.getAttributes(); + if (attribs.getLength() == 0) throw new Exception("Codec attributes missing."); + + profileList.put(attribs.getNamedItem("Name").getNodeValue(), attribs.getNamedItem("GUID").getNodeValue()); + } + } + catch(Exception e) + { + e.printStackTrace(); + } + + return profileList; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseProfileCommand.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseProfileCommand.java new file mode 100644 index 00000000..682855dc --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/RCCResponseProfileCommand.java @@ -0,0 +1,10 @@ +package user.commons.rcc; + + +public class RCCResponseProfileCommand extends RCCResponse { + + RCCResponseProfileCommand(String responseXML) { + super(responseXML); + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/rcc/TranscoderProfile.java b/server/user.jobengine.osgi.commons/src/user/commons/rcc/TranscoderProfile.java new file mode 100644 index 00000000..8f5dfc3d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/rcc/TranscoderProfile.java @@ -0,0 +1,40 @@ +package user.commons.rcc; + +public class TranscoderProfile { + private String name; + private String guid; + private boolean isDefault; + + public TranscoderProfile() { + } + + public TranscoderProfile(String name, String guid, boolean isDefault) { + this.name = name; + this.guid = guid; + this.isDefault = isDefault; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getGuid() { + return guid; + } + + public void setGuid(String guid) { + this.guid = guid; + } + + public boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(boolean isDefault) { + this.isDefault = isDefault; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DeliveryMethod.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DeliveryMethod.java new file mode 100644 index 00000000..a160cab6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DeliveryMethod.java @@ -0,0 +1,5 @@ +package user.commons.remotestore; + +public enum DeliveryMethod { + STREAMING, ADAPTIVESTREAMING, PROGRESSIVEDOWNLOAD +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DirectoryFileFilter.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DirectoryFileFilter.java new file mode 100644 index 00000000..6637c1f2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DirectoryFileFilter.java @@ -0,0 +1,48 @@ +package user.commons.remotestore; + +import java.io.File; +import java.io.FileFilter; + +public class DirectoryFileFilter implements FileFilter { + private String params = null; + private boolean forDirectories = false; + + DirectoryFileFilter(String params, boolean forDirectories) { + this.params = params; + this.forDirectories = forDirectories; + } + + public boolean accept(File file) { + boolean ret = false; + String name = file.getName(); + + if (forDirectories) + ret = file.isDirectory(); + else + ret = file.isFile(); + + if (ret == false) + return ret; + + if (params == null || params.trim().length() == 0) + return ret; + + if (params.startsWith("*")) { + ret &= name.endsWith(params.replace("*", "")); + return ret; + } + + if (params.endsWith("*")) { + ret &= name.startsWith(params.replace("*", "")); + return ret; + } + + if (params.contains("*")) { + String[] p = params.split("\\*"); + if (p.length == 2) + ret &= name.startsWith(p[0]) && name.endsWith(p[1]); + } else + ret &= file.getName().equals(params); + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DirectoryUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DirectoryUtils.java new file mode 100644 index 00000000..7aa6e5e4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/DirectoryUtils.java @@ -0,0 +1,96 @@ +package user.commons.remotestore; + +import org.apache.commons.lang.StringUtils; + +public class DirectoryUtils { + + private static final String PATHSEPARATOR_WINDOWS = "\\"; + private static final String PATHSEPARATOR_LINUX = "/"; + private static final String PATHSEPARATOR = System.getProperty("os.name").startsWith("Windows") ? PATHSEPARATOR_WINDOWS : PATHSEPARATOR_LINUX; + + public static String checkSlash(String data, boolean forceStart, boolean forceEnd) { + return checkSlash(PATHSEPARATOR, data, forceStart, forceEnd); + } + + public static String checkSlash(String separator, String data, boolean forceStart, boolean forceEnd) { + String result = ""; + if (data != null) { + // Hibát okoz linux alatt a teljes elérési utak esetében! + result = StringUtils.strip(data, separator); + result = forceStart ? separator + result : result; + result = forceEnd ? result + separator : result; + + // lehetséges javítás, tesztelendõ + // if (result.indexOf(separator) != 0 && forceStart) + // result = separator + result; + // + // if (result.lastIndexOf(separator) != result.length() && forceEnd) + // result = result + separator; + } + return result; + } + + public static String checkEndSlash(String data) { + return checkEndSlash(data, PATHSEPARATOR); + } + + public static String checkEndSlash(String data, String separator) { + String result = ""; + if (data != null) { + result = data; + if (result.lastIndexOf(separator) != result.length() - 1) + result = result + separator; + } + return result; + } + + public static String normalize(String path, String separator) { + String result = null; + if (separator != null && path != null) { + result = path; + if (separator.contains(PATHSEPARATOR_LINUX) && path.contains(PATHSEPARATOR_WINDOWS)) + result = path.replace(PATHSEPARATOR_WINDOWS, PATHSEPARATOR_LINUX); + else { + if (separator.contains(PATHSEPARATOR_WINDOWS) && path.contains(PATHSEPARATOR_LINUX)) + result = path.replace(PATHSEPARATOR_LINUX, PATHSEPARATOR_WINDOWS); + } + } + return result; + } + + public static String combine(String path1, String path2) throws Exception { + return combine(path1, path2, false, false); + } + + public static String combine(String path1, String path2, boolean isFile, boolean forceSystemSeparator) throws Exception { + String result = ""; + String separator = null; + String normalizedPath1 = null; + String normalizedPath2 = null; + + if (path1 != null) { + separator = forceSystemSeparator ? PATHSEPARATOR : getSeparator(path1); + normalizedPath1 = normalize(path1, separator); + + result = checkEndSlash(normalizedPath1, separator); + if (path2 != null) { + normalizedPath2 = normalize(path2, separator); + result += normalizedPath2; + } + if (!isFile) + result = checkEndSlash(result, separator); + } else { + throw new Exception("RootPath cannot be null!"); + } + return result; + } + + public static String getSeparator(String path) throws Exception { + String result = PATHSEPARATOR_LINUX; + if (path != null && path.contains(PATHSEPARATOR_WINDOWS)) + result = PATHSEPARATOR_WINDOWS; + if (path.contains(PATHSEPARATOR_LINUX) && path.contains(PATHSEPARATOR_WINDOWS)) + throw new Exception("Path cannot contains both of Windows and Linux based type of separators!"); + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/FormatSize.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/FormatSize.java new file mode 100644 index 00000000..84ebc6f3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/FormatSize.java @@ -0,0 +1,26 @@ +package user.commons.remotestore; + +import java.text.NumberFormat; + +public class FormatSize { + public String formatSize(long longSize, int decimalPos) + { + NumberFormat fmt = NumberFormat.getNumberInstance(); + if (decimalPos >= 0) + { + fmt.setMaximumFractionDigits(decimalPos); + } + final double size = longSize; + double val = size / (1024 * 1024); + if (val > 1) + { + return fmt.format(val).concat(" MB"); + } + val = size / 1024; + if (val > 10) + { + return fmt.format(val).concat(" KB"); + } + return fmt.format(val).concat(" bytes"); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/FtpDirectoryLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/FtpDirectoryLister.java new file mode 100644 index 00000000..00407cbe --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/FtpDirectoryLister.java @@ -0,0 +1,186 @@ +package user.commons.remotestore; + +import java.io.InputStream; +import java.io.OutputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.net.ftp.FTP; +import org.apache.commons.net.ftp.FTPClient; +import org.apache.commons.net.ftp.FTPFile; + +import user.commons.RemoteFile; +import user.commons.StoreUri; + +public class FtpDirectoryLister implements IDirectoryLister { + private final StoreUri storeUri; + private FTPClient ftpClient; + private boolean completed; + + public FtpDirectoryLister(StoreUri storeUri) { + this.storeUri = storeUri; + } + + public boolean checkAvailability(RemoteFile remoteFile) throws Exception { + boolean result = false; + InputStream input = null; + String name = remoteFile.getName(); + connect(); + if (ftpClient != null) { + input = ftpClient.retrieveFileStream(name); + completed = true; + if (input != null) { + input.close(); + completePendingCommand(); + result = updateFileSize(remoteFile); + } else { + List remoteFiles = list(); + for (RemoteFile file : remoteFiles) { + if (file.getName().equals(name)) + if (file.getSize() == remoteFile.getSize()) + result = true; + } + } + } + return result; + } + + public void cleanUp() throws Exception { + if (ftpClient != null) { + if (ftpClient.isConnected()) { + ftpClient.logout(); + ftpClient.disconnect(); + ftpClient = null; + } else { + ftpClient = null; + } + if (completed) { + completePendingCommand(); + } + } + } + + private void completePendingCommand() throws Exception { + if (completed) { + if (ftpClient != null) { + ftpClient.completePendingCommand(); + completed = false; + } + } + } + + private void connect() throws Exception { + String path = storeUri.toString(true); + String[] pathElements = path.split("/"); + if (ftpClient == null) { + ftpClient = new FTPClient(); + if (storeUri.getPortNumber() != null) + ftpClient.connect(pathElements[0], storeUri.getPortNumber().intValue()); + else + ftpClient.connect(pathElements[0]); + String userName = storeUri.getUserName(); + userName = StringUtils.isEmpty(userName) ? "anonymous" : userName; + ftpClient.login(userName, storeUri.getPassword()); + ftpClient.setFileType(FTP.BINARY_FILE_TYPE); + ftpClient.enterLocalPassiveMode(); + if (pathElements.length > 1) { + for (int i = 1; i < pathElements.length; i++) { + ftpClient.changeWorkingDirectory(pathElements[i]); + } + } + } + } + + @Override + public RemoteFile get(String fileName) throws Exception { + RemoteFile result = null; + connect(); + if (ftpClient != null) { + FTPFile[] files = ftpClient.listFiles(fileName); + if (files != null && files.length == 1) + result = toRemoteFile(files[0]); + cleanUp(); + } + if (result == null) + throw new Exception("File not exists: " + fileName + " on uri " + storeUri); + return result; + } + + public InputStream getInputStream(RemoteFile remoteFile) throws Exception { + InputStream input = null; + connect(); + if (ftpClient != null) { + input = ftpClient.retrieveFileStream(remoteFile.getName()); + completed = true; + } + return input; + } + + public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception { + OutputStream output = null; + connect(); + if (ftpClient != null) { + output = ftpClient.storeFileStream(remoteFile.getName()); + completed = true; + } + return output; + + } + + @Override + public List list() throws Exception { + List result = new ArrayList(); + connect(); + if (ftpClient != null) { + FTPFile[] files = ftpClient.listFiles(); + for (FTPFile ftpFile : files) { + RemoteFile file = new RemoteFile(); + file.setName(ftpFile.getName()); + file.setCreated(new Timestamp(ftpFile.getTimestamp().getTimeInMillis())); + file.setModify(new Timestamp(ftpFile.getTimestamp().getTimeInMillis())); + file.setIsFolder(ftpFile.isDirectory()); + file.setSize(ftpFile.getSize()); + result.add(file); + } + cleanUp(); + } + return result; + } + + private RemoteFile toRemoteFile(FTPFile file) { + RemoteFile result = new RemoteFile(); + result.setName(file.getName()); + result.setCreated(new Timestamp(file.getTimestamp().getTimeInMillis())); + result.setModify(new Timestamp(file.getTimestamp().getTimeInMillis())); + result.setIsFolder(file.isDirectory()); + result.setSize(file.getSize()); + return result; + } + + private boolean updateFileSize(RemoteFile remoteFile) throws Exception { + boolean result = false; + String name = remoteFile.getName(); + long remoteFilesize = remoteFile.getSize(); + connect(); + if (ftpClient != null) { + boolean featResponse = ftpClient.hasFeature("MLST"); + if (featResponse) { + String[] reply = ftpClient.doCommandAsStrings("MLST", name); + if (reply.length > 1) { + if (reply[1].contains("Size=")) { + String[] stringElements = reply[1].split(";"); + String stringSize = stringElements[0].substring(5); + if (stringSize != null && stringSize != "") { + long size = Long.parseLong(stringSize); + if (size == remoteFilesize) + result = true; + } + } + } + } + } + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IDirectoryLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IDirectoryLister.java new file mode 100644 index 00000000..49310841 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IDirectoryLister.java @@ -0,0 +1,18 @@ +package user.commons.remotestore; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; + +import user.commons.RemoteFile; + +public interface IDirectoryLister { + + List list() throws Exception; + InputStream getInputStream(RemoteFile remoteFile) throws Exception; + OutputStream getOutputStream(RemoteFile remoteFile) throws Exception; + boolean checkAvailability(RemoteFile remoteFile) throws Exception; + void cleanUp() throws Exception; + RemoteFile get(String fileName) throws Exception; + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IProgressEventListener.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IProgressEventListener.java new file mode 100644 index 00000000..1e132870 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IProgressEventListener.java @@ -0,0 +1,8 @@ +package user.commons.remotestore; + +import java.util.EventListener; + +public interface IProgressEventListener extends EventListener { + public void progressChanged(ProgressEvent evt); +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IRemoteFile.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IRemoteFile.java new file mode 100644 index 00000000..772ccafe --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IRemoteFile.java @@ -0,0 +1,27 @@ +package user.commons.remotestore; + +import java.sql.Timestamp; + +public interface IRemoteFile { + + void setName(String name); + + String getName(); + + void setCreated(Timestamp created); + + Timestamp getCreated(); + + void setModify(Timestamp modify); + + Timestamp getModify(); + + void setSize(String size); + + String getSize(); + + void setFolder(boolean isFolder); + + boolean isFolder(); + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IStatusEventListener.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IStatusEventListener.java new file mode 100644 index 00000000..ea244e66 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/IStatusEventListener.java @@ -0,0 +1,8 @@ +package user.commons.remotestore; + +import java.util.EventListener; + +public interface IStatusEventListener extends EventListener { + public void statusChanged(StatusEvent evt); +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/LocalDirectoryLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/LocalDirectoryLister.java new file mode 100644 index 00000000..9f872654 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/LocalDirectoryLister.java @@ -0,0 +1,99 @@ +package user.commons.remotestore; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.List; + +import user.commons.RemoteFile; +import user.commons.StoreUri; + +public class LocalDirectoryLister implements IDirectoryLister { + private StoreUri storeUri; + + public LocalDirectoryLister(StoreUri storeUri) { + this.storeUri = storeUri; + } + + @Override + public boolean checkAvailability(RemoteFile remoteFile) throws Exception { + boolean result = false; + String path = storeUri.toString(true); + File file = new File(path + remoteFile.getName()); + if (file.exists() && file.length() == remoteFile.getSize()) + result = true; + return result; + } + + @Override + public void cleanUp() { + } + + @Override + public RemoteFile get(String fileName) throws Exception { + String path = storeUri.toString(true); + File file = new File(path + fileName); + return toRemoteFile(file); + } + + public InputStream getInputStream(RemoteFile remoteFile) throws Exception { + String path = storeUri.toString(true); + File file = new File(path + remoteFile.getName()); + return new FileInputStream(file); + } + + public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception { + String path = storeUri.toString(true); + File file = new File(path + remoteFile.getName()); + return new FileOutputStream(file); + } + + @Override + public List list() throws Exception { + List result = new ArrayList(); + String path = storeUri.toString(true); + File dir = new File(path); + File[] dirs = dir.listFiles(new DirectoryFileFilter(storeUri + .getFilter(), true)); + File[] files = dir.listFiles(new DirectoryFileFilter(storeUri + .getFilter(), false)); + + Arrays.sort(dirs, new Comparator() { + public int compare(File f1, File f2) { + return f1.getName().compareToIgnoreCase(f2.getName()); + } + }); + + Arrays.sort(files, new Comparator() { + public int compare(File f1, File f2) { + return f1.getName().compareToIgnoreCase(f2.getName()); + } + }); + + for (File file : dirs) { + RemoteFile remoteFile = toRemoteFile(file); + result.add(remoteFile); + } + + for (File file : files) { + RemoteFile remoteFile = toRemoteFile(file); + result.add(remoteFile); + } + return result; + } + + private RemoteFile toRemoteFile(File file) { + RemoteFile result = new RemoteFile(); + result.setName(file.getName()); + result.setModify(new Timestamp(file.lastModified())); + result.setIsFolder(file.isDirectory()); + result.setSize(file.length()); + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/ProgressEvent.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/ProgressEvent.java new file mode 100644 index 00000000..d058beb9 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/ProgressEvent.java @@ -0,0 +1,26 @@ +package user.commons.remotestore; + +import java.util.EventObject; + +/** + * File eseménykezelõ. + * + * @author vasary + */ +public class ProgressEvent extends EventObject { + private static final long serialVersionUID = 1L; + private int progress = 0; + public int getProgress() { + return progress; + } + + public ProgressEvent(Object source, int percent) { + super(source); + this.progress = percent; + } + + public void setProgress(int progress) { + this.progress = progress; + } +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteFileHandler.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteFileHandler.java new file mode 100644 index 00000000..8bf8395d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteFileHandler.java @@ -0,0 +1,29 @@ +package user.commons.remotestore; + +import user.commons.StoreUri; + +public class RemoteFileHandler { + + public static IDirectoryLister createLister(StoreUri storeUri) throws Exception { + IDirectoryLister result = null; + if (storeUri != null) { + switch (storeUri.getProtocol()) { + case FTP: + result = new FtpDirectoryLister(storeUri); + break; + case SMB: + result = new SambaDirectoryLister(storeUri); + break; + case LOCAL: + result = new LocalDirectoryLister(storeUri); + break; + case TSM: + result = new TSMLister(storeUri); + break; + default: + throw new Exception("No handler registered for protocol: " + storeUri.getProtocol().getValue()); + } + } + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteStore.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteStore.java new file mode 100644 index 00000000..60a6481f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteStore.java @@ -0,0 +1,71 @@ +package user.commons.remotestore; + +import user.commons.EntityBase; + +public class RemoteStore extends EntityBase { + private long id; + private String name = null; + private String description = null; + private String uri = null; + private String userName; + private String password; + private String rootPath = null; + + + public String getDescription() { + return description; + } + + public long getId() { + return id; + } + + public String getName() { + return name; + } + + public String getPassword() { + return password; + } + + public String getRootPath() { + return rootPath; + } + + public String getUri() { + return uri; + } + + public String getUserName() { + return userName; + } + + public void setDescription(String description) { + // checkParameter("Description", description); + this.description = description; + } + + public void setId(long id) { + this.id = id; + } + + public void setName(String name) { + this.name = name; + } + + public void setPassword(String password) { + this.password = password; + } + + public void setRootPath(String rootPath) { + this.rootPath = rootPath; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public void setUserName(String userName) { + this.userName = userName; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteStoreProtocol.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteStoreProtocol.java new file mode 100644 index 00000000..2dbaa05e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/RemoteStoreProtocol.java @@ -0,0 +1,27 @@ +package user.commons.remotestore; + +public enum RemoteStoreProtocol { + HTTPS("https://"), HTTP("http://"), FTP("ftp://"), SMB("smb://"), LOCAL("file://"), TSM("tsm://"); + private final String value; + + private RemoteStoreProtocol(String value) { + this.value = value; + } + + static public RemoteStoreProtocol fromString(String data) { + RemoteStoreProtocol result = null; + if (data != null) { + for (RemoteStoreProtocol p : RemoteStoreProtocol.values()) { + if (p.getValue() != null && data.startsWith(p.getValue())) { + result = p; + break; + } + } + } + return result; + } + + public String getValue() { + return value; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaDirectoryLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaDirectoryLister.java new file mode 100644 index 00000000..7ac55e1f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaDirectoryLister.java @@ -0,0 +1,90 @@ +package user.commons.remotestore; + +import java.io.InputStream; +import java.io.OutputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import jcifs.smb.NtlmPasswordAuthentication; +import jcifs.smb.SmbFile; +import user.commons.RemoteFile; +import user.commons.StoreUri; + +public class SambaDirectoryLister implements IDirectoryLister { + private StoreUri storeUri; + + public SambaDirectoryLister(StoreUri storeUri) { + this.storeUri = storeUri; + } + + @Override + public boolean checkAvailability(RemoteFile remoteFile) throws Exception { + boolean result = false; + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, + storeUri.getUserName(), storeUri.getPassword()); + long size = remoteFile.getSize(); + String path = storeUri.toString(true) + remoteFile.getName(); + SmbFile smbFile = new SmbFile(path, auth); + if (smbFile.exists() && smbFile.length() == size) + result = true; + return result; + } + + @Override + public void cleanUp() throws Exception { + } + + @Override + public RemoteFile get(String fileName) throws Exception { + RemoteFile result = null; + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, + storeUri.getUserName(), storeUri.getPassword()); + String path = storeUri.toString(true) + fileName; + SmbFile smbFile = new SmbFile(path, auth); + if (smbFile != null) + result = toRemoteFile(smbFile); + return result; + } + + public InputStream getInputStream(RemoteFile remoteFile) throws Exception { + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, + storeUri.getUserName(), storeUri.getPassword()); + String path = storeUri.toString(true) + remoteFile.getName(); + SmbFile smbFile = new SmbFile(path, auth); + return smbFile.getInputStream(); + } + + public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception { + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, + storeUri.getUserName(), storeUri.getPassword()); + String path = storeUri.toString(true) + remoteFile.getName(); + SmbFile smbFile = new SmbFile(path, auth); + return smbFile.getOutputStream(); + } + + @Override + public List list() throws Exception { + List result = new ArrayList(); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, + storeUri.getUserName(), storeUri.getPassword()); + String path = storeUri.toString(true); + SmbFile smbFile = new SmbFile(path, auth); + SmbFile[] list = smbFile.listFiles(); + for (SmbFile smb : list) { + RemoteFile file = toRemoteFile(smb); + result.add(file); + } + return result; + } + + private RemoteFile toRemoteFile(SmbFile file) throws Exception { + RemoteFile result = new RemoteFile(); + result.setName(file.getName()); + result.setCreated(new Timestamp(file.getDate())); + result.setModify(new Timestamp(file.getLastModified())); + result.setIsFolder((file.getAttributes() & SmbFile.ATTR_DIRECTORY) == SmbFile.ATTR_DIRECTORY); + result.setSize(file.length()); + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaFileFilter.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaFileFilter.java new file mode 100644 index 00000000..5fd16b6a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaFileFilter.java @@ -0,0 +1,55 @@ +package user.commons.remotestore; + +import java.io.File; +import java.io.FileFilter; + +/** + * Ftp file lista filter. + * A LIST parancs paraméterébõl FileFilter-t készít a szûréshez. + * + * @author vasary + */ +public class SambaFileFilter implements FileFilter { + private String params = null; + private boolean forDirectories = false; + + SambaFileFilter(String params, boolean forDirectories) { + this.params = params; + this.forDirectories = forDirectories; + } + + public boolean accept(File file) { + boolean ret = false; + String name = file.getName(); + + if (forDirectories) + ret = file.isDirectory(); + else + ret = file.isFile(); + + if (ret == false) + return ret; + + if (params == null || params.trim().length() == 0) + return ret; + + if (params.startsWith("*")) { + ret &= name.endsWith(params.replace("*", "")); + return ret; + } + + if (params.endsWith("*")) { + ret &= name.startsWith(params.replace("*", "")); + return ret; + } + + if (params.contains("*")) { + String[] p = params.split("\\*"); + if (p.length == 2) + ret &= name.startsWith(p[0]) && name.endsWith(p[1]); + } else + ret &= file.getName().equals(params); + + return ret; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/StatusEvent.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/StatusEvent.java new file mode 100644 index 00000000..060a3f0e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/StatusEvent.java @@ -0,0 +1,30 @@ +package user.commons.remotestore; + +import java.util.EventObject; + +/** + * Státusz eseménykezelõ. + * + * @author vasary + */ +public class StatusEvent extends EventObject { + public StatusEvent(Object source) { + super(source); + } + + private static final long serialVersionUID = 1L; + private boolean cancel = false; + + public boolean isCancel() { + return cancel; + } + + public void setCancel(boolean cancel) { + this.cancel = cancel; + } + + public void cancel() { + cancel = true; + } +} + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMInputStream.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMInputStream.java new file mode 100644 index 00000000..67208aa2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMInputStream.java @@ -0,0 +1,63 @@ +package user.commons.remotestore; + +import java.io.InputStream; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.tsm.client.TSMBackupFileObject; +import user.tsm.client.TSMBufferedClient; +import user.tsm.client.TSMException; + +public class TSMInputStream extends InputStream { + private TSMBufferedClient client; + private TSMBackupFileObject backupObject; + private String filespaceName; + private String highLevelName; + private RemoteFile remoteFile; + private static final Logger logger = LogManager.getLogger(); + + private boolean initialized; + + public TSMInputStream(TSMBufferedClient client, String filespaceName, String highLevelName, RemoteFile remoteFile) { + this.client = client; + this.filespaceName = filespaceName; + this.highLevelName = highLevelName; + this.remoteFile = remoteFile; + } + + public void open() throws TSMException { + backupObject = client.getActiveBackupFileObject(filespaceName, highLevelName, remoteFile.getName()); + logger.info("TSMInputStream backupObject l�trej�tt!"); + } + + @Override + public int read() { + return 0; + } + + @Override + public int read(byte[] buffer, int off, int len) { + int result = 0; + if (client != null) { + if (!initialized) { + client.setBufferSize(len); + initialized = true; + } + try { + result = client.recievePartial(buffer, backupObject, null); + } catch (Exception e) { + e.printStackTrace(); + logger.info("TSMInputStream olvas�si hiba!", e); + } + } + return result; + } + + @Override + public void close() { + client.disconnect(); + logger.info("TSM lekapcsol�dott!"); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java new file mode 100644 index 00000000..3af0cee1 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java @@ -0,0 +1,88 @@ +package user.commons.remotestore; + +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.tsm.client.TSMBackupFileObject; +import user.tsm.client.TSMBufferedClient; + +public class TSMLister implements IDirectoryLister { + + private TSMBufferedClient client; + private static final String FSNAME = File.separator + "JOBENGINE"; + private static final String HLNAME = File.separator + "JOBENGINE"; + private static final Logger logger = LogManager.getLogger(); + + public TSMLister(StoreUri storeUri) throws Exception { + client = new TSMBufferedClient(); + logger.info("TSMBufferedClient initialized!"); + client.connect(storeUri.getUserName(), storeUri.getPassword()); + logger.info("TSMBufferedClient connected!"); + } + + @Override + public List list() throws Exception { + return null; + } + + @Override + public InputStream getInputStream(RemoteFile remoteFile) throws Exception { + TSMInputStream inputStream = new TSMInputStream(client, FSNAME, HLNAME, remoteFile); + logger.info("TSM InputStream l�trej�tt!"); + inputStream.open(); + return inputStream; + } + + @Override + public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception { + try { + logger.info("Trying register filespace"); + client.registerFilespace(FSNAME, "JOBENGINE", 'C', "JOBENGINE", 10L * 1024L * 1024L * 1024L, 0); + } catch (Exception e) { + logger.info(e.getMessage()); + } + TSMOutputStream outputStream = new TSMOutputStream(client, FSNAME, HLNAME, remoteFile); + outputStream.open(); + return outputStream; + } + + @Override + public boolean checkAvailability(RemoteFile remoteFile) throws Exception { + // TODO Auto-generated method stub + return false; + } + + @Override + public void cleanUp() throws Exception { + client.disconnect(); + } + + @Override + public RemoteFile get(String fileName) throws Exception { + RemoteFile result = null; + TSMBackupFileObject backupFileObject = client.getActiveBackupFileObject(FSNAME, HLNAME, + File.separator + fileName); + logger.info("TSMLister get"); + if (backupFileObject != null) { + result = toRemoteFile(backupFileObject); + logger.info( + "TSMLister backupFileObject-et elk�rte a k�vetkez� n�vvel: " + backupFileObject.getLowLevelName()); + } else + cleanUp(); + return result; + } + + private RemoteFile toRemoteFile(TSMBackupFileObject file) { + RemoteFile result = new RemoteFile(); + result.setName(file.getLowLevelName()); + result.setSize(file.getSizeEstimate()); + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMOutputStream.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMOutputStream.java new file mode 100644 index 00000000..c2b034a4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMOutputStream.java @@ -0,0 +1,62 @@ +package user.commons.remotestore; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.OutputStream; + +import user.commons.RemoteFile; +import user.tsm.client.TSMBackupFileObject; +import user.tsm.client.TSMBufferedClient; +import user.tsm.client.TSMException; + +public class TSMOutputStream extends OutputStream { + private TSMBufferedClient client; + private String fileName; + private TSMBackupFileObject backupObject; + private String filespaceName; + private String highLevelName; + private boolean initialized; + private long sizeEstimate; + + public TSMOutputStream(TSMBufferedClient client, String filespaceName, String highLevelName, RemoteFile remoteFile) { + this.client = client; + this.filespaceName = filespaceName; + this.highLevelName = highLevelName; + this.fileName = remoteFile.getName(); + this.sizeEstimate = remoteFile.getSize(); + } + + public void open() throws TSMException, FileNotFoundException { + backupObject = new TSMBackupFileObject(filespaceName, highLevelName, File.separator + fileName); + backupObject.setSizeEstimate(sizeEstimate); + } + + @Override + public void write(byte[] buffer, int off, int byteCount) { + if (client != null) { + if (!initialized) { + client.setBufferSize(byteCount); + initialized = true; + } + try { + client.send(buffer, backupObject, byteCount); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + @Override + public void close() { + try { + client.finishSend(); + } catch (Exception e) { + e.printStackTrace(); + } + client.disconnect(); + } + + @Override + public void write(int arg0) { + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddAsset.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddAsset.java new file mode 100644 index 00000000..8786ba50 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddAsset.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for addAsset complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="addAsset">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="asset" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "addAsset", propOrder = { + "asset" +}) +public class AddAsset { + + protected Asset asset; + + /** + * Gets the value of the asset property. + * + * @return + * possible object is + * {@link Asset } + * + */ + public Asset getAsset() { + return asset; + } + + /** + * Sets the value of the asset property. + * + * @param value + * allowed object is + * {@link Asset } + * + */ + public void setAsset(Asset value) { + this.asset = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddAssetResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddAssetResponse.java new file mode 100644 index 00000000..6f63be3c --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddAssetResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for addAssetResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="addAssetResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "addAssetResponse", propOrder = { + "_return" +}) +public class AddAssetResponse { + + @XmlElement(name = "return") + protected Asset _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link Asset } + * + */ + public Asset getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link Asset } + * + */ + public void setReturn(Asset value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddResourceToGroup.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddResourceToGroup.java new file mode 100644 index 00000000..ebd955f0 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddResourceToGroup.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for addResourceToGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="addResourceToGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="resourceId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "addResourceToGroup", propOrder = { + "resourceId", + "groupId" +}) +public class AddResourceToGroup { + + protected String resourceId; + protected String groupId; + + /** + * Gets the value of the resourceId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getResourceId() { + return resourceId; + } + + /** + * Sets the value of the resourceId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setResourceId(String value) { + this.resourceId = value; + } + + /** + * Gets the value of the groupId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroupId(String value) { + this.groupId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddResourceToGroupResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddResourceToGroupResponse.java new file mode 100644 index 00000000..ccb95b27 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddResourceToGroupResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for addResourceToGroupResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="addResourceToGroupResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "addResourceToGroupResponse") +public class AddResourceToGroupResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddScheduledJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddScheduledJob.java new file mode 100644 index 00000000..b0783ff3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddScheduledJob.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for addScheduledJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="addScheduledJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="scheduledJob" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJob" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "addScheduledJob", propOrder = { + "scheduledJob" +}) +public class AddScheduledJob { + + protected ScheduledJob scheduledJob; + + /** + * Gets the value of the scheduledJob property. + * + * @return + * possible object is + * {@link ScheduledJob } + * + */ + public ScheduledJob getScheduledJob() { + return scheduledJob; + } + + /** + * Sets the value of the scheduledJob property. + * + * @param value + * allowed object is + * {@link ScheduledJob } + * + */ + public void setScheduledJob(ScheduledJob value) { + this.scheduledJob = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddScheduledJobResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddScheduledJobResponse.java new file mode 100644 index 00000000..59b6e7cd --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AddScheduledJobResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for addScheduledJobResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="addScheduledJobResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJob" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "addScheduledJobResponse", propOrder = { + "_return" +}) +public class AddScheduledJobResponse { + + @XmlElement(name = "return") + protected ScheduledJob _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link ScheduledJob } + * + */ + public ScheduledJob getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link ScheduledJob } + * + */ + public void setReturn(ScheduledJob value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AdjustAspectRatioMode.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AdjustAspectRatioMode.java new file mode 100644 index 00000000..773ccf99 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AdjustAspectRatioMode.java @@ -0,0 +1,46 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for adjustAspectRatioMode. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="adjustAspectRatioMode">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="ADJUST_WIDTH"/>
+ *     <enumeration value="ADJUST_HEIGHT"/>
+ *     <enumeration value="GROW_ONLY"/>
+ *     <enumeration value="SHRINK_ONLY"/>
+ *     <enumeration value="LETTERBOX_OR_PILLARBOX"/>
+ *     <enumeration value="CROP"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "adjustAspectRatioMode") +@XmlEnum +public enum AdjustAspectRatioMode { + + ADJUST_WIDTH, + ADJUST_HEIGHT, + GROW_ONLY, + SHRINK_ONLY, + LETTERBOX_OR_PILLARBOX, + CROP; + + public String value() { + return name(); + } + + public static AdjustAspectRatioMode fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Agent.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Agent.java new file mode 100644 index 00000000..fab9b17b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Agent.java @@ -0,0 +1,303 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for agent complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="agent">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="host" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="status" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="mediaManagerVersion" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="mediaManagerVersionFull" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="streamVersion" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="kayakServerVersion" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="numKayakResources" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="systemId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="numProcessors" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "agent", propOrder = { + "id", + "host", + "status", + "mediaManagerVersion", + "mediaManagerVersionFull", + "streamVersion", + "kayakServerVersion", + "numKayakResources", + "systemId", + "numProcessors" +}) +public class Agent { + + protected String id; + protected String host; + protected String status; + protected String mediaManagerVersion; + protected String mediaManagerVersionFull; + protected String streamVersion; + protected String kayakServerVersion; + protected Integer numKayakResources; + protected String systemId; + protected Integer numProcessors; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the host property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHost() { + return host; + } + + /** + * Sets the value of the host property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHost(String value) { + this.host = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatus(String value) { + this.status = value; + } + + /** + * Gets the value of the mediaManagerVersion property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMediaManagerVersion() { + return mediaManagerVersion; + } + + /** + * Sets the value of the mediaManagerVersion property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMediaManagerVersion(String value) { + this.mediaManagerVersion = value; + } + + /** + * Gets the value of the mediaManagerVersionFull property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMediaManagerVersionFull() { + return mediaManagerVersionFull; + } + + /** + * Sets the value of the mediaManagerVersionFull property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMediaManagerVersionFull(String value) { + this.mediaManagerVersionFull = value; + } + + /** + * Gets the value of the streamVersion property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStreamVersion() { + return streamVersion; + } + + /** + * Sets the value of the streamVersion property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStreamVersion(String value) { + this.streamVersion = value; + } + + /** + * Gets the value of the kayakServerVersion property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getKayakServerVersion() { + return kayakServerVersion; + } + + /** + * Sets the value of the kayakServerVersion property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKayakServerVersion(String value) { + this.kayakServerVersion = value; + } + + /** + * Gets the value of the numKayakResources property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getNumKayakResources() { + return numKayakResources; + } + + /** + * Sets the value of the numKayakResources property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setNumKayakResources(Integer value) { + this.numKayakResources = value; + } + + /** + * Gets the value of the systemId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSystemId() { + return systemId; + } + + /** + * Sets the value of the systemId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSystemId(String value) { + this.systemId = value; + } + + /** + * Gets the value of the numProcessors property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getNumProcessors() { + return numProcessors; + } + + /** + * Sets the value of the numProcessors property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setNumProcessors(Integer value) { + this.numProcessors = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Asset.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Asset.java new file mode 100644 index 00000000..671885ae --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Asset.java @@ -0,0 +1,257 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for asset complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="asset">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}assetLayer">
+ *       <sequence>
+ *         <element name="assetPieces" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="assetPiece" type="{http://ws.server.mediamanager.digitalrapids.ca/}assetPiece" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="timeLine" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="marker" type="{http://ws.server.mediamanager.digitalrapids.ca/}timelineMarker" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="timelineId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "asset", propOrder = { + "assetPieces", + "timeLine" +}) +public class Asset + extends AssetLayer +{ + + protected Asset.AssetPieces assetPieces; + protected Asset.TimeLine timeLine; + @XmlAttribute(name = "timelineId") + protected String timelineId; + + /** + * Gets the value of the assetPieces property. + * + * @return + * possible object is + * {@link Asset.AssetPieces } + * + */ + public Asset.AssetPieces getAssetPieces() { + return assetPieces; + } + + /** + * Sets the value of the assetPieces property. + * + * @param value + * allowed object is + * {@link Asset.AssetPieces } + * + */ + public void setAssetPieces(Asset.AssetPieces value) { + this.assetPieces = value; + } + + /** + * Gets the value of the timeLine property. + * + * @return + * possible object is + * {@link Asset.TimeLine } + * + */ + public Asset.TimeLine getTimeLine() { + return timeLine; + } + + /** + * Sets the value of the timeLine property. + * + * @param value + * allowed object is + * {@link Asset.TimeLine } + * + */ + public void setTimeLine(Asset.TimeLine value) { + this.timeLine = value; + } + + /** + * Gets the value of the timelineId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTimelineId() { + return timelineId; + } + + /** + * Sets the value of the timelineId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTimelineId(String value) { + this.timelineId = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="assetPiece" type="{http://ws.server.mediamanager.digitalrapids.ca/}assetPiece" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "assetPiece" + }) + public static class AssetPieces { + + protected List assetPiece; + + /** + * Gets the value of the assetPiece property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the assetPiece property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getAssetPiece().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link AssetPiece } + * + * + */ + public List getAssetPiece() { + if (assetPiece == null) { + assetPiece = new ArrayList(); + } + return this.assetPiece; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="marker" type="{http://ws.server.mediamanager.digitalrapids.ca/}timelineMarker" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "marker" + }) + public static class TimeLine { + + protected List marker; + + /** + * Gets the value of the marker property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the marker property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getMarker().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TimelineMarker } + * + * + */ + public List getMarker() { + if (marker == null) { + marker = new ArrayList(); + } + return this.marker; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetExportRequest.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetExportRequest.java new file mode 100644 index 00000000..58b21425 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetExportRequest.java @@ -0,0 +1,114 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for assetExportRequest complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="assetExportRequest">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="asset" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" minOccurs="0"/>
+ *         <element name="exportFolder" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="packageFilename" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "assetExportRequest", propOrder = { + "asset", + "exportFolder", + "packageFilename" +}) +public class AssetExportRequest { + + protected Asset asset; + protected String exportFolder; + protected String packageFilename; + + /** + * Gets the value of the asset property. + * + * @return + * possible object is + * {@link Asset } + * + */ + public Asset getAsset() { + return asset; + } + + /** + * Sets the value of the asset property. + * + * @param value + * allowed object is + * {@link Asset } + * + */ + public void setAsset(Asset value) { + this.asset = value; + } + + /** + * Gets the value of the exportFolder property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getExportFolder() { + return exportFolder; + } + + /** + * Sets the value of the exportFolder property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setExportFolder(String value) { + this.exportFolder = value; + } + + /** + * Gets the value of the packageFilename property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPackageFilename() { + return packageFilename; + } + + /** + * Sets the value of the packageFilename property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPackageFilename(String value) { + this.packageFilename = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetLayer.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetLayer.java new file mode 100644 index 00000000..42e949b2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetLayer.java @@ -0,0 +1,198 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for assetLayer complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="assetLayer">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="metadataValues" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="metadata" type="{http://ws.server.mediamanager.digitalrapids.ca/}metadata" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "assetLayer", propOrder = { + "metadataValues" +}) +@XmlSeeAlso({ + Asset.class, + AssetPiece.class +}) +public class AssetLayer { + + protected AssetLayer.MetadataValues metadataValues; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(name = "name") + protected String name; + + /** + * Gets the value of the metadataValues property. + * + * @return + * possible object is + * {@link AssetLayer.MetadataValues } + * + */ + public AssetLayer.MetadataValues getMetadataValues() { + return metadataValues; + } + + /** + * Sets the value of the metadataValues property. + * + * @param value + * allowed object is + * {@link AssetLayer.MetadataValues } + * + */ + public void setMetadataValues(AssetLayer.MetadataValues value) { + this.metadataValues = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="metadata" type="{http://ws.server.mediamanager.digitalrapids.ca/}metadata" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "metadata" + }) + public static class MetadataValues { + + protected List metadata; + + /** + * Gets the value of the metadata property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the metadata property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getMetadata().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Metadata } + * + * + */ + public List getMetadata() { + if (metadata == null) { + metadata = new ArrayList(); + } + return this.metadata; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetLayerSearch.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetLayerSearch.java new file mode 100644 index 00000000..6de2c299 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetLayerSearch.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for assetLayerSearch complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="assetLayerSearch">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="maxResults" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "assetLayerSearch", propOrder = { + "name", + "maxResults" +}) +public class AssetLayerSearch { + + protected String name; + protected Integer maxResults; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the maxResults property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getMaxResults() { + return maxResults; + } + + /** + * Sets the value of the maxResults property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setMaxResults(Integer value) { + this.maxResults = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetPiece.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetPiece.java new file mode 100644 index 00000000..5a9aacf7 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AssetPiece.java @@ -0,0 +1,89 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for assetPiece complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="assetPiece">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}assetLayer">
+ *       <sequence>
+ *       </sequence>
+ *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="location" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "assetPiece") +public class AssetPiece + extends AssetLayer +{ + + @XmlAttribute(name = "type", required = true) + protected String type; + @XmlAttribute(name = "location", required = true) + protected String location; + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the location property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLocation() { + return location; + } + + /** + * Sets the value of the location property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLocation(String value) { + this.location = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AudioSource.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AudioSource.java new file mode 100644 index 00000000..427c05a8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/AudioSource.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for audioSource complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="audioSource">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}mediaSource">
+ *       <sequence>
+ *         <element name="channelMask" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "audioSource", propOrder = { + "channelMask" +}) +public class AudioSource + extends MediaSource +{ + + protected Long channelMask; + + /** + * Gets the value of the channelMask property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getChannelMask() { + return channelMask; + } + + /** + * Sets the value of the channelMask property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setChannelMask(Long value) { + this.channelMask = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonOptions.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonOptions.java new file mode 100644 index 00000000..d23ed9ba --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonOptions.java @@ -0,0 +1,89 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for batonOptions complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="batonOptions">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}qcOptions">
+ *       <sequence>
+ *         <element name="testPlanName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="priority" type="{http://ws.server.mediamanager.digitalrapids.ca/}batonPriority" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "batonOptions", propOrder = { + "testPlanName", + "priority" +}) +public class BatonOptions + extends QcOptions +{ + + protected String testPlanName; + protected BatonPriority priority; + + /** + * Gets the value of the testPlanName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTestPlanName() { + return testPlanName; + } + + /** + * Sets the value of the testPlanName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTestPlanName(String value) { + this.testPlanName = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link BatonPriority } + * + */ + public BatonPriority getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link BatonPriority } + * + */ + public void setPriority(BatonPriority value) { + this.priority = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonPriority.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonPriority.java new file mode 100644 index 00000000..8b2fff00 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonPriority.java @@ -0,0 +1,54 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for batonPriority. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="batonPriority">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="Low"/>
+ *     <enumeration value="Normal"/>
+ *     <enumeration value="High"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "batonPriority") +@XmlEnum +public enum BatonPriority { + + @XmlEnumValue("Low") + LOW("Low"), + @XmlEnumValue("Normal") + NORMAL("Normal"), + @XmlEnumValue("High") + HIGH("High"); + private final String value; + + BatonPriority(String v) { + value = v; + } + + public String value() { + return value; + } + + public static BatonPriority fromValue(String v) { + for (BatonPriority c: BatonPriority.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonService.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonService.java new file mode 100644 index 00000000..90753527 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/BatonService.java @@ -0,0 +1,123 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for batonService complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="batonService">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}qcService">
+ *       <sequence>
+ *         <element name="testPlanName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="username" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="password" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "batonService", propOrder = { + "testPlanName", + "username", + "password" +}) +public class BatonService + extends QcService +{ + + protected List testPlanName; + protected String username; + protected String password; + + /** + * Gets the value of the testPlanName property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the testPlanName property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTestPlanName().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getTestPlanName() { + if (testPlanName == null) { + testPlanName = new ArrayList(); + } + return this.testPlanName; + } + + /** + * Gets the value of the username property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUsername() { + return username; + } + + /** + * Sets the value of the username property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUsername(String value) { + this.username = value; + } + + /** + * Gets the value of the password property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPassword() { + return password; + } + + /** + * Sets the value of the password property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPassword(String value) { + this.password = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Border.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Border.java new file mode 100644 index 00000000..71d7ff66 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Border.java @@ -0,0 +1,42 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for border. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="border">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="TOP"/>
+ *     <enumeration value="BOTTOM"/>
+ *     <enumeration value="LEFT"/>
+ *     <enumeration value="RIGHT"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "border") +@XmlEnum +public enum Border { + + TOP, + BOTTOM, + LEFT, + RIGHT; + + public String value() { + return name(); + } + + public static Border fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Callback.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Callback.java new file mode 100644 index 00000000..f6148b76 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Callback.java @@ -0,0 +1,94 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for callback complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="callback">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="url" type="{http://ws.server.mediamanager.digitalrapids.ca/}callbackURL" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "callback", propOrder = { + "id", + "url" +}) +public class Callback { + + protected String id; + protected List url; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the url property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the url property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getUrl().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CallbackURL } + * + * + */ + public List getUrl() { + if (url == null) { + url = new ArrayList(); + } + return this.url; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CallbackURL.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CallbackURL.java new file mode 100644 index 00000000..debb8007 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CallbackURL.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; + + +/** + *

Java class for callbackURL complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="callbackURL">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *       <attribute name="mode" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "callbackURL", propOrder = { + "value" +}) +public class CallbackURL { + + @XmlValue + protected String value; + @XmlAttribute(name = "mode") + protected String mode; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the mode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMode() { + return mode; + } + + /** + * Sets the value of the mode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMode(String value) { + this.mode = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelJob.java new file mode 100644 index 00000000..6bb09e7b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelJob.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cancelJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cancelJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cancelJob", propOrder = { + "id" +}) +public class CancelJob { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelJobResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelJobResponse.java new file mode 100644 index 00000000..eb3a342a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelJobResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cancelJobResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cancelJobResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cancelJobResponse") +public class CancelJobResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelTranscodeTask.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelTranscodeTask.java new file mode 100644 index 00000000..02bc2df7 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelTranscodeTask.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cancelTranscodeTask complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cancelTranscodeTask">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cancelTranscodeTask", propOrder = { + "id" +}) +public class CancelTranscodeTask { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelTranscodeTaskResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelTranscodeTaskResponse.java new file mode 100644 index 00000000..21c9a039 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CancelTranscodeTaskResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cancelTranscodeTaskResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cancelTranscodeTaskResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cancelTranscodeTaskResponse") +public class CancelTranscodeTaskResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyMediaLocation.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyMediaLocation.java new file mode 100644 index 00000000..fc74e4a5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyMediaLocation.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cerifyMediaLocation complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cerifyMediaLocation">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="url" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cerifyMediaLocation", propOrder = { + "name", + "url" +}) +public class CerifyMediaLocation { + + protected String name; + protected String url; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the url property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUrl() { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUrl(String value) { + this.url = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyOptions.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyOptions.java new file mode 100644 index 00000000..54839a7d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyOptions.java @@ -0,0 +1,116 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cerifyOptions complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cerifyOptions">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}qcOptions">
+ *       <sequence>
+ *         <element name="mediaLocationName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="profileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="priority" type="{http://ws.server.mediamanager.digitalrapids.ca/}cerifyPriority" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cerifyOptions", propOrder = { + "mediaLocationName", + "profileName", + "priority" +}) +public class CerifyOptions + extends QcOptions +{ + + protected String mediaLocationName; + protected String profileName; + protected CerifyPriority priority; + + /** + * Gets the value of the mediaLocationName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMediaLocationName() { + return mediaLocationName; + } + + /** + * Sets the value of the mediaLocationName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMediaLocationName(String value) { + this.mediaLocationName = value; + } + + /** + * Gets the value of the profileName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProfileName() { + return profileName; + } + + /** + * Sets the value of the profileName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProfileName(String value) { + this.profileName = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link CerifyPriority } + * + */ + public CerifyPriority getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link CerifyPriority } + * + */ + public void setPriority(CerifyPriority value) { + this.priority = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyPriority.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyPriority.java new file mode 100644 index 00000000..c6bcaf94 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyPriority.java @@ -0,0 +1,54 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cerifyPriority. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="cerifyPriority">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="Low"/>
+ *     <enumeration value="Medium"/>
+ *     <enumeration value="High"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "cerifyPriority") +@XmlEnum +public enum CerifyPriority { + + @XmlEnumValue("Low") + LOW("Low"), + @XmlEnumValue("Medium") + MEDIUM("Medium"), + @XmlEnumValue("High") + HIGH("High"); + private final String value; + + CerifyPriority(String v) { + value = v; + } + + public String value() { + return value; + } + + public static CerifyPriority fromValue(String v) { + for (CerifyPriority c: CerifyPriority.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyService.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyService.java new file mode 100644 index 00000000..4a0520f4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CerifyService.java @@ -0,0 +1,101 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for cerifyService complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="cerifyService">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}qcService">
+ *       <sequence>
+ *         <element name="profileName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="mediaLocations" type="{http://ws.server.mediamanager.digitalrapids.ca/}cerifyMediaLocation" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "cerifyService", propOrder = { + "profileName", + "mediaLocations" +}) +public class CerifyService + extends QcService +{ + + protected List profileName; + protected List mediaLocations; + + /** + * Gets the value of the profileName property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the profileName property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getProfileName().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getProfileName() { + if (profileName == null) { + profileName = new ArrayList(); + } + return this.profileName; + } + + /** + * Gets the value of the mediaLocations property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the mediaLocations property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getMediaLocations().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CerifyMediaLocation } + * + * + */ + public List getMediaLocations() { + if (mediaLocations == null) { + mediaLocations = new ArrayList(); + } + return this.mediaLocations; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Clip.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Clip.java new file mode 100644 index 00000000..803e42ce --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Clip.java @@ -0,0 +1,94 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for clip complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="clip">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="videoSource" type="{http://ws.server.mediamanager.digitalrapids.ca/}videoSource" minOccurs="0"/>
+ *         <element name="audioSource" type="{http://ws.server.mediamanager.digitalrapids.ca/}audioSource" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "clip", propOrder = { + "videoSource", + "audioSource" +}) +public class Clip { + + protected VideoSource videoSource; + protected List audioSource; + + /** + * Gets the value of the videoSource property. + * + * @return + * possible object is + * {@link VideoSource } + * + */ + public VideoSource getVideoSource() { + return videoSource; + } + + /** + * Sets the value of the videoSource property. + * + * @param value + * allowed object is + * {@link VideoSource } + * + */ + public void setVideoSource(VideoSource value) { + this.videoSource = value; + } + + /** + * Gets the value of the audioSource property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the audioSource property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAudioSource().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link AudioSource } + * + * + */ + public List getAudioSource() { + if (audioSource == null) { + audioSource = new ArrayList(); + } + return this.audioSource; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ClipBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ClipBean.java new file mode 100644 index 00000000..4bcc8ee1 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ClipBean.java @@ -0,0 +1,309 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for clipBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="clipBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="sourceRefs" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="sourceRef" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="clipRefs" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="clipRef" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="endTimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "clipBean", propOrder = { + "sourceRefs", + "clipRefs" +}) +public class ClipBean { + + protected ClipBean.SourceRefs sourceRefs; + protected ClipBean.ClipRefs clipRefs; + @XmlAttribute(name = "id", required = true) + protected String id; + @XmlAttribute(name = "name") + protected String name; + @XmlAttribute(name = "endTimeType") + protected String endTimeType; + + /** + * Gets the value of the sourceRefs property. + * + * @return + * possible object is + * {@link ClipBean.SourceRefs } + * + */ + public ClipBean.SourceRefs getSourceRefs() { + return sourceRefs; + } + + /** + * Sets the value of the sourceRefs property. + * + * @param value + * allowed object is + * {@link ClipBean.SourceRefs } + * + */ + public void setSourceRefs(ClipBean.SourceRefs value) { + this.sourceRefs = value; + } + + /** + * Gets the value of the clipRefs property. + * + * @return + * possible object is + * {@link ClipBean.ClipRefs } + * + */ + public ClipBean.ClipRefs getClipRefs() { + return clipRefs; + } + + /** + * Sets the value of the clipRefs property. + * + * @param value + * allowed object is + * {@link ClipBean.ClipRefs } + * + */ + public void setClipRefs(ClipBean.ClipRefs value) { + this.clipRefs = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the endTimeType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEndTimeType() { + return endTimeType; + } + + /** + * Sets the value of the endTimeType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEndTimeType(String value) { + this.endTimeType = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="clipRef" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "clipRef" + }) + public static class ClipRefs { + + protected List clipRef; + + /** + * Gets the value of the clipRef property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the clipRef property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getClipRef().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getClipRef() { + if (clipRef == null) { + clipRef = new ArrayList(); + } + return this.clipRef; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="sourceRef" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "sourceRef" + }) + public static class SourceRefs { + + protected List sourceRef; + + /** + * Gets the value of the sourceRef property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the sourceRef property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getSourceRef().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getSourceRef() { + if (sourceRef == null) { + sourceRef = new ArrayList(); + } + return this.sourceRef; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ClipList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ClipList.java new file mode 100644 index 00000000..69936020 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ClipList.java @@ -0,0 +1,94 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for clipList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="clipList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="clip" type="{http://ws.server.mediamanager.digitalrapids.ca/}clip" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="primaryClipIndex" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "clipList", propOrder = { + "clip", + "primaryClipIndex" +}) +public class ClipList { + + protected List clip; + protected Integer primaryClipIndex; + + /** + * Gets the value of the clip property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the clip property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getClip().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Clip } + * + * + */ + public List getClip() { + if (clip == null) { + clip = new ArrayList(); + } + return this.clip; + } + + /** + * Gets the value of the primaryClipIndex property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getPrimaryClipIndex() { + return primaryClipIndex; + } + + /** + * Sets the value of the primaryClipIndex property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setPrimaryClipIndex(Integer value) { + this.primaryClipIndex = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateGroup.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateGroup.java new file mode 100644 index 00000000..a94c2f99 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateGroup.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for createGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="createGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="resourcePropertyList" type="{http://ws.server.mediamanager.digitalrapids.ca/}resourcePropertyList" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "createGroup", propOrder = { + "name", + "resourcePropertyList" +}) +public class CreateGroup { + + protected String name; + protected ResourcePropertyList resourcePropertyList; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the resourcePropertyList property. + * + * @return + * possible object is + * {@link ResourcePropertyList } + * + */ + public ResourcePropertyList getResourcePropertyList() { + return resourcePropertyList; + } + + /** + * Sets the value of the resourcePropertyList property. + * + * @param value + * allowed object is + * {@link ResourcePropertyList } + * + */ + public void setResourcePropertyList(ResourcePropertyList value) { + this.resourcePropertyList = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateGroupResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateGroupResponse.java new file mode 100644 index 00000000..ace122d4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateGroupResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for createGroupResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="createGroupResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "createGroupResponse", propOrder = { + "_return" +}) +public class CreateGroupResponse { + + @XmlElement(name = "return") + protected String _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturn(String value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateResourceOnAgent.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateResourceOnAgent.java new file mode 100644 index 00000000..68d8faca --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateResourceOnAgent.java @@ -0,0 +1,106 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for createResourceOnAgent complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="createResourceOnAgent">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="agentId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="resourcePropertyList" type="{http://ws.server.mediamanager.digitalrapids.ca/}resourcePropertyList" minOccurs="0"/>
+ *         <element name="numberOfResources" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "createResourceOnAgent", propOrder = { + "agentId", + "resourcePropertyList", + "numberOfResources" +}) +public class CreateResourceOnAgent { + + protected String agentId; + protected ResourcePropertyList resourcePropertyList; + protected int numberOfResources; + + /** + * Gets the value of the agentId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAgentId() { + return agentId; + } + + /** + * Sets the value of the agentId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAgentId(String value) { + this.agentId = value; + } + + /** + * Gets the value of the resourcePropertyList property. + * + * @return + * possible object is + * {@link ResourcePropertyList } + * + */ + public ResourcePropertyList getResourcePropertyList() { + return resourcePropertyList; + } + + /** + * Sets the value of the resourcePropertyList property. + * + * @param value + * allowed object is + * {@link ResourcePropertyList } + * + */ + public void setResourcePropertyList(ResourcePropertyList value) { + this.resourcePropertyList = value; + } + + /** + * Gets the value of the numberOfResources property. + * + */ + public int getNumberOfResources() { + return numberOfResources; + } + + /** + * Sets the value of the numberOfResources property. + * + */ + public void setNumberOfResources(int value) { + this.numberOfResources = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateResourceOnAgentResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateResourceOnAgentResponse.java new file mode 100644 index 00000000..9d940556 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/CreateResourceOnAgentResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for createResourceOnAgentResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="createResourceOnAgentResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "createResourceOnAgentResponse") +public class CreateResourceOnAgentResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DataTypeBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DataTypeBean.java new file mode 100644 index 00000000..eed8050f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DataTypeBean.java @@ -0,0 +1,333 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for dataTypeBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="dataTypeBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="definitions">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="definition" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="keys">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="entry" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "dataTypeBean", propOrder = { + "definitions", + "keys" +}) +public class DataTypeBean { + + @XmlElement(required = true) + protected DataTypeBean.Definitions definitions; + @XmlElement(required = true) + protected DataTypeBean.Keys keys; + + /** + * Gets the value of the definitions property. + * + * @return + * possible object is + * {@link DataTypeBean.Definitions } + * + */ + public DataTypeBean.Definitions getDefinitions() { + return definitions; + } + + /** + * Sets the value of the definitions property. + * + * @param value + * allowed object is + * {@link DataTypeBean.Definitions } + * + */ + public void setDefinitions(DataTypeBean.Definitions value) { + this.definitions = value; + } + + /** + * Gets the value of the keys property. + * + * @return + * possible object is + * {@link DataTypeBean.Keys } + * + */ + public DataTypeBean.Keys getKeys() { + return keys; + } + + /** + * Sets the value of the keys property. + * + * @param value + * allowed object is + * {@link DataTypeBean.Keys } + * + */ + public void setKeys(DataTypeBean.Keys value) { + this.keys = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="definition" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "definition" + }) + public static class Definitions { + + protected List definition; + + /** + * Gets the value of the definition property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the definition property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getDefinition().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getDefinition() { + if (definition == null) { + definition = new ArrayList(); + } + return this.definition; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="entry" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "entry" + }) + public static class Keys { + + protected List entry; + + /** + * Gets the value of the entry property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the entry property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getEntry().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link DataTypeBean.Keys.Entry } + * + * + */ + public List getEntry() { + if (entry == null) { + entry = new ArrayList(); + } + return this.entry; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "key", + "value" + }) + public static class Entry { + + protected String key; + protected String value; + + /** + * Gets the value of the key property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getKey() { + return key; + } + + /** + * Sets the value of the key property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKey(String value) { + this.key = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteAsset.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteAsset.java new file mode 100644 index 00000000..57aa6a02 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteAsset.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for deleteAsset complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="deleteAsset">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "deleteAsset", propOrder = { + "id" +}) +public class DeleteAsset { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteAssetResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteAssetResponse.java new file mode 100644 index 00000000..a91bf414 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteAssetResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for deleteAssetResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="deleteAssetResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "deleteAssetResponse") +public class DeleteAssetResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteScheduledJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteScheduledJob.java new file mode 100644 index 00000000..4cf656a3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteScheduledJob.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for deleteScheduledJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="deleteScheduledJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "deleteScheduledJob", propOrder = { + "id" +}) +public class DeleteScheduledJob { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteScheduledJobResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteScheduledJobResponse.java new file mode 100644 index 00000000..a039efd3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/DeleteScheduledJobResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for deleteScheduledJobResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="deleteScheduledJobResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "deleteScheduledJobResponse") +public class DeleteScheduledJobResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/EventScript.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/EventScript.java new file mode 100644 index 00000000..d81023c5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/EventScript.java @@ -0,0 +1,317 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for eventScript complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="eventScript">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="event" type="{http://ws.server.mediamanager.digitalrapids.ca/}eventScriptType" minOccurs="0"/>
+ *         <element name="scriptFile" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *         <element name="asynchronous" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="customVariables">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="entry" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "eventScript", propOrder = { + "event", + "scriptFile", + "asynchronous", + "customVariables" +}) +public class EventScript { + + protected EventScriptType event; + protected FileSnapshot scriptFile; + protected Boolean asynchronous; + @XmlElement(required = true) + protected EventScript.CustomVariables customVariables; + + /** + * Gets the value of the event property. + * + * @return + * possible object is + * {@link EventScriptType } + * + */ + public EventScriptType getEvent() { + return event; + } + + /** + * Sets the value of the event property. + * + * @param value + * allowed object is + * {@link EventScriptType } + * + */ + public void setEvent(EventScriptType value) { + this.event = value; + } + + /** + * Gets the value of the scriptFile property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getScriptFile() { + return scriptFile; + } + + /** + * Sets the value of the scriptFile property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setScriptFile(FileSnapshot value) { + this.scriptFile = value; + } + + /** + * Gets the value of the asynchronous property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isAsynchronous() { + return asynchronous; + } + + /** + * Sets the value of the asynchronous property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setAsynchronous(Boolean value) { + this.asynchronous = value; + } + + /** + * Gets the value of the customVariables property. + * + * @return + * possible object is + * {@link EventScript.CustomVariables } + * + */ + public EventScript.CustomVariables getCustomVariables() { + return customVariables; + } + + /** + * Sets the value of the customVariables property. + * + * @param value + * allowed object is + * {@link EventScript.CustomVariables } + * + */ + public void setCustomVariables(EventScript.CustomVariables value) { + this.customVariables = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="entry" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "entry" + }) + public static class CustomVariables { + + protected List entry; + + /** + * Gets the value of the entry property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the entry property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getEntry().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link EventScript.CustomVariables.Entry } + * + * + */ + public List getEntry() { + if (entry == null) { + entry = new ArrayList(); + } + return this.entry; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "key", + "value" + }) + public static class Entry { + + protected String key; + protected String value; + + /** + * Gets the value of the key property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getKey() { + return key; + } + + /** + * Sets the value of the key property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKey(String value) { + this.key = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/EventScriptType.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/EventScriptType.java new file mode 100644 index 00000000..4f2d8d50 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/EventScriptType.java @@ -0,0 +1,44 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for eventScriptType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="eventScriptType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="CUSTOMIZE_PROJECT"/>
+ *     <enumeration value="BEFORE_START"/>
+ *     <enumeration value="AFTER_START"/>
+ *     <enumeration value="BEFORE_STOP"/>
+ *     <enumeration value="AFTER_STOP"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "eventScriptType") +@XmlEnum +public enum EventScriptType { + + CUSTOMIZE_PROJECT, + BEFORE_START, + AFTER_START, + BEFORE_STOP, + AFTER_STOP; + + public String value() { + return name(); + } + + public static EventScriptType fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Exception.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Exception.java new file mode 100644 index 00000000..74e029d5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Exception.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for Exception complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Exception">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="message" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Exception", propOrder = { + "message" +}) +public class Exception { + + protected String message; + + /** + * Gets the value of the message property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMessage() { + return message; + } + + /** + * Sets the value of the message property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMessage(String value) { + this.message = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Exception_Exception.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Exception_Exception.java new file mode 100644 index 00000000..9cced5eb --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Exception_Exception.java @@ -0,0 +1,54 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.ws.WebFault; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.4-b01 + * Generated source version: 2.2 + * + */ +@WebFault(name = "Exception", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/") +public class Exception_Exception + extends java.lang.Exception +{ + + /** + * Java type that goes as soapenv:Fault detail element. + * + */ + private user.commons.selenio.wsclient.Exception faultInfo; + + /** + * + * @param message + * @param faultInfo + */ + public Exception_Exception(String message, user.commons.selenio.wsclient.Exception faultInfo) { + super(message); + this.faultInfo = faultInfo; + } + + /** + * + * @param message + * @param faultInfo + * @param cause + */ + public Exception_Exception(String message, user.commons.selenio.wsclient.Exception faultInfo, Throwable cause) { + super(message, cause); + this.faultInfo = faultInfo; + } + + /** + * + * @return + * returns fault bean: user.commons.selenio.wsclient.Exception + */ + public user.commons.selenio.wsclient.Exception getFaultInfo() { + return faultInfo; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExportAsset.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExportAsset.java new file mode 100644 index 00000000..1895020f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExportAsset.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for exportAsset complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="exportAsset">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="exportRequest" type="{http://ws.server.mediamanager.digitalrapids.ca/}assetExportRequest" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "exportAsset", propOrder = { + "exportRequest" +}) +public class ExportAsset { + + protected AssetExportRequest exportRequest; + + /** + * Gets the value of the exportRequest property. + * + * @return + * possible object is + * {@link AssetExportRequest } + * + */ + public AssetExportRequest getExportRequest() { + return exportRequest; + } + + /** + * Sets the value of the exportRequest property. + * + * @param value + * allowed object is + * {@link AssetExportRequest } + * + */ + public void setExportRequest(AssetExportRequest value) { + this.exportRequest = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExportAssetResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExportAssetResponse.java new file mode 100644 index 00000000..d23b82ce --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExportAssetResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for exportAssetResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="exportAssetResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "exportAssetResponse") +public class ExportAssetResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExtendedClipList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExtendedClipList.java new file mode 100644 index 00000000..90a73eb8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ExtendedClipList.java @@ -0,0 +1,352 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for extendedClipList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="extendedClipList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="sources" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="source" type="{http://ws.server.mediamanager.digitalrapids.ca/}sourceBean" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="tracks" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="track" type="{http://ws.server.mediamanager.digitalrapids.ca/}trackBean" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="outputs" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="output" type="{http://ws.server.mediamanager.digitalrapids.ca/}outputBean" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "extendedClipList", propOrder = { + "version", + "sources", + "tracks", + "outputs" +}) +public class ExtendedClipList { + + @XmlElement(required = true, defaultValue = "3.2") + protected String version; + protected ExtendedClipList.Sources sources; + protected ExtendedClipList.Tracks tracks; + protected ExtendedClipList.Outputs outputs; + + /** + * Gets the value of the version property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getVersion() { + return version; + } + + /** + * Sets the value of the version property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVersion(String value) { + this.version = value; + } + + /** + * Gets the value of the sources property. + * + * @return + * possible object is + * {@link ExtendedClipList.Sources } + * + */ + public ExtendedClipList.Sources getSources() { + return sources; + } + + /** + * Sets the value of the sources property. + * + * @param value + * allowed object is + * {@link ExtendedClipList.Sources } + * + */ + public void setSources(ExtendedClipList.Sources value) { + this.sources = value; + } + + /** + * Gets the value of the tracks property. + * + * @return + * possible object is + * {@link ExtendedClipList.Tracks } + * + */ + public ExtendedClipList.Tracks getTracks() { + return tracks; + } + + /** + * Sets the value of the tracks property. + * + * @param value + * allowed object is + * {@link ExtendedClipList.Tracks } + * + */ + public void setTracks(ExtendedClipList.Tracks value) { + this.tracks = value; + } + + /** + * Gets the value of the outputs property. + * + * @return + * possible object is + * {@link ExtendedClipList.Outputs } + * + */ + public ExtendedClipList.Outputs getOutputs() { + return outputs; + } + + /** + * Sets the value of the outputs property. + * + * @param value + * allowed object is + * {@link ExtendedClipList.Outputs } + * + */ + public void setOutputs(ExtendedClipList.Outputs value) { + this.outputs = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="output" type="{http://ws.server.mediamanager.digitalrapids.ca/}outputBean" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "output" + }) + public static class Outputs { + + protected List output; + + /** + * Gets the value of the output property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the output property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getOutput().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link OutputBean } + * + * + */ + public List getOutput() { + if (output == null) { + output = new ArrayList(); + } + return this.output; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="source" type="{http://ws.server.mediamanager.digitalrapids.ca/}sourceBean" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "source" + }) + public static class Sources { + + protected List source; + + /** + * Gets the value of the source property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the source property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getSource().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link SourceBean } + * + * + */ + public List getSource() { + if (source == null) { + source = new ArrayList(); + } + return this.source; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="track" type="{http://ws.server.mediamanager.digitalrapids.ca/}trackBean" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "track" + }) + public static class Tracks { + + protected List track; + + /** + * Gets the value of the track property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the track property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getTrack().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TrackBean } + * + * + */ + public List getTrack() { + if (track == null) { + track = new ArrayList(); + } + return this.track; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FileSnapshot.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FileSnapshot.java new file mode 100644 index 00000000..e5b25047 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FileSnapshot.java @@ -0,0 +1,139 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for fileSnapshot complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="fileSnapshot">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="filename" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="fullPath" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="fileData" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "fileSnapshot", propOrder = { + "id", + "filename", + "fullPath", + "fileData" +}) +public class FileSnapshot { + + protected String id; + protected String filename; + protected String fullPath; + protected byte[] fileData; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the filename property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFilename() { + return filename; + } + + /** + * Sets the value of the filename property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFilename(String value) { + this.filename = value; + } + + /** + * Gets the value of the fullPath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFullPath() { + return fullPath; + } + + /** + * Sets the value of the fullPath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFullPath(String value) { + this.fullPath = value; + } + + /** + * Gets the value of the fileData property. + * + * @return + * possible object is + * byte[] + */ + public byte[] getFileData() { + return fileData; + } + + /** + * Sets the value of the fileData property. + * + * @param value + * allowed object is + * byte[] + */ + public void setFileData(byte[] value) { + this.fileData = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindAssets.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindAssets.java new file mode 100644 index 00000000..29912c26 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindAssets.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for findAssets complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="findAssets">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="search" type="{http://ws.server.mediamanager.digitalrapids.ca/}assetLayerSearch" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "findAssets", propOrder = { + "search" +}) +public class FindAssets { + + protected AssetLayerSearch search; + + /** + * Gets the value of the search property. + * + * @return + * possible object is + * {@link AssetLayerSearch } + * + */ + public AssetLayerSearch getSearch() { + return search; + } + + /** + * Sets the value of the search property. + * + * @param value + * allowed object is + * {@link AssetLayerSearch } + * + */ + public void setSearch(AssetLayerSearch value) { + this.search = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindAssetsResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindAssetsResponse.java new file mode 100644 index 00000000..6cba2713 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindAssetsResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for findAssetsResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="findAssetsResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "findAssetsResponse", propOrder = { + "_return" +}) +public class FindAssetsResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Asset } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindTranscodeTasks.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindTranscodeTasks.java new file mode 100644 index 00000000..f4884146 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindTranscodeTasks.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for findTranscodeTasks complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="findTranscodeTasks">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transcodeTaskSearch" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeTaskSearch" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "findTranscodeTasks", propOrder = { + "transcodeTaskSearch" +}) +public class FindTranscodeTasks { + + protected TranscodeTaskSearch transcodeTaskSearch; + + /** + * Gets the value of the transcodeTaskSearch property. + * + * @return + * possible object is + * {@link TranscodeTaskSearch } + * + */ + public TranscodeTaskSearch getTranscodeTaskSearch() { + return transcodeTaskSearch; + } + + /** + * Sets the value of the transcodeTaskSearch property. + * + * @param value + * allowed object is + * {@link TranscodeTaskSearch } + * + */ + public void setTranscodeTaskSearch(TranscodeTaskSearch value) { + this.transcodeTaskSearch = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindTranscodeTasksResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindTranscodeTasksResponse.java new file mode 100644 index 00000000..66d65e64 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/FindTranscodeTasksResponse.java @@ -0,0 +1,67 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for findTranscodeTasksResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="findTranscodeTasksResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transcodeTasks" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeTask" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "findTranscodeTasksResponse", propOrder = { + "transcodeTasks" +}) +public class FindTranscodeTasksResponse { + + protected List transcodeTasks; + + /** + * Gets the value of the transcodeTasks property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the transcodeTasks property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTranscodeTasks().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TranscodeTask } + * + * + */ + public List getTranscodeTasks() { + if (transcodeTasks == null) { + transcodeTasks = new ArrayList(); + } + return this.transcodeTasks; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAbout.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAbout.java new file mode 100644 index 00000000..f4464caf --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAbout.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAbout complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAbout">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAbout") +public class GetAbout { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAboutResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAboutResponse.java new file mode 100644 index 00000000..e4630664 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAboutResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAboutResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAboutResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAboutResponse", propOrder = { + "_return" +}) +public class GetAboutResponse { + + @XmlElement(name = "return") + protected String _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturn(String value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetActiveJobsList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetActiveJobsList.java new file mode 100644 index 00000000..adc49df6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetActiveJobsList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getActiveJobsList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getActiveJobsList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getActiveJobsList") +public class GetActiveJobsList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetActiveJobsListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetActiveJobsListResponse.java new file mode 100644 index 00000000..bf0db163 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetActiveJobsListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getActiveJobsListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getActiveJobsListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}job" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getActiveJobsListResponse", propOrder = { + "_return" +}) +public class GetActiveJobsListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Job } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAgentList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAgentList.java new file mode 100644 index 00000000..ad5b4572 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAgentList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAgentList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAgentList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAgentList") +public class GetAgentList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAgentListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAgentListResponse.java new file mode 100644 index 00000000..5c0f5f3d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAgentListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAgentListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAgentListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}agent" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAgentListResponse", propOrder = { + "_return" +}) +public class GetAgentListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Agent } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAsset.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAsset.java new file mode 100644 index 00000000..322527cd --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAsset.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAsset complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAsset">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAsset", propOrder = { + "id" +}) +public class GetAsset { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetProfiles.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetProfiles.java new file mode 100644 index 00000000..2b4b0297 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetProfiles.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAssetProfiles complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAssetProfiles">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAssetProfiles") +public class GetAssetProfiles { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetProfilesResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetProfilesResponse.java new file mode 100644 index 00000000..398ae484 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetProfilesResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAssetProfilesResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAssetProfilesResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAssetProfilesResponse", propOrder = { + "_return" +}) +public class GetAssetProfilesResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link FileSnapshot } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetResponse.java new file mode 100644 index 00000000..b706fa06 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetAssetResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getAssetResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getAssetResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getAssetResponse", propOrder = { + "_return" +}) +public class GetAssetResponse { + + @XmlElement(name = "return") + protected Asset _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link Asset } + * + */ + public Asset getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link Asset } + * + */ + public void setReturn(Asset value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetDomain.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetDomain.java new file mode 100644 index 00000000..68255d4b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetDomain.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getDomain complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getDomain">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getDomain") +public class GetDomain { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetDomainResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetDomainResponse.java new file mode 100644 index 00000000..a54d125f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetDomainResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getDomainResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getDomainResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getDomainResponse", propOrder = { + "_return" +}) +public class GetDomainResponse { + + @XmlElement(name = "return") + protected String _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturn(String value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetFileSnapshot.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetFileSnapshot.java new file mode 100644 index 00000000..693dc656 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetFileSnapshot.java @@ -0,0 +1,79 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getFileSnapshot complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getFileSnapshot">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="withData" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getFileSnapshot", propOrder = { + "id", + "withData" +}) +public class GetFileSnapshot { + + protected String id; + protected boolean withData; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the withData property. + * + */ + public boolean isWithData() { + return withData; + } + + /** + * Sets the value of the withData property. + * + */ + public void setWithData(boolean value) { + this.withData = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetFileSnapshotResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetFileSnapshotResponse.java new file mode 100644 index 00000000..30d36451 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetFileSnapshotResponse.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getFileSnapshotResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getFileSnapshotResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="fileSnapshot" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getFileSnapshotResponse", propOrder = { + "fileSnapshot" +}) +public class GetFileSnapshotResponse { + + protected FileSnapshot fileSnapshot; + + /** + * Gets the value of the fileSnapshot property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getFileSnapshot() { + return fileSnapshot; + } + + /** + * Sets the value of the fileSnapshot property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setFileSnapshot(FileSnapshot value) { + this.fileSnapshot = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroup.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroup.java new file mode 100644 index 00000000..4819e521 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroup.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getGroup", propOrder = { + "id" +}) +public class GetGroup { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupList.java new file mode 100644 index 00000000..755df299 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getGroupList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getGroupList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getGroupList") +public class GetGroupList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupListResponse.java new file mode 100644 index 00000000..ade4ea7b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getGroupListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getGroupListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}group" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getGroupListResponse", propOrder = { + "_return" +}) +public class GetGroupListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Group } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupResponse.java new file mode 100644 index 00000000..a15d7e7a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetGroupResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getGroupResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getGroupResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}group" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getGroupResponse", propOrder = { + "_return" +}) +public class GetGroupResponse { + + @XmlElement(name = "return") + protected Group _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link Group } + * + */ + public Group getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link Group } + * + */ + public void setReturn(Group value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJob.java new file mode 100644 index 00000000..1da50608 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJob.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getJob", propOrder = { + "id" +}) +public class GetJob { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobResponse.java new file mode 100644 index 00000000..b228198b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getJobResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getJobResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}job" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getJobResponse", propOrder = { + "_return" +}) +public class GetJobResponse { + + @XmlElement(name = "return") + protected Job _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link Job } + * + */ + public Job getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link Job } + * + */ + public void setReturn(Job value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobsForTranscodeTask.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobsForTranscodeTask.java new file mode 100644 index 00000000..be4b1f71 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobsForTranscodeTask.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getJobsForTranscodeTask complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getJobsForTranscodeTask">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="taskId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getJobsForTranscodeTask", propOrder = { + "taskId" +}) +public class GetJobsForTranscodeTask { + + protected String taskId; + + /** + * Gets the value of the taskId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTaskId() { + return taskId; + } + + /** + * Sets the value of the taskId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTaskId(String value) { + this.taskId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobsForTranscodeTaskResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobsForTranscodeTaskResponse.java new file mode 100644 index 00000000..1c3b9ee2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetJobsForTranscodeTaskResponse.java @@ -0,0 +1,67 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getJobsForTranscodeTaskResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getJobsForTranscodeTaskResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="job" type="{http://ws.server.mediamanager.digitalrapids.ca/}job" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getJobsForTranscodeTaskResponse", propOrder = { + "job" +}) +public class GetJobsForTranscodeTaskResponse { + + protected List job; + + /** + * Gets the value of the job property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the job property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getJob().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Job } + * + * + */ + public List getJob() { + if (job == null) { + job = new ArrayList(); + } + return this.job; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMediaProperties.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMediaProperties.java new file mode 100644 index 00000000..635b4ed0 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMediaProperties.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getMediaProperties complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getMediaProperties">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="request" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaInspectionRequest" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getMediaProperties", propOrder = { + "request" +}) +public class GetMediaProperties { + + protected MediaInspectionRequest request; + + /** + * Gets the value of the request property. + * + * @return + * possible object is + * {@link MediaInspectionRequest } + * + */ + public MediaInspectionRequest getRequest() { + return request; + } + + /** + * Sets the value of the request property. + * + * @param value + * allowed object is + * {@link MediaInspectionRequest } + * + */ + public void setRequest(MediaInspectionRequest value) { + this.request = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMediaPropertiesResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMediaPropertiesResponse.java new file mode 100644 index 00000000..b0c7fe77 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMediaPropertiesResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getMediaPropertiesResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getMediaPropertiesResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaProperties" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getMediaPropertiesResponse", propOrder = { + "_return" +}) +public class GetMediaPropertiesResponse { + + @XmlElement(name = "return") + protected MediaProperties _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link MediaProperties } + * + */ + public MediaProperties getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link MediaProperties } + * + */ + public void setReturn(MediaProperties value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMetadataDefinition.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMetadataDefinition.java new file mode 100644 index 00000000..6d415846 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMetadataDefinition.java @@ -0,0 +1,114 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getMetadataDefinition complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getMetadataDefinition">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="arg0" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="arg1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="arg2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getMetadataDefinition", propOrder = { + "arg0", + "arg1", + "arg2" +}) +public class GetMetadataDefinition { + + protected String arg0; + protected String arg1; + protected String arg2; + + /** + * Gets the value of the arg0 property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getArg0() { + return arg0; + } + + /** + * Sets the value of the arg0 property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setArg0(String value) { + this.arg0 = value; + } + + /** + * Gets the value of the arg1 property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getArg1() { + return arg1; + } + + /** + * Sets the value of the arg1 property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setArg1(String value) { + this.arg1 = value; + } + + /** + * Gets the value of the arg2 property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getArg2() { + return arg2; + } + + /** + * Sets the value of the arg2 property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setArg2(String value) { + this.arg2 = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMetadataDefinitionResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMetadataDefinitionResponse.java new file mode 100644 index 00000000..edd7a134 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetMetadataDefinitionResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getMetadataDefinitionResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getMetadataDefinitionResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}metadataDefinition" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getMetadataDefinitionResponse", propOrder = { + "_return" +}) +public class GetMetadataDefinitionResponse { + + @XmlElement(name = "return") + protected MetadataDefinition _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link MetadataDefinition } + * + */ + public MetadataDefinition getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link MetadataDefinition } + * + */ + public void setReturn(MetadataDefinition value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetName.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetName.java new file mode 100644 index 00000000..fce50730 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetName.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getName complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getName">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getName") +public class GetName { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetNameResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetNameResponse.java new file mode 100644 index 00000000..45e9fd5c --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetNameResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getNameResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getNameResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getNameResponse", propOrder = { + "_return" +}) +public class GetNameResponse { + + @XmlElement(name = "return") + protected String _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturn(String value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProject.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProject.java new file mode 100644 index 00000000..1731f6ac --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProject.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getProject complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getProject">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getProject", propOrder = { + "id" +}) +public class GetProject { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectList.java new file mode 100644 index 00000000..980c4347 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getProjectList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getProjectList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getProjectList") +public class GetProjectList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectListResponse.java new file mode 100644 index 00000000..1b91508a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getProjectListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getProjectListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getProjectListResponse", propOrder = { + "_return" +}) +public class GetProjectListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link FileSnapshot } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectResponse.java new file mode 100644 index 00000000..1ddc5d45 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetProjectResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getProjectResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getProjectResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getProjectResponse", propOrder = { + "_return" +}) +public class GetProjectResponse { + + @XmlElement(name = "return") + protected FileSnapshot _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setReturn(FileSnapshot value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCService.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCService.java new file mode 100644 index 00000000..6324b3ef --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCService.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getQCService complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getQCService">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getQCService", propOrder = { + "id" +}) +public class GetQCService { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceList.java new file mode 100644 index 00000000..9a8ab620 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getQCServiceList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getQCServiceList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getQCServiceList") +public class GetQCServiceList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceListResponse.java new file mode 100644 index 00000000..37d8e319 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceListResponse.java @@ -0,0 +1,67 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getQCServiceListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getQCServiceListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="qcService" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcService" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getQCServiceListResponse", propOrder = { + "qcService" +}) +public class GetQCServiceListResponse { + + protected List qcService; + + /** + * Gets the value of the qcService property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the qcService property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getQcService().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link QcService } + * + * + */ + public List getQcService() { + if (qcService == null) { + qcService = new ArrayList(); + } + return this.qcService; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceResponse.java new file mode 100644 index 00000000..a3412778 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCServiceResponse.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getQCServiceResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getQCServiceResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="qcService" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcService" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getQCServiceResponse", propOrder = { + "qcService" +}) +public class GetQCServiceResponse { + + protected QcService qcService; + + /** + * Gets the value of the qcService property. + * + * @return + * possible object is + * {@link QcService } + * + */ + public QcService getQcService() { + return qcService; + } + + /** + * Sets the value of the qcService property. + * + * @param value + * allowed object is + * {@link QcService } + * + */ + public void setQcService(QcService value) { + this.qcService = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCTask.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCTask.java new file mode 100644 index 00000000..85a18fe6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCTask.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getQCTask complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getQCTask">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getQCTask", propOrder = { + "id" +}) +public class GetQCTask { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCTaskResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCTaskResponse.java new file mode 100644 index 00000000..6723b231 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetQCTaskResponse.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getQCTaskResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getQCTaskResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="qcTask" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcTask" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getQCTaskResponse", propOrder = { + "qcTask" +}) +public class GetQCTaskResponse { + + protected QcTask qcTask; + + /** + * Gets the value of the qcTask property. + * + * @return + * possible object is + * {@link QcTask } + * + */ + public QcTask getQcTask() { + return qcTask; + } + + /** + * Sets the value of the qcTask property. + * + * @param value + * allowed object is + * {@link QcTask } + * + */ + public void setQcTask(QcTask value) { + this.qcTask = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResource.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResource.java new file mode 100644 index 00000000..04f7f980 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResource.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getResource complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getResource">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getResource", propOrder = { + "id" +}) +public class GetResource { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceList.java new file mode 100644 index 00000000..25b2eccd --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getResourceList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getResourceList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getResourceList") +public class GetResourceList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceListResponse.java new file mode 100644 index 00000000..cff51303 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getResourceListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getResourceListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}resource" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getResourceListResponse", propOrder = { + "_return" +}) +public class GetResourceListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Resource } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceResponse.java new file mode 100644 index 00000000..260c8170 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetResourceResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getResourceResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getResourceResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}resource" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getResourceResponse", propOrder = { + "_return" +}) +public class GetResourceResponse { + + @XmlElement(name = "return") + protected Resource _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link Resource } + * + */ + public Resource getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link Resource } + * + */ + public void setReturn(Resource value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJob.java new file mode 100644 index 00000000..5e48884f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJob.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJob", propOrder = { + "id" +}) +public class GetScheduledJob { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobList.java new file mode 100644 index 00000000..3609cbe2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJobList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJobList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJobList") +public class GetScheduledJobList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobListResponse.java new file mode 100644 index 00000000..7b826ddb --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJobListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJobListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJob" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJobListResponse", propOrder = { + "_return" +}) +public class GetScheduledJobListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ScheduledJob } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobResponse.java new file mode 100644 index 00000000..37ee2429 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJobResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJobResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJob" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJobResponse", propOrder = { + "_return" +}) +public class GetScheduledJobResponse { + + @XmlElement(name = "return") + protected ScheduledJob _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link ScheduledJob } + * + */ + public ScheduledJob getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link ScheduledJob } + * + */ + public void setReturn(ScheduledJob value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatus.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatus.java new file mode 100644 index 00000000..03ab0492 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatus.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJobStatus complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJobStatus">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJobStatus", propOrder = { + "id" +}) +public class GetScheduledJobStatus { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusList.java new file mode 100644 index 00000000..788da0fb --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJobStatusList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJobStatusList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJobStatusList") +public class GetScheduledJobStatusList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusListResponse.java new file mode 100644 index 00000000..b073dbcb --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJobStatusListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJobStatusListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJobStatus" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJobStatusListResponse", propOrder = { + "_return" +}) +public class GetScheduledJobStatusListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ScheduledJobStatus } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusResponse.java new file mode 100644 index 00000000..c357d136 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScheduledJobStatusResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScheduledJobStatusResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScheduledJobStatusResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJobStatus" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScheduledJobStatusResponse", propOrder = { + "_return" +}) +public class GetScheduledJobStatusResponse { + + @XmlElement(name = "return") + protected ScheduledJobStatus _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link ScheduledJobStatus } + * + */ + public ScheduledJobStatus getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link ScheduledJobStatus } + * + */ + public void setReturn(ScheduledJobStatus value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScriptList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScriptList.java new file mode 100644 index 00000000..2c6a3e63 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScriptList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScriptList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScriptList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScriptList") +public class GetScriptList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScriptListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScriptListResponse.java new file mode 100644 index 00000000..393fa4c5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetScriptListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getScriptListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getScriptListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getScriptListResponse", propOrder = { + "_return" +}) +public class GetScriptListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link FileSnapshot } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTimeZone.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTimeZone.java new file mode 100644 index 00000000..d7e44d04 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTimeZone.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTimeZone complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTimeZone">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTimeZone") +public class GetTimeZone { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTimeZoneResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTimeZoneResponse.java new file mode 100644 index 00000000..224b0c39 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTimeZoneResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTimeZoneResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTimeZoneResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTimeZoneResponse", propOrder = { + "_return" +}) +public class GetTimeZoneResponse { + + @XmlElement(name = "return") + protected String _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturn(String value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeRequest.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeRequest.java new file mode 100644 index 00000000..2959a930 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeRequest.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTranscodeRequest complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTranscodeRequest">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTranscodeRequest", propOrder = { + "id" +}) +public class GetTranscodeRequest { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeRequestResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeRequestResponse.java new file mode 100644 index 00000000..1469de95 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeRequestResponse.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTranscodeRequestResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTranscodeRequestResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transcodeRequest" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeRequest" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTranscodeRequestResponse", propOrder = { + "transcodeRequest" +}) +public class GetTranscodeRequestResponse { + + protected TranscodeRequest transcodeRequest; + + /** + * Gets the value of the transcodeRequest property. + * + * @return + * possible object is + * {@link TranscodeRequest } + * + */ + public TranscodeRequest getTranscodeRequest() { + return transcodeRequest; + } + + /** + * Sets the value of the transcodeRequest property. + * + * @param value + * allowed object is + * {@link TranscodeRequest } + * + */ + public void setTranscodeRequest(TranscodeRequest value) { + this.transcodeRequest = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTask.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTask.java new file mode 100644 index 00000000..5f9902c6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTask.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTranscodeTask complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTranscodeTask">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTranscodeTask", propOrder = { + "id" +}) +public class GetTranscodeTask { + + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskForJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskForJob.java new file mode 100644 index 00000000..9c7394bd --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskForJob.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTranscodeTaskForJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTranscodeTaskForJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="jobId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTranscodeTaskForJob", propOrder = { + "jobId" +}) +public class GetTranscodeTaskForJob { + + protected String jobId; + + /** + * Gets the value of the jobId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getJobId() { + return jobId; + } + + /** + * Sets the value of the jobId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setJobId(String value) { + this.jobId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskForJobResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskForJobResponse.java new file mode 100644 index 00000000..cfd1fe15 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskForJobResponse.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTranscodeTaskForJobResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTranscodeTaskForJobResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transcodeTask" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeTask" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTranscodeTaskForJobResponse", propOrder = { + "transcodeTask" +}) +public class GetTranscodeTaskForJobResponse { + + protected TranscodeTask transcodeTask; + + /** + * Gets the value of the transcodeTask property. + * + * @return + * possible object is + * {@link TranscodeTask } + * + */ + public TranscodeTask getTranscodeTask() { + return transcodeTask; + } + + /** + * Sets the value of the transcodeTask property. + * + * @param value + * allowed object is + * {@link TranscodeTask } + * + */ + public void setTranscodeTask(TranscodeTask value) { + this.transcodeTask = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskResponse.java new file mode 100644 index 00000000..193dd90d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetTranscodeTaskResponse.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getTranscodeTaskResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getTranscodeTaskResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transcodeTask" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeTask" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getTranscodeTaskResponse", propOrder = { + "transcodeTask" +}) +public class GetTranscodeTaskResponse { + + protected TranscodeTask transcodeTask; + + /** + * Gets the value of the transcodeTask property. + * + * @return + * possible object is + * {@link TranscodeTask } + * + */ + public TranscodeTask getTranscodeTask() { + return transcodeTask; + } + + /** + * Sets the value of the transcodeTask property. + * + * @param value + * allowed object is + * {@link TranscodeTask } + * + */ + public void setTranscodeTask(TranscodeTask value) { + this.transcodeTask = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetVersion.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetVersion.java new file mode 100644 index 00000000..e7a27b71 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetVersion.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getVersion complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getVersion">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getVersion") +public class GetVersion { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetVersionResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetVersionResponse.java new file mode 100644 index 00000000..e0894333 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetVersionResponse.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getVersionResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getVersionResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getVersionResponse", propOrder = { + "_return" +}) +public class GetVersionResponse { + + @XmlElement(name = "return") + protected String _return; + + /** + * Gets the value of the return property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getReturn() { + return _return; + } + + /** + * Sets the value of the return property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setReturn(String value) { + this._return = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetWatchFolderList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetWatchFolderList.java new file mode 100644 index 00000000..1d5c9ccb --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetWatchFolderList.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getWatchFolderList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getWatchFolderList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getWatchFolderList") +public class GetWatchFolderList { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetWatchFolderListResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetWatchFolderListResponse.java new file mode 100644 index 00000000..6b6a8e64 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/GetWatchFolderListResponse.java @@ -0,0 +1,69 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for getWatchFolderListResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="getWatchFolderListResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="return" type="{http://ws.server.mediamanager.digitalrapids.ca/}watchFolder" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "getWatchFolderListResponse", propOrder = { + "_return" +}) +public class GetWatchFolderListResponse { + + @XmlElement(name = "return") + protected List _return; + + /** + * Gets the value of the return property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the return property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReturn().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link WatchFolder } + * + * + */ + public List getReturn() { + if (_return == null) { + _return = new ArrayList(); + } + return this._return; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Group.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Group.java new file mode 100644 index 00000000..d090acef --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Group.java @@ -0,0 +1,141 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for group complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="group">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="role" type="{http://ws.server.mediamanager.digitalrapids.ca/}roleEnum" minOccurs="0"/>
+ *         <element name="routerInfoId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "group", propOrder = { + "id", + "name", + "role", + "routerInfoId" +}) +public class Group { + + protected String id; + protected String name; + protected RoleEnum role; + protected String routerInfoId; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the role property. + * + * @return + * possible object is + * {@link RoleEnum } + * + */ + public RoleEnum getRole() { + return role; + } + + /** + * Sets the value of the role property. + * + * @param value + * allowed object is + * {@link RoleEnum } + * + */ + public void setRole(RoleEnum value) { + this.role = value; + } + + /** + * Gets the value of the routerInfoId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRouterInfoId() { + return routerInfoId; + } + + /** + * Sets the value of the routerInfoId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRouterInfoId(String value) { + this.routerInfoId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/JavaOsArch.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/JavaOsArch.java new file mode 100644 index 00000000..4af68319 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/JavaOsArch.java @@ -0,0 +1,51 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for javaOsArch. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="javaOsArch">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="amd64"/>
+ *     <enumeration value="x86"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "javaOsArch") +@XmlEnum +public enum JavaOsArch { + + @XmlEnumValue("amd64") + AMD_64("amd64"), + @XmlEnumValue("x86") + X_86("x86"); + private final String value; + + JavaOsArch(String v) { + value = v; + } + + public String value() { + return value; + } + + public static JavaOsArch fromValue(String v) { + for (JavaOsArch c: JavaOsArch.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Job.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Job.java new file mode 100644 index 00000000..a7f58cc3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Job.java @@ -0,0 +1,467 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + *

Java class for job complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="job">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="state" type="{http://ws.server.mediamanager.digitalrapids.ca/}jobState" minOccurs="0"/>
+ *         <element name="notes" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="currentResource" type="{http://ws.server.mediamanager.digitalrapids.ca/}resource" minOccurs="0"/>
+ *         <element name="primaryResource" type="{http://ws.server.mediamanager.digitalrapids.ca/}resource" minOccurs="0"/>
+ *         <element name="slaveResources" type="{http://ws.server.mediamanager.digitalrapids.ca/}resource" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="projectName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="projectFileId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="createdTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="startedTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="endedTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="failureCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="outputMediaFiles" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="outputMediaFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaFile" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "job", propOrder = { + "id", + "state", + "notes", + "currentResource", + "primaryResource", + "slaveResources", + "projectName", + "projectFileId", + "createdTimestamp", + "startedTimestamp", + "endedTimestamp", + "failureCount", + "outputMediaFiles" +}) +public class Job { + + protected String id; + protected JobState state; + protected String notes; + protected Resource currentResource; + protected Resource primaryResource; + @XmlElement(nillable = true) + protected List slaveResources; + protected String projectName; + protected String projectFileId; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar createdTimestamp; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar startedTimestamp; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar endedTimestamp; + protected Integer failureCount; + protected Job.OutputMediaFiles outputMediaFiles; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link JobState } + * + */ + public JobState getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link JobState } + * + */ + public void setState(JobState value) { + this.state = value; + } + + /** + * Gets the value of the notes property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNotes() { + return notes; + } + + /** + * Sets the value of the notes property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNotes(String value) { + this.notes = value; + } + + /** + * Gets the value of the currentResource property. + * + * @return + * possible object is + * {@link Resource } + * + */ + public Resource getCurrentResource() { + return currentResource; + } + + /** + * Sets the value of the currentResource property. + * + * @param value + * allowed object is + * {@link Resource } + * + */ + public void setCurrentResource(Resource value) { + this.currentResource = value; + } + + /** + * Gets the value of the primaryResource property. + * + * @return + * possible object is + * {@link Resource } + * + */ + public Resource getPrimaryResource() { + return primaryResource; + } + + /** + * Sets the value of the primaryResource property. + * + * @param value + * allowed object is + * {@link Resource } + * + */ + public void setPrimaryResource(Resource value) { + this.primaryResource = value; + } + + /** + * Gets the value of the slaveResources property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the slaveResources property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getSlaveResources().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Resource } + * + * + */ + public List getSlaveResources() { + if (slaveResources == null) { + slaveResources = new ArrayList(); + } + return this.slaveResources; + } + + /** + * Gets the value of the projectName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProjectName() { + return projectName; + } + + /** + * Sets the value of the projectName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProjectName(String value) { + this.projectName = value; + } + + /** + * Gets the value of the projectFileId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProjectFileId() { + return projectFileId; + } + + /** + * Sets the value of the projectFileId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProjectFileId(String value) { + this.projectFileId = value; + } + + /** + * Gets the value of the createdTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getCreatedTimestamp() { + return createdTimestamp; + } + + /** + * Sets the value of the createdTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setCreatedTimestamp(XMLGregorianCalendar value) { + this.createdTimestamp = value; + } + + /** + * Gets the value of the startedTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getStartedTimestamp() { + return startedTimestamp; + } + + /** + * Sets the value of the startedTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setStartedTimestamp(XMLGregorianCalendar value) { + this.startedTimestamp = value; + } + + /** + * Gets the value of the endedTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getEndedTimestamp() { + return endedTimestamp; + } + + /** + * Sets the value of the endedTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setEndedTimestamp(XMLGregorianCalendar value) { + this.endedTimestamp = value; + } + + /** + * Gets the value of the failureCount property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getFailureCount() { + return failureCount; + } + + /** + * Sets the value of the failureCount property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setFailureCount(Integer value) { + this.failureCount = value; + } + + /** + * Gets the value of the outputMediaFiles property. + * + * @return + * possible object is + * {@link Job.OutputMediaFiles } + * + */ + public Job.OutputMediaFiles getOutputMediaFiles() { + return outputMediaFiles; + } + + /** + * Sets the value of the outputMediaFiles property. + * + * @param value + * allowed object is + * {@link Job.OutputMediaFiles } + * + */ + public void setOutputMediaFiles(Job.OutputMediaFiles value) { + this.outputMediaFiles = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="outputMediaFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaFile" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "outputMediaFiles" + }) + public static class OutputMediaFiles { + + protected List outputMediaFiles; + + /** + * Gets the value of the outputMediaFiles property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the outputMediaFiles property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getOutputMediaFiles().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MediaFile } + * + * + */ + public List getOutputMediaFiles() { + if (outputMediaFiles == null) { + outputMediaFiles = new ArrayList(); + } + return this.outputMediaFiles; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/JobState.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/JobState.java new file mode 100644 index 00000000..7c9f1ad6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/JobState.java @@ -0,0 +1,54 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for jobState. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="jobState">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="STARTING"/>
+ *     <enumeration value="RUNNING"/>
+ *     <enumeration value="FAILOVER"/>
+ *     <enumeration value="FAILED"/>
+ *     <enumeration value="CANCELLED"/>
+ *     <enumeration value="COMPLETED"/>
+ *     <enumeration value="FUTURE"/>
+ *     <enumeration value="UNKNOWN"/>
+ *     <enumeration value="CANCELLING"/>
+ *     <enumeration value="STOPPING"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "jobState") +@XmlEnum +public enum JobState { + + STARTING, + RUNNING, + FAILOVER, + FAILED, + CANCELLED, + COMPLETED, + FUTURE, + UNKNOWN, + CANCELLING, + STOPPING; + + public String value() { + return name(); + } + + public static JobState fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/KayakRuntimeEnvironment.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/KayakRuntimeEnvironment.java new file mode 100644 index 00000000..9ea5b6c6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/KayakRuntimeEnvironment.java @@ -0,0 +1,116 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for kayakRuntimeEnvironment complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="kayakRuntimeEnvironment">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}runtimeEnvironment">
+ *       <sequence>
+ *         <element name="url" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="partition" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="javaOsArch" type="{http://ws.server.mediamanager.digitalrapids.ca/}javaOsArch" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "kayakRuntimeEnvironment", propOrder = { + "url", + "partition", + "javaOsArch" +}) +public class KayakRuntimeEnvironment + extends RuntimeEnvironment +{ + + protected String url; + protected String partition; + protected JavaOsArch javaOsArch; + + /** + * Gets the value of the url property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUrl() { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUrl(String value) { + this.url = value; + } + + /** + * Gets the value of the partition property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPartition() { + return partition; + } + + /** + * Sets the value of the partition property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPartition(String value) { + this.partition = value; + } + + /** + * Gets the value of the javaOsArch property. + * + * @return + * possible object is + * {@link JavaOsArch } + * + */ + public JavaOsArch getJavaOsArch() { + return javaOsArch; + } + + /** + * Sets the value of the javaOsArch property. + * + * @param value + * allowed object is + * {@link JavaOsArch } + * + */ + public void setJavaOsArch(JavaOsArch value) { + this.javaOsArch = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Media.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Media.java new file mode 100644 index 00000000..3dd00d54 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Media.java @@ -0,0 +1,64 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for media complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="media">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="properties" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaProperties" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "media", propOrder = { + "properties" +}) +@XmlSeeAlso({ + MediaFile.class +}) +public class Media { + + protected MediaProperties properties; + + /** + * Gets the value of the properties property. + * + * @return + * possible object is + * {@link MediaProperties } + * + */ + public MediaProperties getProperties() { + return properties; + } + + /** + * Sets the value of the properties property. + * + * @param value + * allowed object is + * {@link MediaProperties } + * + */ + public void setProperties(MediaProperties value) { + this.properties = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaFile.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaFile.java new file mode 100644 index 00000000..217e4c86 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaFile.java @@ -0,0 +1,89 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for mediaFile complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="mediaFile">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}media">
+ *       <sequence>
+ *         <element name="file" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="fileSnapshotId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "mediaFile", propOrder = { + "file", + "fileSnapshotId" +}) +public class MediaFile + extends Media +{ + + protected String file; + protected String fileSnapshotId; + + /** + * Gets the value of the file property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFile() { + return file; + } + + /** + * Sets the value of the file property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFile(String value) { + this.file = value; + } + + /** + * Gets the value of the fileSnapshotId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFileSnapshotId() { + return fileSnapshotId; + } + + /** + * Sets the value of the fileSnapshotId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFileSnapshotId(String value) { + this.fileSnapshotId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaInspectionRequest.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaInspectionRequest.java new file mode 100644 index 00000000..a040d605 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaInspectionRequest.java @@ -0,0 +1,276 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for mediaInspectionRequest complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="mediaInspectionRequest">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="file" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="detectBlackBorders" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="detectCommercialBlacks" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="commercialBlackMinimumDuration" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="commercialBlackLuminanceThreshold" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="timeoutMillis" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
+ *         <element name="mediaReaderAudio" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaReaderEnum" minOccurs="0"/>
+ *         <element name="mediaReaderVideo" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaReaderEnum" minOccurs="0"/>
+ *         <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "mediaInspectionRequest", propOrder = { + "file", + "detectBlackBorders", + "detectCommercialBlacks", + "commercialBlackMinimumDuration", + "commercialBlackLuminanceThreshold", + "timeoutMillis", + "mediaReaderAudio", + "mediaReaderVideo", + "groupId" +}) +public class MediaInspectionRequest { + + protected String file; + protected Boolean detectBlackBorders; + protected Boolean detectCommercialBlacks; + protected Double commercialBlackMinimumDuration; + protected Double commercialBlackLuminanceThreshold; + protected Long timeoutMillis; + protected MediaReaderEnum mediaReaderAudio; + protected MediaReaderEnum mediaReaderVideo; + protected String groupId; + + /** + * Gets the value of the file property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFile() { + return file; + } + + /** + * Sets the value of the file property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFile(String value) { + this.file = value; + } + + /** + * Gets the value of the detectBlackBorders property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isDetectBlackBorders() { + return detectBlackBorders; + } + + /** + * Sets the value of the detectBlackBorders property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setDetectBlackBorders(Boolean value) { + this.detectBlackBorders = value; + } + + /** + * Gets the value of the detectCommercialBlacks property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isDetectCommercialBlacks() { + return detectCommercialBlacks; + } + + /** + * Sets the value of the detectCommercialBlacks property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setDetectCommercialBlacks(Boolean value) { + this.detectCommercialBlacks = value; + } + + /** + * Gets the value of the commercialBlackMinimumDuration property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getCommercialBlackMinimumDuration() { + return commercialBlackMinimumDuration; + } + + /** + * Sets the value of the commercialBlackMinimumDuration property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setCommercialBlackMinimumDuration(Double value) { + this.commercialBlackMinimumDuration = value; + } + + /** + * Gets the value of the commercialBlackLuminanceThreshold property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getCommercialBlackLuminanceThreshold() { + return commercialBlackLuminanceThreshold; + } + + /** + * Sets the value of the commercialBlackLuminanceThreshold property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setCommercialBlackLuminanceThreshold(Double value) { + this.commercialBlackLuminanceThreshold = value; + } + + /** + * Gets the value of the timeoutMillis property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getTimeoutMillis() { + return timeoutMillis; + } + + /** + * Sets the value of the timeoutMillis property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setTimeoutMillis(Long value) { + this.timeoutMillis = value; + } + + /** + * Gets the value of the mediaReaderAudio property. + * + * @return + * possible object is + * {@link MediaReaderEnum } + * + */ + public MediaReaderEnum getMediaReaderAudio() { + return mediaReaderAudio; + } + + /** + * Sets the value of the mediaReaderAudio property. + * + * @param value + * allowed object is + * {@link MediaReaderEnum } + * + */ + public void setMediaReaderAudio(MediaReaderEnum value) { + this.mediaReaderAudio = value; + } + + /** + * Gets the value of the mediaReaderVideo property. + * + * @return + * possible object is + * {@link MediaReaderEnum } + * + */ + public MediaReaderEnum getMediaReaderVideo() { + return mediaReaderVideo; + } + + /** + * Sets the value of the mediaReaderVideo property. + * + * @param value + * allowed object is + * {@link MediaReaderEnum } + * + */ + public void setMediaReaderVideo(MediaReaderEnum value) { + this.mediaReaderVideo = value; + } + + /** + * Gets the value of the groupId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroupId(String value) { + this.groupId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaProperties.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaProperties.java new file mode 100644 index 00000000..7db7d2b3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaProperties.java @@ -0,0 +1,509 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for mediaProperties complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="mediaProperties">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="width" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="height" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="frameRate" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="interlace" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="mediaDuration" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="audioSampleRate" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="audioChannels" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="audioBitsPerSample" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="pictureAspectRatioX" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="pictureAspectRatioY" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="blackBorderPixelsTop" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="blackBorderPixelsBottom" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="blackBorderPixelsLeft" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="blackBorderPixelsRight" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="commercialBlackScenes" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="trim" type="{http://ws.server.mediamanager.digitalrapids.ca/}trim" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "mediaProperties", propOrder = { + "width", + "height", + "frameRate", + "interlace", + "mediaDuration", + "audioSampleRate", + "audioChannels", + "audioBitsPerSample", + "pictureAspectRatioX", + "pictureAspectRatioY", + "blackBorderPixelsTop", + "blackBorderPixelsBottom", + "blackBorderPixelsLeft", + "blackBorderPixelsRight", + "commercialBlackScenes" +}) +public class MediaProperties { + + protected Integer width; + protected Integer height; + protected Double frameRate; + protected Integer interlace; + protected Double mediaDuration; + protected Integer audioSampleRate; + protected Integer audioChannels; + protected Integer audioBitsPerSample; + protected Integer pictureAspectRatioX; + protected Integer pictureAspectRatioY; + protected Integer blackBorderPixelsTop; + protected Integer blackBorderPixelsBottom; + protected Integer blackBorderPixelsLeft; + protected Integer blackBorderPixelsRight; + protected MediaProperties.CommercialBlackScenes commercialBlackScenes; + + /** + * Gets the value of the width property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getWidth() { + return width; + } + + /** + * Sets the value of the width property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setWidth(Integer value) { + this.width = value; + } + + /** + * Gets the value of the height property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getHeight() { + return height; + } + + /** + * Sets the value of the height property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setHeight(Integer value) { + this.height = value; + } + + /** + * Gets the value of the frameRate property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getFrameRate() { + return frameRate; + } + + /** + * Sets the value of the frameRate property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setFrameRate(Double value) { + this.frameRate = value; + } + + /** + * Gets the value of the interlace property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getInterlace() { + return interlace; + } + + /** + * Sets the value of the interlace property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setInterlace(Integer value) { + this.interlace = value; + } + + /** + * Gets the value of the mediaDuration property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getMediaDuration() { + return mediaDuration; + } + + /** + * Sets the value of the mediaDuration property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setMediaDuration(Double value) { + this.mediaDuration = value; + } + + /** + * Gets the value of the audioSampleRate property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getAudioSampleRate() { + return audioSampleRate; + } + + /** + * Sets the value of the audioSampleRate property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setAudioSampleRate(Integer value) { + this.audioSampleRate = value; + } + + /** + * Gets the value of the audioChannels property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getAudioChannels() { + return audioChannels; + } + + /** + * Sets the value of the audioChannels property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setAudioChannels(Integer value) { + this.audioChannels = value; + } + + /** + * Gets the value of the audioBitsPerSample property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getAudioBitsPerSample() { + return audioBitsPerSample; + } + + /** + * Sets the value of the audioBitsPerSample property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setAudioBitsPerSample(Integer value) { + this.audioBitsPerSample = value; + } + + /** + * Gets the value of the pictureAspectRatioX property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getPictureAspectRatioX() { + return pictureAspectRatioX; + } + + /** + * Sets the value of the pictureAspectRatioX property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setPictureAspectRatioX(Integer value) { + this.pictureAspectRatioX = value; + } + + /** + * Gets the value of the pictureAspectRatioY property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getPictureAspectRatioY() { + return pictureAspectRatioY; + } + + /** + * Sets the value of the pictureAspectRatioY property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setPictureAspectRatioY(Integer value) { + this.pictureAspectRatioY = value; + } + + /** + * Gets the value of the blackBorderPixelsTop property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getBlackBorderPixelsTop() { + return blackBorderPixelsTop; + } + + /** + * Sets the value of the blackBorderPixelsTop property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setBlackBorderPixelsTop(Integer value) { + this.blackBorderPixelsTop = value; + } + + /** + * Gets the value of the blackBorderPixelsBottom property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getBlackBorderPixelsBottom() { + return blackBorderPixelsBottom; + } + + /** + * Sets the value of the blackBorderPixelsBottom property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setBlackBorderPixelsBottom(Integer value) { + this.blackBorderPixelsBottom = value; + } + + /** + * Gets the value of the blackBorderPixelsLeft property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getBlackBorderPixelsLeft() { + return blackBorderPixelsLeft; + } + + /** + * Sets the value of the blackBorderPixelsLeft property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setBlackBorderPixelsLeft(Integer value) { + this.blackBorderPixelsLeft = value; + } + + /** + * Gets the value of the blackBorderPixelsRight property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getBlackBorderPixelsRight() { + return blackBorderPixelsRight; + } + + /** + * Sets the value of the blackBorderPixelsRight property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setBlackBorderPixelsRight(Integer value) { + this.blackBorderPixelsRight = value; + } + + /** + * Gets the value of the commercialBlackScenes property. + * + * @return + * possible object is + * {@link MediaProperties.CommercialBlackScenes } + * + */ + public MediaProperties.CommercialBlackScenes getCommercialBlackScenes() { + return commercialBlackScenes; + } + + /** + * Sets the value of the commercialBlackScenes property. + * + * @param value + * allowed object is + * {@link MediaProperties.CommercialBlackScenes } + * + */ + public void setCommercialBlackScenes(MediaProperties.CommercialBlackScenes value) { + this.commercialBlackScenes = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="trim" type="{http://ws.server.mediamanager.digitalrapids.ca/}trim" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "trim" + }) + public static class CommercialBlackScenes { + + protected List trim; + + /** + * Gets the value of the trim property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the trim property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getTrim().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Trim } + * + * + */ + public List getTrim() { + if (trim == null) { + trim = new ArrayList(); + } + return this.trim; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaReaderEnum.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaReaderEnum.java new file mode 100644 index 00000000..c3665830 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaReaderEnum.java @@ -0,0 +1,66 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for mediaReaderEnum. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="mediaReaderEnum">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="DIRECTSHOW"/>
+ *     <enumeration value="QUICKTIME"/>
+ *     <enumeration value="DRC_VIDEO"/>
+ *     <enumeration value="MPEG_302M"/>
+ *     <enumeration value="PINNACLE"/>
+ *     <enumeration value="DPS"/>
+ *     <enumeration value="WAVE"/>
+ *     <enumeration value="WINDOWS_MEDIA"/>
+ *     <enumeration value="TMB"/>
+ *     <enumeration value="REDCAM"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "mediaReaderEnum") +@XmlEnum +public enum MediaReaderEnum { + + DIRECTSHOW("DIRECTSHOW"), + QUICKTIME("QUICKTIME"), + DRC_VIDEO("DRC_VIDEO"), + @XmlEnumValue("MPEG_302M") + MPEG_302_M("MPEG_302M"), + PINNACLE("PINNACLE"), + DPS("DPS"), + WAVE("WAVE"), + WINDOWS_MEDIA("WINDOWS_MEDIA"), + TMB("TMB"), + REDCAM("REDCAM"); + private final String value; + + MediaReaderEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + public static MediaReaderEnum fromValue(String v) { + for (MediaReaderEnum c: MediaReaderEnum.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaSource.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaSource.java new file mode 100644 index 00000000..95ed9ca4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MediaSource.java @@ -0,0 +1,119 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for mediaSource complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="mediaSource">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="mediaFile" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaFile" minOccurs="0"/>
+ *         <element name="trim" type="{http://ws.server.mediamanager.digitalrapids.ca/}trim" minOccurs="0"/>
+ *         <element name="mediaReader" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaReaderEnum" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "mediaSource", propOrder = { + "mediaFile", + "trim", + "mediaReader" +}) +@XmlSeeAlso({ + VideoSource.class, + AudioSource.class +}) +public class MediaSource { + + protected MediaFile mediaFile; + protected Trim trim; + protected MediaReaderEnum mediaReader; + + /** + * Gets the value of the mediaFile property. + * + * @return + * possible object is + * {@link MediaFile } + * + */ + public MediaFile getMediaFile() { + return mediaFile; + } + + /** + * Sets the value of the mediaFile property. + * + * @param value + * allowed object is + * {@link MediaFile } + * + */ + public void setMediaFile(MediaFile value) { + this.mediaFile = value; + } + + /** + * Gets the value of the trim property. + * + * @return + * possible object is + * {@link Trim } + * + */ + public Trim getTrim() { + return trim; + } + + /** + * Sets the value of the trim property. + * + * @param value + * allowed object is + * {@link Trim } + * + */ + public void setTrim(Trim value) { + this.trim = value; + } + + /** + * Gets the value of the mediaReader property. + * + * @return + * possible object is + * {@link MediaReaderEnum } + * + */ + public MediaReaderEnum getMediaReader() { + return mediaReader; + } + + /** + * Sets the value of the mediaReader property. + * + * @param value + * allowed object is + * {@link MediaReaderEnum } + * + */ + public void setMediaReader(MediaReaderEnum value) { + this.mediaReader = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Metadata.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Metadata.java new file mode 100644 index 00000000..f2db164c --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Metadata.java @@ -0,0 +1,175 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for metadata complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="metadata">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <attribute name="group" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "metadata", propOrder = { + "value" +}) +public class Metadata { + + @XmlValue + protected String value; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(name = "group") + protected String group; + @XmlAttribute(name = "name") + protected String name; + @XmlAttribute(name = "type") + protected String type; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroup(String value) { + this.group = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MetadataDefinition.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MetadataDefinition.java new file mode 100644 index 00000000..3423ee10 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MetadataDefinition.java @@ -0,0 +1,230 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for metadataDefinition complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="metadataDefinition">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="enumerationValue" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="enumerationAllowsFreeText" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="group" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "metadataDefinition", propOrder = { + "enumerationValue", + "enumerationAllowsFreeText" +}) +public class MetadataDefinition { + + protected List enumerationValue; + protected Boolean enumerationAllowsFreeText; + @XmlAttribute(name = "group") + protected String group; + @XmlAttribute(name = "name") + protected String name; + @XmlAttribute(name = "type") + protected String type; + @XmlAttribute(name = "defaultValue") + protected String defaultValue; + @XmlAttribute(name = "required") + protected Boolean required; + + /** + * Gets the value of the enumerationValue property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the enumerationValue property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getEnumerationValue().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getEnumerationValue() { + if (enumerationValue == null) { + enumerationValue = new ArrayList(); + } + return this.enumerationValue; + } + + /** + * Gets the value of the enumerationAllowsFreeText property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isEnumerationAllowsFreeText() { + return enumerationAllowsFreeText; + } + + /** + * Sets the value of the enumerationAllowsFreeText property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setEnumerationAllowsFreeText(Boolean value) { + this.enumerationAllowsFreeText = value; + } + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroup(String value) { + this.group = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the defaultValue property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * Sets the value of the defaultValue property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDefaultValue(String value) { + this.defaultValue = value; + } + + /** + * Gets the value of the required property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isRequired() { + return required; + } + + /** + * Sets the value of the required property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setRequired(Boolean value) { + this.required = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyAsset.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyAsset.java new file mode 100644 index 00000000..956f220c --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyAsset.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for modifyAsset complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="modifyAsset">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="asset" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "modifyAsset", propOrder = { + "asset" +}) +public class ModifyAsset { + + protected Asset asset; + + /** + * Gets the value of the asset property. + * + * @return + * possible object is + * {@link Asset } + * + */ + public Asset getAsset() { + return asset; + } + + /** + * Sets the value of the asset property. + * + * @param value + * allowed object is + * {@link Asset } + * + */ + public void setAsset(Asset value) { + this.asset = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyAssetResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyAssetResponse.java new file mode 100644 index 00000000..aee714ca --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyAssetResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for modifyAssetResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="modifyAssetResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "modifyAssetResponse") +public class ModifyAssetResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyScheduledJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyScheduledJob.java new file mode 100644 index 00000000..d12aaa8c --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyScheduledJob.java @@ -0,0 +1,79 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for modifyScheduledJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="modifyScheduledJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="scheduledJob" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJob" minOccurs="0"/>
+ *         <element name="rescheduleNextRun" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "modifyScheduledJob", propOrder = { + "scheduledJob", + "rescheduleNextRun" +}) +public class ModifyScheduledJob { + + protected ScheduledJob scheduledJob; + protected boolean rescheduleNextRun; + + /** + * Gets the value of the scheduledJob property. + * + * @return + * possible object is + * {@link ScheduledJob } + * + */ + public ScheduledJob getScheduledJob() { + return scheduledJob; + } + + /** + * Sets the value of the scheduledJob property. + * + * @param value + * allowed object is + * {@link ScheduledJob } + * + */ + public void setScheduledJob(ScheduledJob value) { + this.scheduledJob = value; + } + + /** + * Gets the value of the rescheduleNextRun property. + * + */ + public boolean isRescheduleNextRun() { + return rescheduleNextRun; + } + + /** + * Sets the value of the rescheduleNextRun property. + * + */ + public void setRescheduleNextRun(boolean value) { + this.rescheduleNextRun = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyScheduledJobResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyScheduledJobResponse.java new file mode 100644 index 00000000..0da0c93c --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ModifyScheduledJobResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for modifyScheduledJobResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="modifyScheduledJobResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "modifyScheduledJobResponse") +public class ModifyScheduledJobResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MoveFileSnapshotFile.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MoveFileSnapshotFile.java new file mode 100644 index 00000000..78cc10ba --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MoveFileSnapshotFile.java @@ -0,0 +1,106 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for moveFileSnapshotFile complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="moveFileSnapshotFile">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="newFullPath" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="movePhysicalFile" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "moveFileSnapshotFile", propOrder = { + "id", + "newFullPath", + "movePhysicalFile" +}) +public class MoveFileSnapshotFile { + + protected String id; + protected String newFullPath; + protected boolean movePhysicalFile; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the newFullPath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getNewFullPath() { + return newFullPath; + } + + /** + * Sets the value of the newFullPath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNewFullPath(String value) { + this.newFullPath = value; + } + + /** + * Gets the value of the movePhysicalFile property. + * + */ + public boolean isMovePhysicalFile() { + return movePhysicalFile; + } + + /** + * Sets the value of the movePhysicalFile property. + * + */ + public void setMovePhysicalFile(boolean value) { + this.movePhysicalFile = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MoveFileSnapshotFileResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MoveFileSnapshotFileResponse.java new file mode 100644 index 00000000..6445b064 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/MoveFileSnapshotFileResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for moveFileSnapshotFileResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="moveFileSnapshotFileResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "moveFileSnapshotFileResponse") +public class MoveFileSnapshotFileResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ObjectFactory.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ObjectFactory.java new file mode 100644 index 00000000..d8897c10 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ObjectFactory.java @@ -0,0 +1,2767 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the user.commons.selenio.wsclient package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _GetJob_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getJob"); + private final static QName _GetNameResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getNameResponse"); + private final static QName _GetResource_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getResource"); + private final static QName _ModifyScheduledJob_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "modifyScheduledJob"); + private final static QName _GetJobsForTranscodeTask_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getJobsForTranscodeTask"); + private final static QName _GetProjectListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getProjectListResponse"); + private final static QName _GetProjectList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getProjectList"); + private final static QName _FindAssets_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "findAssets"); + private final static QName _ModifyAsset_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "modifyAsset"); + private final static QName _GetVersionResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getVersionResponse"); + private final static QName _GetDomainResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getDomainResponse"); + private final static QName _GetScheduledJobStatus_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJobStatus"); + private final static QName _GetScriptList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScriptList"); + private final static QName _GetFileSnapshotResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getFileSnapshotResponse"); + private final static QName _FindTranscodeTasks_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "findTranscodeTasks"); + private final static QName _GetTranscodeTaskForJob_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTranscodeTaskForJob"); + private final static QName _GetTranscodeTaskResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTranscodeTaskResponse"); + private final static QName _GetScriptListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScriptListResponse"); + private final static QName _Output_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "output"); + private final static QName _GetResourceListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getResourceListResponse"); + private final static QName _Property_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "property"); + private final static QName _GetProjectResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getProjectResponse"); + private final static QName _DeleteAsset_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "deleteAsset"); + private final static QName _DeleteScheduledJob_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "deleteScheduledJob"); + private final static QName _SetRuntimeEnvironmentForGroupResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setRuntimeEnvironmentForGroupResponse"); + private final static QName _SetResourceOnlineResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setResourceOnlineResponse"); + private final static QName _GetMediaPropertiesResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getMediaPropertiesResponse"); + private final static QName _GetQCTask_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getQCTask"); + private final static QName _Rule_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "rule"); + private final static QName _GetFileSnapshot_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getFileSnapshot"); + private final static QName _MoveFileSnapshotFileResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "moveFileSnapshotFileResponse"); + private final static QName _Exception_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "Exception"); + private final static QName _GetScheduledJobStatusList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJobStatusList"); + private final static QName _ExportAssetResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "exportAssetResponse"); + private final static QName _GetAgentList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAgentList"); + private final static QName _DeleteAssetResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "deleteAssetResponse"); + private final static QName _GetWatchFolderListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getWatchFolderListResponse"); + private final static QName _GetAssetResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAssetResponse"); + private final static QName _GetScheduledJobList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJobList"); + private final static QName _AddResourceToGroup_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "addResourceToGroup"); + private final static QName _ExportAsset_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "exportAsset"); + private final static QName _DataType_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "dataType"); + private final static QName _ModifyScheduledJobResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "modifyScheduledJobResponse"); + private final static QName _Source_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "source"); + private final static QName _GetProject_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getProject"); + private final static QName _CreateGroupResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "createGroupResponse"); + private final static QName _GetJobResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getJobResponse"); + private final static QName _GetAgentListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAgentListResponse"); + private final static QName _ModifyAssetResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "modifyAssetResponse"); + private final static QName _GetTranscodeTask_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTranscodeTask"); + private final static QName _Clip_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "clip"); + private final static QName _ExtendedClipList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "extendedClipList"); + private final static QName _Task_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "task"); + private final static QName _SetResourceOnline_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setResourceOnline"); + private final static QName _Track_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "track"); + private final static QName _SetTranscodeTaskPriority_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setTranscodeTaskPriority"); + private final static QName _CancelTranscodeTask_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "cancelTranscodeTask"); + private final static QName _GetAssetProfiles_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAssetProfiles"); + private final static QName _CreateGroup_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "createGroup"); + private final static QName _GetQCServiceListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getQCServiceListResponse"); + private final static QName _GetGroupListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getGroupListResponse"); + private final static QName _GetTimeZoneResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTimeZoneResponse"); + private final static QName _GetScheduledJob_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJob"); + private final static QName _FindAssetsResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "findAssetsResponse"); + private final static QName _GetGroup_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getGroup"); + private final static QName _GetQCServiceList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getQCServiceList"); + private final static QName _GetQCService_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getQCService"); + private final static QName _SetRuntimeEnvironmentForGroup_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setRuntimeEnvironmentForGroup"); + private final static QName _GetActiveJobsList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getActiveJobsList"); + private final static QName _GetScheduledJobListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJobListResponse"); + private final static QName _SetGroupRuntimeEnvironmentResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setGroupRuntimeEnvironmentResponse"); + private final static QName _GetJobsForTranscodeTaskResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getJobsForTranscodeTaskResponse"); + private final static QName _SetGroupRuntimeEnvironment_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setGroupRuntimeEnvironment"); + private final static QName _GetAsset_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAsset"); + private final static QName _GetTranscodeRequestResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTranscodeRequestResponse"); + private final static QName _AddResourceToGroupResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "addResourceToGroupResponse"); + private final static QName _GetMediaProperties_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getMediaProperties"); + private final static QName _GetAssetProfilesResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAssetProfilesResponse"); + private final static QName _GetDomain_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getDomain"); + private final static QName _GetWatchFolderList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getWatchFolderList"); + private final static QName _AddScheduledJobResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "addScheduledJobResponse"); + private final static QName _SubmitTranscodeTaskResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "submitTranscodeTaskResponse"); + private final static QName _GetQCTaskResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getQCTaskResponse"); + private final static QName _GetTranscodeTaskForJobResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTranscodeTaskForJobResponse"); + private final static QName _AddScheduledJob_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "addScheduledJob"); + private final static QName _CancelJob_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "cancelJob"); + private final static QName _GetVersion_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getVersion"); + private final static QName _DeleteScheduledJobResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "deleteScheduledJobResponse"); + private final static QName _GetMetadataDefinition_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getMetadataDefinition"); + private final static QName _GetResourceResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getResourceResponse"); + private final static QName _GetTimeZone_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTimeZone"); + private final static QName _CancelTranscodeTaskResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "cancelTranscodeTaskResponse"); + private final static QName _GetTranscodeRequest_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getTranscodeRequest"); + private final static QName _GetQCServiceResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getQCServiceResponse"); + private final static QName _GetMetadataDefinitionResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getMetadataDefinitionResponse"); + private final static QName _MoveFileSnapshotFile_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "moveFileSnapshotFile"); + private final static QName _GetGroupList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getGroupList"); + private final static QName _CreateResourceOnAgent_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "createResourceOnAgent"); + private final static QName _AddAssetResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "addAssetResponse"); + private final static QName _GetGroupResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getGroupResponse"); + private final static QName _GetScheduledJobStatusResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJobStatusResponse"); + private final static QName _GetResourceList_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getResourceList"); + private final static QName _GetActiveJobsListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getActiveJobsListResponse"); + private final static QName _CancelJobResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "cancelJobResponse"); + private final static QName _CreateResourceOnAgentResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "createResourceOnAgentResponse"); + private final static QName _AddAsset_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "addAsset"); + private final static QName _GetName_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getName"); + private final static QName _FindTranscodeTasksResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "findTranscodeTasksResponse"); + private final static QName _SubmitTranscodeTask_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "submitTranscodeTask"); + private final static QName _GetScheduledJobResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJobResponse"); + private final static QName _GetAbout_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAbout"); + private final static QName _GetScheduledJobStatusListResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getScheduledJobStatusListResponse"); + private final static QName _GetAboutResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "getAboutResponse"); + private final static QName _SetTranscodeTaskPriorityResponse_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "setTranscodeTaskPriorityResponse"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: user.commons.selenio.wsclient + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link AssetLayer } + * + */ + public AssetLayer createAssetLayer() { + return new AssetLayer(); + } + + /** + * Create an instance of {@link MediaProperties } + * + */ + public MediaProperties createMediaProperties() { + return new MediaProperties(); + } + + /** + * Create an instance of {@link EventScript } + * + */ + public EventScript createEventScript() { + return new EventScript(); + } + + /** + * Create an instance of {@link EventScript.CustomVariables } + * + */ + public EventScript.CustomVariables createEventScriptCustomVariables() { + return new EventScript.CustomVariables(); + } + + /** + * Create an instance of {@link SjTaskRunTransportStreamInput } + * + */ + public SjTaskRunTransportStreamInput createSjTaskRunTransportStreamInput() { + return new SjTaskRunTransportStreamInput(); + } + + /** + * Create an instance of {@link Job } + * + */ + public Job createJob() { + return new Job(); + } + + /** + * Create an instance of {@link WatchFolder } + * + */ + public WatchFolder createWatchFolder() { + return new WatchFolder(); + } + + /** + * Create an instance of {@link TranscodeRequest } + * + */ + public TranscodeRequest createTranscodeRequest() { + return new TranscodeRequest(); + } + + /** + * Create an instance of {@link TranscodeRequest.TagValues } + * + */ + public TranscodeRequest.TagValues createTranscodeRequestTagValues() { + return new TranscodeRequest.TagValues(); + } + + /** + * Create an instance of {@link SjTaskRunProject } + * + */ + public SjTaskRunProject createSjTaskRunProject() { + return new SjTaskRunProject(); + } + + /** + * Create an instance of {@link ScheduledJob } + * + */ + public ScheduledJob createScheduledJob() { + return new ScheduledJob(); + } + + /** + * Create an instance of {@link TranscodeTask } + * + */ + public TranscodeTask createTranscodeTask() { + return new TranscodeTask(); + } + + /** + * Create an instance of {@link Asset } + * + */ + public Asset createAsset() { + return new Asset(); + } + + /** + * Create an instance of {@link SourceBean } + * + */ + public SourceBean createSourceBean() { + return new SourceBean(); + } + + /** + * Create an instance of {@link DataTypeBean } + * + */ + public DataTypeBean createDataTypeBean() { + return new DataTypeBean(); + } + + /** + * Create an instance of {@link DataTypeBean.Keys } + * + */ + public DataTypeBean.Keys createDataTypeBeanKeys() { + return new DataTypeBean.Keys(); + } + + /** + * Create an instance of {@link TrackBean } + * + */ + public TrackBean createTrackBean() { + return new TrackBean(); + } + + /** + * Create an instance of {@link ExtendedClipList } + * + */ + public ExtendedClipList createExtendedClipList() { + return new ExtendedClipList(); + } + + /** + * Create an instance of {@link ClipBean } + * + */ + public ClipBean createClipBean() { + return new ClipBean(); + } + + /** + * Create an instance of {@link RuleBean } + * + */ + public RuleBean createRuleBean() { + return new RuleBean(); + } + + /** + * Create an instance of {@link OutputBean } + * + */ + public OutputBean createOutputBean() { + return new OutputBean(); + } + + /** + * Create an instance of {@link GetScheduledJobListResponse } + * + */ + public GetScheduledJobListResponse createGetScheduledJobListResponse() { + return new GetScheduledJobListResponse(); + } + + /** + * Create an instance of {@link SetGroupRuntimeEnvironmentResponse } + * + */ + public SetGroupRuntimeEnvironmentResponse createSetGroupRuntimeEnvironmentResponse() { + return new SetGroupRuntimeEnvironmentResponse(); + } + + /** + * Create an instance of {@link GetJobsForTranscodeTaskResponse } + * + */ + public GetJobsForTranscodeTaskResponse createGetJobsForTranscodeTaskResponse() { + return new GetJobsForTranscodeTaskResponse(); + } + + /** + * Create an instance of {@link CreateGroup } + * + */ + public CreateGroup createCreateGroup() { + return new CreateGroup(); + } + + /** + * Create an instance of {@link GetQCServiceListResponse } + * + */ + public GetQCServiceListResponse createGetQCServiceListResponse() { + return new GetQCServiceListResponse(); + } + + /** + * Create an instance of {@link GetGroupListResponse } + * + */ + public GetGroupListResponse createGetGroupListResponse() { + return new GetGroupListResponse(); + } + + /** + * Create an instance of {@link GetTimeZoneResponse } + * + */ + public GetTimeZoneResponse createGetTimeZoneResponse() { + return new GetTimeZoneResponse(); + } + + /** + * Create an instance of {@link FindAssetsResponse } + * + */ + public FindAssetsResponse createFindAssetsResponse() { + return new FindAssetsResponse(); + } + + /** + * Create an instance of {@link GetScheduledJob } + * + */ + public GetScheduledJob createGetScheduledJob() { + return new GetScheduledJob(); + } + + /** + * Create an instance of {@link GetGroup } + * + */ + public GetGroup createGetGroup() { + return new GetGroup(); + } + + /** + * Create an instance of {@link GetQCServiceList } + * + */ + public GetQCServiceList createGetQCServiceList() { + return new GetQCServiceList(); + } + + /** + * Create an instance of {@link GetQCService } + * + */ + public GetQCService createGetQCService() { + return new GetQCService(); + } + + /** + * Create an instance of {@link SetRuntimeEnvironmentForGroup } + * + */ + public SetRuntimeEnvironmentForGroup createSetRuntimeEnvironmentForGroup() { + return new SetRuntimeEnvironmentForGroup(); + } + + /** + * Create an instance of {@link GetActiveJobsList } + * + */ + public GetActiveJobsList createGetActiveJobsList() { + return new GetActiveJobsList(); + } + + /** + * Create an instance of {@link GetWatchFolderList } + * + */ + public GetWatchFolderList createGetWatchFolderList() { + return new GetWatchFolderList(); + } + + /** + * Create an instance of {@link AddScheduledJobResponse } + * + */ + public AddScheduledJobResponse createAddScheduledJobResponse() { + return new AddScheduledJobResponse(); + } + + /** + * Create an instance of {@link SubmitTranscodeTaskResponse } + * + */ + public SubmitTranscodeTaskResponse createSubmitTranscodeTaskResponse() { + return new SubmitTranscodeTaskResponse(); + } + + /** + * Create an instance of {@link GetQCTaskResponse } + * + */ + public GetQCTaskResponse createGetQCTaskResponse() { + return new GetQCTaskResponse(); + } + + /** + * Create an instance of {@link GetTranscodeTaskForJobResponse } + * + */ + public GetTranscodeTaskForJobResponse createGetTranscodeTaskForJobResponse() { + return new GetTranscodeTaskForJobResponse(); + } + + /** + * Create an instance of {@link AddScheduledJob } + * + */ + public AddScheduledJob createAddScheduledJob() { + return new AddScheduledJob(); + } + + /** + * Create an instance of {@link SetGroupRuntimeEnvironment } + * + */ + public SetGroupRuntimeEnvironment createSetGroupRuntimeEnvironment() { + return new SetGroupRuntimeEnvironment(); + } + + /** + * Create an instance of {@link GetAsset } + * + */ + public GetAsset createGetAsset() { + return new GetAsset(); + } + + /** + * Create an instance of {@link GetTranscodeRequestResponse } + * + */ + public GetTranscodeRequestResponse createGetTranscodeRequestResponse() { + return new GetTranscodeRequestResponse(); + } + + /** + * Create an instance of {@link AddResourceToGroupResponse } + * + */ + public AddResourceToGroupResponse createAddResourceToGroupResponse() { + return new AddResourceToGroupResponse(); + } + + /** + * Create an instance of {@link GetMediaProperties } + * + */ + public GetMediaProperties createGetMediaProperties() { + return new GetMediaProperties(); + } + + /** + * Create an instance of {@link GetAssetProfilesResponse } + * + */ + public GetAssetProfilesResponse createGetAssetProfilesResponse() { + return new GetAssetProfilesResponse(); + } + + /** + * Create an instance of {@link GetDomain } + * + */ + public GetDomain createGetDomain() { + return new GetDomain(); + } + + /** + * Create an instance of {@link CancelTranscodeTaskResponse } + * + */ + public CancelTranscodeTaskResponse createCancelTranscodeTaskResponse() { + return new CancelTranscodeTaskResponse(); + } + + /** + * Create an instance of {@link GetTimeZone } + * + */ + public GetTimeZone createGetTimeZone() { + return new GetTimeZone(); + } + + /** + * Create an instance of {@link GetQCServiceResponse } + * + */ + public GetQCServiceResponse createGetQCServiceResponse() { + return new GetQCServiceResponse(); + } + + /** + * Create an instance of {@link GetTranscodeRequest } + * + */ + public GetTranscodeRequest createGetTranscodeRequest() { + return new GetTranscodeRequest(); + } + + /** + * Create an instance of {@link MoveFileSnapshotFile } + * + */ + public MoveFileSnapshotFile createMoveFileSnapshotFile() { + return new MoveFileSnapshotFile(); + } + + /** + * Create an instance of {@link GetMetadataDefinitionResponse } + * + */ + public GetMetadataDefinitionResponse createGetMetadataDefinitionResponse() { + return new GetMetadataDefinitionResponse(); + } + + /** + * Create an instance of {@link GetGroupList } + * + */ + public GetGroupList createGetGroupList() { + return new GetGroupList(); + } + + /** + * Create an instance of {@link CreateResourceOnAgent } + * + */ + public CreateResourceOnAgent createCreateResourceOnAgent() { + return new CreateResourceOnAgent(); + } + + /** + * Create an instance of {@link CancelJob } + * + */ + public CancelJob createCancelJob() { + return new CancelJob(); + } + + /** + * Create an instance of {@link GetVersion } + * + */ + public GetVersion createGetVersion() { + return new GetVersion(); + } + + /** + * Create an instance of {@link DeleteScheduledJobResponse } + * + */ + public DeleteScheduledJobResponse createDeleteScheduledJobResponse() { + return new DeleteScheduledJobResponse(); + } + + /** + * Create an instance of {@link GetMetadataDefinition } + * + */ + public GetMetadataDefinition createGetMetadataDefinition() { + return new GetMetadataDefinition(); + } + + /** + * Create an instance of {@link GetResourceResponse } + * + */ + public GetResourceResponse createGetResourceResponse() { + return new GetResourceResponse(); + } + + /** + * Create an instance of {@link SubmitTranscodeTask } + * + */ + public SubmitTranscodeTask createSubmitTranscodeTask() { + return new SubmitTranscodeTask(); + } + + /** + * Create an instance of {@link GetAbout } + * + */ + public GetAbout createGetAbout() { + return new GetAbout(); + } + + /** + * Create an instance of {@link GetScheduledJobResponse } + * + */ + public GetScheduledJobResponse createGetScheduledJobResponse() { + return new GetScheduledJobResponse(); + } + + /** + * Create an instance of {@link GetScheduledJobStatusListResponse } + * + */ + public GetScheduledJobStatusListResponse createGetScheduledJobStatusListResponse() { + return new GetScheduledJobStatusListResponse(); + } + + /** + * Create an instance of {@link SetTranscodeTaskPriorityResponse } + * + */ + public SetTranscodeTaskPriorityResponse createSetTranscodeTaskPriorityResponse() { + return new SetTranscodeTaskPriorityResponse(); + } + + /** + * Create an instance of {@link GetAboutResponse } + * + */ + public GetAboutResponse createGetAboutResponse() { + return new GetAboutResponse(); + } + + /** + * Create an instance of {@link GetGroupResponse } + * + */ + public GetGroupResponse createGetGroupResponse() { + return new GetGroupResponse(); + } + + /** + * Create an instance of {@link AddAssetResponse } + * + */ + public AddAssetResponse createAddAssetResponse() { + return new AddAssetResponse(); + } + + /** + * Create an instance of {@link GetScheduledJobStatusResponse } + * + */ + public GetScheduledJobStatusResponse createGetScheduledJobStatusResponse() { + return new GetScheduledJobStatusResponse(); + } + + /** + * Create an instance of {@link GetResourceList } + * + */ + public GetResourceList createGetResourceList() { + return new GetResourceList(); + } + + /** + * Create an instance of {@link GetActiveJobsListResponse } + * + */ + public GetActiveJobsListResponse createGetActiveJobsListResponse() { + return new GetActiveJobsListResponse(); + } + + /** + * Create an instance of {@link CancelJobResponse } + * + */ + public CancelJobResponse createCancelJobResponse() { + return new CancelJobResponse(); + } + + /** + * Create an instance of {@link CreateResourceOnAgentResponse } + * + */ + public CreateResourceOnAgentResponse createCreateResourceOnAgentResponse() { + return new CreateResourceOnAgentResponse(); + } + + /** + * Create an instance of {@link AddAsset } + * + */ + public AddAsset createAddAsset() { + return new AddAsset(); + } + + /** + * Create an instance of {@link GetName } + * + */ + public GetName createGetName() { + return new GetName(); + } + + /** + * Create an instance of {@link FindTranscodeTasksResponse } + * + */ + public FindTranscodeTasksResponse createFindTranscodeTasksResponse() { + return new FindTranscodeTasksResponse(); + } + + /** + * Create an instance of {@link GetProjectListResponse } + * + */ + public GetProjectListResponse createGetProjectListResponse() { + return new GetProjectListResponse(); + } + + /** + * Create an instance of {@link GetProjectList } + * + */ + public GetProjectList createGetProjectList() { + return new GetProjectList(); + } + + /** + * Create an instance of {@link FindAssets } + * + */ + public FindAssets createFindAssets() { + return new FindAssets(); + } + + /** + * Create an instance of {@link ModifyAsset } + * + */ + public ModifyAsset createModifyAsset() { + return new ModifyAsset(); + } + + /** + * Create an instance of {@link GetVersionResponse } + * + */ + public GetVersionResponse createGetVersionResponse() { + return new GetVersionResponse(); + } + + /** + * Create an instance of {@link GetDomainResponse } + * + */ + public GetDomainResponse createGetDomainResponse() { + return new GetDomainResponse(); + } + + /** + * Create an instance of {@link GetScheduledJobStatus } + * + */ + public GetScheduledJobStatus createGetScheduledJobStatus() { + return new GetScheduledJobStatus(); + } + + /** + * Create an instance of {@link GetScriptList } + * + */ + public GetScriptList createGetScriptList() { + return new GetScriptList(); + } + + /** + * Create an instance of {@link GetFileSnapshotResponse } + * + */ + public GetFileSnapshotResponse createGetFileSnapshotResponse() { + return new GetFileSnapshotResponse(); + } + + /** + * Create an instance of {@link GetJob } + * + */ + public GetJob createGetJob() { + return new GetJob(); + } + + /** + * Create an instance of {@link GetNameResponse } + * + */ + public GetNameResponse createGetNameResponse() { + return new GetNameResponse(); + } + + /** + * Create an instance of {@link GetResource } + * + */ + public GetResource createGetResource() { + return new GetResource(); + } + + /** + * Create an instance of {@link ModifyScheduledJob } + * + */ + public ModifyScheduledJob createModifyScheduledJob() { + return new ModifyScheduledJob(); + } + + /** + * Create an instance of {@link GetJobsForTranscodeTask } + * + */ + public GetJobsForTranscodeTask createGetJobsForTranscodeTask() { + return new GetJobsForTranscodeTask(); + } + + /** + * Create an instance of {@link GetResourceListResponse } + * + */ + public GetResourceListResponse createGetResourceListResponse() { + return new GetResourceListResponse(); + } + + /** + * Create an instance of {@link PropertyBean } + * + */ + public PropertyBean createPropertyBean() { + return new PropertyBean(); + } + + /** + * Create an instance of {@link GetProjectResponse } + * + */ + public GetProjectResponse createGetProjectResponse() { + return new GetProjectResponse(); + } + + /** + * Create an instance of {@link DeleteAsset } + * + */ + public DeleteAsset createDeleteAsset() { + return new DeleteAsset(); + } + + /** + * Create an instance of {@link DeleteScheduledJob } + * + */ + public DeleteScheduledJob createDeleteScheduledJob() { + return new DeleteScheduledJob(); + } + + /** + * Create an instance of {@link FindTranscodeTasks } + * + */ + public FindTranscodeTasks createFindTranscodeTasks() { + return new FindTranscodeTasks(); + } + + /** + * Create an instance of {@link GetTranscodeTaskForJob } + * + */ + public GetTranscodeTaskForJob createGetTranscodeTaskForJob() { + return new GetTranscodeTaskForJob(); + } + + /** + * Create an instance of {@link GetTranscodeTaskResponse } + * + */ + public GetTranscodeTaskResponse createGetTranscodeTaskResponse() { + return new GetTranscodeTaskResponse(); + } + + /** + * Create an instance of {@link GetScriptListResponse } + * + */ + public GetScriptListResponse createGetScriptListResponse() { + return new GetScriptListResponse(); + } + + /** + * Create an instance of {@link MoveFileSnapshotFileResponse } + * + */ + public MoveFileSnapshotFileResponse createMoveFileSnapshotFileResponse() { + return new MoveFileSnapshotFileResponse(); + } + + /** + * Create an instance of {@link Exception } + * + */ + public Exception createException() { + return new Exception(); + } + + /** + * Create an instance of {@link GetScheduledJobStatusList } + * + */ + public GetScheduledJobStatusList createGetScheduledJobStatusList() { + return new GetScheduledJobStatusList(); + } + + /** + * Create an instance of {@link ExportAssetResponse } + * + */ + public ExportAssetResponse createExportAssetResponse() { + return new ExportAssetResponse(); + } + + /** + * Create an instance of {@link GetAgentList } + * + */ + public GetAgentList createGetAgentList() { + return new GetAgentList(); + } + + /** + * Create an instance of {@link DeleteAssetResponse } + * + */ + public DeleteAssetResponse createDeleteAssetResponse() { + return new DeleteAssetResponse(); + } + + /** + * Create an instance of {@link GetWatchFolderListResponse } + * + */ + public GetWatchFolderListResponse createGetWatchFolderListResponse() { + return new GetWatchFolderListResponse(); + } + + /** + * Create an instance of {@link GetAssetResponse } + * + */ + public GetAssetResponse createGetAssetResponse() { + return new GetAssetResponse(); + } + + /** + * Create an instance of {@link GetScheduledJobList } + * + */ + public GetScheduledJobList createGetScheduledJobList() { + return new GetScheduledJobList(); + } + + /** + * Create an instance of {@link AddResourceToGroup } + * + */ + public AddResourceToGroup createAddResourceToGroup() { + return new AddResourceToGroup(); + } + + /** + * Create an instance of {@link ExportAsset } + * + */ + public ExportAsset createExportAsset() { + return new ExportAsset(); + } + + /** + * Create an instance of {@link SetRuntimeEnvironmentForGroupResponse } + * + */ + public SetRuntimeEnvironmentForGroupResponse createSetRuntimeEnvironmentForGroupResponse() { + return new SetRuntimeEnvironmentForGroupResponse(); + } + + /** + * Create an instance of {@link SetResourceOnlineResponse } + * + */ + public SetResourceOnlineResponse createSetResourceOnlineResponse() { + return new SetResourceOnlineResponse(); + } + + /** + * Create an instance of {@link GetMediaPropertiesResponse } + * + */ + public GetMediaPropertiesResponse createGetMediaPropertiesResponse() { + return new GetMediaPropertiesResponse(); + } + + /** + * Create an instance of {@link GetQCTask } + * + */ + public GetQCTask createGetQCTask() { + return new GetQCTask(); + } + + /** + * Create an instance of {@link GetFileSnapshot } + * + */ + public GetFileSnapshot createGetFileSnapshot() { + return new GetFileSnapshot(); + } + + /** + * Create an instance of {@link GetTranscodeTask } + * + */ + public GetTranscodeTask createGetTranscodeTask() { + return new GetTranscodeTask(); + } + + /** + * Create an instance of {@link TaskBean } + * + */ + public TaskBean createTaskBean() { + return new TaskBean(); + } + + /** + * Create an instance of {@link SetResourceOnline } + * + */ + public SetResourceOnline createSetResourceOnline() { + return new SetResourceOnline(); + } + + /** + * Create an instance of {@link SetTranscodeTaskPriority } + * + */ + public SetTranscodeTaskPriority createSetTranscodeTaskPriority() { + return new SetTranscodeTaskPriority(); + } + + /** + * Create an instance of {@link CancelTranscodeTask } + * + */ + public CancelTranscodeTask createCancelTranscodeTask() { + return new CancelTranscodeTask(); + } + + /** + * Create an instance of {@link GetAssetProfiles } + * + */ + public GetAssetProfiles createGetAssetProfiles() { + return new GetAssetProfiles(); + } + + /** + * Create an instance of {@link ModifyScheduledJobResponse } + * + */ + public ModifyScheduledJobResponse createModifyScheduledJobResponse() { + return new ModifyScheduledJobResponse(); + } + + /** + * Create an instance of {@link CreateGroupResponse } + * + */ + public CreateGroupResponse createCreateGroupResponse() { + return new CreateGroupResponse(); + } + + /** + * Create an instance of {@link GetProject } + * + */ + public GetProject createGetProject() { + return new GetProject(); + } + + /** + * Create an instance of {@link GetJobResponse } + * + */ + public GetJobResponse createGetJobResponse() { + return new GetJobResponse(); + } + + /** + * Create an instance of {@link GetAgentListResponse } + * + */ + public GetAgentListResponse createGetAgentListResponse() { + return new GetAgentListResponse(); + } + + /** + * Create an instance of {@link ModifyAssetResponse } + * + */ + public ModifyAssetResponse createModifyAssetResponse() { + return new ModifyAssetResponse(); + } + + /** + * Create an instance of {@link SjTaskConfigureResource } + * + */ + public SjTaskConfigureResource createSjTaskConfigureResource() { + return new SjTaskConfigureResource(); + } + + /** + * Create an instance of {@link AssetExportRequest } + * + */ + public AssetExportRequest createAssetExportRequest() { + return new AssetExportRequest(); + } + + /** + * Create an instance of {@link ScheduledSubprojectJob } + * + */ + public ScheduledSubprojectJob createScheduledSubprojectJob() { + return new ScheduledSubprojectJob(); + } + + /** + * Create an instance of {@link VideoSource } + * + */ + public VideoSource createVideoSource() { + return new VideoSource(); + } + + /** + * Create an instance of {@link BatonOptions } + * + */ + public BatonOptions createBatonOptions() { + return new BatonOptions(); + } + + /** + * Create an instance of {@link AssetPiece } + * + */ + public AssetPiece createAssetPiece() { + return new AssetPiece(); + } + + /** + * Create an instance of {@link ScheduledJobStatus } + * + */ + public ScheduledJobStatus createScheduledJobStatus() { + return new ScheduledJobStatus(); + } + + /** + * Create an instance of {@link SjSchedule } + * + */ + public SjSchedule createSjSchedule() { + return new SjSchedule(); + } + + /** + * Create an instance of {@link MediaFile } + * + */ + public MediaFile createMediaFile() { + return new MediaFile(); + } + + /** + * Create an instance of {@link CallbackURL } + * + */ + public CallbackURL createCallbackURL() { + return new CallbackURL(); + } + + /** + * Create an instance of {@link PropertiesSet } + * + */ + public PropertiesSet createPropertiesSet() { + return new PropertiesSet(); + } + + /** + * Create an instance of {@link TranscodeTaskSearch } + * + */ + public TranscodeTaskSearch createTranscodeTaskSearch() { + return new TranscodeTaskSearch(); + } + + /** + * Create an instance of {@link TranscodeDestination } + * + */ + public TranscodeDestination createTranscodeDestination() { + return new TranscodeDestination(); + } + + /** + * Create an instance of {@link MetadataDefinition } + * + */ + public MetadataDefinition createMetadataDefinition() { + return new MetadataDefinition(); + } + + /** + * Create an instance of {@link Agent } + * + */ + public Agent createAgent() { + return new Agent(); + } + + /** + * Create an instance of {@link FileSnapshot } + * + */ + public FileSnapshot createFileSnapshot() { + return new FileSnapshot(); + } + + /** + * Create an instance of {@link CerifyService } + * + */ + public CerifyService createCerifyService() { + return new CerifyService(); + } + + /** + * Create an instance of {@link Trim } + * + */ + public Trim createTrim() { + return new Trim(); + } + + /** + * Create an instance of {@link Clip } + * + */ + public Clip createClip() { + return new Clip(); + } + + /** + * Create an instance of {@link CerifyMediaLocation } + * + */ + public CerifyMediaLocation createCerifyMediaLocation() { + return new CerifyMediaLocation(); + } + + /** + * Create an instance of {@link VideoProcessingOptions } + * + */ + public VideoProcessingOptions createVideoProcessingOptions() { + return new VideoProcessingOptions(); + } + + /** + * Create an instance of {@link TranscodeSource } + * + */ + public TranscodeSource createTranscodeSource() { + return new TranscodeSource(); + } + + /** + * Create an instance of {@link SjTarget } + * + */ + public SjTarget createSjTarget() { + return new SjTarget(); + } + + /** + * Create an instance of {@link QcTask } + * + */ + public QcTask createQcTask() { + return new QcTask(); + } + + /** + * Create an instance of {@link KayakRuntimeEnvironment } + * + */ + public KayakRuntimeEnvironment createKayakRuntimeEnvironment() { + return new KayakRuntimeEnvironment(); + } + + /** + * Create an instance of {@link Callback } + * + */ + public Callback createCallback() { + return new Callback(); + } + + /** + * Create an instance of {@link ClipList } + * + */ + public ClipList createClipList() { + return new ClipList(); + } + + /** + * Create an instance of {@link BatonService } + * + */ + public BatonService createBatonService() { + return new BatonService(); + } + + /** + * Create an instance of {@link Timecode } + * + */ + public Timecode createTimecode() { + return new Timecode(); + } + + /** + * Create an instance of {@link Metadata } + * + */ + public Metadata createMetadata() { + return new Metadata(); + } + + /** + * Create an instance of {@link VidcheckerOptions } + * + */ + public VidcheckerOptions createVidcheckerOptions() { + return new VidcheckerOptions(); + } + + /** + * Create an instance of {@link AssetLayerSearch } + * + */ + public AssetLayerSearch createAssetLayerSearch() { + return new AssetLayerSearch(); + } + + /** + * Create an instance of {@link MediaSource } + * + */ + public MediaSource createMediaSource() { + return new MediaSource(); + } + + /** + * Create an instance of {@link CerifyOptions } + * + */ + public CerifyOptions createCerifyOptions() { + return new CerifyOptions(); + } + + /** + * Create an instance of {@link QcJob } + * + */ + public QcJob createQcJob() { + return new QcJob(); + } + + /** + * Create an instance of {@link Property } + * + */ + public Property createProperty() { + return new Property(); + } + + /** + * Create an instance of {@link Media } + * + */ + public Media createMedia() { + return new Media(); + } + + /** + * Create an instance of {@link MediaInspectionRequest } + * + */ + public MediaInspectionRequest createMediaInspectionRequest() { + return new MediaInspectionRequest(); + } + + /** + * Create an instance of {@link TimelineMarker } + * + */ + public TimelineMarker createTimelineMarker() { + return new TimelineMarker(); + } + + /** + * Create an instance of {@link AudioSource } + * + */ + public AudioSource createAudioSource() { + return new AudioSource(); + } + + /** + * Create an instance of {@link Resource } + * + */ + public Resource createResource() { + return new Resource(); + } + + /** + * Create an instance of {@link ResourcePropertyList } + * + */ + public ResourcePropertyList createResourcePropertyList() { + return new ResourcePropertyList(); + } + + /** + * Create an instance of {@link ResourceProperty } + * + */ + public ResourceProperty createResourceProperty() { + return new ResourceProperty(); + } + + /** + * Create an instance of {@link Group } + * + */ + public Group createGroup() { + return new Group(); + } + + /** + * Create an instance of {@link AssetLayer.MetadataValues } + * + */ + public AssetLayer.MetadataValues createAssetLayerMetadataValues() { + return new AssetLayer.MetadataValues(); + } + + /** + * Create an instance of {@link MediaProperties.CommercialBlackScenes } + * + */ + public MediaProperties.CommercialBlackScenes createMediaPropertiesCommercialBlackScenes() { + return new MediaProperties.CommercialBlackScenes(); + } + + /** + * Create an instance of {@link EventScript.CustomVariables.Entry } + * + */ + public EventScript.CustomVariables.Entry createEventScriptCustomVariablesEntry() { + return new EventScript.CustomVariables.Entry(); + } + + /** + * Create an instance of {@link SjTaskRunTransportStreamInput.AudioPids } + * + */ + public SjTaskRunTransportStreamInput.AudioPids createSjTaskRunTransportStreamInputAudioPids() { + return new SjTaskRunTransportStreamInput.AudioPids(); + } + + /** + * Create an instance of {@link Job.OutputMediaFiles } + * + */ + public Job.OutputMediaFiles createJobOutputMediaFiles() { + return new Job.OutputMediaFiles(); + } + + /** + * Create an instance of {@link WatchFolder.Scripts } + * + */ + public WatchFolder.Scripts createWatchFolderScripts() { + return new WatchFolder.Scripts(); + } + + /** + * Create an instance of {@link TranscodeRequest.Scripts } + * + */ + public TranscodeRequest.Scripts createTranscodeRequestScripts() { + return new TranscodeRequest.Scripts(); + } + + /** + * Create an instance of {@link TranscodeRequest.TagValues.Entry } + * + */ + public TranscodeRequest.TagValues.Entry createTranscodeRequestTagValuesEntry() { + return new TranscodeRequest.TagValues.Entry(); + } + + /** + * Create an instance of {@link SjTaskRunProject.ScheduledSubprojectJobs } + * + */ + public SjTaskRunProject.ScheduledSubprojectJobs createSjTaskRunProjectScheduledSubprojectJobs() { + return new SjTaskRunProject.ScheduledSubprojectJobs(); + } + + /** + * Create an instance of {@link ScheduledJob.Scripts } + * + */ + public ScheduledJob.Scripts createScheduledJobScripts() { + return new ScheduledJob.Scripts(); + } + + /** + * Create an instance of {@link TranscodeTask.SourceFiles } + * + */ + public TranscodeTask.SourceFiles createTranscodeTaskSourceFiles() { + return new TranscodeTask.SourceFiles(); + } + + /** + * Create an instance of {@link TranscodeTask.OutputFiles } + * + */ + public TranscodeTask.OutputFiles createTranscodeTaskOutputFiles() { + return new TranscodeTask.OutputFiles(); + } + + /** + * Create an instance of {@link TranscodeTask.OutputAssets } + * + */ + public TranscodeTask.OutputAssets createTranscodeTaskOutputAssets() { + return new TranscodeTask.OutputAssets(); + } + + /** + * Create an instance of {@link TranscodeTask.ChildTasks } + * + */ + public TranscodeTask.ChildTasks createTranscodeTaskChildTasks() { + return new TranscodeTask.ChildTasks(); + } + + /** + * Create an instance of {@link Asset.AssetPieces } + * + */ + public Asset.AssetPieces createAssetAssetPieces() { + return new Asset.AssetPieces(); + } + + /** + * Create an instance of {@link Asset.TimeLine } + * + */ + public Asset.TimeLine createAssetTimeLine() { + return new Asset.TimeLine(); + } + + /** + * Create an instance of {@link SourceBean.Properties } + * + */ + public SourceBean.Properties createSourceBeanProperties() { + return new SourceBean.Properties(); + } + + /** + * Create an instance of {@link DataTypeBean.Definitions } + * + */ + public DataTypeBean.Definitions createDataTypeBeanDefinitions() { + return new DataTypeBean.Definitions(); + } + + /** + * Create an instance of {@link DataTypeBean.Keys.Entry } + * + */ + public DataTypeBean.Keys.Entry createDataTypeBeanKeysEntry() { + return new DataTypeBean.Keys.Entry(); + } + + /** + * Create an instance of {@link TrackBean.Clips } + * + */ + public TrackBean.Clips createTrackBeanClips() { + return new TrackBean.Clips(); + } + + /** + * Create an instance of {@link ExtendedClipList.Sources } + * + */ + public ExtendedClipList.Sources createExtendedClipListSources() { + return new ExtendedClipList.Sources(); + } + + /** + * Create an instance of {@link ExtendedClipList.Tracks } + * + */ + public ExtendedClipList.Tracks createExtendedClipListTracks() { + return new ExtendedClipList.Tracks(); + } + + /** + * Create an instance of {@link ExtendedClipList.Outputs } + * + */ + public ExtendedClipList.Outputs createExtendedClipListOutputs() { + return new ExtendedClipList.Outputs(); + } + + /** + * Create an instance of {@link ClipBean.SourceRefs } + * + */ + public ClipBean.SourceRefs createClipBeanSourceRefs() { + return new ClipBean.SourceRefs(); + } + + /** + * Create an instance of {@link ClipBean.ClipRefs } + * + */ + public ClipBean.ClipRefs createClipBeanClipRefs() { + return new ClipBean.ClipRefs(); + } + + /** + * Create an instance of {@link RuleBean.Tasks } + * + */ + public RuleBean.Tasks createRuleBeanTasks() { + return new RuleBean.Tasks(); + } + + /** + * Create an instance of {@link OutputBean.Rules } + * + */ + public OutputBean.Rules createOutputBeanRules() { + return new OutputBean.Rules(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetJob }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getJob") + public JAXBElement createGetJob(GetJob value) { + return new JAXBElement(_GetJob_QNAME, GetJob.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetNameResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getNameResponse") + public JAXBElement createGetNameResponse(GetNameResponse value) { + return new JAXBElement(_GetNameResponse_QNAME, GetNameResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetResource }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getResource") + public JAXBElement createGetResource(GetResource value) { + return new JAXBElement(_GetResource_QNAME, GetResource.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ModifyScheduledJob }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "modifyScheduledJob") + public JAXBElement createModifyScheduledJob(ModifyScheduledJob value) { + return new JAXBElement(_ModifyScheduledJob_QNAME, ModifyScheduledJob.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetJobsForTranscodeTask }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getJobsForTranscodeTask") + public JAXBElement createGetJobsForTranscodeTask(GetJobsForTranscodeTask value) { + return new JAXBElement(_GetJobsForTranscodeTask_QNAME, GetJobsForTranscodeTask.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetProjectListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getProjectListResponse") + public JAXBElement createGetProjectListResponse(GetProjectListResponse value) { + return new JAXBElement(_GetProjectListResponse_QNAME, GetProjectListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetProjectList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getProjectList") + public JAXBElement createGetProjectList(GetProjectList value) { + return new JAXBElement(_GetProjectList_QNAME, GetProjectList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link FindAssets }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "findAssets") + public JAXBElement createFindAssets(FindAssets value) { + return new JAXBElement(_FindAssets_QNAME, FindAssets.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ModifyAsset }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "modifyAsset") + public JAXBElement createModifyAsset(ModifyAsset value) { + return new JAXBElement(_ModifyAsset_QNAME, ModifyAsset.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetVersionResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getVersionResponse") + public JAXBElement createGetVersionResponse(GetVersionResponse value) { + return new JAXBElement(_GetVersionResponse_QNAME, GetVersionResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetDomainResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getDomainResponse") + public JAXBElement createGetDomainResponse(GetDomainResponse value) { + return new JAXBElement(_GetDomainResponse_QNAME, GetDomainResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJobStatus }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJobStatus") + public JAXBElement createGetScheduledJobStatus(GetScheduledJobStatus value) { + return new JAXBElement(_GetScheduledJobStatus_QNAME, GetScheduledJobStatus.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScriptList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScriptList") + public JAXBElement createGetScriptList(GetScriptList value) { + return new JAXBElement(_GetScriptList_QNAME, GetScriptList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetFileSnapshotResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getFileSnapshotResponse") + public JAXBElement createGetFileSnapshotResponse(GetFileSnapshotResponse value) { + return new JAXBElement(_GetFileSnapshotResponse_QNAME, GetFileSnapshotResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link FindTranscodeTasks }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "findTranscodeTasks") + public JAXBElement createFindTranscodeTasks(FindTranscodeTasks value) { + return new JAXBElement(_FindTranscodeTasks_QNAME, FindTranscodeTasks.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTranscodeTaskForJob }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTranscodeTaskForJob") + public JAXBElement createGetTranscodeTaskForJob(GetTranscodeTaskForJob value) { + return new JAXBElement(_GetTranscodeTaskForJob_QNAME, GetTranscodeTaskForJob.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTranscodeTaskResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTranscodeTaskResponse") + public JAXBElement createGetTranscodeTaskResponse(GetTranscodeTaskResponse value) { + return new JAXBElement(_GetTranscodeTaskResponse_QNAME, GetTranscodeTaskResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScriptListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScriptListResponse") + public JAXBElement createGetScriptListResponse(GetScriptListResponse value) { + return new JAXBElement(_GetScriptListResponse_QNAME, GetScriptListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link OutputBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "output") + public JAXBElement createOutput(OutputBean value) { + return new JAXBElement(_Output_QNAME, OutputBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetResourceListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getResourceListResponse") + public JAXBElement createGetResourceListResponse(GetResourceListResponse value) { + return new JAXBElement(_GetResourceListResponse_QNAME, GetResourceListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PropertyBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "property") + public JAXBElement createProperty(PropertyBean value) { + return new JAXBElement(_Property_QNAME, PropertyBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetProjectResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getProjectResponse") + public JAXBElement createGetProjectResponse(GetProjectResponse value) { + return new JAXBElement(_GetProjectResponse_QNAME, GetProjectResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DeleteAsset }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "deleteAsset") + public JAXBElement createDeleteAsset(DeleteAsset value) { + return new JAXBElement(_DeleteAsset_QNAME, DeleteAsset.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DeleteScheduledJob }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "deleteScheduledJob") + public JAXBElement createDeleteScheduledJob(DeleteScheduledJob value) { + return new JAXBElement(_DeleteScheduledJob_QNAME, DeleteScheduledJob.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetRuntimeEnvironmentForGroupResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setRuntimeEnvironmentForGroupResponse") + public JAXBElement createSetRuntimeEnvironmentForGroupResponse(SetRuntimeEnvironmentForGroupResponse value) { + return new JAXBElement(_SetRuntimeEnvironmentForGroupResponse_QNAME, SetRuntimeEnvironmentForGroupResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetResourceOnlineResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setResourceOnlineResponse") + public JAXBElement createSetResourceOnlineResponse(SetResourceOnlineResponse value) { + return new JAXBElement(_SetResourceOnlineResponse_QNAME, SetResourceOnlineResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetMediaPropertiesResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getMediaPropertiesResponse") + public JAXBElement createGetMediaPropertiesResponse(GetMediaPropertiesResponse value) { + return new JAXBElement(_GetMediaPropertiesResponse_QNAME, GetMediaPropertiesResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetQCTask }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getQCTask") + public JAXBElement createGetQCTask(GetQCTask value) { + return new JAXBElement(_GetQCTask_QNAME, GetQCTask.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link RuleBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "rule") + public JAXBElement createRule(RuleBean value) { + return new JAXBElement(_Rule_QNAME, RuleBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetFileSnapshot }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getFileSnapshot") + public JAXBElement createGetFileSnapshot(GetFileSnapshot value) { + return new JAXBElement(_GetFileSnapshot_QNAME, GetFileSnapshot.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MoveFileSnapshotFileResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "moveFileSnapshotFileResponse") + public JAXBElement createMoveFileSnapshotFileResponse(MoveFileSnapshotFileResponse value) { + return new JAXBElement(_MoveFileSnapshotFileResponse_QNAME, MoveFileSnapshotFileResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Exception }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "Exception") + public JAXBElement createException(Exception value) { + return new JAXBElement(_Exception_QNAME, Exception.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJobStatusList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJobStatusList") + public JAXBElement createGetScheduledJobStatusList(GetScheduledJobStatusList value) { + return new JAXBElement(_GetScheduledJobStatusList_QNAME, GetScheduledJobStatusList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ExportAssetResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "exportAssetResponse") + public JAXBElement createExportAssetResponse(ExportAssetResponse value) { + return new JAXBElement(_ExportAssetResponse_QNAME, ExportAssetResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAgentList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAgentList") + public JAXBElement createGetAgentList(GetAgentList value) { + return new JAXBElement(_GetAgentList_QNAME, GetAgentList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DeleteAssetResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "deleteAssetResponse") + public JAXBElement createDeleteAssetResponse(DeleteAssetResponse value) { + return new JAXBElement(_DeleteAssetResponse_QNAME, DeleteAssetResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetWatchFolderListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getWatchFolderListResponse") + public JAXBElement createGetWatchFolderListResponse(GetWatchFolderListResponse value) { + return new JAXBElement(_GetWatchFolderListResponse_QNAME, GetWatchFolderListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAssetResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAssetResponse") + public JAXBElement createGetAssetResponse(GetAssetResponse value) { + return new JAXBElement(_GetAssetResponse_QNAME, GetAssetResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJobList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJobList") + public JAXBElement createGetScheduledJobList(GetScheduledJobList value) { + return new JAXBElement(_GetScheduledJobList_QNAME, GetScheduledJobList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AddResourceToGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "addResourceToGroup") + public JAXBElement createAddResourceToGroup(AddResourceToGroup value) { + return new JAXBElement(_AddResourceToGroup_QNAME, AddResourceToGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ExportAsset }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "exportAsset") + public JAXBElement createExportAsset(ExportAsset value) { + return new JAXBElement(_ExportAsset_QNAME, ExportAsset.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DataTypeBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "dataType") + public JAXBElement createDataType(DataTypeBean value) { + return new JAXBElement(_DataType_QNAME, DataTypeBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ModifyScheduledJobResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "modifyScheduledJobResponse") + public JAXBElement createModifyScheduledJobResponse(ModifyScheduledJobResponse value) { + return new JAXBElement(_ModifyScheduledJobResponse_QNAME, ModifyScheduledJobResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SourceBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "source") + public JAXBElement createSource(SourceBean value) { + return new JAXBElement(_Source_QNAME, SourceBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetProject }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getProject") + public JAXBElement createGetProject(GetProject value) { + return new JAXBElement(_GetProject_QNAME, GetProject.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CreateGroupResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "createGroupResponse") + public JAXBElement createCreateGroupResponse(CreateGroupResponse value) { + return new JAXBElement(_CreateGroupResponse_QNAME, CreateGroupResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetJobResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getJobResponse") + public JAXBElement createGetJobResponse(GetJobResponse value) { + return new JAXBElement(_GetJobResponse_QNAME, GetJobResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAgentListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAgentListResponse") + public JAXBElement createGetAgentListResponse(GetAgentListResponse value) { + return new JAXBElement(_GetAgentListResponse_QNAME, GetAgentListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ModifyAssetResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "modifyAssetResponse") + public JAXBElement createModifyAssetResponse(ModifyAssetResponse value) { + return new JAXBElement(_ModifyAssetResponse_QNAME, ModifyAssetResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTranscodeTask }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTranscodeTask") + public JAXBElement createGetTranscodeTask(GetTranscodeTask value) { + return new JAXBElement(_GetTranscodeTask_QNAME, GetTranscodeTask.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ClipBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "clip") + public JAXBElement createClip(ClipBean value) { + return new JAXBElement(_Clip_QNAME, ClipBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ExtendedClipList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "extendedClipList") + public JAXBElement createExtendedClipList(ExtendedClipList value) { + return new JAXBElement(_ExtendedClipList_QNAME, ExtendedClipList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TaskBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "task") + public JAXBElement createTask(TaskBean value) { + return new JAXBElement(_Task_QNAME, TaskBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetResourceOnline }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setResourceOnline") + public JAXBElement createSetResourceOnline(SetResourceOnline value) { + return new JAXBElement(_SetResourceOnline_QNAME, SetResourceOnline.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TrackBean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "track") + public JAXBElement createTrack(TrackBean value) { + return new JAXBElement(_Track_QNAME, TrackBean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetTranscodeTaskPriority }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setTranscodeTaskPriority") + public JAXBElement createSetTranscodeTaskPriority(SetTranscodeTaskPriority value) { + return new JAXBElement(_SetTranscodeTaskPriority_QNAME, SetTranscodeTaskPriority.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CancelTranscodeTask }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "cancelTranscodeTask") + public JAXBElement createCancelTranscodeTask(CancelTranscodeTask value) { + return new JAXBElement(_CancelTranscodeTask_QNAME, CancelTranscodeTask.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAssetProfiles }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAssetProfiles") + public JAXBElement createGetAssetProfiles(GetAssetProfiles value) { + return new JAXBElement(_GetAssetProfiles_QNAME, GetAssetProfiles.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CreateGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "createGroup") + public JAXBElement createCreateGroup(CreateGroup value) { + return new JAXBElement(_CreateGroup_QNAME, CreateGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetQCServiceListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getQCServiceListResponse") + public JAXBElement createGetQCServiceListResponse(GetQCServiceListResponse value) { + return new JAXBElement(_GetQCServiceListResponse_QNAME, GetQCServiceListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetGroupListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getGroupListResponse") + public JAXBElement createGetGroupListResponse(GetGroupListResponse value) { + return new JAXBElement(_GetGroupListResponse_QNAME, GetGroupListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTimeZoneResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTimeZoneResponse") + public JAXBElement createGetTimeZoneResponse(GetTimeZoneResponse value) { + return new JAXBElement(_GetTimeZoneResponse_QNAME, GetTimeZoneResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJob }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJob") + public JAXBElement createGetScheduledJob(GetScheduledJob value) { + return new JAXBElement(_GetScheduledJob_QNAME, GetScheduledJob.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link FindAssetsResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "findAssetsResponse") + public JAXBElement createFindAssetsResponse(FindAssetsResponse value) { + return new JAXBElement(_FindAssetsResponse_QNAME, FindAssetsResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getGroup") + public JAXBElement createGetGroup(GetGroup value) { + return new JAXBElement(_GetGroup_QNAME, GetGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetQCServiceList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getQCServiceList") + public JAXBElement createGetQCServiceList(GetQCServiceList value) { + return new JAXBElement(_GetQCServiceList_QNAME, GetQCServiceList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetQCService }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getQCService") + public JAXBElement createGetQCService(GetQCService value) { + return new JAXBElement(_GetQCService_QNAME, GetQCService.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetRuntimeEnvironmentForGroup }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setRuntimeEnvironmentForGroup") + public JAXBElement createSetRuntimeEnvironmentForGroup(SetRuntimeEnvironmentForGroup value) { + return new JAXBElement(_SetRuntimeEnvironmentForGroup_QNAME, SetRuntimeEnvironmentForGroup.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetActiveJobsList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getActiveJobsList") + public JAXBElement createGetActiveJobsList(GetActiveJobsList value) { + return new JAXBElement(_GetActiveJobsList_QNAME, GetActiveJobsList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJobListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJobListResponse") + public JAXBElement createGetScheduledJobListResponse(GetScheduledJobListResponse value) { + return new JAXBElement(_GetScheduledJobListResponse_QNAME, GetScheduledJobListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetGroupRuntimeEnvironmentResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setGroupRuntimeEnvironmentResponse") + public JAXBElement createSetGroupRuntimeEnvironmentResponse(SetGroupRuntimeEnvironmentResponse value) { + return new JAXBElement(_SetGroupRuntimeEnvironmentResponse_QNAME, SetGroupRuntimeEnvironmentResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetJobsForTranscodeTaskResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getJobsForTranscodeTaskResponse") + public JAXBElement createGetJobsForTranscodeTaskResponse(GetJobsForTranscodeTaskResponse value) { + return new JAXBElement(_GetJobsForTranscodeTaskResponse_QNAME, GetJobsForTranscodeTaskResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetGroupRuntimeEnvironment }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setGroupRuntimeEnvironment") + public JAXBElement createSetGroupRuntimeEnvironment(SetGroupRuntimeEnvironment value) { + return new JAXBElement(_SetGroupRuntimeEnvironment_QNAME, SetGroupRuntimeEnvironment.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAsset }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAsset") + public JAXBElement createGetAsset(GetAsset value) { + return new JAXBElement(_GetAsset_QNAME, GetAsset.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTranscodeRequestResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTranscodeRequestResponse") + public JAXBElement createGetTranscodeRequestResponse(GetTranscodeRequestResponse value) { + return new JAXBElement(_GetTranscodeRequestResponse_QNAME, GetTranscodeRequestResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AddResourceToGroupResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "addResourceToGroupResponse") + public JAXBElement createAddResourceToGroupResponse(AddResourceToGroupResponse value) { + return new JAXBElement(_AddResourceToGroupResponse_QNAME, AddResourceToGroupResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetMediaProperties }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getMediaProperties") + public JAXBElement createGetMediaProperties(GetMediaProperties value) { + return new JAXBElement(_GetMediaProperties_QNAME, GetMediaProperties.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAssetProfilesResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAssetProfilesResponse") + public JAXBElement createGetAssetProfilesResponse(GetAssetProfilesResponse value) { + return new JAXBElement(_GetAssetProfilesResponse_QNAME, GetAssetProfilesResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetDomain }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getDomain") + public JAXBElement createGetDomain(GetDomain value) { + return new JAXBElement(_GetDomain_QNAME, GetDomain.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetWatchFolderList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getWatchFolderList") + public JAXBElement createGetWatchFolderList(GetWatchFolderList value) { + return new JAXBElement(_GetWatchFolderList_QNAME, GetWatchFolderList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AddScheduledJobResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "addScheduledJobResponse") + public JAXBElement createAddScheduledJobResponse(AddScheduledJobResponse value) { + return new JAXBElement(_AddScheduledJobResponse_QNAME, AddScheduledJobResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SubmitTranscodeTaskResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "submitTranscodeTaskResponse") + public JAXBElement createSubmitTranscodeTaskResponse(SubmitTranscodeTaskResponse value) { + return new JAXBElement(_SubmitTranscodeTaskResponse_QNAME, SubmitTranscodeTaskResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetQCTaskResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getQCTaskResponse") + public JAXBElement createGetQCTaskResponse(GetQCTaskResponse value) { + return new JAXBElement(_GetQCTaskResponse_QNAME, GetQCTaskResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTranscodeTaskForJobResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTranscodeTaskForJobResponse") + public JAXBElement createGetTranscodeTaskForJobResponse(GetTranscodeTaskForJobResponse value) { + return new JAXBElement(_GetTranscodeTaskForJobResponse_QNAME, GetTranscodeTaskForJobResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AddScheduledJob }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "addScheduledJob") + public JAXBElement createAddScheduledJob(AddScheduledJob value) { + return new JAXBElement(_AddScheduledJob_QNAME, AddScheduledJob.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CancelJob }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "cancelJob") + public JAXBElement createCancelJob(CancelJob value) { + return new JAXBElement(_CancelJob_QNAME, CancelJob.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetVersion }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getVersion") + public JAXBElement createGetVersion(GetVersion value) { + return new JAXBElement(_GetVersion_QNAME, GetVersion.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DeleteScheduledJobResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "deleteScheduledJobResponse") + public JAXBElement createDeleteScheduledJobResponse(DeleteScheduledJobResponse value) { + return new JAXBElement(_DeleteScheduledJobResponse_QNAME, DeleteScheduledJobResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetMetadataDefinition }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getMetadataDefinition") + public JAXBElement createGetMetadataDefinition(GetMetadataDefinition value) { + return new JAXBElement(_GetMetadataDefinition_QNAME, GetMetadataDefinition.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetResourceResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getResourceResponse") + public JAXBElement createGetResourceResponse(GetResourceResponse value) { + return new JAXBElement(_GetResourceResponse_QNAME, GetResourceResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTimeZone }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTimeZone") + public JAXBElement createGetTimeZone(GetTimeZone value) { + return new JAXBElement(_GetTimeZone_QNAME, GetTimeZone.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CancelTranscodeTaskResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "cancelTranscodeTaskResponse") + public JAXBElement createCancelTranscodeTaskResponse(CancelTranscodeTaskResponse value) { + return new JAXBElement(_CancelTranscodeTaskResponse_QNAME, CancelTranscodeTaskResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetTranscodeRequest }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getTranscodeRequest") + public JAXBElement createGetTranscodeRequest(GetTranscodeRequest value) { + return new JAXBElement(_GetTranscodeRequest_QNAME, GetTranscodeRequest.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetQCServiceResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getQCServiceResponse") + public JAXBElement createGetQCServiceResponse(GetQCServiceResponse value) { + return new JAXBElement(_GetQCServiceResponse_QNAME, GetQCServiceResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetMetadataDefinitionResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getMetadataDefinitionResponse") + public JAXBElement createGetMetadataDefinitionResponse(GetMetadataDefinitionResponse value) { + return new JAXBElement(_GetMetadataDefinitionResponse_QNAME, GetMetadataDefinitionResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link MoveFileSnapshotFile }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "moveFileSnapshotFile") + public JAXBElement createMoveFileSnapshotFile(MoveFileSnapshotFile value) { + return new JAXBElement(_MoveFileSnapshotFile_QNAME, MoveFileSnapshotFile.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetGroupList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getGroupList") + public JAXBElement createGetGroupList(GetGroupList value) { + return new JAXBElement(_GetGroupList_QNAME, GetGroupList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CreateResourceOnAgent }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "createResourceOnAgent") + public JAXBElement createCreateResourceOnAgent(CreateResourceOnAgent value) { + return new JAXBElement(_CreateResourceOnAgent_QNAME, CreateResourceOnAgent.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AddAssetResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "addAssetResponse") + public JAXBElement createAddAssetResponse(AddAssetResponse value) { + return new JAXBElement(_AddAssetResponse_QNAME, AddAssetResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetGroupResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getGroupResponse") + public JAXBElement createGetGroupResponse(GetGroupResponse value) { + return new JAXBElement(_GetGroupResponse_QNAME, GetGroupResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJobStatusResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJobStatusResponse") + public JAXBElement createGetScheduledJobStatusResponse(GetScheduledJobStatusResponse value) { + return new JAXBElement(_GetScheduledJobStatusResponse_QNAME, GetScheduledJobStatusResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetResourceList }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getResourceList") + public JAXBElement createGetResourceList(GetResourceList value) { + return new JAXBElement(_GetResourceList_QNAME, GetResourceList.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetActiveJobsListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getActiveJobsListResponse") + public JAXBElement createGetActiveJobsListResponse(GetActiveJobsListResponse value) { + return new JAXBElement(_GetActiveJobsListResponse_QNAME, GetActiveJobsListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CancelJobResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "cancelJobResponse") + public JAXBElement createCancelJobResponse(CancelJobResponse value) { + return new JAXBElement(_CancelJobResponse_QNAME, CancelJobResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link CreateResourceOnAgentResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "createResourceOnAgentResponse") + public JAXBElement createCreateResourceOnAgentResponse(CreateResourceOnAgentResponse value) { + return new JAXBElement(_CreateResourceOnAgentResponse_QNAME, CreateResourceOnAgentResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AddAsset }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "addAsset") + public JAXBElement createAddAsset(AddAsset value) { + return new JAXBElement(_AddAsset_QNAME, AddAsset.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetName }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getName") + public JAXBElement createGetName(GetName value) { + return new JAXBElement(_GetName_QNAME, GetName.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link FindTranscodeTasksResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "findTranscodeTasksResponse") + public JAXBElement createFindTranscodeTasksResponse(FindTranscodeTasksResponse value) { + return new JAXBElement(_FindTranscodeTasksResponse_QNAME, FindTranscodeTasksResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SubmitTranscodeTask }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "submitTranscodeTask") + public JAXBElement createSubmitTranscodeTask(SubmitTranscodeTask value) { + return new JAXBElement(_SubmitTranscodeTask_QNAME, SubmitTranscodeTask.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJobResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJobResponse") + public JAXBElement createGetScheduledJobResponse(GetScheduledJobResponse value) { + return new JAXBElement(_GetScheduledJobResponse_QNAME, GetScheduledJobResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAbout }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAbout") + public JAXBElement createGetAbout(GetAbout value) { + return new JAXBElement(_GetAbout_QNAME, GetAbout.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetScheduledJobStatusListResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getScheduledJobStatusListResponse") + public JAXBElement createGetScheduledJobStatusListResponse(GetScheduledJobStatusListResponse value) { + return new JAXBElement(_GetScheduledJobStatusListResponse_QNAME, GetScheduledJobStatusListResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetAboutResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "getAboutResponse") + public JAXBElement createGetAboutResponse(GetAboutResponse value) { + return new JAXBElement(_GetAboutResponse_QNAME, GetAboutResponse.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SetTranscodeTaskPriorityResponse }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://ws.server.mediamanager.digitalrapids.ca/", name = "setTranscodeTaskPriorityResponse") + public JAXBElement createSetTranscodeTaskPriorityResponse(SetTranscodeTaskPriorityResponse value) { + return new JAXBElement(_SetTranscodeTaskPriorityResponse_QNAME, SetTranscodeTaskPriorityResponse.class, null, value); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/OutputBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/OutputBean.java new file mode 100644 index 00000000..a20ad1fe --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/OutputBean.java @@ -0,0 +1,213 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for outputBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="outputBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="pinDataType" type="{http://ws.server.mediamanager.digitalrapids.ca/}dataTypeBean" minOccurs="0"/>
+ *         <element name="rules" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="rule" type="{http://ws.server.mediamanager.digitalrapids.ca/}ruleBean" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "outputBean", propOrder = { + "pinDataType", + "rules" +}) +public class OutputBean { + + protected DataTypeBean pinDataType; + protected OutputBean.Rules rules; + @XmlAttribute(name = "id", required = true) + protected String id; + @XmlAttribute(name = "name") + protected String name; + + /** + * Gets the value of the pinDataType property. + * + * @return + * possible object is + * {@link DataTypeBean } + * + */ + public DataTypeBean getPinDataType() { + return pinDataType; + } + + /** + * Sets the value of the pinDataType property. + * + * @param value + * allowed object is + * {@link DataTypeBean } + * + */ + public void setPinDataType(DataTypeBean value) { + this.pinDataType = value; + } + + /** + * Gets the value of the rules property. + * + * @return + * possible object is + * {@link OutputBean.Rules } + * + */ + public OutputBean.Rules getRules() { + return rules; + } + + /** + * Sets the value of the rules property. + * + * @param value + * allowed object is + * {@link OutputBean.Rules } + * + */ + public void setRules(OutputBean.Rules value) { + this.rules = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="rule" type="{http://ws.server.mediamanager.digitalrapids.ca/}ruleBean" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "rule" + }) + public static class Rules { + + protected List rule; + + /** + * Gets the value of the rule property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the rule property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getRule().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link RuleBean } + * + * + */ + public List getRule() { + if (rule == null) { + rule = new ArrayList(); + } + return this.rule; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/PropertiesSet.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/PropertiesSet.java new file mode 100644 index 00000000..41766bbe --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/PropertiesSet.java @@ -0,0 +1,67 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for propertiesSet complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="propertiesSet">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="property" type="{http://ws.server.mediamanager.digitalrapids.ca/}property" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "propertiesSet", propOrder = { + "property" +}) +public class PropertiesSet { + + protected List property; + + /** + * Gets the value of the property property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the property property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getProperty().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Property } + * + * + */ + public List getProperty() { + if (property == null) { + property = new ArrayList(); + } + return this.property; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Property.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Property.java new file mode 100644 index 00000000..7d8f4694 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Property.java @@ -0,0 +1,115 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for property complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="property">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="extendedValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="propertyPath" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "property", propOrder = { + "extendedValue" +}) +public class Property { + + protected String extendedValue; + @XmlAttribute(name = "propertyPath", required = true) + protected String propertyPath; + @XmlAttribute(name = "value") + protected String value; + + /** + * Gets the value of the extendedValue property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getExtendedValue() { + return extendedValue; + } + + /** + * Sets the value of the extendedValue property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setExtendedValue(String value) { + this.extendedValue = value; + } + + /** + * Gets the value of the propertyPath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPropertyPath() { + return propertyPath; + } + + /** + * Sets the value of the propertyPath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPropertyPath(String value) { + this.propertyPath = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/PropertyBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/PropertyBean.java new file mode 100644 index 00000000..be4a074d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/PropertyBean.java @@ -0,0 +1,89 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for propertyBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="propertyBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "propertyBean", propOrder = { + "name", + "value" +}) +public class PropertyBean { + + @XmlElement(required = true) + protected String name; + protected String value; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcJob.java new file mode 100644 index 00000000..2a153b2d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcJob.java @@ -0,0 +1,204 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="qcJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="foreignId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="status" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcStatus" minOccurs="0"/>
+ *         <element name="result" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcResult" minOccurs="0"/>
+ *         <element name="percentComplete" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="files" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="rawResponse" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "qcJob", propOrder = { + "foreignId", + "status", + "result", + "percentComplete", + "files", + "rawResponse" +}) +public class QcJob { + + protected String foreignId; + protected QcStatus status; + protected QcResult result; + protected Integer percentComplete; + @XmlElement(nillable = true) + protected List files; + protected String rawResponse; + + /** + * Gets the value of the foreignId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getForeignId() { + return foreignId; + } + + /** + * Sets the value of the foreignId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setForeignId(String value) { + this.foreignId = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link QcStatus } + * + */ + public QcStatus getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link QcStatus } + * + */ + public void setStatus(QcStatus value) { + this.status = value; + } + + /** + * Gets the value of the result property. + * + * @return + * possible object is + * {@link QcResult } + * + */ + public QcResult getResult() { + return result; + } + + /** + * Sets the value of the result property. + * + * @param value + * allowed object is + * {@link QcResult } + * + */ + public void setResult(QcResult value) { + this.result = value; + } + + /** + * Gets the value of the percentComplete property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getPercentComplete() { + return percentComplete; + } + + /** + * Sets the value of the percentComplete property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setPercentComplete(Integer value) { + this.percentComplete = value; + } + + /** + * Gets the value of the files property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the files property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFiles().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getFiles() { + if (files == null) { + files = new ArrayList(); + } + return this.files; + } + + /** + * Gets the value of the rawResponse property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRawResponse() { + return rawResponse; + } + + /** + * Sets the value of the rawResponse property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRawResponse(String value) { + this.rawResponse = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcOptions.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcOptions.java new file mode 100644 index 00000000..5bf9aa55 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcOptions.java @@ -0,0 +1,120 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcOptions complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="qcOptions">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="passLevel" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcResult" minOccurs="0"/>
+ *         <element name="serviceId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="unavailabilityStrategy" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcUnavailabilityStrategy" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "qcOptions", propOrder = { + "passLevel", + "serviceId", + "unavailabilityStrategy" +}) +@XmlSeeAlso({ + BatonOptions.class, + VidcheckerOptions.class, + CerifyOptions.class +}) +public abstract class QcOptions { + + protected QcResult passLevel; + protected String serviceId; + protected QcUnavailabilityStrategy unavailabilityStrategy; + + /** + * Gets the value of the passLevel property. + * + * @return + * possible object is + * {@link QcResult } + * + */ + public QcResult getPassLevel() { + return passLevel; + } + + /** + * Sets the value of the passLevel property. + * + * @param value + * allowed object is + * {@link QcResult } + * + */ + public void setPassLevel(QcResult value) { + this.passLevel = value; + } + + /** + * Gets the value of the serviceId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getServiceId() { + return serviceId; + } + + /** + * Sets the value of the serviceId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setServiceId(String value) { + this.serviceId = value; + } + + /** + * Gets the value of the unavailabilityStrategy property. + * + * @return + * possible object is + * {@link QcUnavailabilityStrategy } + * + */ + public QcUnavailabilityStrategy getUnavailabilityStrategy() { + return unavailabilityStrategy; + } + + /** + * Sets the value of the unavailabilityStrategy property. + * + * @param value + * allowed object is + * {@link QcUnavailabilityStrategy } + * + */ + public void setUnavailabilityStrategy(QcUnavailabilityStrategy value) { + this.unavailabilityStrategy = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcResult.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcResult.java new file mode 100644 index 00000000..4f5c157a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcResult.java @@ -0,0 +1,42 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcResult. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="qcResult">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="PASSED"/>
+ *     <enumeration value="WARNINGS"/>
+ *     <enumeration value="FAILED"/>
+ *     <enumeration value="FATAL"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "qcResult") +@XmlEnum +public enum QcResult { + + PASSED, + WARNINGS, + FAILED, + FATAL; + + public String value() { + return name(); + } + + public static QcResult fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcService.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcService.java new file mode 100644 index 00000000..5d6cc9c9 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcService.java @@ -0,0 +1,146 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcService complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="qcService">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="location" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="status" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcServiceStatus" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "qcService", propOrder = { + "id", + "name", + "location", + "status" +}) +@XmlSeeAlso({ + CerifyService.class, + BatonService.class +}) +public abstract class QcService { + + protected String id; + protected String name; + protected String location; + protected QcServiceStatus status; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the location property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLocation() { + return location; + } + + /** + * Sets the value of the location property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLocation(String value) { + this.location = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link QcServiceStatus } + * + */ + public QcServiceStatus getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link QcServiceStatus } + * + */ + public void setStatus(QcServiceStatus value) { + this.status = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcServiceStatus.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcServiceStatus.java new file mode 100644 index 00000000..1ff25e82 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcServiceStatus.java @@ -0,0 +1,38 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcServiceStatus. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="qcServiceStatus">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="AVAILABLE"/>
+ *     <enumeration value="ERROR"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "qcServiceStatus") +@XmlEnum +public enum QcServiceStatus { + + AVAILABLE, + ERROR; + + public String value() { + return name(); + } + + public static QcServiceStatus fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcStatus.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcStatus.java new file mode 100644 index 00000000..f782e85b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcStatus.java @@ -0,0 +1,46 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcStatus. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="qcStatus">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="INIT"/>
+ *     <enumeration value="PENDING"/>
+ *     <enumeration value="RUNNING"/>
+ *     <enumeration value="COMPLETE"/>
+ *     <enumeration value="ERROR"/>
+ *     <enumeration value="CANCELLED"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "qcStatus") +@XmlEnum +public enum QcStatus { + + INIT, + PENDING, + RUNNING, + COMPLETE, + ERROR, + CANCELLED; + + public String value() { + return name(); + } + + public static QcStatus fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcTask.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcTask.java new file mode 100644 index 00000000..ea60acaf --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcTask.java @@ -0,0 +1,207 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcTask complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="qcTask">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="status" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcStatus" minOccurs="0"/>
+ *         <element name="result" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcResult" minOccurs="0"/>
+ *         <element name="percentComplete" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="file" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="options" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcOptions" minOccurs="0"/>
+ *         <element name="jobs" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcJob" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "qcTask", propOrder = { + "status", + "result", + "percentComplete", + "file", + "options", + "jobs" +}) +public class QcTask { + + protected QcStatus status; + protected QcResult result; + protected Integer percentComplete; + protected List file; + protected QcOptions options; + protected List jobs; + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link QcStatus } + * + */ + public QcStatus getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link QcStatus } + * + */ + public void setStatus(QcStatus value) { + this.status = value; + } + + /** + * Gets the value of the result property. + * + * @return + * possible object is + * {@link QcResult } + * + */ + public QcResult getResult() { + return result; + } + + /** + * Sets the value of the result property. + * + * @param value + * allowed object is + * {@link QcResult } + * + */ + public void setResult(QcResult value) { + this.result = value; + } + + /** + * Gets the value of the percentComplete property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getPercentComplete() { + return percentComplete; + } + + /** + * Sets the value of the percentComplete property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setPercentComplete(Integer value) { + this.percentComplete = value; + } + + /** + * Gets the value of the file property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the file property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFile().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getFile() { + if (file == null) { + file = new ArrayList(); + } + return this.file; + } + + /** + * Gets the value of the options property. + * + * @return + * possible object is + * {@link QcOptions } + * + */ + public QcOptions getOptions() { + return options; + } + + /** + * Sets the value of the options property. + * + * @param value + * allowed object is + * {@link QcOptions } + * + */ + public void setOptions(QcOptions value) { + this.options = value; + } + + /** + * Gets the value of the jobs property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the jobs property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getJobs().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link QcJob } + * + * + */ + public List getJobs() { + if (jobs == null) { + jobs = new ArrayList(); + } + return this.jobs; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcUnavailabilityStrategy.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcUnavailabilityStrategy.java new file mode 100644 index 00000000..2dbe522c --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/QcUnavailabilityStrategy.java @@ -0,0 +1,38 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for qcUnavailabilityStrategy. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="qcUnavailabilityStrategy">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="FAIL"/>
+ *     <enumeration value="BYPASS"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "qcUnavailabilityStrategy") +@XmlEnum +public enum QcUnavailabilityStrategy { + + FAIL, + BYPASS; + + public String value() { + return name(); + } + + public static QcUnavailabilityStrategy fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RepeatMode.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RepeatMode.java new file mode 100644 index 00000000..d3d971a2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RepeatMode.java @@ -0,0 +1,42 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for repeatMode. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="repeatMode">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="DAILY"/>
+ *     <enumeration value="DAILY_MON_TO_FRI"/>
+ *     <enumeration value="WEEKLY"/>
+ *     <enumeration value="CUSTOM_INTERVAL"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "repeatMode") +@XmlEnum +public enum RepeatMode { + + DAILY, + DAILY_MON_TO_FRI, + WEEKLY, + CUSTOM_INTERVAL; + + public String value() { + return name(); + } + + public static RepeatMode fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Resource.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Resource.java new file mode 100644 index 00000000..475469f1 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Resource.java @@ -0,0 +1,465 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for resource complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="resource">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="displayName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="role" type="{http://ws.server.mediamanager.digitalrapids.ca/}roleEnum" minOccurs="0"/>
+ *         <element name="status" type="{http://ws.server.mediamanager.digitalrapids.ca/}statusEnum" minOccurs="0"/>
+ *         <element name="offline" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="agentId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="host" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="failoverForResourceId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="routerInfoId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="routerOutput" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="projectName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="droppedFrameCount" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="videoTimestamp" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="audioTimestamp" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="cpuUsage" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "resource", propOrder = { + "id", + "displayName", + "role", + "status", + "offline", + "groupId", + "agentId", + "host", + "failoverForResourceId", + "routerInfoId", + "routerOutput", + "projectName", + "droppedFrameCount", + "videoTimestamp", + "audioTimestamp", + "cpuUsage" +}) +public class Resource { + + protected String id; + protected String displayName; + protected RoleEnum role; + protected StatusEnum status; + protected Boolean offline; + protected String groupId; + protected String agentId; + protected String host; + protected String failoverForResourceId; + protected String routerInfoId; + protected Integer routerOutput; + protected String projectName; + protected Integer droppedFrameCount; + protected Integer videoTimestamp; + protected Integer audioTimestamp; + protected Integer cpuUsage; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the displayName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDisplayName() { + return displayName; + } + + /** + * Sets the value of the displayName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDisplayName(String value) { + this.displayName = value; + } + + /** + * Gets the value of the role property. + * + * @return + * possible object is + * {@link RoleEnum } + * + */ + public RoleEnum getRole() { + return role; + } + + /** + * Sets the value of the role property. + * + * @param value + * allowed object is + * {@link RoleEnum } + * + */ + public void setRole(RoleEnum value) { + this.role = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link StatusEnum } + * + */ + public StatusEnum getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link StatusEnum } + * + */ + public void setStatus(StatusEnum value) { + this.status = value; + } + + /** + * Gets the value of the offline property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isOffline() { + return offline; + } + + /** + * Sets the value of the offline property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setOffline(Boolean value) { + this.offline = value; + } + + /** + * Gets the value of the groupId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroupId(String value) { + this.groupId = value; + } + + /** + * Gets the value of the agentId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAgentId() { + return agentId; + } + + /** + * Sets the value of the agentId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAgentId(String value) { + this.agentId = value; + } + + /** + * Gets the value of the host property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getHost() { + return host; + } + + /** + * Sets the value of the host property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHost(String value) { + this.host = value; + } + + /** + * Gets the value of the failoverForResourceId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFailoverForResourceId() { + return failoverForResourceId; + } + + /** + * Sets the value of the failoverForResourceId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFailoverForResourceId(String value) { + this.failoverForResourceId = value; + } + + /** + * Gets the value of the routerInfoId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getRouterInfoId() { + return routerInfoId; + } + + /** + * Sets the value of the routerInfoId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRouterInfoId(String value) { + this.routerInfoId = value; + } + + /** + * Gets the value of the routerOutput property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getRouterOutput() { + return routerOutput; + } + + /** + * Sets the value of the routerOutput property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setRouterOutput(Integer value) { + this.routerOutput = value; + } + + /** + * Gets the value of the projectName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProjectName() { + return projectName; + } + + /** + * Sets the value of the projectName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProjectName(String value) { + this.projectName = value; + } + + /** + * Gets the value of the droppedFrameCount property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getDroppedFrameCount() { + return droppedFrameCount; + } + + /** + * Sets the value of the droppedFrameCount property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setDroppedFrameCount(Integer value) { + this.droppedFrameCount = value; + } + + /** + * Gets the value of the videoTimestamp property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getVideoTimestamp() { + return videoTimestamp; + } + + /** + * Sets the value of the videoTimestamp property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setVideoTimestamp(Integer value) { + this.videoTimestamp = value; + } + + /** + * Gets the value of the audioTimestamp property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getAudioTimestamp() { + return audioTimestamp; + } + + /** + * Sets the value of the audioTimestamp property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setAudioTimestamp(Integer value) { + this.audioTimestamp = value; + } + + /** + * Gets the value of the cpuUsage property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getCpuUsage() { + return cpuUsage; + } + + /** + * Sets the value of the cpuUsage property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setCpuUsage(Integer value) { + this.cpuUsage = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ResourceProperty.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ResourceProperty.java new file mode 100644 index 00000000..feae1687 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ResourceProperty.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for resourceProperty complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="resourceProperty">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "resourceProperty", propOrder = { + "name", + "value" +}) +public class ResourceProperty { + + protected String name; + protected String value; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ResourcePropertyList.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ResourcePropertyList.java new file mode 100644 index 00000000..36e0b16b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ResourcePropertyList.java @@ -0,0 +1,67 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for resourcePropertyList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="resourcePropertyList">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="resourceProperty" type="{http://ws.server.mediamanager.digitalrapids.ca/}resourceProperty" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "resourcePropertyList", propOrder = { + "resourceProperty" +}) +public class ResourcePropertyList { + + protected List resourceProperty; + + /** + * Gets the value of the resourceProperty property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the resourceProperty property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getResourceProperty().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ResourceProperty } + * + * + */ + public List getResourceProperty() { + if (resourceProperty == null) { + resourceProperty = new ArrayList(); + } + return this.resourceProperty; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RoleEnum.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RoleEnum.java new file mode 100644 index 00000000..a8e37387 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RoleEnum.java @@ -0,0 +1,82 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for roleEnum. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="roleEnum">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="ROLE_TRANSCODE"/>
+ *     <enumeration value="ROLE_LIVE_STREAM"/>
+ *     <enumeration value="ROLE_DISTRIBUTION"/>
+ *     <enumeration value="ROLE_KAYAK_TRANSCODE"/>
+ *     <enumeration value="ROLE_LIVE_STREAM_IP"/>
+ *     <enumeration value="ROLE_SUBURBAN_8000D"/>
+ *     <enumeration value="ROLE_SUBURBAN_8000IP"/>
+ *     <enumeration value="ROLE_SUBURBAN_8000ASI"/>
+ *     <enumeration value="ROLE_SUBURBAN_6000D"/>
+ *     <enumeration value="ROLE_SUBURBAN_6000IP"/>
+ *     <enumeration value="ROLE_SUBURBAN_6000ASI"/>
+ *     <enumeration value="ROLE_SUBURBAN_4000D"/>
+ *     <enumeration value="ROLE_SUBURBAN_4000IP"/>
+ *     <enumeration value="ROLE_SUBURBAN_4000ASI"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "roleEnum") +@XmlEnum +public enum RoleEnum { + + ROLE_TRANSCODE("ROLE_TRANSCODE"), + ROLE_LIVE_STREAM("ROLE_LIVE_STREAM"), + ROLE_DISTRIBUTION("ROLE_DISTRIBUTION"), + ROLE_KAYAK_TRANSCODE("ROLE_KAYAK_TRANSCODE"), + ROLE_LIVE_STREAM_IP("ROLE_LIVE_STREAM_IP"), + @XmlEnumValue("ROLE_SUBURBAN_8000D") + ROLE_SUBURBAN_8000_D("ROLE_SUBURBAN_8000D"), + @XmlEnumValue("ROLE_SUBURBAN_8000IP") + ROLE_SUBURBAN_8000_IP("ROLE_SUBURBAN_8000IP"), + @XmlEnumValue("ROLE_SUBURBAN_8000ASI") + ROLE_SUBURBAN_8000_ASI("ROLE_SUBURBAN_8000ASI"), + @XmlEnumValue("ROLE_SUBURBAN_6000D") + ROLE_SUBURBAN_6000_D("ROLE_SUBURBAN_6000D"), + @XmlEnumValue("ROLE_SUBURBAN_6000IP") + ROLE_SUBURBAN_6000_IP("ROLE_SUBURBAN_6000IP"), + @XmlEnumValue("ROLE_SUBURBAN_6000ASI") + ROLE_SUBURBAN_6000_ASI("ROLE_SUBURBAN_6000ASI"), + @XmlEnumValue("ROLE_SUBURBAN_4000D") + ROLE_SUBURBAN_4000_D("ROLE_SUBURBAN_4000D"), + @XmlEnumValue("ROLE_SUBURBAN_4000IP") + ROLE_SUBURBAN_4000_IP("ROLE_SUBURBAN_4000IP"), + @XmlEnumValue("ROLE_SUBURBAN_4000ASI") + ROLE_SUBURBAN_4000_ASI("ROLE_SUBURBAN_4000ASI"); + private final String value; + + RoleEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + public static RoleEnum fromValue(String v) { + for (RoleEnum c: RoleEnum.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RuleBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RuleBean.java new file mode 100644 index 00000000..395d328e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RuleBean.java @@ -0,0 +1,158 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ruleBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ruleBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="dataType" type="{http://ws.server.mediamanager.digitalrapids.ca/}dataTypeBean" minOccurs="0"/>
+ *         <element name="tasks" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="task" type="{http://ws.server.mediamanager.digitalrapids.ca/}taskBean" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ruleBean", propOrder = { + "dataType", + "tasks" +}) +public class RuleBean { + + protected DataTypeBean dataType; + protected RuleBean.Tasks tasks; + + /** + * Gets the value of the dataType property. + * + * @return + * possible object is + * {@link DataTypeBean } + * + */ + public DataTypeBean getDataType() { + return dataType; + } + + /** + * Sets the value of the dataType property. + * + * @param value + * allowed object is + * {@link DataTypeBean } + * + */ + public void setDataType(DataTypeBean value) { + this.dataType = value; + } + + /** + * Gets the value of the tasks property. + * + * @return + * possible object is + * {@link RuleBean.Tasks } + * + */ + public RuleBean.Tasks getTasks() { + return tasks; + } + + /** + * Sets the value of the tasks property. + * + * @param value + * allowed object is + * {@link RuleBean.Tasks } + * + */ + public void setTasks(RuleBean.Tasks value) { + this.tasks = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="task" type="{http://ws.server.mediamanager.digitalrapids.ca/}taskBean" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "task" + }) + public static class Tasks { + + protected List task; + + /** + * Gets the value of the task property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the task property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getTask().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TaskBean } + * + * + */ + public List getTask() { + if (task == null) { + task = new ArrayList(); + } + return this.task; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RunResult.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RunResult.java new file mode 100644 index 00000000..a3e79557 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RunResult.java @@ -0,0 +1,54 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for runResult. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="runResult">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="Success"/>
+ *     <enumeration value="Warning"/>
+ *     <enumeration value="Failure"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "runResult") +@XmlEnum +public enum RunResult { + + @XmlEnumValue("Success") + SUCCESS("Success"), + @XmlEnumValue("Warning") + WARNING("Warning"), + @XmlEnumValue("Failure") + FAILURE("Failure"); + private final String value; + + RunResult(String v) { + value = v; + } + + public String value() { + return value; + } + + public static RunResult fromValue(String v) { + for (RunResult c: RunResult.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RuntimeEnvironment.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RuntimeEnvironment.java new file mode 100644 index 00000000..843ce5d3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/RuntimeEnvironment.java @@ -0,0 +1,36 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for runtimeEnvironment complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="runtimeEnvironment">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "runtimeEnvironment") +@XmlSeeAlso({ + KayakRuntimeEnvironment.class +}) +public abstract class RuntimeEnvironment { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledJob.java new file mode 100644 index 00000000..c59378dc --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledJob.java @@ -0,0 +1,378 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for scheduledJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="scheduledJob">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="taskType" type="{http://ws.server.mediamanager.digitalrapids.ca/}taskType" minOccurs="0"/>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="autoPurge" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="target" type="{http://ws.server.mediamanager.digitalrapids.ca/}sjTarget" minOccurs="0"/>
+ *         <element name="schedule" type="{http://ws.server.mediamanager.digitalrapids.ca/}sjSchedule" minOccurs="0"/>
+ *         <element name="scripts" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="scripts" type="{http://ws.server.mediamanager.digitalrapids.ca/}eventScript" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="runProjectDetails" type="{http://ws.server.mediamanager.digitalrapids.ca/}sjTaskRunProject" minOccurs="0"/>
+ *         <element name="configureResourceDetails" type="{http://ws.server.mediamanager.digitalrapids.ca/}sjTaskConfigureResource" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "scheduledJob", propOrder = { + "id", + "taskType", + "name", + "description", + "autoPurge", + "target", + "schedule", + "scripts", + "runProjectDetails", + "configureResourceDetails" +}) +@XmlSeeAlso({ + ScheduledSubprojectJob.class +}) +public class ScheduledJob { + + protected String id; + protected TaskType taskType; + protected String name; + protected String description; + protected Boolean autoPurge; + protected SjTarget target; + protected SjSchedule schedule; + protected ScheduledJob.Scripts scripts; + protected SjTaskRunProject runProjectDetails; + protected SjTaskConfigureResource configureResourceDetails; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the taskType property. + * + * @return + * possible object is + * {@link TaskType } + * + */ + public TaskType getTaskType() { + return taskType; + } + + /** + * Sets the value of the taskType property. + * + * @param value + * allowed object is + * {@link TaskType } + * + */ + public void setTaskType(TaskType value) { + this.taskType = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the description property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDescription() { + return description; + } + + /** + * Sets the value of the description property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDescription(String value) { + this.description = value; + } + + /** + * Gets the value of the autoPurge property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isAutoPurge() { + return autoPurge; + } + + /** + * Sets the value of the autoPurge property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setAutoPurge(Boolean value) { + this.autoPurge = value; + } + + /** + * Gets the value of the target property. + * + * @return + * possible object is + * {@link SjTarget } + * + */ + public SjTarget getTarget() { + return target; + } + + /** + * Sets the value of the target property. + * + * @param value + * allowed object is + * {@link SjTarget } + * + */ + public void setTarget(SjTarget value) { + this.target = value; + } + + /** + * Gets the value of the schedule property. + * + * @return + * possible object is + * {@link SjSchedule } + * + */ + public SjSchedule getSchedule() { + return schedule; + } + + /** + * Sets the value of the schedule property. + * + * @param value + * allowed object is + * {@link SjSchedule } + * + */ + public void setSchedule(SjSchedule value) { + this.schedule = value; + } + + /** + * Gets the value of the scripts property. + * + * @return + * possible object is + * {@link ScheduledJob.Scripts } + * + */ + public ScheduledJob.Scripts getScripts() { + return scripts; + } + + /** + * Sets the value of the scripts property. + * + * @param value + * allowed object is + * {@link ScheduledJob.Scripts } + * + */ + public void setScripts(ScheduledJob.Scripts value) { + this.scripts = value; + } + + /** + * Gets the value of the runProjectDetails property. + * + * @return + * possible object is + * {@link SjTaskRunProject } + * + */ + public SjTaskRunProject getRunProjectDetails() { + return runProjectDetails; + } + + /** + * Sets the value of the runProjectDetails property. + * + * @param value + * allowed object is + * {@link SjTaskRunProject } + * + */ + public void setRunProjectDetails(SjTaskRunProject value) { + this.runProjectDetails = value; + } + + /** + * Gets the value of the configureResourceDetails property. + * + * @return + * possible object is + * {@link SjTaskConfigureResource } + * + */ + public SjTaskConfigureResource getConfigureResourceDetails() { + return configureResourceDetails; + } + + /** + * Sets the value of the configureResourceDetails property. + * + * @param value + * allowed object is + * {@link SjTaskConfigureResource } + * + */ + public void setConfigureResourceDetails(SjTaskConfigureResource value) { + this.configureResourceDetails = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="scripts" type="{http://ws.server.mediamanager.digitalrapids.ca/}eventScript" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "scripts" + }) + public static class Scripts { + + protected List scripts; + + /** + * Gets the value of the scripts property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the scripts property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getScripts().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link EventScript } + * + * + */ + public List getScripts() { + if (scripts == null) { + scripts = new ArrayList(); + } + return this.scripts; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledJobStatus.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledJobStatus.java new file mode 100644 index 00000000..f9987655 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledJobStatus.java @@ -0,0 +1,363 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + *

Java class for scheduledJobStatus complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="scheduledJobStatus">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="taskType" type="{http://ws.server.mediamanager.digitalrapids.ca/}taskType" minOccurs="0"/>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="lastRunScheduledTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="lastRunActualTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="lastRunResult" type="{http://ws.server.mediamanager.digitalrapids.ca/}runResult" minOccurs="0"/>
+ *         <element name="nextRunTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="paused" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="scheduledRunDurationMillis" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
+ *         <element name="willStopJobTime" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="activeJobId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="lastJobId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "scheduledJobStatus", propOrder = { + "id", + "taskType", + "name", + "lastRunScheduledTime", + "lastRunActualTime", + "lastRunResult", + "nextRunTime", + "paused", + "scheduledRunDurationMillis", + "willStopJobTime", + "activeJobId", + "lastJobId" +}) +public class ScheduledJobStatus { + + protected String id; + protected TaskType taskType; + protected String name; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar lastRunScheduledTime; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar lastRunActualTime; + protected RunResult lastRunResult; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar nextRunTime; + protected Boolean paused; + protected Long scheduledRunDurationMillis; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar willStopJobTime; + protected String activeJobId; + protected String lastJobId; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the taskType property. + * + * @return + * possible object is + * {@link TaskType } + * + */ + public TaskType getTaskType() { + return taskType; + } + + /** + * Sets the value of the taskType property. + * + * @param value + * allowed object is + * {@link TaskType } + * + */ + public void setTaskType(TaskType value) { + this.taskType = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the lastRunScheduledTime property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getLastRunScheduledTime() { + return lastRunScheduledTime; + } + + /** + * Sets the value of the lastRunScheduledTime property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setLastRunScheduledTime(XMLGregorianCalendar value) { + this.lastRunScheduledTime = value; + } + + /** + * Gets the value of the lastRunActualTime property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getLastRunActualTime() { + return lastRunActualTime; + } + + /** + * Sets the value of the lastRunActualTime property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setLastRunActualTime(XMLGregorianCalendar value) { + this.lastRunActualTime = value; + } + + /** + * Gets the value of the lastRunResult property. + * + * @return + * possible object is + * {@link RunResult } + * + */ + public RunResult getLastRunResult() { + return lastRunResult; + } + + /** + * Sets the value of the lastRunResult property. + * + * @param value + * allowed object is + * {@link RunResult } + * + */ + public void setLastRunResult(RunResult value) { + this.lastRunResult = value; + } + + /** + * Gets the value of the nextRunTime property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getNextRunTime() { + return nextRunTime; + } + + /** + * Sets the value of the nextRunTime property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setNextRunTime(XMLGregorianCalendar value) { + this.nextRunTime = value; + } + + /** + * Gets the value of the paused property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isPaused() { + return paused; + } + + /** + * Sets the value of the paused property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setPaused(Boolean value) { + this.paused = value; + } + + /** + * Gets the value of the scheduledRunDurationMillis property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getScheduledRunDurationMillis() { + return scheduledRunDurationMillis; + } + + /** + * Sets the value of the scheduledRunDurationMillis property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setScheduledRunDurationMillis(Long value) { + this.scheduledRunDurationMillis = value; + } + + /** + * Gets the value of the willStopJobTime property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getWillStopJobTime() { + return willStopJobTime; + } + + /** + * Sets the value of the willStopJobTime property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setWillStopJobTime(XMLGregorianCalendar value) { + this.willStopJobTime = value; + } + + /** + * Gets the value of the activeJobId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getActiveJobId() { + return activeJobId; + } + + /** + * Sets the value of the activeJobId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setActiveJobId(String value) { + this.activeJobId = value; + } + + /** + * Gets the value of the lastJobId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLastJobId() { + return lastJobId; + } + + /** + * Sets the value of the lastJobId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLastJobId(String value) { + this.lastJobId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledSubprojectJob.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledSubprojectJob.java new file mode 100644 index 00000000..c2121c5a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/ScheduledSubprojectJob.java @@ -0,0 +1,62 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for scheduledSubprojectJob complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="scheduledSubprojectJob">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledJob">
+ *       <sequence>
+ *         <element name="subprojectId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "scheduledSubprojectJob", propOrder = { + "subprojectId" +}) +public class ScheduledSubprojectJob + extends ScheduledJob +{ + + protected String subprojectId; + + /** + * Gets the value of the subprojectId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSubprojectId() { + return subprojectId; + } + + /** + * Sets the value of the subprojectId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSubprojectId(String value) { + this.subprojectId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetGroupRuntimeEnvironment.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetGroupRuntimeEnvironment.java new file mode 100644 index 00000000..5f081f50 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetGroupRuntimeEnvironment.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setGroupRuntimeEnvironment complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setGroupRuntimeEnvironment">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="runtimeEnvironment" type="{http://ws.server.mediamanager.digitalrapids.ca/}runtimeEnvironment" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setGroupRuntimeEnvironment", propOrder = { + "groupId", + "runtimeEnvironment" +}) +public class SetGroupRuntimeEnvironment { + + protected String groupId; + protected RuntimeEnvironment runtimeEnvironment; + + /** + * Gets the value of the groupId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroupId(String value) { + this.groupId = value; + } + + /** + * Gets the value of the runtimeEnvironment property. + * + * @return + * possible object is + * {@link RuntimeEnvironment } + * + */ + public RuntimeEnvironment getRuntimeEnvironment() { + return runtimeEnvironment; + } + + /** + * Sets the value of the runtimeEnvironment property. + * + * @param value + * allowed object is + * {@link RuntimeEnvironment } + * + */ + public void setRuntimeEnvironment(RuntimeEnvironment value) { + this.runtimeEnvironment = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetGroupRuntimeEnvironmentResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetGroupRuntimeEnvironmentResponse.java new file mode 100644 index 00000000..4e8fa11a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetGroupRuntimeEnvironmentResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setGroupRuntimeEnvironmentResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setGroupRuntimeEnvironmentResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setGroupRuntimeEnvironmentResponse") +public class SetGroupRuntimeEnvironmentResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetResourceOnline.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetResourceOnline.java new file mode 100644 index 00000000..0354125f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetResourceOnline.java @@ -0,0 +1,79 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setResourceOnline complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setResourceOnline">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="online" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setResourceOnline", propOrder = { + "id", + "online" +}) +public class SetResourceOnline { + + protected String id; + protected boolean online; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the online property. + * + */ + public boolean isOnline() { + return online; + } + + /** + * Sets the value of the online property. + * + */ + public void setOnline(boolean value) { + this.online = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetResourceOnlineResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetResourceOnlineResponse.java new file mode 100644 index 00000000..d555d750 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetResourceOnlineResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setResourceOnlineResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setResourceOnlineResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setResourceOnlineResponse") +public class SetResourceOnlineResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetRuntimeEnvironmentForGroup.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetRuntimeEnvironmentForGroup.java new file mode 100644 index 00000000..e0aaed8a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetRuntimeEnvironmentForGroup.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setRuntimeEnvironmentForGroup complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setRuntimeEnvironmentForGroup">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="resourcePropertyList" type="{http://ws.server.mediamanager.digitalrapids.ca/}resourcePropertyList" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setRuntimeEnvironmentForGroup", propOrder = { + "groupId", + "resourcePropertyList" +}) +public class SetRuntimeEnvironmentForGroup { + + protected String groupId; + protected ResourcePropertyList resourcePropertyList; + + /** + * Gets the value of the groupId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroupId(String value) { + this.groupId = value; + } + + /** + * Gets the value of the resourcePropertyList property. + * + * @return + * possible object is + * {@link ResourcePropertyList } + * + */ + public ResourcePropertyList getResourcePropertyList() { + return resourcePropertyList; + } + + /** + * Sets the value of the resourcePropertyList property. + * + * @param value + * allowed object is + * {@link ResourcePropertyList } + * + */ + public void setResourcePropertyList(ResourcePropertyList value) { + this.resourcePropertyList = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetRuntimeEnvironmentForGroupResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetRuntimeEnvironmentForGroupResponse.java new file mode 100644 index 00000000..bf2f1eea --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetRuntimeEnvironmentForGroupResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setRuntimeEnvironmentForGroupResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setRuntimeEnvironmentForGroupResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setRuntimeEnvironmentForGroupResponse") +public class SetRuntimeEnvironmentForGroupResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetTranscodeTaskPriority.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetTranscodeTaskPriority.java new file mode 100644 index 00000000..096d0ea7 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetTranscodeTaskPriority.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setTranscodeTaskPriority complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setTranscodeTaskPriority">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="priority" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setTranscodeTaskPriority", propOrder = { + "id", + "priority" +}) +public class SetTranscodeTaskPriority { + + protected String id; + protected Double priority; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setPriority(Double value) { + this.priority = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetTranscodeTaskPriorityResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetTranscodeTaskPriorityResponse.java new file mode 100644 index 00000000..ae783040 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SetTranscodeTaskPriorityResponse.java @@ -0,0 +1,32 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for setTranscodeTaskPriorityResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="setTranscodeTaskPriorityResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "setTranscodeTaskPriorityResponse") +public class SetTranscodeTaskPriorityResponse { + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjSchedule.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjSchedule.java new file mode 100644 index 00000000..60531abf --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjSchedule.java @@ -0,0 +1,172 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + *

Java class for sjSchedule complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="sjSchedule">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="start" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="repeatMode" type="{http://ws.server.mediamanager.digitalrapids.ca/}repeatMode" minOccurs="0"/>
+ *         <element name="repeatCustomIntervalMillis" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
+ *         <element name="repeatUntil" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="runDurationMillis" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sjSchedule", propOrder = { + "start", + "repeatMode", + "repeatCustomIntervalMillis", + "repeatUntil", + "runDurationMillis" +}) +public class SjSchedule { + + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar start; + protected RepeatMode repeatMode; + protected Long repeatCustomIntervalMillis; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar repeatUntil; + protected Long runDurationMillis; + + /** + * Gets the value of the start property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getStart() { + return start; + } + + /** + * Sets the value of the start property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setStart(XMLGregorianCalendar value) { + this.start = value; + } + + /** + * Gets the value of the repeatMode property. + * + * @return + * possible object is + * {@link RepeatMode } + * + */ + public RepeatMode getRepeatMode() { + return repeatMode; + } + + /** + * Sets the value of the repeatMode property. + * + * @param value + * allowed object is + * {@link RepeatMode } + * + */ + public void setRepeatMode(RepeatMode value) { + this.repeatMode = value; + } + + /** + * Gets the value of the repeatCustomIntervalMillis property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getRepeatCustomIntervalMillis() { + return repeatCustomIntervalMillis; + } + + /** + * Sets the value of the repeatCustomIntervalMillis property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setRepeatCustomIntervalMillis(Long value) { + this.repeatCustomIntervalMillis = value; + } + + /** + * Gets the value of the repeatUntil property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getRepeatUntil() { + return repeatUntil; + } + + /** + * Sets the value of the repeatUntil property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setRepeatUntil(XMLGregorianCalendar value) { + this.repeatUntil = value; + } + + /** + * Gets the value of the runDurationMillis property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getRunDurationMillis() { + return runDurationMillis; + } + + /** + * Sets the value of the runDurationMillis property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setRunDurationMillis(Long value) { + this.runDurationMillis = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTarget.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTarget.java new file mode 100644 index 00000000..845a72ef --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTarget.java @@ -0,0 +1,153 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for sjTarget complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="sjTarget">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="resource" type="{http://ws.server.mediamanager.digitalrapids.ca/}resource" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="group" type="{http://ws.server.mediamanager.digitalrapids.ca/}group" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="targetBusyRule" type="{http://ws.server.mediamanager.digitalrapids.ca/}targetBusyRule" minOccurs="0"/>
+ *         <element name="targetSelectionRule" type="{http://ws.server.mediamanager.digitalrapids.ca/}targetSelectionRule" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sjTarget", propOrder = { + "resource", + "group", + "targetBusyRule", + "targetSelectionRule" +}) +public class SjTarget { + + protected List resource; + protected List group; + protected TargetBusyRule targetBusyRule; + protected TargetSelectionRule targetSelectionRule; + + /** + * Gets the value of the resource property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the resource property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getResource().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Resource } + * + * + */ + public List getResource() { + if (resource == null) { + resource = new ArrayList(); + } + return this.resource; + } + + /** + * Gets the value of the group property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the group property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getGroup().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Group } + * + * + */ + public List getGroup() { + if (group == null) { + group = new ArrayList(); + } + return this.group; + } + + /** + * Gets the value of the targetBusyRule property. + * + * @return + * possible object is + * {@link TargetBusyRule } + * + */ + public TargetBusyRule getTargetBusyRule() { + return targetBusyRule; + } + + /** + * Sets the value of the targetBusyRule property. + * + * @param value + * allowed object is + * {@link TargetBusyRule } + * + */ + public void setTargetBusyRule(TargetBusyRule value) { + this.targetBusyRule = value; + } + + /** + * Gets the value of the targetSelectionRule property. + * + * @return + * possible object is + * {@link TargetSelectionRule } + * + */ + public TargetSelectionRule getTargetSelectionRule() { + return targetSelectionRule; + } + + /** + * Sets the value of the targetSelectionRule property. + * + * @param value + * allowed object is + * {@link TargetSelectionRule } + * + */ + public void setTargetSelectionRule(TargetSelectionRule value) { + this.targetSelectionRule = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskConfigureResource.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskConfigureResource.java new file mode 100644 index 00000000..c13c278e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskConfigureResource.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for sjTaskConfigureResource complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="sjTaskConfigureResource">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="online" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="groupId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sjTaskConfigureResource", propOrder = { + "online", + "groupId" +}) +public class SjTaskConfigureResource { + + protected Boolean online; + protected String groupId; + + /** + * Gets the value of the online property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isOnline() { + return online; + } + + /** + * Sets the value of the online property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setOnline(Boolean value) { + this.online = value; + } + + /** + * Gets the value of the groupId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGroupId() { + return groupId; + } + + /** + * Sets the value of the groupId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGroupId(String value) { + this.groupId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskRunProject.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskRunProject.java new file mode 100644 index 00000000..3a50981e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskRunProject.java @@ -0,0 +1,327 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for sjTaskRunProject complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="sjTaskRunProject">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="project" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *         <element name="backupProject" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *         <element name="sourceProfile" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *         <element name="liveIPSourceProfile" type="{http://ws.server.mediamanager.digitalrapids.ca/}sjTaskRunTransportStreamInput" minOccurs="0"/>
+ *         <element name="routerInputPort" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="ingestToAsset" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" minOccurs="0"/>
+ *         <element name="scheduledSubprojectJobs" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="scheduledSubprojectJobs" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledSubprojectJob" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="doNotStartSubprojectIds" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sjTaskRunProject", propOrder = { + "project", + "backupProject", + "sourceProfile", + "liveIPSourceProfile", + "routerInputPort", + "ingestToAsset", + "scheduledSubprojectJobs", + "doNotStartSubprojectIds" +}) +public class SjTaskRunProject { + + protected FileSnapshot project; + protected FileSnapshot backupProject; + protected FileSnapshot sourceProfile; + protected SjTaskRunTransportStreamInput liveIPSourceProfile; + protected Integer routerInputPort; + protected Asset ingestToAsset; + protected SjTaskRunProject.ScheduledSubprojectJobs scheduledSubprojectJobs; + @XmlElement(nillable = true) + protected List doNotStartSubprojectIds; + + /** + * Gets the value of the project property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getProject() { + return project; + } + + /** + * Sets the value of the project property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setProject(FileSnapshot value) { + this.project = value; + } + + /** + * Gets the value of the backupProject property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getBackupProject() { + return backupProject; + } + + /** + * Sets the value of the backupProject property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setBackupProject(FileSnapshot value) { + this.backupProject = value; + } + + /** + * Gets the value of the sourceProfile property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getSourceProfile() { + return sourceProfile; + } + + /** + * Sets the value of the sourceProfile property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setSourceProfile(FileSnapshot value) { + this.sourceProfile = value; + } + + /** + * Gets the value of the liveIPSourceProfile property. + * + * @return + * possible object is + * {@link SjTaskRunTransportStreamInput } + * + */ + public SjTaskRunTransportStreamInput getLiveIPSourceProfile() { + return liveIPSourceProfile; + } + + /** + * Sets the value of the liveIPSourceProfile property. + * + * @param value + * allowed object is + * {@link SjTaskRunTransportStreamInput } + * + */ + public void setLiveIPSourceProfile(SjTaskRunTransportStreamInput value) { + this.liveIPSourceProfile = value; + } + + /** + * Gets the value of the routerInputPort property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getRouterInputPort() { + return routerInputPort; + } + + /** + * Sets the value of the routerInputPort property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setRouterInputPort(Integer value) { + this.routerInputPort = value; + } + + /** + * Gets the value of the ingestToAsset property. + * + * @return + * possible object is + * {@link Asset } + * + */ + public Asset getIngestToAsset() { + return ingestToAsset; + } + + /** + * Sets the value of the ingestToAsset property. + * + * @param value + * allowed object is + * {@link Asset } + * + */ + public void setIngestToAsset(Asset value) { + this.ingestToAsset = value; + } + + /** + * Gets the value of the scheduledSubprojectJobs property. + * + * @return + * possible object is + * {@link SjTaskRunProject.ScheduledSubprojectJobs } + * + */ + public SjTaskRunProject.ScheduledSubprojectJobs getScheduledSubprojectJobs() { + return scheduledSubprojectJobs; + } + + /** + * Sets the value of the scheduledSubprojectJobs property. + * + * @param value + * allowed object is + * {@link SjTaskRunProject.ScheduledSubprojectJobs } + * + */ + public void setScheduledSubprojectJobs(SjTaskRunProject.ScheduledSubprojectJobs value) { + this.scheduledSubprojectJobs = value; + } + + /** + * Gets the value of the doNotStartSubprojectIds property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the doNotStartSubprojectIds property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getDoNotStartSubprojectIds().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getDoNotStartSubprojectIds() { + if (doNotStartSubprojectIds == null) { + doNotStartSubprojectIds = new ArrayList(); + } + return this.doNotStartSubprojectIds; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="scheduledSubprojectJobs" type="{http://ws.server.mediamanager.digitalrapids.ca/}scheduledSubprojectJob" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "scheduledSubprojectJobs" + }) + public static class ScheduledSubprojectJobs { + + protected List scheduledSubprojectJobs; + + /** + * Gets the value of the scheduledSubprojectJobs property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the scheduledSubprojectJobs property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getScheduledSubprojectJobs().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ScheduledSubprojectJob } + * + * + */ + public List getScheduledSubprojectJobs() { + if (scheduledSubprojectJobs == null) { + scheduledSubprojectJobs = new ArrayList(); + } + return this.scheduledSubprojectJobs; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskRunTransportStreamInput.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskRunTransportStreamInput.java new file mode 100644 index 00000000..60a6370f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SjTaskRunTransportStreamInput.java @@ -0,0 +1,214 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for sjTaskRunTransportStreamInput complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="sjTaskRunTransportStreamInput">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ipAddress" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="port" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="videoPid" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="audioPids" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="audioPid" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sjTaskRunTransportStreamInput", propOrder = { + "ipAddress", + "port", + "videoPid", + "audioPids" +}) +public class SjTaskRunTransportStreamInput { + + protected String ipAddress; + protected Integer port; + protected Integer videoPid; + protected SjTaskRunTransportStreamInput.AudioPids audioPids; + + /** + * Gets the value of the ipAddress property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getIpAddress() { + return ipAddress; + } + + /** + * Sets the value of the ipAddress property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIpAddress(String value) { + this.ipAddress = value; + } + + /** + * Gets the value of the port property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getPort() { + return port; + } + + /** + * Sets the value of the port property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setPort(Integer value) { + this.port = value; + } + + /** + * Gets the value of the videoPid property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getVideoPid() { + return videoPid; + } + + /** + * Sets the value of the videoPid property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setVideoPid(Integer value) { + this.videoPid = value; + } + + /** + * Gets the value of the audioPids property. + * + * @return + * possible object is + * {@link SjTaskRunTransportStreamInput.AudioPids } + * + */ + public SjTaskRunTransportStreamInput.AudioPids getAudioPids() { + return audioPids; + } + + /** + * Sets the value of the audioPids property. + * + * @param value + * allowed object is + * {@link SjTaskRunTransportStreamInput.AudioPids } + * + */ + public void setAudioPids(SjTaskRunTransportStreamInput.AudioPids value) { + this.audioPids = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="audioPid" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "audioPid" + }) + public static class AudioPids { + + @XmlElement(type = Integer.class) + protected List audioPid; + + /** + * Gets the value of the audioPid property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the audioPid property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getAudioPid().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Integer } + * + * + */ + public List getAudioPid() { + if (audioPid == null) { + audioPid = new ArrayList(); + } + return this.audioPid; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SourceBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SourceBean.java new file mode 100644 index 00000000..453a0d4f --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SourceBean.java @@ -0,0 +1,213 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for sourceBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="sourceBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="component" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="graph" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="properties" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="property" type="{http://ws.server.mediamanager.digitalrapids.ca/}propertyBean" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "sourceBean", propOrder = { + "component", + "graph", + "properties" +}) +public class SourceBean { + + protected String component; + protected String graph; + protected SourceBean.Properties properties; + @XmlAttribute(name = "id", required = true) + protected String id; + + /** + * Gets the value of the component property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getComponent() { + return component; + } + + /** + * Sets the value of the component property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setComponent(String value) { + this.component = value; + } + + /** + * Gets the value of the graph property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getGraph() { + return graph; + } + + /** + * Sets the value of the graph property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGraph(String value) { + this.graph = value; + } + + /** + * Gets the value of the properties property. + * + * @return + * possible object is + * {@link SourceBean.Properties } + * + */ + public SourceBean.Properties getProperties() { + return properties; + } + + /** + * Sets the value of the properties property. + * + * @param value + * allowed object is + * {@link SourceBean.Properties } + * + */ + public void setProperties(SourceBean.Properties value) { + this.properties = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="property" type="{http://ws.server.mediamanager.digitalrapids.ca/}propertyBean" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "property" + }) + public static class Properties { + + protected List property; + + /** + * Gets the value of the property property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the property property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getProperty().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PropertyBean } + * + * + */ + public List getProperty() { + if (property == null) { + property = new ArrayList(); + } + return this.property; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SplitProfileOption.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SplitProfileOption.java new file mode 100644 index 00000000..1163ff01 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SplitProfileOption.java @@ -0,0 +1,40 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for splitProfileOption. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="splitProfileOption">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="AUTOMATIC"/>
+ *     <enumeration value="ALWAYS"/>
+ *     <enumeration value="NEVER"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "splitProfileOption") +@XmlEnum +public enum SplitProfileOption { + + AUTOMATIC, + ALWAYS, + NEVER; + + public String value() { + return name(); + } + + public static SplitProfileOption fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/State.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/State.java new file mode 100644 index 00000000..64aa0182 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/State.java @@ -0,0 +1,50 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for state. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="state">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="QUEUED"/>
+ *     <enumeration value="IN_PROGRESS"/>
+ *     <enumeration value="COMPLETE"/>
+ *     <enumeration value="FAILED"/>
+ *     <enumeration value="CANCELLED"/>
+ *     <enumeration value="POST_PROCESS"/>
+ *     <enumeration value="PRE_PROCESS"/>
+ *     <enumeration value="RESERVED"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "state") +@XmlEnum +public enum State { + + QUEUED, + IN_PROGRESS, + COMPLETE, + FAILED, + CANCELLED, + POST_PROCESS, + PRE_PROCESS, + RESERVED; + + public String value() { + return name(); + } + + public static State fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/StatusEnum.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/StatusEnum.java new file mode 100644 index 00000000..4836dea3 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/StatusEnum.java @@ -0,0 +1,54 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for statusEnum. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="statusEnum">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="STATUS_AVAILABLE"/>
+ *     <enumeration value="STATUS_BUSY"/>
+ *     <enumeration value="STATUS_FAILED"/>
+ *     <enumeration value="STATUS_MISSING"/>
+ *     <enumeration value="STATUS_MISSING_ENC"/>
+ *     <enumeration value="STATUS_UNKNOWN"/>
+ *     <enumeration value="STATUS_HUNG"/>
+ *     <enumeration value="STATUS_UNLICENSED"/>
+ *     <enumeration value="STATUS_NOT_CONTROLLED"/>
+ *     <enumeration value="STATUS_RESERVED"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "statusEnum") +@XmlEnum +public enum StatusEnum { + + STATUS_AVAILABLE, + STATUS_BUSY, + STATUS_FAILED, + STATUS_MISSING, + STATUS_MISSING_ENC, + STATUS_UNKNOWN, + STATUS_HUNG, + STATUS_UNLICENSED, + STATUS_NOT_CONTROLLED, + STATUS_RESERVED; + + public String value() { + return name(); + } + + public static StatusEnum fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SubmitTranscodeTask.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SubmitTranscodeTask.java new file mode 100644 index 00000000..479380e1 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SubmitTranscodeTask.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for submitTranscodeTask complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="submitTranscodeTask">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transcodeRequest" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeRequest" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "submitTranscodeTask", propOrder = { + "transcodeRequest" +}) +public class SubmitTranscodeTask { + + protected TranscodeRequest transcodeRequest; + + /** + * Gets the value of the transcodeRequest property. + * + * @return + * possible object is + * {@link TranscodeRequest } + * + */ + public TranscodeRequest getTranscodeRequest() { + return transcodeRequest; + } + + /** + * Sets the value of the transcodeRequest property. + * + * @param value + * allowed object is + * {@link TranscodeRequest } + * + */ + public void setTranscodeRequest(TranscodeRequest value) { + this.transcodeRequest = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SubmitTranscodeTaskResponse.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SubmitTranscodeTaskResponse.java new file mode 100644 index 00000000..8268f902 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/SubmitTranscodeTaskResponse.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for submitTranscodeTaskResponse complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="submitTranscodeTaskResponse">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transcodeTask" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeTask" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "submitTranscodeTaskResponse", propOrder = { + "transcodeTask" +}) +public class SubmitTranscodeTaskResponse { + + protected TranscodeTask transcodeTask; + + /** + * Gets the value of the transcodeTask property. + * + * @return + * possible object is + * {@link TranscodeTask } + * + */ + public TranscodeTask getTranscodeTask() { + return transcodeTask; + } + + /** + * Sets the value of the transcodeTask property. + * + * @param value + * allowed object is + * {@link TranscodeTask } + * + */ + public void setTranscodeTask(TranscodeTask value) { + this.transcodeTask = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TargetBusyRule.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TargetBusyRule.java new file mode 100644 index 00000000..ed900e7b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TargetBusyRule.java @@ -0,0 +1,42 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for targetBusyRule. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="targetBusyRule">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="SKIP_TARGET"/>
+ *     <enumeration value="STOP_TARGET_AND_EXECUTE"/>
+ *     <enumeration value="FAILOVER_TARGET_AND_EXECUTE"/>
+ *     <enumeration value="EXECUTE"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "targetBusyRule") +@XmlEnum +public enum TargetBusyRule { + + SKIP_TARGET, + STOP_TARGET_AND_EXECUTE, + FAILOVER_TARGET_AND_EXECUTE, + EXECUTE; + + public String value() { + return name(); + } + + public static TargetBusyRule fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TargetSelectionRule.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TargetSelectionRule.java new file mode 100644 index 00000000..8522911b --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TargetSelectionRule.java @@ -0,0 +1,38 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for targetSelectionRule. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="targetSelectionRule">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="ALL_TARGETS"/>
+ *     <enumeration value="ONLY_ONE_TARGET"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "targetSelectionRule") +@XmlEnum +public enum TargetSelectionRule { + + ALL_TARGETS, + ONLY_ONE_TARGET; + + public String value() { + return name(); + } + + public static TargetSelectionRule fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskBean.java new file mode 100644 index 00000000..35282b38 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskBean.java @@ -0,0 +1,60 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for taskBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="taskBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *       <attribute name="type" use="required" type="{http://ws.server.mediamanager.digitalrapids.ca/}taskEnum" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "taskBean") +public class TaskBean { + + @XmlAttribute(name = "type", required = true) + protected TaskEnum type; + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link TaskEnum } + * + */ + public TaskEnum getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link TaskEnum } + * + */ + public void setType(TaskEnum value) { + this.type = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskEnum.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskEnum.java new file mode 100644 index 00000000..2c6ca0a1 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskEnum.java @@ -0,0 +1,51 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for taskEnum. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="taskEnum">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="InterleaveAllAudio"/>
+ *     <enumeration value="ValidateDataIsMissing"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "taskEnum") +@XmlEnum +public enum TaskEnum { + + @XmlEnumValue("InterleaveAllAudio") + INTERLEAVE_ALL_AUDIO("InterleaveAllAudio"), + @XmlEnumValue("ValidateDataIsMissing") + VALIDATE_DATA_IS_MISSING("ValidateDataIsMissing"); + private final String value; + + TaskEnum(String v) { + value = v; + } + + public String value() { + return value; + } + + public static TaskEnum fromValue(String v) { + for (TaskEnum c: TaskEnum.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskType.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskType.java new file mode 100644 index 00000000..c1aa0cd4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TaskType.java @@ -0,0 +1,42 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for taskType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="taskType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="REBOOT_HOST"/>
+ *     <enumeration value="RUN_PROJECT"/>
+ *     <enumeration value="CONFIGURE_RESOURCE"/>
+ *     <enumeration value="RUN_SUBPROJCT_JOB"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "taskType") +@XmlEnum +public enum TaskType { + + REBOOT_HOST, + RUN_PROJECT, + CONFIGURE_RESOURCE, + RUN_SUBPROJCT_JOB; + + public String value() { + return name(); + } + + public static TaskType fromValue(String v) { + return valueOf(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Timecode.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Timecode.java new file mode 100644 index 00000000..7b167345 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Timecode.java @@ -0,0 +1,87 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; + + +/** + *

Java class for timecode complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="timecode">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *       <attribute name="fps" type="{http://www.w3.org/2001/XMLSchema}double" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "timecode", propOrder = { + "value" +}) +public class Timecode { + + @XmlValue + protected String value; + @XmlAttribute(name = "fps") + protected Double fps; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the fps property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getFps() { + return fps; + } + + /** + * Sets the value of the fps property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setFps(Double value) { + this.fps = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TimelineMarker.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TimelineMarker.java new file mode 100644 index 00000000..12f1f3ae --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TimelineMarker.java @@ -0,0 +1,256 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for timelineMarker complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="timelineMarker">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *       </sequence>
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="inPoint" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="outPoint" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="timelineUnits" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="label" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="info" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="markerGroupId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "timelineMarker") +public class TimelineMarker { + + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(name = "type", required = true) + protected String type; + @XmlAttribute(name = "inPoint") + protected String inPoint; + @XmlAttribute(name = "outPoint") + protected String outPoint; + @XmlAttribute(name = "timelineUnits") + protected String timelineUnits; + @XmlAttribute(name = "label", required = true) + protected String label; + @XmlAttribute(name = "info") + protected String info; + @XmlAttribute(name = "markerGroupId") + protected String markerGroupId; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the inPoint property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getInPoint() { + return inPoint; + } + + /** + * Sets the value of the inPoint property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInPoint(String value) { + this.inPoint = value; + } + + /** + * Gets the value of the outPoint property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOutPoint() { + return outPoint; + } + + /** + * Sets the value of the outPoint property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutPoint(String value) { + this.outPoint = value; + } + + /** + * Gets the value of the timelineUnits property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTimelineUnits() { + return timelineUnits; + } + + /** + * Sets the value of the timelineUnits property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTimelineUnits(String value) { + this.timelineUnits = value; + } + + /** + * Gets the value of the label property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLabel() { + return label; + } + + /** + * Sets the value of the label property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLabel(String value) { + this.label = value; + } + + /** + * Gets the value of the info property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getInfo() { + return info; + } + + /** + * Sets the value of the info property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInfo(String value) { + this.info = value; + } + + /** + * Gets the value of the markerGroupId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMarkerGroupId() { + return markerGroupId; + } + + /** + * Sets the value of the markerGroupId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMarkerGroupId(String value) { + this.markerGroupId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TrackBean.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TrackBean.java new file mode 100644 index 00000000..d8f2f322 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TrackBean.java @@ -0,0 +1,186 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for trackBean complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="trackBean">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="clips" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="clip" type="{http://ws.server.mediamanager.digitalrapids.ca/}clipBean" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="outputRef" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="applyToAllOutputs" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "trackBean", propOrder = { + "clips" +}) +public class TrackBean { + + protected TrackBean.Clips clips; + @XmlAttribute(name = "outputRef") + protected String outputRef; + @XmlAttribute(name = "applyToAllOutputs") + protected Boolean applyToAllOutputs; + + /** + * Gets the value of the clips property. + * + * @return + * possible object is + * {@link TrackBean.Clips } + * + */ + public TrackBean.Clips getClips() { + return clips; + } + + /** + * Sets the value of the clips property. + * + * @param value + * allowed object is + * {@link TrackBean.Clips } + * + */ + public void setClips(TrackBean.Clips value) { + this.clips = value; + } + + /** + * Gets the value of the outputRef property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOutputRef() { + return outputRef; + } + + /** + * Sets the value of the outputRef property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutputRef(String value) { + this.outputRef = value; + } + + /** + * Gets the value of the applyToAllOutputs property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isApplyToAllOutputs() { + return applyToAllOutputs; + } + + /** + * Sets the value of the applyToAllOutputs property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setApplyToAllOutputs(Boolean value) { + this.applyToAllOutputs = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="clip" type="{http://ws.server.mediamanager.digitalrapids.ca/}clipBean" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "clip" + }) + public static class Clips { + + protected List clip; + + /** + * Gets the value of the clip property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the clip property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getClip().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ClipBean } + * + * + */ + public List getClip() { + if (clip == null) { + clip = new ArrayList(); + } + return this.clip; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeDestination.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeDestination.java new file mode 100644 index 00000000..5f2b8c83 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeDestination.java @@ -0,0 +1,114 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for transcodeDestination complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="transcodeDestination">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="outputWriteDirectory" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="outputPostMoveDirectory" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="transcodeToAsset" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "transcodeDestination", propOrder = { + "outputWriteDirectory", + "outputPostMoveDirectory", + "transcodeToAsset" +}) +public class TranscodeDestination { + + protected String outputWriteDirectory; + protected String outputPostMoveDirectory; + protected Asset transcodeToAsset; + + /** + * Gets the value of the outputWriteDirectory property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOutputWriteDirectory() { + return outputWriteDirectory; + } + + /** + * Sets the value of the outputWriteDirectory property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutputWriteDirectory(String value) { + this.outputWriteDirectory = value; + } + + /** + * Gets the value of the outputPostMoveDirectory property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOutputPostMoveDirectory() { + return outputPostMoveDirectory; + } + + /** + * Sets the value of the outputPostMoveDirectory property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutputPostMoveDirectory(String value) { + this.outputPostMoveDirectory = value; + } + + /** + * Gets the value of the transcodeToAsset property. + * + * @return + * possible object is + * {@link Asset } + * + */ + public Asset getTranscodeToAsset() { + return transcodeToAsset; + } + + /** + * Sets the value of the transcodeToAsset property. + * + * @param value + * allowed object is + * {@link Asset } + * + */ + public void setTranscodeToAsset(Asset value) { + this.transcodeToAsset = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeMgrWS.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeMgrWS.java new file mode 100644 index 00000000..d46a2850 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeMgrWS.java @@ -0,0 +1,1001 @@ + +package user.commons.selenio.wsclient; + +import java.util.List; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.jws.WebService; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.ws.Action; +import javax.xml.ws.FaultAction; +import javax.xml.ws.RequestWrapper; +import javax.xml.ws.ResponseWrapper; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.4-b01 + * Generated source version: 2.2 + * + */ +@WebService(name = "TranscodeMgrWS", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/") +@XmlSeeAlso({ + ObjectFactory.class +}) +public interface TranscodeMgrWS { + + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.TranscodeRequest + * @throws Exception_Exception + */ + @WebMethod(action = "getTranscodeRequest") + @WebResult(name = "transcodeRequest", targetNamespace = "") + @RequestWrapper(localName = "getTranscodeRequest", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTranscodeRequest") + @ResponseWrapper(localName = "getTranscodeRequestResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTranscodeRequestResponse") + @Action(input = "getTranscodeRequest", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTranscodeRequestResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTranscodeRequest/Fault/Exception") + }) + public TranscodeRequest getTranscodeRequest( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param transcodeTaskSearch + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "findTranscodeTasks") + @WebResult(name = "transcodeTasks", targetNamespace = "") + @RequestWrapper(localName = "findTranscodeTasks", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.FindTranscodeTasks") + @ResponseWrapper(localName = "findTranscodeTasksResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.FindTranscodeTasksResponse") + @Action(input = "findTranscodeTasks", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/findTranscodeTasksResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/findTranscodeTasks/Fault/Exception") + }) + public List findTranscodeTasks( + @WebParam(name = "transcodeTaskSearch", targetNamespace = "") + TranscodeTaskSearch transcodeTaskSearch) + throws Exception_Exception + ; + + /** + * + * @param jobId + * @return + * returns user.commons.selenio.wsclient.TranscodeTask + * @throws Exception_Exception + */ + @WebMethod(action = "getTranscodeTaskForJob") + @WebResult(name = "transcodeTask", targetNamespace = "") + @RequestWrapper(localName = "getTranscodeTaskForJob", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTranscodeTaskForJob") + @ResponseWrapper(localName = "getTranscodeTaskForJobResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTranscodeTaskForJobResponse") + @Action(input = "getTranscodeTaskForJob", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTranscodeTaskForJobResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTranscodeTaskForJob/Fault/Exception") + }) + public TranscodeTask getTranscodeTaskForJob( + @WebParam(name = "jobId", targetNamespace = "") + String jobId) + throws Exception_Exception + ; + + /** + * + * @param numberOfResources + * @param agentId + * @param resourcePropertyList + * @throws Exception_Exception + */ + @WebMethod(action = "createResourceOnAgent") + @RequestWrapper(localName = "createResourceOnAgent", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CreateResourceOnAgent") + @ResponseWrapper(localName = "createResourceOnAgentResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CreateResourceOnAgentResponse") + @Action(input = "createResourceOnAgent", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/createResourceOnAgentResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/createResourceOnAgent/Fault/Exception") + }) + public void createResourceOnAgent( + @WebParam(name = "agentId", targetNamespace = "") + String agentId, + @WebParam(name = "resourcePropertyList", targetNamespace = "") + ResourcePropertyList resourcePropertyList, + @WebParam(name = "numberOfResources", targetNamespace = "") + int numberOfResources) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + */ + @WebMethod(action = "getQCServiceList") + @WebResult(name = "qcService", targetNamespace = "") + @RequestWrapper(localName = "getQCServiceList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetQCServiceList") + @ResponseWrapper(localName = "getQCServiceListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetQCServiceListResponse") + @Action(input = "getQCServiceList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getQCServiceListResponse") + public List getQCServiceList(); + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.QcService + */ + @WebMethod(action = "getQCService") + @WebResult(name = "qcService", targetNamespace = "") + @RequestWrapper(localName = "getQCService", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetQCService") + @ResponseWrapper(localName = "getQCServiceResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetQCServiceResponse") + @Action(input = "getQCService", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getQCServiceResponse") + public QcService getQCService( + @WebParam(name = "id", targetNamespace = "") + String id); + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.QcTask + */ + @WebMethod(action = "getQCTask") + @WebResult(name = "qcTask", targetNamespace = "") + @RequestWrapper(localName = "getQCTask", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetQCTask") + @ResponseWrapper(localName = "getQCTaskResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetQCTaskResponse") + @Action(input = "getQCTask", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getQCTaskResponse") + public QcTask getQCTask( + @WebParam(name = "id", targetNamespace = "") + String id); + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.TranscodeTask + * @throws Exception_Exception + */ + @WebMethod(action = "getTranscodeTask") + @WebResult(name = "transcodeTask", targetNamespace = "") + @RequestWrapper(localName = "getTranscodeTask", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTranscodeTask") + @ResponseWrapper(localName = "getTranscodeTaskResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTranscodeTaskResponse") + @Action(input = "getTranscodeTask", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTranscodeTaskResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTranscodeTask/Fault/Exception") + }) + public TranscodeTask getTranscodeTask( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param taskId + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getJobsForTranscodeTask") + @WebResult(name = "job", targetNamespace = "") + @RequestWrapper(localName = "getJobsForTranscodeTask", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetJobsForTranscodeTask") + @ResponseWrapper(localName = "getJobsForTranscodeTaskResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetJobsForTranscodeTaskResponse") + @Action(input = "getJobsForTranscodeTask", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getJobsForTranscodeTaskResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getJobsForTranscodeTask/Fault/Exception") + }) + public List getJobsForTranscodeTask( + @WebParam(name = "taskId", targetNamespace = "") + String taskId) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getWatchFolderList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getWatchFolderList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetWatchFolderList") + @ResponseWrapper(localName = "getWatchFolderListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetWatchFolderListResponse") + @Action(input = "getWatchFolderList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getWatchFolderListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getWatchFolderList/Fault/Exception") + }) + public List getWatchFolderList() + throws Exception_Exception + ; + + /** + * + * @param id + * @param priority + * @throws Exception_Exception + */ + @WebMethod(action = "setTranscodeTaskPriority") + @RequestWrapper(localName = "setTranscodeTaskPriority", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetTranscodeTaskPriority") + @ResponseWrapper(localName = "setTranscodeTaskPriorityResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetTranscodeTaskPriorityResponse") + @Action(input = "setTranscodeTaskPriority", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setTranscodeTaskPriorityResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setTranscodeTaskPriority/Fault/Exception") + }) + public void setTranscodeTaskPriority( + @WebParam(name = "id", targetNamespace = "") + String id, + @WebParam(name = "priority", targetNamespace = "") + Double priority) + throws Exception_Exception + ; + + /** + * + * @param transcodeRequest + * @return + * returns user.commons.selenio.wsclient.TranscodeTask + * @throws Exception_Exception + */ + @WebMethod(action = "submitTranscodeTask") + @WebResult(name = "transcodeTask", targetNamespace = "") + @RequestWrapper(localName = "submitTranscodeTask", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SubmitTranscodeTask") + @ResponseWrapper(localName = "submitTranscodeTaskResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SubmitTranscodeTaskResponse") + @Action(input = "submitTranscodeTask", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/submitTranscodeTaskResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/submitTranscodeTask/Fault/Exception") + }) + public TranscodeTask submitTranscodeTask( + @WebParam(name = "transcodeRequest", targetNamespace = "") + TranscodeRequest transcodeRequest) + throws Exception_Exception + ; + + /** + * + * @param id + * @throws Exception_Exception + */ + @WebMethod(action = "cancelTranscodeTask") + @RequestWrapper(localName = "cancelTranscodeTask", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CancelTranscodeTask") + @ResponseWrapper(localName = "cancelTranscodeTaskResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CancelTranscodeTaskResponse") + @Action(input = "cancelTranscodeTask", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/cancelTranscodeTaskResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/cancelTranscodeTask/Fault/Exception") + }) + public void cancelTranscodeTask( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.lang.String + * @throws Exception_Exception + */ + @WebMethod(action = "getName") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getName", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetName") + @ResponseWrapper(localName = "getNameResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetNameResponse") + @Action(input = "getName", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getNameResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getName/Fault/Exception") + }) + public String getName() + throws Exception_Exception + ; + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.Resource + * @throws Exception_Exception + */ + @WebMethod(action = "getResource") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getResource", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetResource") + @ResponseWrapper(localName = "getResourceResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetResourceResponse") + @Action(input = "getResource", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getResourceResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getResource/Fault/Exception") + }) + public Resource getResource( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.lang.String + * @throws Exception_Exception + */ + @WebMethod(action = "getTimeZone") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getTimeZone", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTimeZone") + @ResponseWrapper(localName = "getTimeZoneResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetTimeZoneResponse") + @Action(input = "getTimeZone", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTimeZoneResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getTimeZone/Fault/Exception") + }) + public String getTimeZone() + throws Exception_Exception + ; + + /** + * + * @param name + * @param resourcePropertyList + * @return + * returns java.lang.String + * @throws Exception_Exception + */ + @WebMethod(action = "createGroup") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "createGroup", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CreateGroup") + @ResponseWrapper(localName = "createGroupResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CreateGroupResponse") + @Action(input = "createGroup", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/createGroupResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/createGroup/Fault/Exception") + }) + public String createGroup( + @WebParam(name = "name", targetNamespace = "") + String name, + @WebParam(name = "resourcePropertyList", targetNamespace = "") + ResourcePropertyList resourcePropertyList) + throws Exception_Exception + ; + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.Group + * @throws Exception_Exception + */ + @WebMethod(action = "getGroup") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getGroup", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetGroup") + @ResponseWrapper(localName = "getGroupResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetGroupResponse") + @Action(input = "getGroup", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getGroupResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getGroup/Fault/Exception") + }) + public Group getGroup( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getResourceList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getResourceList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetResourceList") + @ResponseWrapper(localName = "getResourceListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetResourceListResponse") + @Action(input = "getResourceList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getResourceListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getResourceList/Fault/Exception") + }) + public List getResourceList() + throws Exception_Exception + ; + + /** + * + * @return + * returns java.lang.String + * @throws Exception_Exception + */ + @WebMethod(action = "getVersion") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getVersion", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetVersion") + @ResponseWrapper(localName = "getVersionResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetVersionResponse") + @Action(input = "getVersion", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getVersionResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getVersion/Fault/Exception") + }) + public String getVersion() + throws Exception_Exception + ; + + /** + * + * @return + * returns java.lang.String + * @throws Exception_Exception + */ + @WebMethod(action = "getDomain") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getDomain", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetDomain") + @ResponseWrapper(localName = "getDomainResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetDomainResponse") + @Action(input = "getDomain", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getDomainResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getDomain/Fault/Exception") + }) + public String getDomain() + throws Exception_Exception + ; + + /** + * + * @return + * returns java.lang.String + * @throws Exception_Exception + */ + @WebMethod(action = "getAbout") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getAbout", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAbout") + @ResponseWrapper(localName = "getAboutResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAboutResponse") + @Action(input = "getAbout", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAboutResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAbout/Fault/Exception") + }) + public String getAbout() + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getScheduledJobList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getScheduledJobList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJobList") + @ResponseWrapper(localName = "getScheduledJobListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJobListResponse") + @Action(input = "getScheduledJobList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJobListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJobList/Fault/Exception") + }) + public List getScheduledJobList() + throws Exception_Exception + ; + + /** + * + * @param rescheduleNextRun + * @param scheduledJob + * @throws Exception_Exception + */ + @WebMethod(action = "modifyScheduledJob") + @RequestWrapper(localName = "modifyScheduledJob", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.ModifyScheduledJob") + @ResponseWrapper(localName = "modifyScheduledJobResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.ModifyScheduledJobResponse") + @Action(input = "modifyScheduledJob", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/modifyScheduledJobResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/modifyScheduledJob/Fault/Exception") + }) + public void modifyScheduledJob( + @WebParam(name = "scheduledJob", targetNamespace = "") + ScheduledJob scheduledJob, + @WebParam(name = "rescheduleNextRun", targetNamespace = "") + boolean rescheduleNextRun) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getActiveJobsList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getActiveJobsList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetActiveJobsList") + @ResponseWrapper(localName = "getActiveJobsListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetActiveJobsListResponse") + @Action(input = "getActiveJobsList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getActiveJobsListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getActiveJobsList/Fault/Exception") + }) + public List getActiveJobsList() + throws Exception_Exception + ; + + /** + * + * @param id + * @throws Exception_Exception + */ + @WebMethod(action = "deleteScheduledJob") + @RequestWrapper(localName = "deleteScheduledJob", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.DeleteScheduledJob") + @ResponseWrapper(localName = "deleteScheduledJobResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.DeleteScheduledJobResponse") + @Action(input = "deleteScheduledJob", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/deleteScheduledJobResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/deleteScheduledJob/Fault/Exception") + }) + public void deleteScheduledJob( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param arg2 + * @param arg1 + * @param arg0 + * @return + * returns user.commons.selenio.wsclient.MetadataDefinition + * @throws Exception_Exception + */ + @WebMethod(action = "getMetadataDefinition") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getMetadataDefinition", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetMetadataDefinition") + @ResponseWrapper(localName = "getMetadataDefinitionResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetMetadataDefinitionResponse") + @Action(input = "getMetadataDefinition", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getMetadataDefinitionResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getMetadataDefinition/Fault/Exception") + }) + public MetadataDefinition getMetadataDefinition( + @WebParam(name = "arg0", targetNamespace = "") + String arg0, + @WebParam(name = "arg1", targetNamespace = "") + String arg1, + @WebParam(name = "arg2", targetNamespace = "") + String arg2) + throws Exception_Exception + ; + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.ScheduledJobStatus + * @throws Exception_Exception + */ + @WebMethod(action = "getScheduledJobStatus") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getScheduledJobStatus", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJobStatus") + @ResponseWrapper(localName = "getScheduledJobStatusResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJobStatusResponse") + @Action(input = "getScheduledJobStatus", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJobStatusResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJobStatus/Fault/Exception") + }) + public ScheduledJobStatus getScheduledJobStatus( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param groupId + * @param runtimeEnvironment + * @throws Exception_Exception + */ + @WebMethod(action = "setGroupRuntimeEnvironment") + @RequestWrapper(localName = "setGroupRuntimeEnvironment", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetGroupRuntimeEnvironment") + @ResponseWrapper(localName = "setGroupRuntimeEnvironmentResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetGroupRuntimeEnvironmentResponse") + @Action(input = "setGroupRuntimeEnvironment", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setGroupRuntimeEnvironmentResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setGroupRuntimeEnvironment/Fault/Exception") + }) + public void setGroupRuntimeEnvironment( + @WebParam(name = "groupId", targetNamespace = "") + String groupId, + @WebParam(name = "runtimeEnvironment", targetNamespace = "") + RuntimeEnvironment runtimeEnvironment) + throws Exception_Exception + ; + + /** + * + * @param exportRequest + * @throws Exception_Exception + */ + @WebMethod(action = "exportAsset") + @RequestWrapper(localName = "exportAsset", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.ExportAsset") + @ResponseWrapper(localName = "exportAssetResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.ExportAssetResponse") + @Action(input = "exportAsset", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/exportAssetResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/exportAsset/Fault/Exception") + }) + public void exportAsset( + @WebParam(name = "exportRequest", targetNamespace = "") + AssetExportRequest exportRequest) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getGroupList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getGroupList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetGroupList") + @ResponseWrapper(localName = "getGroupListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetGroupListResponse") + @Action(input = "getGroupList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getGroupListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getGroupList/Fault/Exception") + }) + public List getGroupList() + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getAgentList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getAgentList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAgentList") + @ResponseWrapper(localName = "getAgentListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAgentListResponse") + @Action(input = "getAgentList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAgentListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAgentList/Fault/Exception") + }) + public List getAgentList() + throws Exception_Exception + ; + + /** + * + * @param id + * @throws Exception_Exception + */ + @WebMethod(action = "cancelJob") + @RequestWrapper(localName = "cancelJob", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CancelJob") + @ResponseWrapper(localName = "cancelJobResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.CancelJobResponse") + @Action(input = "cancelJob", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/cancelJobResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/cancelJob/Fault/Exception") + }) + public void cancelJob( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param id + * @param movePhysicalFile + * @param newFullPath + * @throws Exception_Exception + */ + @WebMethod(action = "moveFileSnapshotFile") + @RequestWrapper(localName = "moveFileSnapshotFile", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.MoveFileSnapshotFile") + @ResponseWrapper(localName = "moveFileSnapshotFileResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.MoveFileSnapshotFileResponse") + @Action(input = "moveFileSnapshotFile", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/moveFileSnapshotFileResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/moveFileSnapshotFile/Fault/Exception") + }) + public void moveFileSnapshotFile( + @WebParam(name = "id", targetNamespace = "") + String id, + @WebParam(name = "newFullPath", targetNamespace = "") + String newFullPath, + @WebParam(name = "movePhysicalFile", targetNamespace = "") + boolean movePhysicalFile) + throws Exception_Exception + ; + + /** + * + * @param groupId + * @param resourceId + * @throws Exception_Exception + */ + @WebMethod(action = "addResourceToGroup") + @RequestWrapper(localName = "addResourceToGroup", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.AddResourceToGroup") + @ResponseWrapper(localName = "addResourceToGroupResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.AddResourceToGroupResponse") + @Action(input = "addResourceToGroup", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/addResourceToGroupResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/addResourceToGroup/Fault/Exception") + }) + public void addResourceToGroup( + @WebParam(name = "resourceId", targetNamespace = "") + String resourceId, + @WebParam(name = "groupId", targetNamespace = "") + String groupId) + throws Exception_Exception + ; + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.Job + * @throws Exception_Exception + */ + @WebMethod(action = "getJob") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getJob", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetJob") + @ResponseWrapper(localName = "getJobResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetJobResponse") + @Action(input = "getJob", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getJobResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getJob/Fault/Exception") + }) + public Job getJob( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.Asset + * @throws Exception_Exception + */ + @WebMethod(action = "getAsset") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getAsset", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAsset") + @ResponseWrapper(localName = "getAssetResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAssetResponse") + @Action(input = "getAsset", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAssetResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAsset/Fault/Exception") + }) + public Asset getAsset( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param id + * @throws Exception_Exception + */ + @WebMethod(action = "deleteAsset") + @RequestWrapper(localName = "deleteAsset", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.DeleteAsset") + @ResponseWrapper(localName = "deleteAssetResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.DeleteAssetResponse") + @Action(input = "deleteAsset", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/deleteAssetResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/deleteAsset/Fault/Exception") + }) + public void deleteAsset( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param search + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "findAssets") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "findAssets", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.FindAssets") + @ResponseWrapper(localName = "findAssetsResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.FindAssetsResponse") + @Action(input = "findAssets", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/findAssetsResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/findAssets/Fault/Exception") + }) + public List findAssets( + @WebParam(name = "search", targetNamespace = "") + AssetLayerSearch search) + throws Exception_Exception + ; + + /** + * + * @param scheduledJob + * @return + * returns user.commons.selenio.wsclient.ScheduledJob + * @throws Exception_Exception + */ + @WebMethod(action = "addScheduledJob") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "addScheduledJob", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.AddScheduledJob") + @ResponseWrapper(localName = "addScheduledJobResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.AddScheduledJobResponse") + @Action(input = "addScheduledJob", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/addScheduledJobResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/addScheduledJob/Fault/Exception") + }) + public ScheduledJob addScheduledJob( + @WebParam(name = "scheduledJob", targetNamespace = "") + ScheduledJob scheduledJob) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getProjectList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getProjectList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetProjectList") + @ResponseWrapper(localName = "getProjectListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetProjectListResponse") + @Action(input = "getProjectList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getProjectListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getProjectList/Fault/Exception") + }) + public List getProjectList() + throws Exception_Exception + ; + + /** + * + * @param id + * @param withData + * @return + * returns user.commons.selenio.wsclient.FileSnapshot + */ + @WebMethod(action = "getFileSnapshot") + @WebResult(name = "fileSnapshot", targetNamespace = "") + @RequestWrapper(localName = "getFileSnapshot", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetFileSnapshot") + @ResponseWrapper(localName = "getFileSnapshotResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetFileSnapshotResponse") + @Action(input = "getFileSnapshot", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getFileSnapshotResponse") + public FileSnapshot getFileSnapshot( + @WebParam(name = "id", targetNamespace = "") + String id, + @WebParam(name = "withData", targetNamespace = "") + boolean withData); + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getAssetProfiles") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getAssetProfiles", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAssetProfiles") + @ResponseWrapper(localName = "getAssetProfilesResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetAssetProfilesResponse") + @Action(input = "getAssetProfiles", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAssetProfilesResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getAssetProfiles/Fault/Exception") + }) + public List getAssetProfiles() + throws Exception_Exception + ; + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.ScheduledJob + * @throws Exception_Exception + */ + @WebMethod(action = "getScheduledJob") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getScheduledJob", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJob") + @ResponseWrapper(localName = "getScheduledJobResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJobResponse") + @Action(input = "getScheduledJob", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJobResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJob/Fault/Exception") + }) + public ScheduledJob getScheduledJob( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param asset + * @throws Exception_Exception + */ + @WebMethod(action = "modifyAsset") + @RequestWrapper(localName = "modifyAsset", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.ModifyAsset") + @ResponseWrapper(localName = "modifyAssetResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.ModifyAssetResponse") + @Action(input = "modifyAsset", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/modifyAssetResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/modifyAsset/Fault/Exception") + }) + public void modifyAsset( + @WebParam(name = "asset", targetNamespace = "") + Asset asset) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getScriptList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getScriptList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScriptList") + @ResponseWrapper(localName = "getScriptListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScriptListResponse") + @Action(input = "getScriptList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScriptListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScriptList/Fault/Exception") + }) + public List getScriptList() + throws Exception_Exception + ; + + /** + * + * @param id + * @return + * returns user.commons.selenio.wsclient.FileSnapshot + * @throws Exception_Exception + */ + @WebMethod(action = "getProject") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getProject", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetProject") + @ResponseWrapper(localName = "getProjectResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetProjectResponse") + @Action(input = "getProject", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getProjectResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getProject/Fault/Exception") + }) + public FileSnapshot getProject( + @WebParam(name = "id", targetNamespace = "") + String id) + throws Exception_Exception + ; + + /** + * + * @param request + * @return + * returns user.commons.selenio.wsclient.MediaProperties + * @throws Exception_Exception + */ + @WebMethod(action = "getMediaProperties") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getMediaProperties", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetMediaProperties") + @ResponseWrapper(localName = "getMediaPropertiesResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetMediaPropertiesResponse") + @Action(input = "getMediaProperties", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getMediaPropertiesResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getMediaProperties/Fault/Exception") + }) + public MediaProperties getMediaProperties( + @WebParam(name = "request", targetNamespace = "") + MediaInspectionRequest request) + throws Exception_Exception + ; + + /** + * + * @param asset + * @return + * returns user.commons.selenio.wsclient.Asset + * @throws Exception_Exception + */ + @WebMethod(action = "addAsset") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "addAsset", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.AddAsset") + @ResponseWrapper(localName = "addAssetResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.AddAssetResponse") + @Action(input = "addAsset", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/addAssetResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/addAsset/Fault/Exception") + }) + public Asset addAsset( + @WebParam(name = "asset", targetNamespace = "") + Asset asset) + throws Exception_Exception + ; + + /** + * + * @return + * returns java.util.List + * @throws Exception_Exception + */ + @WebMethod(action = "getScheduledJobStatusList") + @WebResult(targetNamespace = "") + @RequestWrapper(localName = "getScheduledJobStatusList", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJobStatusList") + @ResponseWrapper(localName = "getScheduledJobStatusListResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.GetScheduledJobStatusListResponse") + @Action(input = "getScheduledJobStatusList", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJobStatusListResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/getScheduledJobStatusList/Fault/Exception") + }) + public List getScheduledJobStatusList() + throws Exception_Exception + ; + + /** + * + * @param groupId + * @param resourcePropertyList + * @throws Exception_Exception + */ + @WebMethod(action = "setRuntimeEnvironmentForGroup") + @RequestWrapper(localName = "setRuntimeEnvironmentForGroup", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetRuntimeEnvironmentForGroup") + @ResponseWrapper(localName = "setRuntimeEnvironmentForGroupResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetRuntimeEnvironmentForGroupResponse") + @Action(input = "setRuntimeEnvironmentForGroup", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setRuntimeEnvironmentForGroupResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setRuntimeEnvironmentForGroup/Fault/Exception") + }) + public void setRuntimeEnvironmentForGroup( + @WebParam(name = "groupId", targetNamespace = "") + String groupId, + @WebParam(name = "resourcePropertyList", targetNamespace = "") + ResourcePropertyList resourcePropertyList) + throws Exception_Exception + ; + + /** + * + * @param id + * @param online + * @throws Exception_Exception + */ + @WebMethod(action = "setResourceOnline") + @RequestWrapper(localName = "setResourceOnline", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetResourceOnline") + @ResponseWrapper(localName = "setResourceOnlineResponse", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", className = "user.commons.selenio.wsclient.SetResourceOnlineResponse") + @Action(input = "setResourceOnline", output = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setResourceOnlineResponse", fault = { + @FaultAction(className = Exception_Exception.class, value = "http://ws.server.mediamanager.digitalrapids.ca/TranscodeMgrWS/setResourceOnline/Fault/Exception") + }) + public void setResourceOnline( + @WebParam(name = "id", targetNamespace = "") + String id, + @WebParam(name = "online", targetNamespace = "") + boolean online) + throws Exception_Exception + ; + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeMgrWSService.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeMgrWSService.java new file mode 100644 index 00000000..584f84bd --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeMgrWSService.java @@ -0,0 +1,94 @@ + +package user.commons.selenio.wsclient; + +import java.net.MalformedURLException; +import java.net.URL; +import javax.xml.namespace.QName; +import javax.xml.ws.Service; +import javax.xml.ws.WebEndpoint; +import javax.xml.ws.WebServiceClient; +import javax.xml.ws.WebServiceException; +import javax.xml.ws.WebServiceFeature; + + +/** + * This class was generated by the JAX-WS RI. + * JAX-WS RI 2.2.4-b01 + * Generated source version: 2.2 + * + */ +@WebServiceClient(name = "TranscodeMgrWSService", targetNamespace = "http://ws.server.mediamanager.digitalrapids.ca/", wsdlLocation = "http://10.10.1.71:44000/TranscodeMgrWS?wsdl") +public class TranscodeMgrWSService + extends Service +{ + + private final static URL TRANSCODEMGRWSSERVICE_WSDL_LOCATION; + private final static WebServiceException TRANSCODEMGRWSSERVICE_EXCEPTION; + private final static QName TRANSCODEMGRWSSERVICE_QNAME = new QName("http://ws.server.mediamanager.digitalrapids.ca/", "TranscodeMgrWSService"); + + static { + URL url = null; + WebServiceException e = null; + try { + url = new URL("http://10.10.1.71:44000/TranscodeMgrWS?wsdl"); + } catch (MalformedURLException ex) { + e = new WebServiceException(ex); + } + TRANSCODEMGRWSSERVICE_WSDL_LOCATION = url; + TRANSCODEMGRWSSERVICE_EXCEPTION = e; + } + + public TranscodeMgrWSService() { + super(__getWsdlLocation(), TRANSCODEMGRWSSERVICE_QNAME); + } + + public TranscodeMgrWSService(WebServiceFeature... features) { + super(__getWsdlLocation(), TRANSCODEMGRWSSERVICE_QNAME, features); + } + + public TranscodeMgrWSService(URL wsdlLocation) { + super(wsdlLocation, TRANSCODEMGRWSSERVICE_QNAME); + } + + public TranscodeMgrWSService(URL wsdlLocation, WebServiceFeature... features) { + super(wsdlLocation, TRANSCODEMGRWSSERVICE_QNAME, features); + } + + public TranscodeMgrWSService(URL wsdlLocation, QName serviceName) { + super(wsdlLocation, serviceName); + } + + public TranscodeMgrWSService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) { + super(wsdlLocation, serviceName, features); + } + + /** + * + * @return + * returns TranscodeMgrWS + */ + @WebEndpoint(name = "TranscodeMgrWSPort") + public TranscodeMgrWS getTranscodeMgrWSPort() { + return super.getPort(new QName("http://ws.server.mediamanager.digitalrapids.ca/", "TranscodeMgrWSPort"), TranscodeMgrWS.class); + } + + /** + * + * @param features + * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. + * @return + * returns TranscodeMgrWS + */ + @WebEndpoint(name = "TranscodeMgrWSPort") + public TranscodeMgrWS getTranscodeMgrWSPort(WebServiceFeature... features) { + return super.getPort(new QName("http://ws.server.mediamanager.digitalrapids.ca/", "TranscodeMgrWSPort"), TranscodeMgrWS.class, features); + } + + private static URL __getWsdlLocation() { + if (TRANSCODEMGRWSSERVICE_EXCEPTION!= null) { + throw TRANSCODEMGRWSSERVICE_EXCEPTION; + } + return TRANSCODEMGRWSSERVICE_WSDL_LOCATION; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeRequest.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeRequest.java new file mode 100644 index 00000000..4c3163e6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeRequest.java @@ -0,0 +1,629 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for transcodeRequest complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="transcodeRequest">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="project" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *         <element name="group" type="{http://ws.server.mediamanager.digitalrapids.ca/}group" minOccurs="0"/>
+ *         <element name="transcodeSource" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeSource" minOccurs="0"/>
+ *         <element name="transcodeDestination" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeDestination" minOccurs="0"/>
+ *         <element name="scripts" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="eventScript" type="{http://ws.server.mediamanager.digitalrapids.ca/}eventScript" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="splitProfileOption" type="{http://ws.server.mediamanager.digitalrapids.ca/}splitProfileOption" minOccurs="0"/>
+ *         <element name="videoProcessingOptions" type="{http://ws.server.mediamanager.digitalrapids.ca/}videoProcessingOptions" minOccurs="0"/>
+ *         <element name="priority" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="tagValues">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="entry" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                             <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="setRuntimeProperties" type="{http://ws.server.mediamanager.digitalrapids.ca/}propertiesSet" minOccurs="0"/>
+ *         <element name="qcOptions" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcOptions" minOccurs="0"/>
+ *         <element name="watchFolder" type="{http://ws.server.mediamanager.digitalrapids.ca/}watchFolder" minOccurs="0"/>
+ *         <element name="callback" type="{http://ws.server.mediamanager.digitalrapids.ca/}callback" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "transcodeRequest", propOrder = { + "project", + "group", + "transcodeSource", + "transcodeDestination", + "scripts", + "splitProfileOption", + "videoProcessingOptions", + "priority", + "tagValues", + "setRuntimeProperties", + "qcOptions", + "watchFolder", + "callback" +}) +public class TranscodeRequest { + + protected FileSnapshot project; + protected Group group; + protected TranscodeSource transcodeSource; + protected TranscodeDestination transcodeDestination; + protected TranscodeRequest.Scripts scripts; + protected SplitProfileOption splitProfileOption; + protected VideoProcessingOptions videoProcessingOptions; + protected Double priority; + @XmlElement(required = true) + protected TranscodeRequest.TagValues tagValues; + protected PropertiesSet setRuntimeProperties; + protected QcOptions qcOptions; + protected WatchFolder watchFolder; + protected Callback callback; + + /** + * Gets the value of the project property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getProject() { + return project; + } + + /** + * Sets the value of the project property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setProject(FileSnapshot value) { + this.project = value; + } + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link Group } + * + */ + public Group getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link Group } + * + */ + public void setGroup(Group value) { + this.group = value; + } + + /** + * Gets the value of the transcodeSource property. + * + * @return + * possible object is + * {@link TranscodeSource } + * + */ + public TranscodeSource getTranscodeSource() { + return transcodeSource; + } + + /** + * Sets the value of the transcodeSource property. + * + * @param value + * allowed object is + * {@link TranscodeSource } + * + */ + public void setTranscodeSource(TranscodeSource value) { + this.transcodeSource = value; + } + + /** + * Gets the value of the transcodeDestination property. + * + * @return + * possible object is + * {@link TranscodeDestination } + * + */ + public TranscodeDestination getTranscodeDestination() { + return transcodeDestination; + } + + /** + * Sets the value of the transcodeDestination property. + * + * @param value + * allowed object is + * {@link TranscodeDestination } + * + */ + public void setTranscodeDestination(TranscodeDestination value) { + this.transcodeDestination = value; + } + + /** + * Gets the value of the scripts property. + * + * @return + * possible object is + * {@link TranscodeRequest.Scripts } + * + */ + public TranscodeRequest.Scripts getScripts() { + return scripts; + } + + /** + * Sets the value of the scripts property. + * + * @param value + * allowed object is + * {@link TranscodeRequest.Scripts } + * + */ + public void setScripts(TranscodeRequest.Scripts value) { + this.scripts = value; + } + + /** + * Gets the value of the splitProfileOption property. + * + * @return + * possible object is + * {@link SplitProfileOption } + * + */ + public SplitProfileOption getSplitProfileOption() { + return splitProfileOption; + } + + /** + * Sets the value of the splitProfileOption property. + * + * @param value + * allowed object is + * {@link SplitProfileOption } + * + */ + public void setSplitProfileOption(SplitProfileOption value) { + this.splitProfileOption = value; + } + + /** + * Gets the value of the videoProcessingOptions property. + * + * @return + * possible object is + * {@link VideoProcessingOptions } + * + */ + public VideoProcessingOptions getVideoProcessingOptions() { + return videoProcessingOptions; + } + + /** + * Sets the value of the videoProcessingOptions property. + * + * @param value + * allowed object is + * {@link VideoProcessingOptions } + * + */ + public void setVideoProcessingOptions(VideoProcessingOptions value) { + this.videoProcessingOptions = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setPriority(Double value) { + this.priority = value; + } + + /** + * Gets the value of the tagValues property. + * + * @return + * possible object is + * {@link TranscodeRequest.TagValues } + * + */ + public TranscodeRequest.TagValues getTagValues() { + return tagValues; + } + + /** + * Sets the value of the tagValues property. + * + * @param value + * allowed object is + * {@link TranscodeRequest.TagValues } + * + */ + public void setTagValues(TranscodeRequest.TagValues value) { + this.tagValues = value; + } + + /** + * Gets the value of the setRuntimeProperties property. + * + * @return + * possible object is + * {@link PropertiesSet } + * + */ + public PropertiesSet getSetRuntimeProperties() { + return setRuntimeProperties; + } + + /** + * Sets the value of the setRuntimeProperties property. + * + * @param value + * allowed object is + * {@link PropertiesSet } + * + */ + public void setSetRuntimeProperties(PropertiesSet value) { + this.setRuntimeProperties = value; + } + + /** + * Gets the value of the qcOptions property. + * + * @return + * possible object is + * {@link QcOptions } + * + */ + public QcOptions getQcOptions() { + return qcOptions; + } + + /** + * Sets the value of the qcOptions property. + * + * @param value + * allowed object is + * {@link QcOptions } + * + */ + public void setQcOptions(QcOptions value) { + this.qcOptions = value; + } + + /** + * Gets the value of the watchFolder property. + * + * @return + * possible object is + * {@link WatchFolder } + * + */ + public WatchFolder getWatchFolder() { + return watchFolder; + } + + /** + * Sets the value of the watchFolder property. + * + * @param value + * allowed object is + * {@link WatchFolder } + * + */ + public void setWatchFolder(WatchFolder value) { + this.watchFolder = value; + } + + /** + * Gets the value of the callback property. + * + * @return + * possible object is + * {@link Callback } + * + */ + public Callback getCallback() { + return callback; + } + + /** + * Sets the value of the callback property. + * + * @param value + * allowed object is + * {@link Callback } + * + */ + public void setCallback(Callback value) { + this.callback = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="eventScript" type="{http://ws.server.mediamanager.digitalrapids.ca/}eventScript" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "eventScript" + }) + public static class Scripts { + + protected List eventScript; + + /** + * Gets the value of the eventScript property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the eventScript property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getEventScript().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link EventScript } + * + * + */ + public List getEventScript() { + if (eventScript == null) { + eventScript = new ArrayList(); + } + return this.eventScript; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="entry" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "entry" + }) + public static class TagValues { + + protected List entry; + + /** + * Gets the value of the entry property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the entry property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getEntry().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TranscodeRequest.TagValues.Entry } + * + * + */ + public List getEntry() { + if (entry == null) { + entry = new ArrayList(); + } + return this.entry; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+         *       </sequence>
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "key", + "value" + }) + public static class Entry { + + protected String key; + protected String value; + + /** + * Gets the value of the key property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getKey() { + return key; + } + + /** + * Sets the value of the key property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKey(String value) { + this.key = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeSource.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeSource.java new file mode 100644 index 00000000..38e89bc9 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeSource.java @@ -0,0 +1,114 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for transcodeSource complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="transcodeSource">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="clipList" type="{http://ws.server.mediamanager.digitalrapids.ca/}clipList" minOccurs="0"/>
+ *         <element name="extendedClipList" type="{http://ws.server.mediamanager.digitalrapids.ca/}extendedClipList" minOccurs="0"/>
+ *         <element name="sourceFileId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "transcodeSource", propOrder = { + "clipList", + "extendedClipList", + "sourceFileId" +}) +public class TranscodeSource { + + protected ClipList clipList; + protected ExtendedClipList extendedClipList; + protected String sourceFileId; + + /** + * Gets the value of the clipList property. + * + * @return + * possible object is + * {@link ClipList } + * + */ + public ClipList getClipList() { + return clipList; + } + + /** + * Sets the value of the clipList property. + * + * @param value + * allowed object is + * {@link ClipList } + * + */ + public void setClipList(ClipList value) { + this.clipList = value; + } + + /** + * Gets the value of the extendedClipList property. + * + * @return + * possible object is + * {@link ExtendedClipList } + * + */ + public ExtendedClipList getExtendedClipList() { + return extendedClipList; + } + + /** + * Sets the value of the extendedClipList property. + * + * @param value + * allowed object is + * {@link ExtendedClipList } + * + */ + public void setExtendedClipList(ExtendedClipList value) { + this.extendedClipList = value; + } + + /** + * Gets the value of the sourceFileId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceFileId() { + return sourceFileId; + } + + /** + * Sets the value of the sourceFileId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceFileId(String value) { + this.sourceFileId = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeTask.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeTask.java new file mode 100644 index 00000000..3a9004d2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeTask.java @@ -0,0 +1,814 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + *

Java class for transcodeTask complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="transcodeTask">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="state" type="{http://ws.server.mediamanager.digitalrapids.ca/}state" minOccurs="0"/>
+ *         <element name="group" type="{http://ws.server.mediamanager.digitalrapids.ca/}group" minOccurs="0"/>
+ *         <element name="projectName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="estimateSecondsRemaining" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *         <element name="progress" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="priority" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="statusDetail" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="encodeDescription" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sourceFiles" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="sourceFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaFile" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="outputFiles" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="outputFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaFile" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="outputAssets" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="asset" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="childTasks" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="childTasks" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeTask" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="qcTask" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcTask" minOccurs="0"/>
+ *         <element name="submittedTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="startedTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="endedTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <attribute name="parentTask" type="{http://www.w3.org/2001/XMLSchema}IDREF" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "transcodeTask", propOrder = { + "state", + "group", + "projectName", + "estimateSecondsRemaining", + "progress", + "priority", + "statusDetail", + "encodeDescription", + "sourceFiles", + "outputFiles", + "outputAssets", + "childTasks", + "qcTask", + "submittedTimestamp", + "startedTimestamp", + "endedTimestamp" +}) +public class TranscodeTask { + + protected State state; + protected Group group; + protected String projectName; + protected Integer estimateSecondsRemaining; + protected Double progress; + protected Double priority; + protected String statusDetail; + protected String encodeDescription; + protected TranscodeTask.SourceFiles sourceFiles; + protected TranscodeTask.OutputFiles outputFiles; + protected TranscodeTask.OutputAssets outputAssets; + protected TranscodeTask.ChildTasks childTasks; + protected QcTask qcTask; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar submittedTimestamp; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar startedTimestamp; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar endedTimestamp; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(name = "parentTask") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + protected Object parentTask; + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link State } + * + */ + public State getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link State } + * + */ + public void setState(State value) { + this.state = value; + } + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link Group } + * + */ + public Group getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link Group } + * + */ + public void setGroup(Group value) { + this.group = value; + } + + /** + * Gets the value of the projectName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProjectName() { + return projectName; + } + + /** + * Sets the value of the projectName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProjectName(String value) { + this.projectName = value; + } + + /** + * Gets the value of the estimateSecondsRemaining property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getEstimateSecondsRemaining() { + return estimateSecondsRemaining; + } + + /** + * Sets the value of the estimateSecondsRemaining property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setEstimateSecondsRemaining(Integer value) { + this.estimateSecondsRemaining = value; + } + + /** + * Gets the value of the progress property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getProgress() { + return progress; + } + + /** + * Sets the value of the progress property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setProgress(Double value) { + this.progress = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setPriority(Double value) { + this.priority = value; + } + + /** + * Gets the value of the statusDetail property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStatusDetail() { + return statusDetail; + } + + /** + * Sets the value of the statusDetail property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStatusDetail(String value) { + this.statusDetail = value; + } + + /** + * Gets the value of the encodeDescription property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEncodeDescription() { + return encodeDescription; + } + + /** + * Sets the value of the encodeDescription property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEncodeDescription(String value) { + this.encodeDescription = value; + } + + /** + * Gets the value of the sourceFiles property. + * + * @return + * possible object is + * {@link TranscodeTask.SourceFiles } + * + */ + public TranscodeTask.SourceFiles getSourceFiles() { + return sourceFiles; + } + + /** + * Sets the value of the sourceFiles property. + * + * @param value + * allowed object is + * {@link TranscodeTask.SourceFiles } + * + */ + public void setSourceFiles(TranscodeTask.SourceFiles value) { + this.sourceFiles = value; + } + + /** + * Gets the value of the outputFiles property. + * + * @return + * possible object is + * {@link TranscodeTask.OutputFiles } + * + */ + public TranscodeTask.OutputFiles getOutputFiles() { + return outputFiles; + } + + /** + * Sets the value of the outputFiles property. + * + * @param value + * allowed object is + * {@link TranscodeTask.OutputFiles } + * + */ + public void setOutputFiles(TranscodeTask.OutputFiles value) { + this.outputFiles = value; + } + + /** + * Gets the value of the outputAssets property. + * + * @return + * possible object is + * {@link TranscodeTask.OutputAssets } + * + */ + public TranscodeTask.OutputAssets getOutputAssets() { + return outputAssets; + } + + /** + * Sets the value of the outputAssets property. + * + * @param value + * allowed object is + * {@link TranscodeTask.OutputAssets } + * + */ + public void setOutputAssets(TranscodeTask.OutputAssets value) { + this.outputAssets = value; + } + + /** + * Gets the value of the childTasks property. + * + * @return + * possible object is + * {@link TranscodeTask.ChildTasks } + * + */ + public TranscodeTask.ChildTasks getChildTasks() { + return childTasks; + } + + /** + * Sets the value of the childTasks property. + * + * @param value + * allowed object is + * {@link TranscodeTask.ChildTasks } + * + */ + public void setChildTasks(TranscodeTask.ChildTasks value) { + this.childTasks = value; + } + + /** + * Gets the value of the qcTask property. + * + * @return + * possible object is + * {@link QcTask } + * + */ + public QcTask getQcTask() { + return qcTask; + } + + /** + * Sets the value of the qcTask property. + * + * @param value + * allowed object is + * {@link QcTask } + * + */ + public void setQcTask(QcTask value) { + this.qcTask = value; + } + + /** + * Gets the value of the submittedTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getSubmittedTimestamp() { + return submittedTimestamp; + } + + /** + * Sets the value of the submittedTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setSubmittedTimestamp(XMLGregorianCalendar value) { + this.submittedTimestamp = value; + } + + /** + * Gets the value of the startedTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getStartedTimestamp() { + return startedTimestamp; + } + + /** + * Sets the value of the startedTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setStartedTimestamp(XMLGregorianCalendar value) { + this.startedTimestamp = value; + } + + /** + * Gets the value of the endedTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getEndedTimestamp() { + return endedTimestamp; + } + + /** + * Sets the value of the endedTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setEndedTimestamp(XMLGregorianCalendar value) { + this.endedTimestamp = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the parentTask property. + * + * @return + * possible object is + * {@link Object } + * + */ + public Object getParentTask() { + return parentTask; + } + + /** + * Sets the value of the parentTask property. + * + * @param value + * allowed object is + * {@link Object } + * + */ + public void setParentTask(Object value) { + this.parentTask = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="childTasks" type="{http://ws.server.mediamanager.digitalrapids.ca/}transcodeTask" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "childTasks" + }) + public static class ChildTasks { + + @XmlElement(nillable = true) + protected List childTasks; + + /** + * Gets the value of the childTasks property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the childTasks property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getChildTasks().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TranscodeTask } + * + * + */ + public List getChildTasks() { + if (childTasks == null) { + childTasks = new ArrayList(); + } + return this.childTasks; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="asset" type="{http://ws.server.mediamanager.digitalrapids.ca/}asset" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "asset" + }) + public static class OutputAssets { + + protected List asset; + + /** + * Gets the value of the asset property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the asset property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getAsset().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Asset } + * + * + */ + public List getAsset() { + if (asset == null) { + asset = new ArrayList(); + } + return this.asset; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="outputFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaFile" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "outputFiles" + }) + public static class OutputFiles { + + protected List outputFiles; + + /** + * Gets the value of the outputFiles property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the outputFiles property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getOutputFiles().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MediaFile } + * + * + */ + public List getOutputFiles() { + if (outputFiles == null) { + outputFiles = new ArrayList(); + } + return this.outputFiles; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="sourceFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaFile" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "sourceFiles" + }) + public static class SourceFiles { + + protected List sourceFiles; + + /** + * Gets the value of the sourceFiles property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the sourceFiles property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getSourceFiles().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MediaFile } + * + * + */ + public List getSourceFiles() { + if (sourceFiles == null) { + sourceFiles = new ArrayList(); + } + return this.sourceFiles; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeTaskSearch.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeTaskSearch.java new file mode 100644 index 00000000..1f236292 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/TranscodeTaskSearch.java @@ -0,0 +1,382 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; + + +/** + *

Java class for transcodeTaskSearch complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="transcodeTaskSearch">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="incompleteTasks" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="taskStates" type="{http://ws.server.mediamanager.digitalrapids.ca/}state" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="taskIds" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="minEndedTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="maxEndedTimestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="hasChildren" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="hasParent" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="groups" type="{http://ws.server.mediamanager.digitalrapids.ca/}group" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="projectName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sourceFilename" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="outputFilename" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="maxResults" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "transcodeTaskSearch", propOrder = { + "incompleteTasks", + "taskStates", + "taskIds", + "minEndedTimestamp", + "maxEndedTimestamp", + "hasChildren", + "hasParent", + "groups", + "projectName", + "sourceFilename", + "outputFilename", + "maxResults" +}) +public class TranscodeTaskSearch { + + protected Boolean incompleteTasks; + @XmlElement(nillable = true) + protected List taskStates; + @XmlElement(nillable = true) + protected List taskIds; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar minEndedTimestamp; + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar maxEndedTimestamp; + protected Boolean hasChildren; + protected Boolean hasParent; + @XmlElement(nillable = true) + protected List groups; + protected String projectName; + protected String sourceFilename; + protected String outputFilename; + protected Integer maxResults; + + /** + * Gets the value of the incompleteTasks property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isIncompleteTasks() { + return incompleteTasks; + } + + /** + * Sets the value of the incompleteTasks property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setIncompleteTasks(Boolean value) { + this.incompleteTasks = value; + } + + /** + * Gets the value of the taskStates property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the taskStates property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTaskStates().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link State } + * + * + */ + public List getTaskStates() { + if (taskStates == null) { + taskStates = new ArrayList(); + } + return this.taskStates; + } + + /** + * Gets the value of the taskIds property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the taskIds property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTaskIds().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getTaskIds() { + if (taskIds == null) { + taskIds = new ArrayList(); + } + return this.taskIds; + } + + /** + * Gets the value of the minEndedTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getMinEndedTimestamp() { + return minEndedTimestamp; + } + + /** + * Sets the value of the minEndedTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setMinEndedTimestamp(XMLGregorianCalendar value) { + this.minEndedTimestamp = value; + } + + /** + * Gets the value of the maxEndedTimestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getMaxEndedTimestamp() { + return maxEndedTimestamp; + } + + /** + * Sets the value of the maxEndedTimestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setMaxEndedTimestamp(XMLGregorianCalendar value) { + this.maxEndedTimestamp = value; + } + + /** + * Gets the value of the hasChildren property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isHasChildren() { + return hasChildren; + } + + /** + * Sets the value of the hasChildren property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setHasChildren(Boolean value) { + this.hasChildren = value; + } + + /** + * Gets the value of the hasParent property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isHasParent() { + return hasParent; + } + + /** + * Sets the value of the hasParent property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setHasParent(Boolean value) { + this.hasParent = value; + } + + /** + * Gets the value of the groups property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the groups property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getGroups().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Group } + * + * + */ + public List getGroups() { + if (groups == null) { + groups = new ArrayList(); + } + return this.groups; + } + + /** + * Gets the value of the projectName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProjectName() { + return projectName; + } + + /** + * Sets the value of the projectName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProjectName(String value) { + this.projectName = value; + } + + /** + * Gets the value of the sourceFilename property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceFilename() { + return sourceFilename; + } + + /** + * Sets the value of the sourceFilename property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceFilename(String value) { + this.sourceFilename = value; + } + + /** + * Gets the value of the outputFilename property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOutputFilename() { + return outputFilename; + } + + /** + * Sets the value of the outputFilename property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutputFilename(String value) { + this.outputFilename = value; + } + + /** + * Gets the value of the maxResults property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getMaxResults() { + return maxResults; + } + + /** + * Sets the value of the maxResults property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setMaxResults(Integer value) { + this.maxResults = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Trim.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Trim.java new file mode 100644 index 00000000..28ad3f97 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/Trim.java @@ -0,0 +1,141 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for trim complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="trim">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="start" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="duration" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="inPoint" type="{http://ws.server.mediamanager.digitalrapids.ca/}timecode" minOccurs="0"/>
+ *         <element name="outPoint" type="{http://ws.server.mediamanager.digitalrapids.ca/}timecode" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "trim", propOrder = { + "start", + "duration", + "inPoint", + "outPoint" +}) +public class Trim { + + protected Double start; + protected Double duration; + protected Timecode inPoint; + protected Timecode outPoint; + + /** + * Gets the value of the start property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getStart() { + return start; + } + + /** + * Sets the value of the start property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setStart(Double value) { + this.start = value; + } + + /** + * Gets the value of the duration property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getDuration() { + return duration; + } + + /** + * Sets the value of the duration property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setDuration(Double value) { + this.duration = value; + } + + /** + * Gets the value of the inPoint property. + * + * @return + * possible object is + * {@link Timecode } + * + */ + public Timecode getInPoint() { + return inPoint; + } + + /** + * Sets the value of the inPoint property. + * + * @param value + * allowed object is + * {@link Timecode } + * + */ + public void setInPoint(Timecode value) { + this.inPoint = value; + } + + /** + * Gets the value of the outPoint property. + * + * @return + * possible object is + * {@link Timecode } + * + */ + public Timecode getOutPoint() { + return outPoint; + } + + /** + * Sets the value of the outPoint property. + * + * @param value + * allowed object is + * {@link Timecode } + * + */ + public void setOutPoint(Timecode value) { + this.outPoint = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VidcheckerOptions.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VidcheckerOptions.java new file mode 100644 index 00000000..fb3e1cb7 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VidcheckerOptions.java @@ -0,0 +1,89 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for vidcheckerOptions complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="vidcheckerOptions">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}qcOptions">
+ *       <sequence>
+ *         <element name="templateName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="priority" type="{http://ws.server.mediamanager.digitalrapids.ca/}vidcheckerPriority" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "vidcheckerOptions", propOrder = { + "templateName", + "priority" +}) +public class VidcheckerOptions + extends QcOptions +{ + + protected String templateName; + protected VidcheckerPriority priority; + + /** + * Gets the value of the templateName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getTemplateName() { + return templateName; + } + + /** + * Sets the value of the templateName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTemplateName(String value) { + this.templateName = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link VidcheckerPriority } + * + */ + public VidcheckerPriority getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link VidcheckerPriority } + * + */ + public void setPriority(VidcheckerPriority value) { + this.priority = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VidcheckerPriority.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VidcheckerPriority.java new file mode 100644 index 00000000..d1399bf2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VidcheckerPriority.java @@ -0,0 +1,54 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for vidcheckerPriority. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="vidcheckerPriority">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="Low"/>
+ *     <enumeration value="Medium"/>
+ *     <enumeration value="High"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "vidcheckerPriority") +@XmlEnum +public enum VidcheckerPriority { + + @XmlEnumValue("Low") + LOW("Low"), + @XmlEnumValue("Medium") + MEDIUM("Medium"), + @XmlEnumValue("High") + HIGH("High"); + private final String value; + + VidcheckerPriority(String v) { + value = v; + } + + public String value() { + return value; + } + + public static VidcheckerPriority fromValue(String v) { + for (VidcheckerPriority c: VidcheckerPriority.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VideoProcessingOptions.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VideoProcessingOptions.java new file mode 100644 index 00000000..5fdd8a5d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VideoProcessingOptions.java @@ -0,0 +1,123 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for videoProcessingOptions complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="videoProcessingOptions">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="autoCropBlackBorders" type="{http://ws.server.mediamanager.digitalrapids.ca/}border" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="autoAdjustAspectRatio" type="{http://ws.server.mediamanager.digitalrapids.ca/}adjustAspectRatioMode" minOccurs="0"/>
+ *         <element name="autoCommercialBlackRemoval" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "videoProcessingOptions", propOrder = { + "autoCropBlackBorders", + "autoAdjustAspectRatio", + "autoCommercialBlackRemoval" +}) +public class VideoProcessingOptions { + + @XmlElement(nillable = true) + protected List autoCropBlackBorders; + protected AdjustAspectRatioMode autoAdjustAspectRatio; + protected Boolean autoCommercialBlackRemoval; + + /** + * Gets the value of the autoCropBlackBorders property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the autoCropBlackBorders property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAutoCropBlackBorders().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Border } + * + * + */ + public List getAutoCropBlackBorders() { + if (autoCropBlackBorders == null) { + autoCropBlackBorders = new ArrayList(); + } + return this.autoCropBlackBorders; + } + + /** + * Gets the value of the autoAdjustAspectRatio property. + * + * @return + * possible object is + * {@link AdjustAspectRatioMode } + * + */ + public AdjustAspectRatioMode getAutoAdjustAspectRatio() { + return autoAdjustAspectRatio; + } + + /** + * Sets the value of the autoAdjustAspectRatio property. + * + * @param value + * allowed object is + * {@link AdjustAspectRatioMode } + * + */ + public void setAutoAdjustAspectRatio(AdjustAspectRatioMode value) { + this.autoAdjustAspectRatio = value; + } + + /** + * Gets the value of the autoCommercialBlackRemoval property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isAutoCommercialBlackRemoval() { + return autoCommercialBlackRemoval; + } + + /** + * Sets the value of the autoCommercialBlackRemoval property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setAutoCommercialBlackRemoval(Boolean value) { + this.autoCommercialBlackRemoval = value; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VideoSource.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VideoSource.java new file mode 100644 index 00000000..42b06762 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/VideoSource.java @@ -0,0 +1,34 @@ + +package user.commons.selenio.wsclient; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for videoSource complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="videoSource">
+ *   <complexContent>
+ *     <extension base="{http://ws.server.mediamanager.digitalrapids.ca/}mediaSource">
+ *       <sequence>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "videoSource") +public class VideoSource + extends MediaSource +{ + + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/WatchFolder.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/WatchFolder.java new file mode 100644 index 00000000..4d9b02d9 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/WatchFolder.java @@ -0,0 +1,684 @@ + +package user.commons.selenio.wsclient; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for watchFolder complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="watchFolder">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="deleteSource" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="priority" type="{http://www.w3.org/2001/XMLSchema}double" minOccurs="0"/>
+ *         <element name="splitProfileOption" type="{http://ws.server.mediamanager.digitalrapids.ca/}splitProfileOption" minOccurs="0"/>
+ *         <element name="sourceIncludeExtensions" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sourceExcludeExtensions" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="outputFilesMovePath" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="outputFilesWritePath" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="sourceFilesMovePath" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="group" type="{http://ws.server.mediamanager.digitalrapids.ca/}group" minOccurs="0"/>
+ *         <element name="watchFolder" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *         <element name="projectFile" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" minOccurs="0"/>
+ *         <element name="headerFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="trailerFiles" type="{http://ws.server.mediamanager.digitalrapids.ca/}fileSnapshot" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="scripts" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="scripts" type="{http://ws.server.mediamanager.digitalrapids.ca/}eventScript" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="videoProcessingOptions" type="{http://ws.server.mediamanager.digitalrapids.ca/}videoProcessingOptions" minOccurs="0"/>
+ *         <element name="mediaReaderAudio" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaReaderEnum" minOccurs="0"/>
+ *         <element name="mediaReaderVideo" type="{http://ws.server.mediamanager.digitalrapids.ca/}mediaReaderEnum" minOccurs="0"/>
+ *         <element name="engineType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="qcOptions" type="{http://ws.server.mediamanager.digitalrapids.ca/}qcOptions" minOccurs="0"/>
+ *         <element name="callback" type="{http://ws.server.mediamanager.digitalrapids.ca/}callback" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "watchFolder", propOrder = { + "id", + "deleteSource", + "priority", + "splitProfileOption", + "sourceIncludeExtensions", + "sourceExcludeExtensions", + "outputFilesMovePath", + "outputFilesWritePath", + "sourceFilesMovePath", + "group", + "watchFolder", + "projectFile", + "headerFiles", + "trailerFiles", + "scripts", + "videoProcessingOptions", + "mediaReaderAudio", + "mediaReaderVideo", + "engineType", + "qcOptions", + "callback" +}) +public class WatchFolder { + + protected String id; + protected Boolean deleteSource; + protected Double priority; + protected SplitProfileOption splitProfileOption; + protected String sourceIncludeExtensions; + protected String sourceExcludeExtensions; + protected String outputFilesMovePath; + protected String outputFilesWritePath; + protected String sourceFilesMovePath; + protected Group group; + protected FileSnapshot watchFolder; + protected FileSnapshot projectFile; + @XmlElement(nillable = true) + protected List headerFiles; + @XmlElement(nillable = true) + protected List trailerFiles; + protected WatchFolder.Scripts scripts; + protected VideoProcessingOptions videoProcessingOptions; + protected MediaReaderEnum mediaReaderAudio; + protected MediaReaderEnum mediaReaderVideo; + protected String engineType; + protected QcOptions qcOptions; + protected Callback callback; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the deleteSource property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isDeleteSource() { + return deleteSource; + } + + /** + * Sets the value of the deleteSource property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setDeleteSource(Boolean value) { + this.deleteSource = value; + } + + /** + * Gets the value of the priority property. + * + * @return + * possible object is + * {@link Double } + * + */ + public Double getPriority() { + return priority; + } + + /** + * Sets the value of the priority property. + * + * @param value + * allowed object is + * {@link Double } + * + */ + public void setPriority(Double value) { + this.priority = value; + } + + /** + * Gets the value of the splitProfileOption property. + * + * @return + * possible object is + * {@link SplitProfileOption } + * + */ + public SplitProfileOption getSplitProfileOption() { + return splitProfileOption; + } + + /** + * Sets the value of the splitProfileOption property. + * + * @param value + * allowed object is + * {@link SplitProfileOption } + * + */ + public void setSplitProfileOption(SplitProfileOption value) { + this.splitProfileOption = value; + } + + /** + * Gets the value of the sourceIncludeExtensions property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceIncludeExtensions() { + return sourceIncludeExtensions; + } + + /** + * Sets the value of the sourceIncludeExtensions property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceIncludeExtensions(String value) { + this.sourceIncludeExtensions = value; + } + + /** + * Gets the value of the sourceExcludeExtensions property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceExcludeExtensions() { + return sourceExcludeExtensions; + } + + /** + * Sets the value of the sourceExcludeExtensions property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceExcludeExtensions(String value) { + this.sourceExcludeExtensions = value; + } + + /** + * Gets the value of the outputFilesMovePath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOutputFilesMovePath() { + return outputFilesMovePath; + } + + /** + * Sets the value of the outputFilesMovePath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutputFilesMovePath(String value) { + this.outputFilesMovePath = value; + } + + /** + * Gets the value of the outputFilesWritePath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getOutputFilesWritePath() { + return outputFilesWritePath; + } + + /** + * Sets the value of the outputFilesWritePath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutputFilesWritePath(String value) { + this.outputFilesWritePath = value; + } + + /** + * Gets the value of the sourceFilesMovePath property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceFilesMovePath() { + return sourceFilesMovePath; + } + + /** + * Sets the value of the sourceFilesMovePath property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceFilesMovePath(String value) { + this.sourceFilesMovePath = value; + } + + /** + * Gets the value of the group property. + * + * @return + * possible object is + * {@link Group } + * + */ + public Group getGroup() { + return group; + } + + /** + * Sets the value of the group property. + * + * @param value + * allowed object is + * {@link Group } + * + */ + public void setGroup(Group value) { + this.group = value; + } + + /** + * Gets the value of the watchFolder property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getWatchFolder() { + return watchFolder; + } + + /** + * Sets the value of the watchFolder property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setWatchFolder(FileSnapshot value) { + this.watchFolder = value; + } + + /** + * Gets the value of the projectFile property. + * + * @return + * possible object is + * {@link FileSnapshot } + * + */ + public FileSnapshot getProjectFile() { + return projectFile; + } + + /** + * Sets the value of the projectFile property. + * + * @param value + * allowed object is + * {@link FileSnapshot } + * + */ + public void setProjectFile(FileSnapshot value) { + this.projectFile = value; + } + + /** + * Gets the value of the headerFiles property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the headerFiles property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getHeaderFiles().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link FileSnapshot } + * + * + */ + public List getHeaderFiles() { + if (headerFiles == null) { + headerFiles = new ArrayList(); + } + return this.headerFiles; + } + + /** + * Gets the value of the trailerFiles property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the trailerFiles property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTrailerFiles().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link FileSnapshot } + * + * + */ + public List getTrailerFiles() { + if (trailerFiles == null) { + trailerFiles = new ArrayList(); + } + return this.trailerFiles; + } + + /** + * Gets the value of the scripts property. + * + * @return + * possible object is + * {@link WatchFolder.Scripts } + * + */ + public WatchFolder.Scripts getScripts() { + return scripts; + } + + /** + * Sets the value of the scripts property. + * + * @param value + * allowed object is + * {@link WatchFolder.Scripts } + * + */ + public void setScripts(WatchFolder.Scripts value) { + this.scripts = value; + } + + /** + * Gets the value of the videoProcessingOptions property. + * + * @return + * possible object is + * {@link VideoProcessingOptions } + * + */ + public VideoProcessingOptions getVideoProcessingOptions() { + return videoProcessingOptions; + } + + /** + * Sets the value of the videoProcessingOptions property. + * + * @param value + * allowed object is + * {@link VideoProcessingOptions } + * + */ + public void setVideoProcessingOptions(VideoProcessingOptions value) { + this.videoProcessingOptions = value; + } + + /** + * Gets the value of the mediaReaderAudio property. + * + * @return + * possible object is + * {@link MediaReaderEnum } + * + */ + public MediaReaderEnum getMediaReaderAudio() { + return mediaReaderAudio; + } + + /** + * Sets the value of the mediaReaderAudio property. + * + * @param value + * allowed object is + * {@link MediaReaderEnum } + * + */ + public void setMediaReaderAudio(MediaReaderEnum value) { + this.mediaReaderAudio = value; + } + + /** + * Gets the value of the mediaReaderVideo property. + * + * @return + * possible object is + * {@link MediaReaderEnum } + * + */ + public MediaReaderEnum getMediaReaderVideo() { + return mediaReaderVideo; + } + + /** + * Sets the value of the mediaReaderVideo property. + * + * @param value + * allowed object is + * {@link MediaReaderEnum } + * + */ + public void setMediaReaderVideo(MediaReaderEnum value) { + this.mediaReaderVideo = value; + } + + /** + * Gets the value of the engineType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEngineType() { + return engineType; + } + + /** + * Sets the value of the engineType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEngineType(String value) { + this.engineType = value; + } + + /** + * Gets the value of the qcOptions property. + * + * @return + * possible object is + * {@link QcOptions } + * + */ + public QcOptions getQcOptions() { + return qcOptions; + } + + /** + * Sets the value of the qcOptions property. + * + * @param value + * allowed object is + * {@link QcOptions } + * + */ + public void setQcOptions(QcOptions value) { + this.qcOptions = value; + } + + /** + * Gets the value of the callback property. + * + * @return + * possible object is + * {@link Callback } + * + */ + public Callback getCallback() { + return callback; + } + + /** + * Sets the value of the callback property. + * + * @param value + * allowed object is + * {@link Callback } + * + */ + public void setCallback(Callback value) { + this.callback = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="scripts" type="{http://ws.server.mediamanager.digitalrapids.ca/}eventScript" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "scripts" + }) + public static class Scripts { + + protected List scripts; + + /** + * Gets the value of the scripts property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the scripts property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getScripts().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link EventScript } + * + * + */ + public List getScripts() { + if (scripts == null) { + scripts = new ArrayList(); + } + return this.scripts; + } + + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/package-info.java b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/package-info.java new file mode 100644 index 00000000..a1331afa --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/selenio/wsclient/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://ws.server.mediamanager.digitalrapids.ca/") +package user.commons.selenio.wsclient; diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/IProtocol.java b/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/IProtocol.java new file mode 100644 index 00000000..6159970d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/IProtocol.java @@ -0,0 +1,7 @@ +package user.commons.server.protocol; + +public interface IProtocol { + byte[] handle(byte[] bytes); + boolean isFinished(); + void addToSendQqueue(byte[] bytes); +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/PolicyProtocol.java b/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/PolicyProtocol.java new file mode 100644 index 00000000..b5c8fb17 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/PolicyProtocol.java @@ -0,0 +1,43 @@ +package user.commons.server.protocol; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class PolicyProtocol implements IProtocol { + private static final Logger logger = LogManager.getLogger(); + private String policy_request = ""; + private String policy = "\r\n" + "\r\n" + + "\r\n" + "\r\n" + "\r\n" + "\r\n" + + "\r\n" + "\r\n" + "\r\n" + + "\r\n" + "\r\n" + "\r\n" + ""; + private boolean isFinished; + + @Override + public byte[] handle(byte[] bytes) { + byte[] result = null; + if (bytes != null) { + String data = new String(bytes); + if (data != null && data.trim().equals(policy_request)) { + logger.info("Incoming policy_request"); + try { + result = policy.getBytes("UTF-8"); + logger.info("Sent: " + policy); + } catch (Exception e) { + logger.error(e.getMessage()); + } + isFinished = true; + } + } + return result; + } + + @Override + public boolean isFinished() { + return isFinished; + } + + @Override + public void addToSendQqueue(byte[] bytes) { + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/SignalProtocol.java b/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/SignalProtocol.java new file mode 100644 index 00000000..496f4339 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/protocol/SignalProtocol.java @@ -0,0 +1,50 @@ +package user.commons.server.protocol; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class SignalProtocol implements IProtocol { + private static final Logger logger = LogManager.getLogger(); + private BlockingQueue sendQueue; + + public SignalProtocol() { + sendQueue = new LinkedBlockingQueue(); + ; + } + + @Override + public byte[] handle(byte[] bytes) { + byte[] result = null; + + if (sendQueue != null) { + try { + result = sendQueue.poll(100, TimeUnit.MILLISECONDS); + if (result != null) + logger.debug("Found signal"); + } catch (Exception e) { + logger.error(e); + } + } + return result; + } + + @Override + public boolean isFinished() { + return false; + } + + @Override + public void addToSendQqueue(byte[] bytes) { + try { + logger.debug("Signal added"); + sendQueue.offer(bytes); + } catch (Exception e) { + logger.error(e); + } + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/PolicyServer.java b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/PolicyServer.java new file mode 100644 index 00000000..069c490d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/PolicyServer.java @@ -0,0 +1,11 @@ +package user.commons.server.tcp; + +import user.commons.server.protocol.PolicyProtocol; + +public class PolicyServer extends TcpServer { + + public PolicyServer() { + super(PolicyProtocol.class, 943); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/SignalServer.java b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/SignalServer.java new file mode 100644 index 00000000..e954ab1e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/SignalServer.java @@ -0,0 +1,11 @@ +package user.commons.server.tcp; + +import user.commons.server.protocol.SignalProtocol; + +public class SignalServer extends TcpServer { + + public SignalServer() { + super(SignalProtocol.class, 4502); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpException.java b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpException.java new file mode 100644 index 00000000..a8e5be7e --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpException.java @@ -0,0 +1,9 @@ +package user.commons.server.tcp; + +public class TcpException extends RuntimeException { + private static final long serialVersionUID = -2357518580850559771L; + + public TcpException(String message) { + super(message); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpServer.java b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpServer.java new file mode 100644 index 00000000..aa5c4be2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpServer.java @@ -0,0 +1,146 @@ +package user.commons.server.tcp; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.server.protocol.IProtocol; + +/** + * Ftp server. Saj't sz'lon fut, és minden kapcsolathoz külön session + * szálat indít. + * + * @author vasary + */ +public class TcpServer extends Thread { + + class AliveWatchDog extends Thread { + private volatile boolean shutdown = false; + + @Override + public void run() { + while (!shutdown) { + if (sessions != null) { + try { + List inactiveSessions = new ArrayList(); + for (TcpSession session : sessions) { + SocketChannel channel = session.getChannel(); + if (!channel.isConnected()) + inactiveSessions.add(session); + } + for (TcpSession session : inactiveSessions) { + sessions.remove(session); + logger.info(String.format("Connection closed from %1$s(%2$s) -> %3$s.", + session.getClientName(), session.getClientPort(), session.getServerPort())); + } + Thread.sleep(1000); + } catch (InterruptedException e) { + logger.error(e); + } + } + } + } + + void shutDown() { + try { + for (TcpSession session : sessions) { + SocketChannel channel = session.getChannel(); + if (channel.isConnected()) + channel.close(); + } + shutdown = true; + join(); + } catch (Exception e) { + } + } + } + + private static final Logger logger = LogManager.getLogger(); + private ServerSocketChannel serverSocket = null; + private String name = "TCP Server Main Thread"; + private TcpServerProperties properties = null; + private List sessions = null; + private AliveWatchDog watchDog = null; + private Class protocolType; + + public TcpServer(Class protocolType, int port) { + this.protocolType = protocolType; + sessions = Collections.synchronizedList(new ArrayList()); + watchDog = new AliveWatchDog(); + try { + properties = new TcpServerProperties(); + serverSocket = ServerSocketChannel.open(); + serverSocket.configureBlocking(false); + serverSocket.socket().bind(new InetSocketAddress(port)); + logger.info(String.format("Created on port %1$s with protocol %2$s.", serverSocket.socket().getLocalPort(), + protocolType.getSimpleName())); + } catch (IOException e) { + logger.error("Exception: " + e); + } + } + + public TcpServerProperties getProperties() { + return properties; + } + + private IProtocol createProtocol() { + IProtocol result = null; + try { + Class type = Class.forName(protocolType.getName()); + result = (IProtocol) type.newInstance(); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + @Override + public void run() { + watchDog.start(); + this.setName(name); + SocketChannel channel = null; + try { + while (true) { + if (serverSocket == null || !serverSocket.isOpen()) + break; + channel = serverSocket.accept(); + if (channel != null) { + IProtocol protocol = createProtocol(); + TcpSession session = new TcpSession(channel, protocol); + session.start(); + sessions.add(session); + logger.info(String.format("Connection opened from %1$s(%2$s) -> %3$s.", session.getClientName(), + session.getClientPort(), session.getServerPort())); + } else + Thread.sleep(1); + } + } catch (Exception e) { + logger.info(String.format("Stopped on port %1$s with protocol %2$s.", serverSocket.socket().getLocalPort(), + protocolType.getSimpleName())); + } + } + + public void shutdown() { + try { + watchDog.shutDown(); + if (serverSocket != null && serverSocket.isOpen()) + serverSocket.close(); + this.interrupt(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void queueMessage(byte[] bytes) { + for (TcpSession session : sessions) + session.queueMessage(bytes); + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpServerProperties.java b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpServerProperties.java new file mode 100644 index 00000000..f01113f5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpServerProperties.java @@ -0,0 +1,35 @@ +package user.commons.server.tcp; + +import java.io.File; + +import user.commons.CommonsProperties; + +public class TcpServerProperties extends CommonsProperties { + + static public final String USERS = "Users"; + static public final String SERVERROOT = "ServerRoot"; + static public final String PORT = "Port"; + + TcpServerProperties() { + super.add(SERVERROOT, "c:\\temp"); + super.add(PORT, 4530); + } + + public TcpServerProperties(int port, String serverRoot) { + CommonsProperties.checkParameter(SERVERROOT, serverRoot); + CommonsProperties.checkParameter(PORT, port); + File f = new File(serverRoot); + if (!f.exists() || !f.isDirectory()) + throw new TcpException("Server root is not valid: " + serverRoot); + super.add(SERVERROOT, serverRoot); + super.add(PORT, port); + } + + public int getPort() { + return getInt(PORT); + } + + public String getServerRoot(){ + return getString(SERVERROOT); + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpSession.java b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpSession.java new file mode 100644 index 00000000..b3a9f49a --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/server/tcp/TcpSession.java @@ -0,0 +1,103 @@ +package user.commons.server.tcp; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.SocketChannel; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.Bytes; +import user.commons.server.protocol.IProtocol; + +class TcpSession extends Thread { + private static final Logger logger = LogManager.getLogger(); + private SocketChannel channel = null; + private String nameFmt = "TcpServer session thread for %1$s:%2$d"; + private String clientName; + private int clientPort; + private int serverPort; + private IProtocol protocol; + + TcpSession(SocketChannel channel, IProtocol protocol) throws IOException { + this.channel = channel; + this.protocol = protocol; + String socketInfo = channel.socket().getRemoteSocketAddress().toString(); + String[] socketArray = socketInfo.split(":"); + clientName = socketArray[0]; + clientPort = Integer.parseInt(socketArray[1]); + serverPort = channel.socket().getLocalPort(); + channel.configureBlocking(false); + } + + public SocketChannel getChannel() { + return channel; + } + + public void queueMessage(byte[] bytes) { + protocol.addToSendQqueue(bytes); + } + + protected byte[] getAsByteArray(ByteBuffer buf) { + buf.flip(); + byte[] result = new byte[buf.remaining()]; + buf.get(result); + return result; + } + + @Override + public void run() { + String remoteAddress = channel.socket().getRemoteSocketAddress().toString(); + String name = String.format(nameFmt, remoteAddress, channel.socket().getLocalPort()); + this.setName(name); + + try { + ByteBuffer buf = ByteBuffer.allocateDirect(1024); + while (true) { + int byteCount = 0; + byte[] inBuffer = null; + while ((byteCount = channel.read(buf)) > 0) { + if (inBuffer == null) + inBuffer = getAsByteArray(buf); + else + inBuffer = Bytes.concatAll(inBuffer, getAsByteArray(buf)); + } + + byte[] outBuffer = protocol.handle(inBuffer); + + if (outBuffer != null) { + buf = ByteBuffer.wrap(outBuffer); + int sent = channel.write(buf); + logger.debug("Sent " + sent + " remaining " + buf.remaining()); + // TODO mennyit siker�lt �rni? + } + + if (protocol.isFinished()) { + channel.close(); + break; + } + } + + } catch (Exception e) { + logger.info("Session closed by " + e.getClass()); + try { + channel.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + return; + } + } + + public String getClientName() { + return clientName; + } + + public int getClientPort() { + return clientPort; + } + + public int getServerPort() { + return serverPort; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/strings/StringConverter.java b/server/user.jobengine.osgi.commons/src/user/commons/strings/StringConverter.java new file mode 100644 index 00000000..2439135d --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/strings/StringConverter.java @@ -0,0 +1,16 @@ +package user.commons.strings; + +import java.io.UnsupportedEncodingException; + +public class StringConverter { + + public static String toUTF8(String input) { + String result = null; + try { + if (input != null) + result = new String(input.getBytes("UTF-8")); + } catch (UnsupportedEncodingException e) { + } + return result; + } +} diff --git a/server/user.jobengine.osgi.commons/src/user/jobengine/osgi/commons/Activator.java b/server/user.jobengine.osgi.commons/src/user/jobengine/osgi/commons/Activator.java new file mode 100644 index 00000000..dd8ef6a2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/jobengine/osgi/commons/Activator.java @@ -0,0 +1,66 @@ +package user.jobengine.osgi.commons; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + +import user.commons.server.tcp.TcpServer; +import user.tsm.client.TSMClient; + +public class Activator implements BundleActivator { + private static final Logger logger = LogManager.getLogger(); + private static BundleContext context; + private TcpServer signalServer; + private TcpServer policyServer; + private ServiceRegistration registration; + + static BundleContext getContext() { + return context; + } + + private void TSMTest() { + TSMClient tsm = null; + try { + tsm = new TSMClient("JobEngine"); + tsm.connect(null, null); + logger.info("Connected to TSM"); + } catch (Exception e) { + logger.error(e); + } finally { + tsm.disconnect(); + logger.info("Diconnected from TSM"); + } + + } + + @Override + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + + // TSMTest(); + + // policyServer = new PolicyServer(); + // signalServer = new SignalServer(); + // if (policyServer != null) + // policyServer.start(); + // if (signalServer != null) + // signalServer.start(); + // + // registration = context.registerService(SignalServer.class.getName(), + // signalServer, (Dictionary) null); + } + + @Override + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + // if (policyServer != null) + // policyServer.shutdown(); + // if (signalServer != null) + // signalServer.shutdown(); + // if (registration != null) + // registration.unregister(); + } + +} diff --git a/server/user.jobengine.osgi.commons/test/user/common/nexio/test/NexioDataMinerTest.java b/server/user.jobengine.osgi.commons/test/user/common/nexio/test/NexioDataMinerTest.java new file mode 100644 index 00000000..7d01d23f --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/common/nexio/test/NexioDataMinerTest.java @@ -0,0 +1,45 @@ +package user.common.nexio.test; + +import java.io.FileInputStream; +import java.lang.invoke.MethodHandles; +import java.net.URL; +import java.util.Properties; + +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.nexio.NexioDataMiner; + +public class NexioDataMinerTest { + private NexioDataMiner sut; + + @BeforeClass + public static void initialize() throws Exception { + //Naplozas + // ConsoleAppender console = new ConsoleAppender(); + // String PATTERN = "%d{HH:mm:ss.SSS} %-5p %-20.20M | %m (%F:%L)%n"; + // console.setLayout(new PatternLayout(PATTERN)); + // console.activateOptions(); + // Logger.getRootLogger().addAppender(console); + // Logger.getRootLogger().setLevel(LOG_LEVEL); + + //Kornyezeti valtozok betoltese + Properties properties = new Properties(); + URL srcLocation = MethodHandles.lookup().lookupClass().getProtectionDomain().getCodeSource().getLocation(); + URL location = new URL(srcLocation, "../../-configuration/mediacube-dev.properties"); + properties.load(new FileInputStream(location.toURI().getPath().toString())); + System.getProperties().putAll(properties); + } + + @Test + public void run() { + sut = new NexioDataMiner(); + sut.run(); + } + + @Test + public void reset() { + sut = new NexioDataMiner(); + sut.reset(); + } +} diff --git a/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusAPITest.java b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusAPITest.java new file mode 100644 index 00000000..3777ffb4 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusAPITest.java @@ -0,0 +1,106 @@ +package user.common.octopus.test; + +import java.sql.SQLException; +import java.util.Calendar; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.Test; + +import com.ibm.nosql.json.api.BasicDBList; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBObject; +import com.ibm.nosql.json.api.NoSQLClient; + +import user.commons.octopus.IOctopusAPI; +import user.commons.octopus.OctopusAPI; + +public class OctopusAPITest { + + private IOctopusAPI sut; + + @BeforeClass + public static void initialize() { + System.setProperty("jobengine.nosql.db.url", + "jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;"); + System.setProperty("jobengine.nosql.db.user", "db2admin"); + System.setProperty("jobengine.nosql.db.password", "password"); + System.setProperty("jobengine.nosql.db.schema", "test"); + System.setProperty("jobengine.octopus.api.address", "http://demo.octopus-news.com/api/v1/"); + System.setProperty("jobengine.octopus.api.user", "demo"); + System.setProperty("jobengine.octopus.api.password", "demo"); + } + + @Test + public void getRundownsByDate() throws SQLException { + sut = new OctopusAPI(); + Calendar calendar = Calendar.getInstance(); + calendar.set(2000, 5, 21); + // BasicDBList rundowns = sut.getRundowns(calendar.getTime()); + // assertNotNull(rundowns); + // assertTrue(rundowns.size() > 0); + } + + @Test + public void getRundownByStoryID() throws SQLException { + sut = new OctopusAPI(); + + List actual = sut.getRundownByStoryID(36421476); + + /* + * long actualID = actual.getLong("id"); Assert.assertEquals(44622396, + * actualID); + */ + } + + @Test + public void getStoryFolders() throws SQLException { + sut = new OctopusAPI(); + + List actual = sut.getStoryFolders(62549297); + } + + @Test + public void getStoryFoldersTest() throws SQLException { + sut = new OctopusAPI(); + + sut.getStoryFolders(); + } + + @Test + public void getRundownByPlaceHolderIdTest() throws SQLException { + // Fixture + sut = new OctopusAPI(); + DB db = NoSQLClient.getDB("jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;", + "db2admin", "password", "test"); + DBCollection testStoryCollection = db.getCollection("testStoryCollection"); + DBCollection testRundownCollection = db.getCollection("testRundownCollection"); + long storyID = 1; + long rundownID = 2; + BasicDBObject obj = new BasicDBObject("id", storyID); + String globalID = "OCTOPUS-ECHOTV-2429902"; + BasicDBObject mosObject = new BasicDBObject("mosId", "NEXIO.MOS").append("mosId", "NEXIO.MOS") + .append("objId", "xxxl").append("objectType", "MosObject").append("id", 2429902) + .append("globalId", globalID).append("modified", "2017-08-08T11:38:53.000+02:00"); + BasicDBList mosObjects = new BasicDBList(mosObject); + obj.append("mosObjects", mosObjects); + BasicDBObject referenceObject = new BasicDBObject("id", rundownID); + referenceObject.append("position", 0); + BasicDBList rundownReferences = new BasicDBList(referenceObject); + obj.append("rundown", rundownReferences); + testStoryCollection.save(obj); + testRundownCollection.save(new BasicDBObject("id", rundownID)); + + // Exercise + try { + List actual = sut.getRundownsByPlaceHolderId(globalID); + } catch (Exception e) { + System.out.println(e.getMessage()); + } finally { + testRundownCollection.remove(); + testStoryCollection.remove(); + } + } +} diff --git a/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java new file mode 100644 index 00000000..ebb1c1b2 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java @@ -0,0 +1,127 @@ +package user.common.octopus.test; + +import java.io.FileInputStream; +import java.lang.invoke.MethodHandles; +import java.net.URL; +import java.sql.SQLException; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; + +import org.junit.BeforeClass; +import org.junit.Test; + +import com.ibm.nosql.json.api.BasicDBList; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBObject; +import com.ibm.nosql.json.api.NoSQLClient; +import com.ibm.nosql.json.api.QueryBuilder; +import com.ibm.nosql.json.api.WriteResult; + +import user.commons.octopus.IOctopusAPI; +import user.commons.octopus.OctopusAPI; +import user.commons.octopus.OctopusDataMiner; + +public class OctopusDataMinerTest { + + private OctopusDataMiner sut; + + @BeforeClass + public static void initialize() throws Exception { + // System.setProperty("jobengine.nosql.db.url", + // "jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;"); + // System.setProperty("jobengine.nosql.db.user", "db2admin"); + // System.setProperty("jobengine.nosql.db.password", "password"); + // System.setProperty("jobengine.nosql.db.schema", "test"); + // System.setProperty("jobengine.octopus.api.address", + // "http://10.10.1.21/api/v1/"); // + // "http://demo.octopus-news.com/api/v1/" + // System.setProperty("jobengine.octopus.api.user", "mam"); + // System.setProperty("jobengine.octopus.api.password", "napocska"); + + Properties properties = new Properties(); + URL srcLocation = MethodHandles.lookup().lookupClass().getProtectionDomain().getCodeSource().getLocation(); + URL location = new URL(srcLocation, "../../-configuration/mediacube-dev.properties"); + properties.load(new FileInputStream(location.toURI().getPath().toString())); + System.getProperties().putAll(properties); + + } + + @Test + public void run() { + sut = new OctopusDataMiner(); + sut.run(); + } + + @Test + public void integrationTestWithClear() { + // fixture + sut = new OctopusDataMiner(); + sut.clear(); + + // Exercise + sut.run(); + } + + @Test + public void deleteOrphanStories() { + try { + DB db = NoSQLClient.getDB( + "jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;", "db2admin", + "password", "test"); + DBCollection collection = db.getCollection("testCollection"); + + long id1 = 1, id2 = 2, id3 = 3, id4 = 4, id5 = 5; + + BasicDBObject obj1 = new BasicDBObject("id", id1); + BasicDBObject obj2 = new BasicDBObject("id", id2); + BasicDBObject obj3 = new BasicDBObject("id", id3); + BasicDBObject obj4 = new BasicDBObject("id", id4); + BasicDBObject obj5 = new BasicDBObject("id", id5); + + collection.save(obj1); + collection.save(obj2); + collection.save(obj3); + collection.save(obj4); + collection.save(obj5); + System.out.println("collection count " + collection.count()); + + HashSet storyIDs = new HashSet<>(); + // storyIDs.add(tesztid); + storyIDs.add(id1); + storyIDs.add(id2); + BasicDBObject query = (BasicDBObject) QueryBuilder.start().put("id").notIn(storyIDs.toArray()).get(); + + /* + * DBCursor cursor = collection.find(query); while + * (cursor.hasNext()) { DBObject obj = cursor.next(); + * System.out.println(obj); collection.remove(obj); } + */ + + WriteResult res = collection.remove(query); + System.out.println("collection count " + collection.count()); + System.out.println(res.getN()); + // BasicDBObject query = (BasicDBObject) + // QueryBuilder.start().put(ID).notIn(Arrays.asList(storyIDs)).get(); + + } catch (Exception e) { + System.out.println(e); + } + } + + @Test + public void test() throws SQLException { + IOctopusAPI api = new OctopusAPI(); + List stories = api.getStories(); + for (DBObject actual : stories) { + if (actual.containsField("rundown")) { + BasicDBList rundowns = (BasicDBList)actual.get("rundown"); + BasicDBList objs = (BasicDBList) actual.get("mosObjects"); + if(objs.size() > 0) + System.out.println(rundowns); + } + } + } +} diff --git a/server/user.jobengine.osgi.commons/test/user/commons/TestStoreUri.java b/server/user.jobengine.osgi.commons/test/user/commons/TestStoreUri.java new file mode 100644 index 00000000..61583ad8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/commons/TestStoreUri.java @@ -0,0 +1,95 @@ +package user.commons; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; + +import org.junit.Test; + +import user.commons.remotestore.IDirectoryLister; +import user.commons.remotestore.IProgressEventListener; +import user.commons.remotestore.ProgressEvent; +import user.commons.remotestore.RemoteFileHandler; + +public class TestStoreUri { + @Test + public void testFtpGet() throws Exception { + StoreUri uri = new StoreUri(); + uri.setUri("ftp://localhost"); + uri.setRootPath("upload"); + uri.setUserName("anonymous"); + // String f = uri.getFullPath(); + IDirectoryLister lister = RemoteFileHandler.createLister(uri); + RemoteFile file = null; + try { + file = lister.get("stadion.DV.avi"); + } catch (Exception e) { + e.printStackTrace(); + } + + assertNotNull(file); + assertTrue(file.getSize() > 0); + } + + @Test + public void testUptload() { + StoreUri targetStoreUri = new StoreUri(); + targetStoreUri.setUri("ftp://localhost"); + targetStoreUri.setUserName("anonymous"); + targetStoreUri.setPortNumber(4503); + RemoteFile remoteFile = new RemoteFile(); + remoteFile.setName("stadion.DV.avi"); + remoteFile.setSize(232600324); + StoreUri sourceStoreUri = new StoreUri(); + sourceStoreUri.setUri("file://c:\\"); + sourceStoreUri.addProgressListener(new IProgressEventListener() { + @Override + public void progressChanged(ProgressEvent evt) { + // System.out.println("Uploaded: " + evt.getProgress() + "%"); + + } + }); + + try { + sourceStoreUri.transferFrom(targetStoreUri, remoteFile, null); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + // @Test + // public void testDownload() { + // StoreUri targetStoreUri = new StoreUri(); + // targetStoreUri.setUri("jobengine://c:\\"); + // RemoteFile remoteFile = new RemoteFile(); + // remoteFile.setName("stadion.DV.avi"); + // remoteFile.setSize("232600324"); + // StoreUri sourceStoreUri = new StoreUri(); + // sourceStoreUri.setUri("ftp://localhost"); + // sourceStoreUri.setUserName("anonymous"); + // sourceStoreUri.setPortNumber(4503); + // sourceStoreUri.addProgressListener(new IProgressEventListener(){ + // @Override + // public void progressChanged(ProgressEvent evt) { + // System.out.println("Uploaded: " + evt.getProgress() + "%"); + // + // } + // }); + // + // try { + // sourceStoreUri.transferFrom(targetStoreUri, remoteFile); + // } catch (IOException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } catch (Exception e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // } + +} diff --git a/server/user.jobengine.osgi.commons/test/user/commons/ftp/TestFtp.java b/server/user.jobengine.osgi.commons/test/user/commons/ftp/TestFtp.java new file mode 100644 index 00000000..800680bf --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/commons/ftp/TestFtp.java @@ -0,0 +1,186 @@ +package user.commons.ftp; + + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TestFtp { + private static FtpServer server = null; + + @BeforeClass + public static void beforeTest() { +// server = new FtpServer(); +// server.start(); + } + + @AfterClass + public static void afterTest() { +// server.shutdown(); + } + + @Test + public void testConnectClose() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + assertEquals(true, client.isConnected()); + client.disconnect(); + assertEquals(false, client.isConnected()); + } + + @Test + public void testLogin() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + client.disconnect(); + } + + @Test(expected=FtpException.class) + public void testWrongLogin() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftpx", "xxx"); + client.disconnect(); + } + + @Test + public void testPwd() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + assertEquals("/", client.pwd()); + client.disconnect(); + } + + @Test + public void testCwd() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + assertEquals(true, client.cwd("junit test")); + assertEquals("/junit test/", client.pwd()); + client.disconnect(); + } + + @Test + public void testMkRmDir() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + assertEquals(true, client.mkDir("junit create test")); + assertEquals(true, client.rmDir("junit create test")); + client.disconnect(); + } + + @Test + public void testNameList() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + String[] list = client.nlist("junit test"); + assertEquals(2, list.length); + client.disconnect(); + } + + @Test + public void testNameListPassive() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + client.pasv(); + String[] list = client.nlist("junit test"); + assertEquals(2, list.length); + client.disconnect(); + } + + @Test + public void testFormattedList() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + List list = client.flist("junit test"); + assertEquals(2, list.size()); + client.disconnect(); + } + + @Test + public void testUpload() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("anonymous", "xxx"); + client.addFileListener(new FileEventListener() { + public void fileUpload(FileEvent evt) { + System.out.println("Uploaded: " + evt.getPercentComplete() + "%"); + } + public void fileDownload(FileEvent evt) { + } + }); + + client.upload("c:\\junit test.txt", "junit test.txt"); + client.disconnect(); + } + + @Test + public void testCancelUpload() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + client.addFileListener(new FileEventListener() { + public void fileUpload(FileEvent evt) { + System.out.println("Uploaded: " + evt.getPercentComplete() + "%"); + //teszt 10 százalék elérésekor megszakítva a feltöltés + if (evt.getPercentComplete() >= 10) { + evt.cancel(); + } + } + public void fileDownload(FileEvent evt) { + } + }); + + client.upload("c:\\2.avi", "2.avi"); + client.disconnect(); + } + + @Test + public void testDownload() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + client.addFileListener(new FileEventListener() { + public void fileUpload(FileEvent evt) { + } + public void fileDownload(FileEvent evt) { + System.out.println("Dowloaded: " + evt.getPercentComplete() + "%"); + } + }); + + client.download("junit test.txt", "c:\\junit test.txt"); + client.disconnect(); + } + + @Test + public void testCancelDownload() { + FtpClient client = new FtpClient(); + client.connect("localhost", 21); + client.login("ftp", "xxx"); + client.addFileListener(new FileEventListener() { + public void fileUpload(FileEvent evt) { + } + public void fileDownload(FileEvent evt) { + System.out.println("Dowloaded: " + evt.getPercentComplete() + "%"); + //teszt 10 százalék elérésekor megszakítva a letöltés + if (evt.getPercentComplete() >= 10) { + evt.cancel(); + } + } + }); + + client.download("1.avi", "c:\\1.avi"); + client.disconnect(); + } +} diff --git a/server/user.jobengine.osgi.commons/test/user/commons/rcc/RCCClientTest.java b/server/user.jobengine.osgi.commons/test/user/commons/rcc/RCCClientTest.java new file mode 100644 index 00000000..2ef3638e --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/commons/rcc/RCCClientTest.java @@ -0,0 +1,96 @@ +package user.commons.rcc; + +import static org.junit.Assert.assertEquals; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; + +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class RCCClientTest { + + private RCCClient sut; + + @BeforeClass + public static void setupClass() throws Exception { + } + + @Before + public void setup() throws Exception { + System.setProperty("jobengine.loglevel", "DEBUG"); + sut = new RCCClient("localhost:1120"); + } + + @Test + public void testConstructor1() { + sut = new RCCClient(null); + assertEquals("localhost", sut.getHostName()); + assertEquals(1120, sut.getPort()); + } + + @Test + public void testConstructor2() { + sut = new RCCClient("localhost:1130"); + assertEquals("localhost", sut.getHostName()); + assertEquals(1130, sut.getPort()); + } + + @Test + public void testConstructor3() { + sut = new RCCClient("server:1140"); + assertEquals("server", sut.getHostName()); + assertEquals(1140, sut.getPort()); + } + + @Test + public void testGetJobStatusList() throws Exception { + InputStream input = new FileInputStream(new File("c:\\$Movie\\toMP4.with.timecode.filter.xml")); + BufferedReader in = new BufferedReader(new InputStreamReader(input, "UTF-8")); + String line = null; + String content = ""; + while ((line = in.readLine()) != null) { + content += line; + } + content = "CarbonAPIXML1 " + content.length() + " " + content; + String reply = sut.communicate(content); + + for (int i = 0; i < 10000; i++) { + System.out.println(sut.getJobsStatusList()); + Thread.sleep(1000); + } + } + + @Test + public void testSubmit_Error() throws Exception { + String guid = sut.getProfileId("MPEG4 - Streaming - 1024kbps - PAL"); + RCCJob job = new RCCJob(sut, "teszt1", null, 1000); + if (job.submit("c:\\valami", "c:\\x", guid)) { + job.refresh(); + while (job.isRunning()) { + Thread.sleep(2000); + } + } + + } + + @Test + public void testDetails() throws Exception { + String guid = sut.getProfileId("MPEG4 - Streaming - 1024kbps - PAL"); + RCCJob job = new RCCJob(sut, "teszt1", null, 1000); + if (job.submit("c:\\valami.avi", "c:\\x", guid)) { + sut.getJobDetails(job.getGuid()); + } + } + + @Test + public void testProfileDetails() throws Exception { + String guid = sut.getProfileId("MPEG4 - Streaming - 1024kbps - PAL"); + sut.getProfileDetails(guid); + } + +} diff --git a/server/user.jobengine.osgi.commons/test/user/commons/selenio/TestSelenio.java b/server/user.jobengine.osgi.commons/test/user/commons/selenio/TestSelenio.java new file mode 100644 index 00000000..9f1f4de8 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/commons/selenio/TestSelenio.java @@ -0,0 +1,212 @@ +package user.commons.selenio; + +import java.io.ByteArrayOutputStream; +import java.net.URL; +import java.util.List; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.Marshaller; +import javax.xml.namespace.QName; + +import org.junit.Test; + +import user.commons.selenio.wsclient.AudioSource; +import user.commons.selenio.wsclient.Clip; +import user.commons.selenio.wsclient.ClipList; +import user.commons.selenio.wsclient.FileSnapshot; +import user.commons.selenio.wsclient.Group; +import user.commons.selenio.wsclient.MediaFile; +import user.commons.selenio.wsclient.State; +import user.commons.selenio.wsclient.TranscodeMgrWS; +import user.commons.selenio.wsclient.TranscodeMgrWSService; +import user.commons.selenio.wsclient.TranscodeRequest; +import user.commons.selenio.wsclient.TranscodeSource; +import user.commons.selenio.wsclient.TranscodeTask; +import user.commons.selenio.wsclient.VideoSource; + + +public class TestSelenio { + + private TranscodeMgrWS port = null; + private String address = "http://10.10.1.71:44000/TranscodeMgrWS?wsdl"; + private String projectFilePath = "\\\\10.10.1.71\\Data\\Blueprints\\MP4_H264_AAC_v4.zenium"; + private String sourceFilePath = "\\\\10.10.1.71\\Data\\Input\\test1.mxf"; + + public TestSelenio() { + try{ + TranscodeMgrWSService service = new TranscodeMgrWSService(new URL(address), new QName("http://ws.server.mediamanager.digitalrapids.ca/", "TranscodeMgrWSService")); + port = service.getTranscodeMgrWSPort(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + @Test + public void testGroupList(){ + try{ + List grpList = port.getGroupList(); + for(Group g : grpList){ + System.out.println("Selenio Group: id=" + g.getId() + ", name=" + g.getName() + ", role=" + g.getRole()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + + /* + XML: + + + PRE_PROCESS + + DRf4c49dcb-de2f-4bc5-900f-f1a6ebf6531d + GROUP-01 + ROLE_KAYAK_TRANSCODE + + MP4_H264_AAC_v4.zenium + + + \\10.10.1.71\Data\Input\test1.mxf + DR1db07e32-41e0-4f37-9ea5-7bacd9b14edf + + + 2017-08-14T11:00:25.930+02:00 + +*/ + + @Test + public void testCreateTranscodeTask(){ + try{ + TranscodeRequest transcodeRequest = buildTranscodeRequest(projectFilePath, sourceFilePath); + TranscodeTask tt = port.submitTranscodeTask(transcodeRequest); + printTranscodeTask(tt); + } catch (Exception e) { + e.printStackTrace(); + } + } + + + @Test + public void testQueryTranscodeTask(){ + try{ + TranscodeTask ttq = port.getTranscodeTask("DR3aedfd0f-46ad-464b-aaa7-05e91445ea51"); + if(ttq != null){ + // QUEUED, IN_PROGRESS, COMPLETE, FAILED, CANCELLED, POST_PROCESS, PRE_PROCESS, RESERVED; + if(State.COMPLETE.equals(ttq.getState())){ + printTranscodeTask(ttq); + } + System.out.println(ttq.getId() + " state: " + ttq.getState()); + }else{ + System.out.println("query result is null!"); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + + + private String convertToXML(Object o) throws java.lang.Exception { + if (o == null) { + return "null"; + } + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(o.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty("jaxb.formatted.output", true); + marshaller.marshal(new JAXBElement(new QName(o.getClass().getSimpleName()), o.getClass(), o), bos); + return bos.toString(); + } + + + /** + * Build a TranscodeRequest. Use the values provided by the user. + */ + private TranscodeRequest buildTranscodeRequest(String projectFilePath, String sourceFilePath) throws java.lang.Exception { + + // Use the TranscodeRequest Transcode Manager class to create a new, empty request. + TranscodeRequest transcodeRequest = new TranscodeRequest(); + + // Get the Stream project or Kayak Transcode Blueprint specified + // by the user. Store the file in a Transcode Manager FileSnapshot object. + // The FileSnapshot can store the path to a file as well as the file's contents. + FileSnapshot project = new FileSnapshot(); + project.setFullPath(projectFilePath); + + // Add the project or blueprint to the transcode request. This file will + // be used to process the media file input source. + transcodeRequest.setProject(project); + + // Create a clip list with the input source files provided by the end user. + // The TranscodeManager ClipList is encapsulated within a TranscodeSource object + // that is added to the TranscodeRequest. + + // Create an empty TranscodeSource object. + TranscodeSource transcodeSource = new TranscodeSource(); + + // Store the input file provided by the end user in a TranscodeManager + // MediaFile object. + MediaFile mediaFile = new MediaFile(); + mediaFile.setFile(sourceFilePath); + + /* + * Though this client only accepts one input file, only clip lists are + * processed by blueprints and projects. The file must + * be encapsulated within a ClipList before it is added to the + * TranscodeRequest. + */ + + // Create an empty Transcode Manager ClipList object. + ClipList clipList = new ClipList(); + + // Create Clip object for each input source file. + Clip clip = new Clip(); + + // A Clip always consists of one video file and at least one + // audio file. Store the source files in AudioSource and VideoSource + // Transcode Manager API objects. + AudioSource audioSource = new AudioSource(); + VideoSource videoSource = new VideoSource(); + + // In this case the client only accepts one file -- a video file. + // Video files can be used as the audio source of a clip as long + // as the file contains both elementary video and audio streams. + // + // Add the file to the AudioSource and VideoSource objects. + audioSource.setMediaFile(mediaFile); + videoSource.setMediaFile(mediaFile); + + // Add the AudioSource and VideoSource objects to the Clip. + // Add the Clip to the ClipList + clip.getAudioSource().add(audioSource); + clip.setVideoSource(videoSource); + clipList.getClip().add(clip); + + // Add the ClipList to the TranscodeSource + transcodeSource.setClipList(clipList); + + // Add the TranscodeSource to the Transcoderequest + transcodeRequest.setTranscodeSource(transcodeSource); + + + return transcodeRequest; + } + + + private void printTranscodeTask(TranscodeTask tt) throws java.lang.Exception{ + System.out.println("ID: " + tt.getId()); + System.out.println(convertToXML(tt)); + } + + + +} + + + + + diff --git a/server/user.jobengine.osgi.commons/test/user/commons/server/tcp/TcpClient.java b/server/user.jobengine.osgi.commons/test/user/commons/server/tcp/TcpClient.java new file mode 100644 index 00000000..7123d321 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/commons/server/tcp/TcpClient.java @@ -0,0 +1,42 @@ +package user.commons.server.tcp; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.Socket; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class TcpClient { + private static final Logger logger = LogManager.getLogger(); + private DataInputStream inputStream = null; + private DataOutputStream outputStream = null; + private Socket socket = null; + + void connect(String host, int port) { + try { + socket = new Socket(host, port); + inputStream = new DataInputStream(socket.getInputStream()); + outputStream = new DataOutputStream(socket.getOutputStream()); + } catch (Exception e) { + logger.error(e); + } + } + + public void test() { + try { + String message = ""; + outputStream.write(message.getBytes("UTF-8")); + String line = ""; + final byte buf[] = new byte[1024]; + int byteCount = 0; + while ((byteCount = inputStream.read(buf)) > 0) { + line += new String(buf, 0, byteCount); + System.out.println(line); + } + } catch (IOException e) { + logger.error(e); + } + } +} diff --git a/server/user.jobengine.osgi.commons/test/user/commons/server/tcp/TestProperties.java b/server/user.jobengine.osgi.commons/test/user/commons/server/tcp/TestProperties.java new file mode 100644 index 00000000..e52228b6 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/commons/server/tcp/TestProperties.java @@ -0,0 +1,28 @@ +package user.commons.server.tcp; + +import org.junit.Test; + +public class TestProperties { + + @Test + public void test(){ + TcpClient client = new TcpClient(); + client.connect("localhost", 943); + client.test(); + } +} +/* + + + + + + + + + + + + + + */ \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/test/user/jobengine/remotestore/TestDirectoryUtils.java b/server/user.jobengine.osgi.commons/test/user/jobengine/remotestore/TestDirectoryUtils.java new file mode 100644 index 00000000..fc48fb63 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/jobengine/remotestore/TestDirectoryUtils.java @@ -0,0 +1,131 @@ +package user.jobengine.remotestore; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import user.commons.remotestore.DirectoryUtils; + +public class TestDirectoryUtils { + + private static final String PATHSEPARATOR_WINDOWS = "\\"; + private static final String PATHSEPARATOR_LINUX = "/"; + + // private String uri1 = "localhost/probaMappa"; + // private String uri2 = separator + uri1 + separator; + + // @Test + // public void Test() { + // assertEquals(uri1, + // DirectoryUtils.checkSlash(separator, uri1, false, false)); + // assertEquals(separator + uri1, + // DirectoryUtils.checkSlash(separator, uri1, true, false)); + // assertEquals(uri1 + separator, + // DirectoryUtils.checkSlash(separator, uri1, false, true)); + // + // assertEquals(uri1, + // DirectoryUtils.checkSlash(separator, uri2, false, false)); + // assertEquals(separator + uri1, + // DirectoryUtils.checkSlash(separator, uri2, true, false)); + // assertEquals(uri1 + separator, + // DirectoryUtils.checkSlash(separator, uri2, false, true)); + // } + + @Test + public void testCombine1() throws Exception { + String rootPath = "/localhost/probaMappa"; + String currentPath = "foo/fooFolder"; + String fullPath = rootPath + PATHSEPARATOR_LINUX + currentPath + PATHSEPARATOR_LINUX; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPath)); + } + + @Test + public void testCombine2() throws Exception { + String rootPath = "/localhost/probaMappa"; + String currentPath = "foo/fooFolder"; + String currentPathBad = "foo\\fooFolder"; + String fullPath = rootPath + PATHSEPARATOR_LINUX + currentPath + PATHSEPARATOR_LINUX; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPathBad)); + } + + @Test + public void testCombine3() throws Exception { + String currentPath = "foo/fooFolder"; + String fullPath = currentPath + PATHSEPARATOR_LINUX; + // assertEquals(fullPath, DirectoryUtils.combine(null, currentPath)); + } + + @Test + public void testCombine4() throws Exception { + String rootPath = "/localhost/probaMappa"; + assertEquals(rootPath + PATHSEPARATOR_LINUX, DirectoryUtils.combine(rootPath, null)); + } + + @Test + public void testCombine5() throws Exception { + String rootPath = "\\localhost\\probaMappa"; + String currentPath = "foo\\fooFolder"; + String fullPath = rootPath + PATHSEPARATOR_WINDOWS + currentPath + PATHSEPARATOR_WINDOWS; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPath)); + } + + @Test + public void testCombine6() throws Exception { + String rootPath = "\\localhost\\probaMappa"; + String rootPathBad = "\\localhost/probaMappa"; + String currentPath = "foo\\fooFolder"; + String fullPath = rootPath + PATHSEPARATOR_WINDOWS + currentPath + PATHSEPARATOR_WINDOWS; + assertEquals(fullPath, DirectoryUtils.combine(rootPathBad, currentPath)); + } + + @Test + public void testCombine7() throws Exception { + String rootPath = "\\localhost\\probaMappa"; + String currentPath = "foo\\fooFolder"; + String currentPathBad = "foo/fooFolder"; + String fullPath = rootPath + PATHSEPARATOR_WINDOWS + currentPath + PATHSEPARATOR_WINDOWS; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPathBad)); + } + + @Test + public void testCombine8() throws Exception { + String rootPath = "\\localhost\\probaMappa"; + String currentPath = "foo\\fooFolder.wmw"; + String fullPath = rootPath + PATHSEPARATOR_WINDOWS + currentPath; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPath, true, false)); + } + + @Test + public void testCombine9() throws Exception { + String rootPath = "/localhost/probaMappa"; + String currentPath = "foo/fooFolder.wmw"; + String fullPath = rootPath + PATHSEPARATOR_LINUX + currentPath; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPath, true, false)); + } + + @Test + public void testCombine10() throws Exception { + String rootPath = "/localhost/probaMappa/"; + String currentPath = "foo/fooFolder.wmw"; + String fullPath = rootPath + currentPath; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPath, true, false)); + } + + @Test + public void testCombine11() throws Exception { + String rootPath = "/localhost/probaMappa/"; + String currentPath = "foo/fooFolder.wmw"; + String fullPath = rootPath + currentPath; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPath, true, false)); + } + + @Test + public void testCombine12() throws Exception { + String rootPath = "\\localhost\\probaMappa"; + String currentPath = "foo\\fooFolder"; + String currentPathBad = "foo/fooFolder"; + String fullPath = rootPath + PATHSEPARATOR_WINDOWS + currentPath + PATHSEPARATOR_WINDOWS; + assertEquals(fullPath, DirectoryUtils.combine(rootPath, currentPathBad, false, false)); + } + +} diff --git a/server/user.jobengine.osgi.commons/test/user/jobengine/remotestore/TestTSMClient.java b/server/user.jobengine.osgi.commons/test/user/jobengine/remotestore/TestTSMClient.java new file mode 100644 index 00000000..0bea07a7 --- /dev/null +++ b/server/user.jobengine.osgi.commons/test/user/jobengine/remotestore/TestTSMClient.java @@ -0,0 +1,157 @@ +package user.jobengine.remotestore; + +import static org.junit.Assert.assertEquals; + +import java.io.File; +import java.io.IOException; + +import org.junit.BeforeClass; + +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.tsm.client.TSMBackupFileObject; +import user.tsm.client.TSMClient; + +public class TestTSMClient { + + @BeforeClass + static public void beforeClass() throws IOException { + + /***************************************** + * launch/TestTSMClient.launch + ****************************************/ + + // export DSMI_DIR=c:\Program Files\Tivoli\TSM\baclient + // export DSMI_CONFIG=c:\Program Files\Tivoli\TSM\baclient\dsm.opt + // export DSMI_LOG=c:\temp + + // -Djava.library.path="c:/Program Files/Tivoli/TSM/api64/DLL/" + + // export DSMI_DIR=/opt/tivoli/tsm/client/api/bin64 + // export DSMI_CONFIG=/opt/tivoli/tsm/client/api/bin64/dsm.opt + // export DSMI_LOG=/db2data/Fuge/tsmapi/test + + // -Djava.library.path=/opt/tivoli/tsm/client/api/bin64, + } + + // @Test + public void TestConnect() { + boolean actual = false; + TSMClient tsm = null; + try { + tsm = new TSMClient("JobEngine"); + tsm.connect(null, null); + System.out.println("Connected"); + actual = true; + } catch (Exception e) { + e.printStackTrace(); + } finally { + tsm.disconnect(); + } + + assertEquals(true, actual); + } + + // @Test + // Tesztelve, mûködik! + public void TestBackUp() { + TSMClient tsm = null; + boolean actual = false; + try { + tsm = new TSMClient("JobEngine"); + tsm.connect(null, null); + System.out.println("Connected"); + try { + System.out.println("Trying register filespace"); + tsm.registerFilespace(File.separator + "JOBENGINE", + "JOBENGINE", 'C', "JOBENGINE", + 10L * 1024L * 1024L * 1024L, 0); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + tsm.setBufferSize(65536); + TSMBackupFileObject objtsm = new TSMBackupFileObject(File.separator + + "JOBENGINE", File.separator + "JOBENGINE", File.separator + + "stadionRestore.avi"); + objtsm.setLocalFilePath("c://temp//stadion.avi"); + tsm.send(objtsm); + actual = true; + + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } finally { + tsm.disconnect(); + System.out.println("Disconnected"); + } + assertEquals(true, actual); + } + + // @Test + // Tesztelve, mûködik! + public void TestRestore() { + TSMClient tsm = null; + boolean actual = false; + try { + tsm = new TSMClient("JobEngine"); + tsm.connect(null, null); + System.out.println("Connected"); + tsm.setBufferSize(65536); + TSMBackupFileObject result = tsm.getActiveBackupFileObject( + File.separator + "JOBENGINE", File.separator + "JOBENGINE", + File.separator + "stadionRestore.avi"); + System.out.println("Query results: "); + if (result != null) { + result.setLocalFilePath("c://temp//stadion.avix"); + tsm.recieve(result); + actual = true; + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } finally { + tsm.disconnect(); + System.out.println("Disconnected"); + } + assertEquals(true, actual); + } + + // @Test + public void TestStreamRestore() { + StoreUri sourceUri = new StoreUri(); + + // TSMLister kiválasztásához beállítjuk az uri-t. + sourceUri.setUri("tsm://"); + // mfStore.getSourceStoreUri(RemoteStoreProtocol.TSM); + StoreUri target = new StoreUri(); + target.setUri("file://c://temp//"); + RemoteFile result = null; + try { + result = sourceUri.transferFrom(target, "stadionRestore.avi", + "restored.avi"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + // @Test + public void TestStreamBackup() { + StoreUri sourceUri = new StoreUri(); + + // TSMLister kiválasztásához beállítjuk az uri-t. + sourceUri.setUri("file://c://temp//"); + // mfStore.getSourceStoreUri(RemoteStoreProtocol.TSM); + StoreUri target = new StoreUri(); + target.setUri("tsm://"); + RemoteFile result = null; + try { + result = sourceUri.transferFrom(target, "stadion.avi", + "stadionRestore.avi"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/server/user.jobengine.osgi.db/.classpath b/server/user.jobengine.osgi.db/.classpath new file mode 100644 index 00000000..cf38f8c6 --- /dev/null +++ b/server/user.jobengine.osgi.db/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/server/user.jobengine.osgi.db/.project b/server/user.jobengine.osgi.db/.project new file mode 100644 index 00000000..5366a480 --- /dev/null +++ b/server/user.jobengine.osgi.db/.project @@ -0,0 +1,33 @@ + + + user.jobengine.osgi.db + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.ds.core.builder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/server/user.jobengine.osgi.db/.settings/org.eclipse.jdt.core.prefs b/server/user.jobengine.osgi.db/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..66737877 --- /dev/null +++ b/server/user.jobengine.osgi.db/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Mon Feb 06 13:26:25 CET 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/server/user.jobengine.osgi.db/.settings/org.eclipse.ltk.core.refactoring.prefs b/server/user.jobengine.osgi.db/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 00000000..0eb77ce3 --- /dev/null +++ b/server/user.jobengine.osgi.db/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Thu Feb 16 15:01:38 CET 2012 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/server/user.jobengine.osgi.db/.settings/org.eclipse.pde.core.prefs b/server/user.jobengine.osgi.db/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 00000000..cd25bffc --- /dev/null +++ b/server/user.jobengine.osgi.db/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,4 @@ +#Tue Feb 01 19:35:25 CET 2011 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false diff --git a/server/user.jobengine.osgi.db/.tpignore b/server/user.jobengine.osgi.db/.tpignore new file mode 100644 index 00000000..5f0c452f --- /dev/null +++ b/server/user.jobengine.osgi.db/.tpignore @@ -0,0 +1,2 @@ +/target/ +/user/jobengine/db/.* diff --git a/server/user.jobengine.osgi.db/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.db/META-INF/MANIFEST.MF new file mode 100644 index 00000000..666e72a3 --- /dev/null +++ b/server/user.jobengine.osgi.db/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Db +Bundle-SymbolicName: user.jobengine.osgi.db;singleton:=true +Bundle-Version: 1.0.0 +DynamicImport-Package: * +Bundle-ClassPath: . +Require-Bundle: user.jobengine.osgi.commons;bundle-version="1.0.0", + com.ibm.db2jcc4;bundle-version="4.19.26", + com.ibm.nosql;bundle-version="4.19.26";visibility:=reexport, + org.jmock.junit4;bundle-version="2.6.0", + org.junit;bundle-version="4.12.0", + org.jmock;bundle-version="2.6.0", + org.apache.logging.log4j.api;bundle-version="2.8.2" +Service-Component: OSGI-INF/component.xml +Bundle-ActivationPolicy: lazy +Import-Package: com.fasterxml.jackson.annotation;version="2.4.5" +Export-Package: user.jobengine.db + diff --git a/server/user.jobengine.osgi.db/OSGI-INF/component.xml b/server/user.jobengine.osgi.db/OSGI-INF/component.xml new file mode 100644 index 00000000..81791494 --- /dev/null +++ b/server/user.jobengine.osgi.db/OSGI-INF/component.xml @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/server/user.jobengine.osgi.db/bldsqlj.bat b/server/user.jobengine.osgi.db/bldsqlj.bat new file mode 100644 index 00000000..e69a70ad --- /dev/null +++ b/server/user.jobengine.osgi.db/bldsqlj.bat @@ -0,0 +1,7 @@ +set DB=%~dp0 +cd "%DB%src\user\jobengine\db\" +copy *.sqlj "%DB%generated\user\jobengine\db\" +cd "%DB%generated\user\jobengine\db\" +sqlj *.sqlj -compile=false -ser2class +del /F/ Q *.sqlj +pause \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/build-remote-sqlj.bat b/server/user.jobengine.osgi.db/build-remote-sqlj.bat new file mode 100644 index 00000000..e14046f3 --- /dev/null +++ b/server/user.jobengine.osgi.db/build-remote-sqlj.bat @@ -0,0 +1,32 @@ +@ECHO OFF + ECHO *** Begin SQL compile on server %DB_REMOTE_HOST% *** + + CALL settings.bat + + CALL :deploy_source + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + + ECHO *** Completed *** + GOTO :eof + +:deploy_source + ECHO --- Deploying source + WinSCP.com /command ^ + "open %REMOTE_SERVER_ADDRESS% -hostkey=""%REMOTE_SERVER_HOSTKEY%""" ^ + "call mkdir -p %REMOTE_LOCATION%" ^ + "cd %REMOTE_LOCATION%" ^ + "lcd src/user/jobengine/db" ^ + "synchronize remote -filemask=*.sqlj" ^ + "call sqlj *.sqlj -compile=false -ser2class" ^ + "lcd ../../../../generated/user/jobengine/db" ^ + "synchronize local -filemask=*ser;*.java" ^ + "exit" + IF %ERRORLEVEL% neq 0 ( + ECHO !!! Error deploy source + EXIT /b %ERRORLEVEL% + ) + GOTO :eof +@ECHO ON +pause + + diff --git a/server/user.jobengine.osgi.db/build-remote-sqlj.launch b/server/user.jobengine.osgi.db/build-remote-sqlj.launch new file mode 100644 index 00000000..2fd9207d --- /dev/null +++ b/server/user.jobengine.osgi.db/build-remote-sqlj.launch @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/server/user.jobengine.osgi.db/build.properties b/server/user.jobengine.osgi.db/build.properties new file mode 100644 index 00000000..0ef21187 --- /dev/null +++ b/server/user.jobengine.osgi.db/build.properties @@ -0,0 +1,7 @@ +source.. = src/,\ + test/,\ + generated/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/ diff --git a/server/user.jobengine.osgi.db/database/configure_db b/server/user.jobengine.osgi.db/database/configure_db new file mode 100644 index 00000000..08631a7c --- /dev/null +++ b/server/user.jobengine.osgi.db/database/configure_db @@ -0,0 +1,2 @@ +db2 catalog tcpip node je remote 192.168.43.11 server 50000 +db2 catalog db je at node je \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/database/createproc.sql b/server/user.jobengine.osgi.db/database/createproc.sql new file mode 100644 index 00000000..fc3cc867 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/createproc.sql @@ -0,0 +1,44 @@ +-- usage: db2 -vtf createdb.sql +CONNECT TO MFTEST@ + +CREATE PROCEDURE SET_CONSTRAINTS(ENFORCE VARCHAR(3)) +LANGUAGE SQL +BEGIN + DECLARE v_tabname VARCHAR(128); + DECLARE v_constname VARCHAR(128); + DECLARE v_rows INTEGER; + DECLARE v_alter_table_sql VARCHAR(256); + DECLARE tmp_cursor CURSOR FOR SELECT tabname, constname FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA ORDER BY CONSTNAME,TABNAME, REFTABNAME; + SELECT count(*) INTO v_rows FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA; + OPEN tmp_cursor; + WHILE (v_rows > 0) DO + FETCH tmp_cursor INTO v_tabname, v_constname; + SET v_alter_table_sql = 'alter table ' || '"' || current SCHEMA || '"' || '.' || v_tabname || ' alter foreign key ' || v_constname; + IF (ENFORCE = 'NO') THEN + SET v_alter_table_sql = v_alter_table_sql || ' NOT ENFORCED'; + ELSE + SET v_alter_table_sql = v_alter_table_sql || ' ENFORCED'; + END IF; + EXECUTE IMMEDIATE v_alter_table_sql; + SET v_rows = v_rows - 1; + END while; + CLOSE tmp_cursor; +END @ + +CREATE PROCEDURE DROP_DYNAMIC_DATA() +LANGUAGE SQL +BEGIN + DECLARE v_tabname VARCHAR(128); + DECLARE v_rows INTEGER; + DECLARE v_drop_table_sql VARCHAR(256); + DECLARE tmp_cursor CURSOR FOR SELECT tabname FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + SELECT count(*) INTO v_rows FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + OPEN tmp_cursor; + WHILE (v_rows > 0) DO + FETCH tmp_cursor INTO v_tabname; + SET v_drop_table_sql = 'drop table ' || '"' || current SCHEMA || '"' || '.' || v_tabname; + EXECUTE IMMEDIATE v_drop_table_sql; + SET v_rows = v_rows - 1; + END while; + CLOSE tmp_cursor; +END @ diff --git a/server/user.jobengine.osgi.db/database/databaseDiagram.erm b/server/user.jobengine.osgi.db/database/databaseDiagram.erm new file mode 100644 index 00000000..37f3575b --- /dev/null +++ b/server/user.jobengine.osgi.db/database/databaseDiagram.erm @@ -0,0 +1,6296 @@ + + + + false + 100 + A4 210 x 297 mm + 30 + 30 + 30 + 30 + + 0 + 1.0 + 0 + 0 + + 128 + 128 + 192 + + + 255 + 255 + 255 + + + 9 + + DB2 + true + funny + IE + 0 + true + 1 + 1 + 1 + false + true + false + false + + + + + + + false + false + false + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + true + false + false + false + + + + + + + false + + + + + 0 + + + + false + false + + + + + false + + + + + + -1 + -1 + Segoe UI + 9 + 50 + 50 + + 255 + 255 + 255 + + + + false + 2013-01-08 14:52:51 + 2013-01-09 11:39:27 + + Project Name + + + + Model Name + + + + Version + + + + Compnay + + + + Author + + + + + + + + + 0 + Default + + + + + + 0 + null + null + false + null + false + + + ARCHIVED + ARCHIVED + timestamp + + + 1 + 10 + null + false + null + false + + + BASETYPE + BASETYPE + varchar(n) + + + 2 + null + null + false + null + false + + + CREATED + CREATED + timestamp + + + 3 + null + null + false + null + false + + + DATA + DATA + blob + + + 4 + 10 + null + false + null + false + + + DATATYPE + DATATYPE + varchar(n) + + + 5 + 200 + null + false + null + false + + + DESCRIPTION + DESCRIPTION + varchar(n) + + + 6 + 255 + null + false + null + false + + + DESCRIPTION + DESCRIPTION + varchar(n) + + + 7 + 200 + null + false + null + false + + + DISPLAY + DISPLAY + varchar(n) + + + 8 + 255 + null + false + null + false + + + FILESTRUCTINFO + FILESTRUCTINFO + varchar(n) + + + 9 + null + null + false + null + false + + + FILETYPEID + FILETYPEID + bigint + + + 10 + null + null + false + null + false + + + FINISHED + FINISHED + timestamp + + + 11 + 80 + null + false + null + false + + + FULLNAME + FULLNAME + varchar(n) + + + 12 + 20 + null + false + null + false + + + GUITYPE + GUITYPE + varchar(n) + + + 13 + 40 + null + false + null + false + + + HOUSEID + HOUSEID + varchar(n) + + + 14 + null + null + false + null + false + + + ID + ID + bigint + + + 15 + null + null + false + null + false + + + INPOINT + INPOINT + bigint + + + 16 + 1 + null + false + null + false + + + ISDBINDEX + ISDBINDEX + character(n) + + + 17 + 1 + null + false + null + false + + + ISDBNULLABLE + ISDBNULLABLE + character(n) + + + 18 + 1 + null + false + null + false + + + ISDBUNIQUE + ISDBUNIQUE + character(n) + + + 19 + 1 + null + false + null + false + + + ISEDITABLE + ISEDITABLE + character(n) + + + 20 + 1 + null + false + null + false + + + ISFOLDER + ISFOLDER + character(n) + + + 21 + 1 + null + false + null + false + + + ISGENERATED + ISGENERATED + character(n) + + + 22 + 1 + null + false + null + false + + + ISLISTABLE + ISLISTABLE + character(n) + + + 23 + 1 + null + false + null + false + + + ISLOWRES + ISLOWRES + character(n) + + + 24 + 1 + null + false + null + false + + + ISSEARCHABLE + ISSEARCHABLE + character(n) + + + 25 + 1 + null + false + null + false + + + ISSOURCE + ISSOURCE + character(n) + + + 26 + 1 + null + false + null + false + + + ISSTATIC + ISSTATIC + character(n) + + + 27 + 1 + null + false + null + false + + + ISSTREAM + ISSTREAM + character(n) + + + 28 + 1 + null + false + null + false + + + ISSYSTEM + ISSYSTEM + character(n) + + + 29 + 1 + null + false + null + false + + + ISTARGET + ISTARGET + character(n) + + + 30 + 255 + null + false + null + false + + + JAVATYPE + JAVATYPE + varchar(n) + + + 31 + null + null + false + null + false + + + LASTLOGIN + LASTLOGIN + timestamp + + + 32 + null + null + false + null + false + + + LENGTH + LENGTH + bigint + + + 33 + null + null + false + null + false + + + LENGTH + LENGTH + integer + + + 34 + 20 + null + false + null + false + + + LISTTYPE + LISTTYPE + varchar(n) + + + 35 + null + null + false + null + false + + + METADATAID + METADATAID + bigint + + + 36 + null + null + false + null + false + + + MODIFIED + MODIFIED + timestamp + + + 37 + 40 + null + false + null + false + + + NAME + NAME + varchar(n) + + + 38 + 80 + null + false + null + false + + + NAME + NAME + varchar(n) + + + 39 + null + null + false + null + false + + + OUTPOINT + OUTPOINT + bigint + + + 40 + 80 + null + false + null + false + + + OWNER + OWNER + varchar(n) + + + 41 + 20 + null + false + null + false + + + PARAMETER + PARAMETER + varchar(n) + + + 42 + 20 + null + false + null + false + + + PASSWORD + PASSWORD + varbinary(n) + + + 43 + 20 + null + false + null + false + + + PASSWORD + PASSWORD + varchar(n) + + + 44 + 20 + null + false + null + false + + + POJOFIELD + POJOFIELD + varchar(n) + + + 45 + null + null + false + null + false + + + PORTNUMBER + PORTNUMBER + integer + + + 46 + null + null + false + null + false + + + POSITION + POSITION + bigint + + + 47 + null + null + false + null + false + + + POSTER + POSTER + blob + + + 48 + null + null + false + null + false + + + PRIORITY + PRIORITY + integer + + + 49 + null + null + false + null + false + + + PROGRESS + PROGRESS + integer + + + 50 + null + null + false + null + false + + + RECORDID + RECORDID + bigint + + + 51 + 255 + null + false + null + false + + + RELATIVEPATH + RELATIVEPATH + varchar(n) + + + 52 + null + null + false + null + false + + + RIGHTS + RIGHTS + integer + + + 53 + 255 + null + false + null + false + + + ROOTPATH + ROOTPATH + varchar(n) + + + 54 + null + null + false + null + false + + + SCHEDULEDTIME + SCHEDULEDTIME + timestamp + + + 55 + 20 + null + false + null + false + + + SQLFIELD + SQLFIELD + varchar(n) + + + 56 + 20 + null + false + null + false + + + STATICTABLE + STATICTABLE + varchar(n) + + + 57 + 80 + null + false + null + false + + + STATUS + STATUS + varchar(n) + + + 58 + null + null + false + null + false + + + SUBMITTED + SUBMITTED + timestamp + + + 59 + 80 + null + false + null + false + + + TEMPLATE + TEMPLATE + varchar(n) + + + 60 + null + null + false + null + false + + + THUMBNAIL + THUMBNAIL + blob + + + 61 + 40 + null + false + null + false + + + TITLE + TITLE + varchar(n) + + + 62 + 80 + null + false + null + false + + + TITLE + TITLE + varchar(n) + + + 63 + 255 + null + false + null + false + + + URI + URI + varchar(n) + + + 64 + 20 + null + false + null + false + + + USERNAME + USERNAME + varchar(n) + + + 65 + null + null + false + null + false + + + VALUE + VALUE + bigint + + + + + + + 0 + -1 + -1 + Segoe UI + 9 + 15 + 920 + + 128 + 128 + 192 + + + + 0 + 12 + 0 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 1 + 13 + 0 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + METADATAELEMENT + METADATAELEMENT + + + SQL121105174637260 + + + + 14 + 0 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 1 + 79 + 1 + + + METADATATYPEID + METADATATYPEID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 37 + 2 + + + + + varchar(n) + + + false + false + true + false + true + + + + + + + + + + + false + false + + + 0 + + + + 6 + 3 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 4 + 77 + 0 + + + DOMAINCATEGORYID + DOMAINCATEGORYID + bigint + + NULL + false + true + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 1 + -1 + -1 + Segoe UI + 9 + 7 + 461 + + 128 + 128 + 192 + + + + 2 + 3 + 1 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 3 + 0 + 1 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 4 + 12 + 1 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + METADATA + METADATA + + + SQL121105174638040 + + + + 14 + 5 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 6 + 29 + 2 + + + ITEMTYPEID + ITEMTYPEID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 7 + 0 + 3 + + + METADATAELEMENTID + METADATAELEMENTID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 16 + 8 + + + + + character(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 18 + 9 + + + + + character(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 17 + 10 + + + + + character(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 22 + 11 + + + + + character(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 19 + 12 + + + + + character(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 21 + 13 + + + + + character(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 24 + 14 + + + + + character(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 12 + 15 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 34 + 16 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 56 + 17 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 44 + 18 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 55 + 19 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 41 + 20 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 21 + 77 + 4 + + + DOMAINCATEGORYID + DOMAINCATEGORYID + bigint + + + false + true + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 2 + -1 + -1 + Segoe UI + 9 + 12 + 1528 + + 128 + 128 + 192 + + + + USERINFO + USERINFO + + + SQL121105174651310 + + + + 14 + 22 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 11 + 23 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 64 + 24 + + + + + varchar(n) + + + false + false + true + false + true + + + + + + + + + + + false + false + + + 0 + + + + 42 + 25 + + + + + varbinary(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 2 + 26 + + + + + timestamp + + CURRENT TIMESTAMP + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 31 + 27 + + + + + timestamp + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 52 + 28 + + + + + integer + + 0 + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + false + true + IDX_ITEM_USERNAMEPASSWORD + BTREE + + + + 24 + false + + + 25 + false + + + + + + + + DB2ADMIN + +
+ + 3 + -1 + -1 + Segoe UI + 9 + 12 + 298 + + 128 + 128 + 192 + + + + ITEMTYPE + ITEMTYPE + + + SQL121105174635750 + + + + 14 + 29 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 37 + 30 + + + + + varchar(n) + + + false + false + true + false + true + + + + + + + + + + + false + false + + + 0 + + + + 6 + 31 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 26 + 32 + + + + + character(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 4 + -1 + -1 + Segoe UI + 9 + 774 + 15 + + 128 + 128 + 192 + + + + MASTERID + MASTERID + + + SQL121105174633450 + + + + 14 + 33 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 2 + 34 + + + + + timestamp + + CURRENT TIMESTAMP + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 14 + 35 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 5 + -1 + -1 + Segoe UI + 9 + 354 + 1109 + + 128 + 128 + 192 + + + + 5 + 12 + 5 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + DOMAIN + DOMAIN + + + SQL121105174634950 + + + + 14 + 36 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 37 + 77 + 5 + + + DOMAINCATEGORYID + DOMAINCATEGORYID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 7 + 38 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 65 + 39 + + + + + bigint + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + false + true + UDX_DOMAIN_DOMAINCATEGORYID_DISPLAY + BTREE + + + + 37 + false + + + 38 + false + + + + + + + + DB2ADMIN + +
+ + 6 + -1 + -1 + Segoe UI + 9 + 661 + 223 + + 128 + 128 + 192 + + + + 6 + 19 + 6 + 1..n + 1 + true + + RESTRICT + RESTRICT + 100 + 86 + -1 + -1 + null + null + + + 7 + 3 + 6 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + MEDIA + MEDIA + + + SQL121105174641520 + + + + 14 + 40 + + + + + bigint + + + false + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 41 + 113 + 6 + + + ITEMID + ITEMID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 42 + 29 + 7 + + + ITEMTYPEID + ITEMTYPEID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 13 + 43 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 61 + 44 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 6 + 45 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 32 + 46 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 2 + 47 + + + + + timestamp + + CURRENT TIMESTAMP + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 36 + 48 + + + + + timestamp + + + true + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 0 + 49 + + + + + timestamp + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 47 + 50 + + + + + blob + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + false + true + IDX_MEDIA_ARCHIVED + BTREE + + + + 49 + false + + + + + false + true + IDX_MEDIA_CREATED + BTREE + + + + 47 + false + + + + + false + true + IDX_MEDIA_DESCRIPTION + BTREE + + + + 45 + false + + + + + false + true + IDX_MEDIA_HOUSEID + BTREE + + + + 43 + false + + + + + false + true + IDX_MEDIA_ITEMID + BTREE + + + + 41 + false + + + + + false + true + IDX_MEDIA_LENGTH + BTREE + + + + 46 + false + + + + + false + true + IDX_MEDIA_TITLE + BTREE + + + + 44 + false + + + + + + + + DB2ADMIN + +
+ + 7 + -1 + -1 + Segoe UI + 9 + 993 + 736 + + 128 + 128 + 192 + + + + SCENE + SCENE + + + SQL121105174648450 + + + + 14 + 51 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 2 + 52 + + + + + timestamp + + CURRENT TIMESTAMP + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 36 + 53 + + + + + timestamp + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 8 + -1 + -1 + Segoe UI + 9 + 995 + 529 + + 128 + 128 + 192 + + + + 8 + 15 + 8 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 9 + 7 + 8 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + SCENECONTENT + SCENECONTENT + + + SQL121105174649120 + + + + 14 + 54 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 55 + 51 + 9 + + + SCENEID + SCENEID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 56 + 88 + 8 + + + SHOTID + SHOTID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 38 + 57 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 46 + 58 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 9 + -1 + -1 + Segoe UI + 9 + 360 + 1525 + + 128 + 128 + 192 + + + + JOB + JOB + + + SQL121220174417060 + + + + 14 + 59 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 38 + 60 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 40 + 61 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 48 + 62 + + + + + integer + + 0 + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 49 + 63 + + + + + integer + + 0 + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 57 + 64 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 5 + 65 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 58 + 66 + + + + + timestamp + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 10 + 67 + + + + + timestamp + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 59 + 68 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 54 + 69 + + + + + timestamp + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 10 + -1 + -1 + Segoe UI + 9 + 607 + 1524 + + 128 + 128 + 192 + + + + JOBPARAMETERS + JOBPARAMETERS + + + + + + + 14 + 70 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 3 + 71 + + + + + blob + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 11 + -1 + -1 + Segoe UI + 9 + 52 + 1740 + + 128 + 128 + 192 + + + + SEARCHDEFINITION + SEARCHDEFINITION + + + SQL121105174650300 + + + + 14 + 72 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 37 + 73 + + + + + varchar(n) + + + false + false + true + false + true + + + + + + + + + + + false + false + + + 0 + + + + 2 + 74 + + + + + timestamp + + CURRENT TIMESTAMP + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 36 + 75 + + + + + timestamp + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 3 + 76 + + + + + blob + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 12 + -1 + -1 + Segoe UI + 9 + 376 + 954 + + 128 + 128 + 192 + + + + DOMAINCATEGORY + DOMAINCATEGORY + + + SQL121105174634170 + + + + 14 + 77 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 37 + 78 + + + + + varchar(n) + + + false + false + true + false + true + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 13 + -1 + -1 + Segoe UI + 9 + 17 + 1142 + + 128 + 128 + 192 + + + + METADATATYPE + METADATATYPE + + + SQL121105174636520 + + + + 14 + 79 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 37 + 80 + + + + + varchar(n) + + + false + false + true + false + true + + + + + + + + + + + false + false + + + 0 + + + + 4 + 81 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 33 + 82 + + + + + integer + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 1 + 83 + + + + + varchar(n) + + '' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 30 + 84 + + + + + varchar(n) + + '' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 14 + -1 + -1 + Segoe UI + 9 + 390 + 87 + + 128 + 128 + 192 + + + + 10 + 19 + 14 + 1..n + 1 + true + + RESTRICT + RESTRICT + 100 + 59 + -1 + -1 + null + null + + + 11 + 19 + 14 + 1..n + 1 + true + + RESTRICT + RESTRICT + 100 + 74 + 0 + 80 + null + null + + + FOLDER + FOLDER + + + SQL121105174640600 + + + + 14 + 85 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 86 + 113 + 10 + + + PARENTID + PARENTID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 87 + 113 + 11 + + + CHILDID + CHILDID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + false + false + UDX_FOLDER_NODUPLICATE + BTREE + + + + 86 + false + + + 87 + false + + + + + + + + DB2ADMIN + +
+ + 15 + -1 + -1 + Segoe UI + 9 + 988 + 277 + + 128 + 128 + 192 + + + + 12 + 6 + 15 + 1..n + 1 + true + + RESTRICT + RESTRICT + 100 + 54 + -1 + -1 + null + null + + + SHOT + SHOT + + + SQL121105174646510 + + + + 14 + 88 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 89 + 40 + 12 + + + MEDIAID + MEDIAID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 60 + 90 + + + + + blob + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 15 + 91 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 39 + 92 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 6 + 93 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 2 + 94 + + + + + timestamp + + CURRENT TIMESTAMP + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + false + true + IDX_SHOT_DESCRIPTION + BTREE + + + + 93 + false + + + + + + + + DB2ADMIN + +
+ + 16 + -1 + -1 + Segoe UI + 9 + 686 + 798 + + 128 + 128 + 192 + + + + STORE + STORE + + + SQL121105174643820 + + + + 14 + 95 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 38 + 96 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 28 + 97 + + + + + character(n) + + 'N' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 23 + 98 + + + + + character(n) + + 'N' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 17 + -1 + -1 + Segoe UI + 9 + 684 + 998 + + 128 + 128 + 192 + + + + 13 + 16 + 17 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + STOREURI + STOREURI + + + SQL121105174645270 + + + + 14 + 99 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 100 + 95 + 13 + + + STOREID + STOREID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 63 + 101 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 27 + 102 + + + + + character(n) + + 'N' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 25 + 103 + + + + + character(n) + + 'N' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 29 + 104 + + + + + character(n) + + 'N' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 64 + 105 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 43 + 106 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 53 + 107 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 45 + 108 + + + + + integer + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 18 + -1 + -1 + Segoe UI + 9 + 377 + 1314 + + 128 + 128 + 192 + + + + 14 + 5 + 18 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + DOMAININDEX + DOMAININDEX + + + SQL121105174638750 + + + + 14 + 109 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 50 + 110 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 35 + 111 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 112 + 36 + 14 + + + DOMAINID + DOMAINID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+ + 19 + -1 + -1 + Segoe UI + 9 + 14 + 14 + + 128 + 128 + 192 + + + + 15 + 3 + 19 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 16 + 4 + 19 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + 100 + 25 + null + null + + + ITEM + ITEM + + + SQL121105174639410 + + + + 113 + 33 + 16 + + + + + bigint + + + false + true + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 114 + 29 + 15 + + + ITEMTYPEID + ITEMTYPEID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 13 + 115 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + 62 + 116 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 6 + 117 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 20 + 118 + + + + + character(n) + + 'N' + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 2 + 119 + + + + + timestamp + + CURRENT TIMESTAMP + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 36 + 120 + + + + + timestamp + + + true + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + false + true + IDX_ITEM_CREATED + BTREE + + + + 119 + false + + + + + false + true + IDX_ITEM_DESCRIPTION + BTREE + + + + 117 + false + + + + + false + true + IDX_ITEM_HOUSEID + BTREE + + + + 115 + false + + + + + false + true + IDX_ITEM_ISFOLDER + BTREE + + + + 118 + false + + + + + false + true + IDX_ITEM_TITLE + BTREE + + + + 116 + false + + + + + + + + DB2ADMIN + +
+ + 20 + -1 + -1 + Segoe UI + 9 + 658 + 552 + + 128 + 128 + 192 + + + + 17 + 16 + 20 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + 18 + 6 + 20 + 1..n + 1 + true + + RESTRICT + RESTRICT + -1 + -1 + -1 + -1 + null + null + + + MEDIAFILE + MEDIAFILE + + + SQL121105174644520 + + + + 14 + 121 + + + + + bigint + + + true + false + true + true + false + + + + + + + + + + + false + false + + + 0 + + + + 122 + 40 + 18 + + + MEDIAID + MEDIAID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 123 + 95 + 17 + + + STOREID + STOREID + bigint + + + false + true + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 9 + 124 + + + + + bigint + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 51 + 125 + + + + + varchar(n) + + + false + false + true + false + false + + + + + + + + + + + false + false + + + 0 + + + + 8 + 126 + + + + + varchar(n) + + + false + false + false + false + false + + + + + + + + + + + false + false + + + 0 + + + + + + + + + DB2ADMIN + +
+
+ + + + + + + + + + +
diff --git a/server/user.jobengine.osgi.db/database/db.structure.DB2.xml b/server/user.jobengine.osgi.db/database/db.structure.DB2.xml new file mode 100644 index 00000000..9f3868a0 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/db.structure.DB2.xml @@ -0,0 +1,169 @@ + + + + + SELECT TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'VASARY' AND TABNAME LIKE ? ESCAPE '\' + + + + CREATE TABLE MASTERID + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL + ) +
+ + CREATE TABLE METADATATYPE + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DATATYPE VARCHAR(10) NOT NULL, + LENGTH INTEGER NOT NULL, + CONSTRAINT UIX_METADATATYPE_NAME UNIQUE (NAME) + ) +
+ + CREATE TABLE METADATAELEMENT + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + METADATATYPEID BIGINT NOT NULL, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255), + CONSTRAINT UIX_METADATAELEMENT_NAME UNIQUE (NAME), + CONSTRAINT FK_METADATAELEMENT_METADATATYPEID_ID FOREIGN KEY (METADATATYPEID) REFERENCES METADATATYPE (ID) + ) +
+ + CREATE TABLE ITEMTYPE + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255) NOT NULL, + CONSTRAINT UIX_ITEMTYPE_NAME UNIQUE (NAME) + ) +
+ + CREATE TABLE METADATA + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + METADATAELEMENTID BIGINT NOT NULL, + ISDBINDEX CHARACTER (1) NOT NULL, + ISDBUNIQUE CHARACTER (1) NOT NULL, + ISDBNULLABLE CHARACTER (1) NOT NULL, + CONSTRAINT FK_METADATA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID), + CONSTRAINT FK_METADATA_METADATAELEMENTID FOREIGN KEY (METADATAELEMENTID) REFERENCES METADATAELEMENT (ID), + CONSTRAINT CHK_METADATA_ISDBINDEX CHECK (ISDBINDEX in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBUNIQUE CHECK (ISDBUNIQUE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBNULLABLE CHECK (ISDBNULLABLE in ('Y', 'N')) + ) +
+ + CREATE TABLE ITEM + ( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + NAME VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT FK_ITEM_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID), + CONSTRAINT FK_ITEM_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) + ) +
+ + CREATE TABLE MEDIA + ( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMID BIGINT NOT NULL, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + LENGTH BIGINT NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + ARCHIVED TIMESTAMP, + CONSTRAINT FK_MEDIA_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID), + CONSTRAINT FK_MEDIA_PARENTID FOREIGN KEY (ITEMID) REFERENCES ITEM (ID), + CONSTRAINT FK_MEDIA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) + ) +
+ + CREATE TABLE STORE + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + CONSTRAINT UIX_STORE_NAME UNIQUE (NAME) + ) +
+ + CREATE TABLE FILETYPE + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + VIDEOCODEC VARCHAR(10) NOT NULL, + AUDIOCODEC VARCHAR(10) NOT NULL, + VIDEOTRACKS INT NOT NULL, + AUDIOTRACKS INT NOT NULL, + FRAMERATE FLOAT NOT NULL + ) +
+ + CREATE TABLE MEDIAFILE + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + STOREID BIGINT NOT NULL, + FILETYPEID BIGINT NOT NULL, + RELATIVEPATH VARCHAR(255) NOT NULL, + FILESTRUCTINFO VARCHAR(255), + CONSTRAINT FK_FILE_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID), + CONSTRAINT FK_FILE_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID), + CONSTRAINT FK_FILE_FILETYPEID FOREIGN KEY (FILETYPEID) REFERENCES FILETYPE (ID) + ) +
+ + CREATE TABLE STOREURI + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + STOREID BIGINT NOT NULL, + URI VARCHAR(255) NOT NULL, + CONSTRAINT FK_STOREURI_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID) + ) +
+ + CREATE TABLE SHOT + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + INPOINT BIGINT NOT NULL, + OUTPOINT BIGINT NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT FK_SHOT_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) + ) +
+ + CREATE TABLE SCENE + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL + ) +
+ + CREATE TABLE SCENECONTENT + ( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + SCENEID BIGINT NOT NULL, + SHOTID BIGINT NOT NULL, + CONSTRAINT FK_SCENECONTENT_SCENEID FOREIGN KEY (SCENEID) REFERENCES SCENE (ID), + CONSTRAINT FK_SCENECONTENT_SHOTID FOREIGN KEY (SHOTID) REFERENCES SHOT (ID) + ) +
+
+
diff --git a/server/user.jobengine.osgi.db/database/db_create.sql b/server/user.jobengine.osgi.db/database/db_create.sql new file mode 100644 index 00000000..9c11841c --- /dev/null +++ b/server/user.jobengine.osgi.db/database/db_create.sql @@ -0,0 +1,386 @@ +--CONNECT TO JE USER db2admin USING Danken74@ +--CONNECT TO MF USER jobengine USING DaGus201@ +--CONNECT TO JE USER jobengine USING DaGus201@ +--CONNECT TO MFORIGO USER DB2ADMIN USING mamtitok@ + +CREATE PROCEDURE SET_CONSTRAINTS(ENFORCE VARCHAR(3)) +LANGUAGE SQL +BEGIN + DECLARE v_tabname VARCHAR(128); + DECLARE v_constname VARCHAR(128); + DECLARE v_rows INTEGER; + DECLARE v_alter_table_sql VARCHAR(256); + DECLARE tmp_cursor CURSOR FOR SELECT tabname, constname FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA ORDER BY CONSTNAME,TABNAME, REFTABNAME; + SELECT count(*) INTO v_rows FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA; + OPEN tmp_cursor; + WHILE (v_rows > 0) DO + FETCH tmp_cursor INTO v_tabname, v_constname; + SET v_alter_table_sql = 'alter table ' || '"' || current SCHEMA || '"' || '.' || v_tabname || ' alter foreign key ' || v_constname; + IF (ENFORCE = 'NO') THEN + SET v_alter_table_sql = v_alter_table_sql || ' NOT ENFORCED'; + ELSE + SET v_alter_table_sql = v_alter_table_sql || ' ENFORCED'; + END IF; + EXECUTE IMMEDIATE v_alter_table_sql; + SET v_rows = v_rows - 1; + END while; + CLOSE tmp_cursor; +END @ + +CREATE PROCEDURE DROP_DYNAMIC_DATA() +LANGUAGE SQL +BEGIN + DECLARE v_tabname VARCHAR(128); + DECLARE v_rows INTEGER; + DECLARE v_drop_table_sql VARCHAR(256); + DECLARE tmp_cursor CURSOR FOR SELECT tabname FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + SELECT count(*) INTO v_rows FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + OPEN tmp_cursor; + WHILE (v_rows > 0) DO + FETCH tmp_cursor INTO v_tabname; + SET v_drop_table_sql = 'drop table ' || '"' || current SCHEMA || '"' || '.' || v_tabname; + EXECUTE IMMEDIATE v_drop_table_sql; + SET v_rows = v_rows - 1; + END while; + CLOSE tmp_cursor; +END @ + +CREATE TABLE MASTERID +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +)@ + +CREATE TABLE DOMAINCATEGORY +( + ID BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL +)@ + +CREATE UNIQUE INDEX UDX_DOMAINCATEGORY_NAME ON DOMAINCATEGORY ("NAME")@ + +CREATE TABLE DOMAIN +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + DOMAINCATEGORYID BIGINT NOT NULL, + DISPLAY VARCHAR(200) NOT NULL, + VALUE BIGINT, + CONSTRAINT FK_DOMAIN_DOMAINCATEGORYID FOREIGN KEY (DOMAINCATEGORYID) REFERENCES DOMAINCATEGORY (ID) +)@ + +CREATE INDEX UDX_DOMAIN_DOMAINCATEGORYID_DISPLAY ON DOMAIN ("DOMAINCATEGORYID","DISPLAY")@ + +CREATE TABLE ITEMTYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255) NOT NULL, + ISSTATIC CHARACTER (1) NOT NULL, + CONSTRAINT CHK_ITEMTYPE_ISSTATIC CHECK (ISSTATIC in ('Y', 'N')) +)@ + +CREATE UNIQUE INDEX UDX_ITEMTYPE_NAME ON ITEMTYPE ("NAME")@ + +CREATE TABLE METADATATYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DATATYPE VARCHAR(10) NOT NULL, + LENGTH INTEGER NOT NULL, + BASETYPE VARCHAR(10) NOT NULL DEFAULT '', + JAVATYPE VARCHAR(255) NOT NULL DEFAULT '' +)@ + +CREATE UNIQUE INDEX UDX_METADATATYPE_NAME ON METADATATYPE ("NAME")@ + +CREATE TABLE METADATAELEMENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + METADATATYPEID BIGINT NOT NULL, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + DOMAINCATEGORYID BIGINT , + CONSTRAINT FK_METADATAELEMENT_METADATATYPEID FOREIGN KEY (METADATATYPEID) REFERENCES METADATATYPE (ID), + CONSTRAINT FK_METADATAELEMENT_DOMAINCATEGORYID FOREIGN KEY (DOMAINCATEGORYID) REFERENCES DOMAINCATEGORY (ID) +)@ + +CREATE UNIQUE INDEX UDX_METADATAELEMENT_NAME ON METADATAELEMENT ("NAME")@ + +CREATE TABLE METADATA +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + METADATAELEMENTID BIGINT NOT NULL, + ISDBINDEX CHARACTER(1) NOT NULL, + ISDBUNIQUE CHARACTER(1) NOT NULL, + ISDBNULLABLE CHARACTER(1) NOT NULL, + ISLISTABLE CHARACTER(1) NOT NULL, + ISEDITABLE CHARACTER(1) NOT NULL, + ISGENERATED CHARACTER(1) NOT NULL, + ISSEARCHABLE CHARACTER(1) NOT NULL, + GUITYPE VARCHAR(20) NOT NULL, + LISTTYPE VARCHAR(20) NOT NULL, + STATICTABLE VARCHAR(20) , + POJOFIELD VARCHAR(20) , + SQLFIELD VARCHAR(20) , + PARAMETER VARCHAR(20) , + DOMAINCATEGORYID BIGINT, + CONSTRAINT CHK_METADATA_ISDBINDEX CHECK (ISDBINDEX in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBUNIQUE CHECK (ISDBUNIQUE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBNULLABLE CHECK (ISDBNULLABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISEDITABLE CHECK (ISEDITABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISLISTABLE CHECK (ISLISTABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISGENERATED CHECK (ISGENERATED in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISSEARCHABLE CHECK (ISGENERATED in ('Y', 'N')), + CONSTRAINT FK_METADATA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID), + CONSTRAINT FK_METADATA_METADATAELEMENTID FOREIGN KEY (METADATAELEMENTID) REFERENCES METADATAELEMENT (ID) +)@ + +CREATE TABLE DOMAININDEX +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + RECORDID BIGINT NOT NULL, + METADATAID BIGINT NOT NULL, + DOMAINID BIGINT NOT NULL, + CONSTRAINT FK_DOMAININDEX_RECORDID FOREIGN KEY (RECORDID) REFERENCES MASTERID (ID), + CONSTRAINT FK_DOMAININDEX_METADATAID FOREIGN KEY (METADATAID) REFERENCES METADATA (ID), + CONSTRAINT FK_DOMAININDEX_DOMAINID FOREIGN KEY (DOMAINID) REFERENCES DOMAIN (ID) +)@ + +CREATE TABLE ITEM +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + TITLE VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + ISFOLDER CHARACTER(1) NOT NULL DEFAULT 'N', + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP, + CONSTRAINT CHK_ITEM_ISFOLDER CHECK (ISFOLDER in ('Y', 'N')), + CONSTRAINT FK_ITEM_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID), + CONSTRAINT FK_ITEM_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) +)@ + + +CREATE INDEX IDX_ITEM_TITLE ON ITEM ("TITLE")@ +CREATE INDEX IDX_ITEM_DESCRIPTION ON ITEM ("DESCRIPTION")@ +CREATE INDEX IDX_ITEM_HOUSEID ON ITEM ("HOUSEID")@ +CREATE INDEX IDX_ITEM_CREATED ON ITEM ("CREATED")@ +CREATE INDEX IDX_ITEM_ISFOLDER ON ITEM ("ISFOLDER")@ + +CREATE TABLE FOLDER +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + PARENTID BIGINT NOT NULL, + CHILDID BIGINT NOT NULL, + CONSTRAINT CHK_FOLDER_SELFCHILD CHECK (PARENTID != CHILDID), + CONSTRAINT FK_FOLDER_PARENTID FOREIGN KEY (PARENTID) REFERENCES ITEM (ID), + CONSTRAINT FK_FOLDER_CHILDID FOREIGN KEY (CHILDID) REFERENCES ITEM (ID) +)@ + +CREATE UNIQUE INDEX UDX_FOLDER_NODUPLICATE ON FOLDER ("PARENTID", "CHILDID")@ + +CREATE TRIGGER TRG_INSERT_FOLDER AFTER INSERT ON FOLDER +REFERENCING NEW AS N + FOR EACH ROW UPDATE ITEM SET ISFOLDER = 'Y' WHERE ID = N.PARENTID AND ISFOLDER = 'N'@ + + +CREATE TRIGGER TRG_DELETE_FOLDER AFTER DELETE ON FOLDER +REFERENCING OLD AS O + FOR EACH ROW UPDATE ITEM SET ISFOLDER = 'N' WHERE ID = O.PARENTID AND NOT EXISTS (SELECT * FROM FOLDER WHERE PARENTID = O.PARENTID)@ + + +CREATE TABLE MEDIA +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMID BIGINT NOT NULL, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + TITLE VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + LENGTH BIGINT NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP, + ARCHIVED TIMESTAMP, + POSTER BLOB, + CONSTRAINT FK_MEDIA_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID), + CONSTRAINT FK_MEDIA_ITEMID FOREIGN KEY (ITEMID) REFERENCES ITEM (ID), + CONSTRAINT FK_MEDIA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) +)@ + +CREATE INDEX IDX_MEDIA_TITLE ON MEDIA ("TITLE")@ +CREATE INDEX IDX_MEDIA_ITEMID ON MEDIA ("ITEMID")@ +CREATE INDEX IDX_MEDIA_DESCRIPTION ON MEDIA ("DESCRIPTION")@ +CREATE INDEX IDX_MEDIA_HOUSEID ON MEDIA ("HOUSEID")@ +CREATE INDEX IDX_MEDIA_CREATED ON MEDIA ("CREATED")@ +CREATE INDEX IDX_MEDIA_ARCHIVED ON MEDIA ("ARCHIVED")@ +CREATE INDEX IDX_MEDIA_LENGTH ON MEDIA ("LENGTH")@ + +CREATE TABLE FILETYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + VIDEOCODEC VARCHAR(10) NOT NULL, + AUDIOCODEC VARCHAR(10) NOT NULL, + VIDEOTRACKS INT NOT NULL, + AUDIOTRACKS INT NOT NULL, + FRAMERATE FLOAT NOT NULL +)@ + +CREATE UNIQUE INDEX UDX_FILETYPE_NAME ON FILETYPE ("NAME")@ + +CREATE TABLE STORE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + ISSYSTEM CHARACTER(1) NOT NULL DEFAULT 'N', + ISLOWRES CHARACTER(1) NOT NULL DEFAULT 'N', + CONSTRAINT CHK_STORE_ISSYSTEM CHECK (ISSYSTEM in ('Y', 'N')), + CONSTRAINT CHK_STORE_ISLOWRES CHECK (ISLOWRES in ('Y', 'N')) +)@ + +CREATE UNIQUE INDEX UDX_STORE_NAME ON STORE ("NAME")@ + +CREATE TABLE MEDIAFILE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + STOREID BIGINT NOT NULL, + FILETYPEID BIGINT NOT NULL, + RELATIVEPATH VARCHAR(255) NOT NULL, + FILESTRUCTINFO VARCHAR(255), + CONSTRAINT FK_MEDIAFILE_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID), + CONSTRAINT FK_MEDIAFILE_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID), + CONSTRAINT FK_MEDIAFILE_FILETYPEID FOREIGN KEY (FILETYPEID) REFERENCES FILETYPE (ID) +)@ + +CREATE TABLE STOREURI +( + ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, + STOREID BIGINT NOT NULL, + PROTOCOL VARCHAR(20) , + DELIVERY VARCHAR(20) , + URI VARCHAR(255) NOT NULL, + ISSTREAM CHARACTER(1) NOT NULL DEFAULT 'N', + ISSOURCE CHARACTER(1) NOT NULL DEFAULT 'N', + ISTARGET CHARACTER(1) NOT NULL DEFAULT 'N', + USERNAME VARCHAR(20), + PASSWORD VARCHAR(20), + ROOTPATH VARCHAR(255), + PORTNUMBER INT, + CONSTRAINT CHK_STOREURI_ISSTREAM CHECK (ISSTREAM in ('Y', 'N')), + CONSTRAINT CHK_STOREURI_ISSOURCE CHECK (ISSOURCE in ('Y', 'N')), + CONSTRAINT CHK_STOREURI_ISTARGET CHECK (ISTARGET in ('Y', 'N')), + CONSTRAINT FK_STOREURI_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID) +)@ + +CREATE TABLE SHOT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB, + INPOINT BIGINT NOT NULL, + OUTPOINT BIGINT NOT NULL, + DESCRIPTION VARCHAR(255), + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT FK_SHOT_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +)@ + +CREATE INDEX IDX_SHOT_DESCRIPTION ON SHOT ("DESCRIPTION")@ + +CREATE TABLE BREAK +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB NOT NULL, + INPOINT BIGINT NOT NULL, + BREAKTYPE VARCHAR(10) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT FK_BREAK_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +)@ + +CREATE TABLE SCENE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP +)@ + +CREATE TABLE SCENECONTENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + SCENEID BIGINT NOT NULL, + SHOTID BIGINT NOT NULL, + POSITION BIGINT NOT NULL, + CONSTRAINT FK_SCENECONTENT_SCENEID FOREIGN KEY (SCENEID) REFERENCES SCENE (ID), + CONSTRAINT FK_SCENECONTENT_SHOTID FOREIGN KEY (SHOTID) REFERENCES SHOT (ID) +)@ + +CREATE TABLE SEARCHDEFINITION +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP, + DATA BLOB +)@ +CREATE UNIQUE INDEX UDX_SEARCHDEFINITION_NAME ON SEARCHDEFINITION ("NAME")@ + +CREATE TABLE USERINFO +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + FULLNAME VARCHAR(80) NOT NULL, + USERNAME VARCHAR(20) NOT NULL, + PASSWORD VARCHAR(20) NOT NULL FOR BIT DATA, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + LASTLOGIN TIMESTAMP, + RIGHTS INT NOT NULL DEFAULT 0 +)@ + +CREATE UNIQUE INDEX UDX_USERINFO_USERNAME ON USERINFO ("USERNAME")@ +CREATE INDEX IDX_ITEM_USERNAMEPASSWORD ON USERINFO ("USERNAME", "PASSWORD")@ + +CREATE TABLE JOB +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + PARENTJOBID BIGINT, + NAME VARCHAR(80) NOT NULL, + OWNER VARCHAR(80), + PRIORITY INT NOT NULL DEFAULT 0, + PROGRESS INT NOT NULL DEFAULT 0, + STATUS VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(200), + SUBMITTED TIMESTAMP NOT NULL, + FINISHED TIMESTAMP, + TEMPLATE VARCHAR(80) NOT NULL, + SCHEDULEDTIME TIMESTAMP +)@ + +CREATE TABLE JOBPARAMETERS +( + ID NOT NULL PRIMARY KEY, + DATA BLOB +)@ + +CREATE TABLE WORKFLOWACTION +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + TOUCHED TIMESTAMP NOT NULL, + STARTED TIMESTAMP NOT NULL, + FINISHED TIMESTAMP NOT NULL, + SUCCESSFUL CHARACTER(1) NOT NULL DEFAULT 'N', + HOUSEID VARCHAR(40), + DESCRIPTION VARCHAR(255) NOT NULL, + SOURCE VARCHAR(255) NOT NULL, + DESTINATION VARCHAR(255) NOT NULL, + TAG VARCHAR(40) NOT NULL, + SIZE BIGINT NOT NULL, + CONSTRAINT CHK_WORKFLOWACTION_SUCCESSFUL CHECK (SUCCESSFUL in ('Y', 'N')) +)@ + +CREATE INDEX IDX_WORKFLOWACTION_FINISHED ON WORKFLOWACTION ("FINISHED")@ +CREATE INDEX IDX_WORKFLOWACTION_HOUSEID ON WORKFLOWACTION ("HOUSEID")@ + diff --git a/server/user.jobengine.osgi.db/database/db_drop.sql b/server/user.jobengine.osgi.db/database/db_drop.sql new file mode 100644 index 00000000..d438c7aa --- /dev/null +++ b/server/user.jobengine.osgi.db/database/db_drop.sql @@ -0,0 +1,43 @@ +--CONNECT TO JE USER db2admin USING Danken74@ +--CONNECT TO JE USER db2admin USING password@ +--CONNECT TO MF USER jobengine USING DaGus201@ +--CONNECT TO MFTEST USER jobengine USING DaGus201@ +--CONNECT TO MFORIGO USER DB2ADMIN USING mamtitok@ +--CONNECT TO MF USER db2admin USING D0urdenDrizzt@ +CONNECT TO JE USER jobengine USING DaGus201@ + +CALL SET_CONSTRAINTS('NO')@ +CALL DROP_DYNAMIC_DATA()@ + +DROP PROCEDURE SET_CONSTRAINTS@ +DROP PROCEDURE DROP_DYNAMIC_DATA@ + +DROP TABLE MEDIAFILE@ +DROP TABLE SCENECONTENT@ +DROP TABLE SHOT@ +DROP TABLE MEDIA@ +DROP TABLE ITEM@ +DROP TABLE MASTERID@ +DROP TABLE METADATA@ +DROP TABLE ITEMTYPE@ +DROP TABLE METADATAELEMENT@ +DROP TABLE METADATATYPE@ +DROP TABLE SCENE@ +DROP TABLE STOREURI@ +DROP TABLE FILETYPE@ +DROP TABLE STORE@ +DROP TABLE BREAK@ +DROP TABLE DOMAIN@ +DROP TABLE DOMAINCATEGORY@ +DROP TABLE DOMAININDEX@ +DROP TABLE WORKFLOWACTION@ +--obsolate +--DROP TABLE QUERYOBJECT@ +DROP TABLE SEARCHDEFINITION@ +DROP TABLE FOLDER@ +DROP TABLE USERINFO@ +DROP TABLE JOB@ +DROP TABLE JOBPARAMETERS@ + +DROP TRIGGER TRG_INSERT_FOLDER@ +DROP TRIGGER TRG_DELETE_FOLDER@ diff --git a/server/user.jobengine.osgi.db/database/erd.pdf b/server/user.jobengine.osgi.db/database/erd.pdf new file mode 100644 index 00000000..adef4833 Binary files /dev/null and b/server/user.jobengine.osgi.db/database/erd.pdf differ diff --git a/server/user.jobengine.osgi.db/database/erd.vsd b/server/user.jobengine.osgi.db/database/erd.vsd new file mode 100644 index 00000000..767e5b73 Binary files /dev/null and b/server/user.jobengine.osgi.db/database/erd.vsd differ diff --git a/server/user.jobengine.osgi.db/database/oracle/provys.sql b/server/user.jobengine.osgi.db/database/oracle/provys.sql new file mode 100644 index 00000000..34c2cf01 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/oracle/provys.sql @@ -0,0 +1,61 @@ +SELECT SCN_TO_TIMESTAMP(ORA_ROWSCN) FROM brc_prog_tb + WHERE IDEC = '09-00106-0000' + +SELECT * FROM all_tab_modifications + +select date_modif from PRG_PROG_VW where ROWNUM < 10 +select scn_to_timestamp(max(ora_rowscn)) from PRG_PROG_VW + +select max(rownum) from PRG_PROG_VW +select * from PRG_SERIES_VW where SERIES_ID = 10024100369 + +select * from PRG_PROG_VW where SERIES_ID = 10024100369 +--SERIES_ID olyan prog id aminek az elemeit keressük + +select * from PRG_PROG_VW where PROG_ID = 10024100369 + + +select * from PRG_PROG_LIST_DW where IDEC = '09-00106-0000' +select * from PRG_PROG_VW where IDEC = '09-00106-0000' +--SERIES_ID olyan prog, ami nem sorozat +select * from ALL_TAB_STATS_HISTORY where table_name='BRC_PROG_TB' AND ROWNUM < 10 +select count(*) from ALL_TAB_STATS_HISTORY where ROWNUM < 10 + + +select count(*) from PRG_SERIES_VW where SERIES-ID not in (SELECT select * from PRG_PROG_VW where) +select * from PRG_PROG_VW where SERIES_ID = 10024100369 +select * from PRG_PROG_VW where SERIES_ID = null AND ROWNUM < 10 +select * from PRG_VERSION_VW where PROG_ID=10024100370 + +ROWNUM < 10 +select * from PRG_VERSION_VW where ROWNUM < 10 +select * from prg_series_vw where ROWNUM < 10 + +10024100369 + +select count(*) from prg_prog_vw +select count(*) from PRG_SERIES_DETAIL_DW +select count(*) from PRG_SERIES_CONTEXT_DW +select count(*) from PRG_SERIES_LIST_DW + +select * from prg_series_vw where ROWNUM < 10 order by series_id desc + + +REQTYPE_RF + +select * from user_views +select count(*) from ALL_OBJECTS +select count(*) from ALL_TABLES +select count(*) from ALL_VIEWS +select * from ALL_VIEWS where view_name like 'REQ%' +select * from ALL_VIEWS where view_name like 'PRG_S%' + +desc prg_prog_vw + + +select * from prg_prog_vw where ROWNUM < 10 +select count(*) from USER_VIEWS +select * from ALL_VIEWS where ROWNUM < 100 AND view_name like 'PRG_P%' +select * from ALL_VIEWS where ROWNUM < 10 AND view_name like '%HIST%' + +select * from DBA_TABLES where ROWNUM < 10 \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/database/procedure.sql b/server/user.jobengine.osgi.db/database/procedure.sql new file mode 100644 index 00000000..2490fd93 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/procedure.sql @@ -0,0 +1,58 @@ + + +call SET_CONSTRAINTS('YES') +call SET_CONSTRAINTS('NO') +select * from syscat.tabconst where tabschema='VASARY' and TYPE='F' + +drop procedure SET_CONSTRAINTS + +create procedure SET_CONSTRAINTS (ENFORCE VARCHAR(3)) +LANGUAGE SQL +BEGIN +declare v_tabname varchar(128); +declare v_constname varchar(128); +declare v_rows integer; +declare v_alter_table_sql varchar(256); +declare tmp_cursor cursor for SELECT tabname, constname FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA ORDER BY CONSTNAME,TABNAME, REFTABNAME; +select count(*) into v_rows from syscat.references WHERE TABSCHEMA = CURRENT SCHEMA; +open tmp_cursor; +while (v_rows > 0) DO +FETCH tmp_cursor INTO v_tabname, v_constname; +SET v_alter_table_sql = 'alter table ' || '"' || current SCHEMA || '"' || '.' || v_tabname || ' alter foreign key ' || v_constname; +IF (ENFORCE = 'NO') THEN + SET v_alter_table_sql = v_alter_table_sql || ' NOT ENFORCED'; +ELSE + SET v_alter_table_sql = v_alter_table_sql || ' ENFORCED'; +END IF; +execute immediate v_alter_table_sql; +SET v_rows = v_rows - 1; +end while; +close tmp_cursor; +END + +call SET_CONSTRAINTS('YES') + +SELECT TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'VASARY' AND TABNAME LIKE 'METADATA\\_%' ESCAPE '\' +SELECT TABNAME FROM SYSCAT.TABLES WHERE TABNAME LIKE 'METADATA\_%' ESCAPE '\' + +DROP PROCEDURE DROP_DYNAMIC_DATA + +CREATE PROCEDURE DROP_DYNAMIC_DATA() +LANGUAGE SQL +BEGIN + DECLARE v_tabname VARCHAR(128); + DECLARE v_rows INTEGER; + DECLARE v_drop_table_sql VARCHAR(256); + DECLARE tmp_cursor CURSOR FOR SELECT tabname FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + SELECT count(*) INTO v_rows FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + OPEN tmp_cursor; + WHILE (v_rows > 0) DO + FETCH tmp_cursor INTO v_tabname; + SET v_drop_table_sql = 'drop table ' || '"' || current SCHEMA || '"' || '.' || v_tabname; + EXECUTE IMMEDIATE v_drop_table_sql; + SET v_rows = v_rows - 1; + END while; + CLOSE tmp_cursor; +END + +call DROP_DYNAMIC_DATA() diff --git a/server/user.jobengine.osgi.db/database/query.sql b/server/user.jobengine.osgi.db/database/query.sql new file mode 100644 index 00000000..4e05da21 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/query.sql @@ -0,0 +1,545 @@ +alter table media add column POSTER BLOB + + +select * from JOB j where (j.SUBMITTED LIKE '2012-09-02%') +select * from JOB j where (j.SUBMITTED = '2012-09-02 18:11:49.857') + +select * from job +update job set submitted = '2012-02-13 10:23:00' +update job set finished = '2012-02-13 10:27:00' +delete from job +delete from jobparameters +select * from jobparameters + +DROP TABLE JOB +CREATE TABLE JOB +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + OWNER VARCHAR(80), + PRIORITY INT NOT NULL DEFAULT 0, + PROGRESS INT NOT NULL DEFAULT 0, + STATUS VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(200), + SUBMITTED TIMESTAMP NOT NULL, + FINISHED TIMESTAMP, + TEMPLATE VARCHAR(80) NOT NULL, + SCHEDULEDTIME TIMESTAMP +) + +CREATE TABLE JOBPARAMETERS +( + ID BIGINT NOT NULL, + DATA BLOB +) + + +CREATE UNIQUE INDEX UDX_SEARCHDEFINITION_NAME ON SEARCHDEFINITION ("NAME") + +DROP TABLE QUERYOBJECT +CREATE TABLE SEARCHDEFINITION +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP, + DATA BLOB +) + + + + +ALTER TABLE STORE ADD COLUMN ISSYSTEM CHARACTER(1) NOT NULL DEFAULT 'N' +ALTER TABLE STORE ADD CONSTRAINT CHK_STORE_ISSYSTEM CHECK (ISSYSTEM in ('Y', 'N')) +ALTER TABLE STORE ADD COLUMN ISLOWRES CHARACTER(1) NOT NULL DEFAULT 'N' +ALTER TABLE STORE ADD CONSTRAINT CHK_STORE_ISLOWRES CHECK (ISLOWRES in ('Y', 'N')) + + + +SELECT ID, USERNAME, DECRYPT_CHAR(PASSWORD, 'xwXbgTer') AS PASSWORD FROM USERINFO + +SELECT ID, USERNAME, DECRYPT_CHAR(PASSWORD, 'xwXbgTer') AS PASSWORD FROM USERINFO WHERE PASSWORD = ENCRYPT('teszt2', 'xwXbgTer') AND USERNAME = 'teszt2' +SELECT ID, USERNAME, DECRYPT_CHAR(PASSWORD, 'xwXbgTer') AS PASSWORD FROM USERINFO WHERE PASSWORD = 'teszt2' AND USERNAME = 'teszt2' + +CREATE UNIQUE INDEX UDX_USERINFO_USERNAME ON USERINFO ("USERNAME") +CREATE INDEX IDX_ITEM_USERNAMEPASSWORD ON USERINFO ("USERNAME", "PASSWORD") + + +set encryption password = 'jobengine' + +insert into userinfo (fullname, username, password) values ('dani', 'vasary', encrypt('mypwd', 'jobengine')) +select fullname, username, decrypt_char(password, 'jobengine') as clearpassword from userinfo + +select decrypt_char(password, 'jobengine') from userinfo +select fullname, username, decrypt_char(CAST(x'0810f0ffb804aed5235d58ff67a6969e' AS VARCHAR(100) FOR BIT DATA), 'jobengine') from userinfo + +declare @a varchar(200) +go +select encrypt('mypwd', 'kuka') into a; +select a; + + +DROP TABLE USERINFO +CREATE TABLE USERINFO +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + FULLNAME VARCHAR(80) NOT NULL, + USERNAME VARCHAR(20) NOT NULL, + PASSWORD VARCHAR(20) NOT NULL FOR BIT DATA, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + LASTLOGIN TIMESTAMP, + RIGHTS INT NOT NULL DEFAULT 0 +) + + + +SELECT d.ID, d.DOMAINCATEGORYID, d.DISPLAY, d.VALUE FROM DOMAIN d, DOMAININDEX i WHERE d.ID = i.DOMAINID AND i.RECORDID = 6001 +select * from domainindex +select * from domain +select * from domaincategory + MERGE INTO METADATA_1003 m USING (SELECT 6921 as ID METADATA_1003) o ON (m.ID = o.ID) + WHEN NOT MATCHED THEN INSERT (id, C1003) VALUES (6921, 'insert') + + ELSE UPDATE SET C1003 = 'update' + + WHEN MATCHED THEN INSERT (id, C1003) VALUES (6921, 'insert') + + select * from METADATA_1003 + + select min(id) from item +MERGE INTO METADATA_1003 + +select * from item where title like 'D%' FETCH FIRST 1 ROWS ONLY +25721 +select * from item where title like 'F%' FETCH FIRST 1 ROWS ONLY +25722 + +drop table remotestore +SELECT * FROM SYSCAT.TABLES WHERE TABNAME LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA + +TRUNCATE TABLE DOMAINCATEGORY DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE +TRUNCATE TABLE DOMAIN DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE +TRUNCATE TABLE DOMAININDEX DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE + +call SYSPROC.ADMIN_CMD ('REORG TABLE QUERYOBJECT') +SELECT TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'VASARY' AND TABNAME LIKE 'METADATA\_%' ESCAPE '\' + + +insert into ITEM (id, itemtypeid, title, description, houseid) values (2219521, 657, 'xxx','xxx','xxx') + +insert into masterid (created) values ('2011-08-19') + +select max(id) from masterid fetch first 10 rows only +select * from item fetch first 10 rows only +select * from item where title='xxx' fetch first 10 rows only + + +--PD teszt +select * from mediafile where mediaid in +(select id from media where itemid in +(select id from item where title = 'Avatar')) + +update mediafile set storeid=281 where id=2646459 or id=2646461 +update mediafile set RELATIVEPATH='avatar.vmw' where id=2646459 or id=2646461 + +insert into store (name) values ('Home progressive download') +insert into storeuri (storeid,uri,isstream) select id as storeid, 'http://vasary-pc/', 'Y' as isstream from store where name='Home progressive download' +select * from store +select * from storeuri +--http://vasary-pc/avatar.wmv + +update queryobject set name='teszt' + +insert into filetype (name, videocodec, audiocodec, videotracks, audiotracks, framerate) values ('hanganyag', '', 'MP3', 0, 1, 0) +insert into filetype (name, videocodec, audiocodec, videotracks, audiotracks, framerate) values ('film', 'MPEG2_V', 'MPEG2_A', 1, 1, 25) +insert into filetype (name, videocodec, audiocodec, videotracks, audiotracks, framerate) values ('bináris', '', '', 0, 0, 0) + +insert into store (name) values ('Archívum gyorstár') +insert into storeuri (storeid,uri,isstream) select id as storeid, 'ftp://localhost:4503/', 'N' as isstream from store where name='Archívum gyorstár' +update item set created ='2011-01-01' + + +--insert into storeuri (storeid, uri, isstream) values ( 'bináris', '', '', 0, 0, 0) +--select id as storeid, 'ftp://localhost:4503/' from store where name='Local NAS' + + +select * from metadata where pojofield='created' + +update mediafile set relativepath='low2.mp4' where storeid=247 +select * from store +select * from storeuri + +update mediafile set relativepath='LOW_30min.mp4' +select * from mediafile +--top level folders ! +select distinct(f.parentid) from folder f left join folder p on (f.parentid = p.childid) where p.parentid is null + +SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ID IN ( + SELECT DISTINCT(f.PARENTID) FROM FOLDER f LEFT JOIN FOLDER p ON (f.PARENTID = p.CHILDID) WHERE P.PARENTID IS NULL + ) ORDER BY TITLE + +SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ISFOLDER = 'Y' AND ID IN ( + SELECT CHILDID FROM FOLDER WHERE PARENTID = 2205679 + ) ORDER BY TITLE + + +SELECT x.ID, x.PARENTID, x.CHILDID FROM FOLDER x, ITEM WHERE ITEM.ID = x.PARENTID AND x.PARENTID IN ( + SELECT DISTINCT(f.PARENTID) FROM FOLDER f LEFT JOIN FOLDER p ON (f.PARENTID = p.CHILDID) WHERE P.PARENTID IS NULL + ) ORDER BY ITEM.TITLE + + +SELECT x.ID, x.PARENTID, x.CHILDID FROM FOLDER x, ITEM i WHERE i.ID = x.PARENTID AND i.ISFOLDER = 'Y' AND x.PARENTID = :id ORDER BY i.TITLE + +select i.id, i.title, p.childid as parentid, ch.parentid as childid from folder f +left join folder ch on (f.childid = ch.parentid) +left join folder p on (f.parentid = p.childid) +left join item i on (i.id = f.parentid) +order by i.title + +CREATE VIEW FOLDERINFO AS +select i.id, count(distinct(p.childid)) as parents, count(distinct(ch.parentid)) as children from folder f +left join folder ch on (f.childid = ch.parentid) +left join folder p on (f.parentid = p.childid) +left join item i on (i.id = f.parentid) +group by i.id + +SELECT * FROM FOLDERINFO + +SELECT i.ID, i.TITLE, f.PARENTS, f.CHILDREN FROM ITEM i, FOLDERINFO f WHERE (i.ID = f.ID) ORDER BY i.TITLE + +count(f.parentid) + +select f.parentid, pi.title, p.parentid, f.childid, chi.title from folder f +left join folder p on (f.parentid = p.childid) +left join item pi on (pi.id = f.parentid) +left join item chi on (chi.id = f.childid) +order by f.parentid + +group by f.parentid + + +select pi.id, pi.title, chi.id, chi.title from folder p +left join folder ch on (ch.parentid = p.childid) +left join item pi on (pi.id = p.parentid) +left join item chi on (chi.id = p.childid) +order by p.parentid + + + +select * from folder order by parentid + + +SELECT ii.ITEMTYPEID, CAST(COUNT(DISTINCT(ii.ID)) AS BIGINT) FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE ((ii.ISFOLDER = 'Y')) GROUP BY ii.ITEMTYPEID + +WITH NUMBEREDITEM AS (SELECT ROWNUMBER() OVER (ORDER BY md.C1461 DESC) AS RN, i.ID, i.TITLE, i.DESCRIPTION, i.ITEMTYPEID, i.HOUSEID, i.CREATED, i.ISFOLDER FROM ITEM i WHERE i.ID IN LEFT OUTER JOIN METADATA_1461 md ON (md.ID = i.ID) WHERE i.ID IN (SELECT ii.ID FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) LEFT OUTER JOIN METADATA_1461 i_METADATA_1461 ON (i_METADATA_1461.ID = ii.ID) LEFT OUTER JOIN METADATA_1461 m_METADATA_1461 ON (m_METADATA_1461.ID = mm.ID) WHERE ((ii.TITLE LIKE 'F%') OR (ii.TITLE LIKE 'S%')) AND ii.ITEMTYPEID = 657)) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 50 + +select * from METADATA_0501 +ALTER TABLE METADATA_0501 ADD COLUMN "C" BIGINT +ALTER TABLE METADATA_0501 DROP COLUMN "C" + +ALTER TABLE METADATA_0501 DROP COLUMN "C1081" +ALTER TABLE METADATA_0501 ADD COLUMN "C1081" TIMESTAMP NOT NULL DEFAULT '1900-01-01' +CREATE INDEX IDX_METADATA_0501_C1081 ON METADATA_0501 ("C1081") +call SYSPROC.ADMIN_CMD ('REORG TABLE METADATA_0501') + + + + +WITH NUMBEREDITEM AS (SELECT ROWNUMBER() OVER (ORDER BY i."TITLE" ASC) AS RN, i.ID, i.TITLE, i.DESCRIPTION, i.CREATED, i.HOUSEID, i.ITEMTYPEID, i.ISFOLDER FROM ITEM i LEFT OUTER JOIN METADATA_0496 md ON (md.ID = i.ID) WHERE i.ID IN (SELECT ii.ID FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.TITLE LIKE 'F%') OR (ii.TITLE LIKE 'S%') AND ii.ITEMTYPEID = 496)) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 50 + +select count(*) from item where title like 'S%' + + +CREATE TABLE TEST +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL +) + + +WITH NUMBEREDITEM AS (SELECT ROWNUMBER() OVER () AS RN, i.ID, i.TITLE, i.DESCRIPTION, i.CREATED, i.HOUSEID, i.ITEMTYPEID, i.ISFOLDER, i.FOLDERID FROM ITEM i LEFT OUTER JOIN METADATA_0101 md ON (md.ID = i.ID) WHERE i.ID IN (SELECT ii.ID FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.TITLE LIKE 'F%') AND ii.ITEMTYPEID = 101)) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 50 + +WITH NUMBEREDITEM AS (SELECT ROWNUMBER() OVER () AS RN, i.ID FROM ITEM i ) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 50 + +CREATE VIEW VW_ITEM_NUMBERS AS + SELECT ROWNUMBER() OVER () AS RN, i.ID FROM ITEM i + +CREATE VIEW VW_ITEM AS + SELECT vi.rn, i.* from VW_ITEM_NUMBERS vi, ITEM i WHERE vi.id = i.id + +select * from vw_item + + SELECT * FROM T1 WHERE COL1 > 10 + +SELECT ROWNUMBER() OVER () AS RN, i.ID FROM ITEM i WHERE RN = 4 +SELECT i.ID FROM ITEM i + +SELECT ROWNUMBER() OVER (ORDER BY i."NAME" ASC) AS RN, i.ID, i.NAME, i.DESCRIPTION, i.CREATED, i.HOUSEID, i.ITEMTYPEID, i.ISFOLDER, i.FOLDERID FROM ITEM i LEFT OUTER JOIN METADATA_0101 md ON (md.ID = i.ID) WHERE i.ID IN (SELECT ii.ID FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.NAME LIKE '%10090%') AND ii.ITEMTYPEID = 101) + +select * from storeuri +update storeuri set isstream = 'Y' where id = 81 + +select * from masterid +select * from item +select * from metadata_0279 + +delete from item +select * from scene +SELECT ID, NAME, MODIFIED, CREATED FROM SCENE WHERE (UPPER(NAME) LIKE UPPER('Ava%')) + +select distinct(mediaid) from shot + +SELECT ID, NAME, DESCRIPTION, FOLDERID, ISFOLDER FROM ITEM WHERE ISFOLDER = 'Y' ORDER BY FOLDERID DESC +select * from item where name like 'Bayw%' +select * from item where id =1615911 + +select * from item i +left outer join metadata_0101 m on (m.id = i.id) +where i.id = 1165861 + +select * from storeuri +update storeuri set uri='http://localhost/lowres/' where id = 81 +update storeuri set uri='file://localhost/c$/_movie/lowres/' where id = 82 + +select * from item where id = 1615771 + + +update item set folderid=null where id=1165861 +delete from item where isfolder='Y' + + +WITH NUMBEREDITEM AS (SELECT ROWNUMBER() OVER (ORDER BY i."NAME" ASC) +AS RN, i.ID, i.NAME, i.DESCRIPTION, i.CREATED, i.HOUSEID, i.ITEMTYPEID, i.ISFOLDER, i.FOLDERID FROM ITEM i LEFT OUTER JOIN METADATA_0101 md ON +(md.ID = i.ID) WHERE i.ID IN (SELECT ii.ID FROM ITEM ii +LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.ID = '1165861') AND ii.ITEMTYPEID = 101)) +SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 100 + +SELECT f.ID, f.NAME, f.FOLDERID FROM ITEM f WHERE f.ISFOLDER='Y' +UPDATE ITEM SET NAME='Mappa 1' WHERE ID = 1615844 +UPDATE ITEM SET NAME='Mappa 2' WHERE ID = 1615845 +UPDATE ITEM SET NAME='Mappa 3' WHERE ID = 1615846 +UPDATE ITEM SET NAME='Mappa 4' WHERE ID = 1615847 +UPDATE ITEM SET NAME='Mappa 5' WHERE ID = 1615848 +UPDATE ITEM SET NAME='Mappa 6' WHERE ID = 1615849 +UPDATE ITEM SET NAME='Mappa 7' WHERE ID = 1615850 +UPDATE ITEM SET NAME='Stargate CSK-1', FOLDERID = 1615851 WHERE ID = 1615852 +UPDATE ITEM SET FOLDERID = 1615852 WHERE ID = 1165861 +UPDATE ITEM SET FOLDERID = 1615853 WHERE ID = 1165864 + +UPDATE ITEM SET FOLDERID = 1615853 WHERE ID =1614791 + + + + +SELECT f.ID, f.NAME, f.FOLDERID FROM ITEM f WHERE f.FOLDERID > 0 +SELECT * FROM ITEM WHERE ID > 1614781 + +SELECT f.ID, f.NAME, f.FOLDERID FROM ITEM f WHERE f.ISFOLDER='Y' AND f.ID IN +(SELECT ii.FOLDERID FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.ID > '1614781') AND ii.ITEMTYPEID = 101) +ORDER BY f.FOLDERID + +WITH NUMBEREDITEM AS ( +SELECT ROWNUMBER() OVER (ORDER BY i."NAME" ASC) AS RN, i.ID, i.NAME, i.DESCRIPTION, i.CREATED, i.HOUSEID, i.ITEMTYPEID, i.ISFOLDER, i.FOLDERID +FROM ITEM i LEFT OUTER JOIN METADATA_0101 md ON (md.ID = i.ID) +WHERE i.ID IN( SELECT ii.ID FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.NAME LIKE 'Soroz%') AND ii.ITEMTYPEID = 101) +) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 100 + +SELECT f.ID, f.NAME, f.FOLDERID FROM ITEM f WHERE f.ISFOLDER='Y' AND f.ID IN( +SELECT ii.ID FROM ITEM ii LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.NAME LIKE 'Soroz%') AND ii.ITEMTYPEID = 101 +) + +SELECT ii.ITEMTYPEID, CAST(COUNT(DISTINCT(ii.ID)) AS BIGINT) FROM ITEM ii +LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) WHERE (ii.NAME LIKE 'Soroz%') +GROUP BY ii.ITEMTYPEID + +select * from item where name like 'Sorozat%' +1615851 + +select * from item where id=1165861 +select * from media where itemid=1165861 +select * from shot where mediaid=1165863 + + +select * from media where id=1165863 +select * from MEDIAFILE where mediaid=1165687 +select * from MEDIAFILE where mediaid=1165688 + +insert into masterid (created) values ('2100-01-03 ') +select * from masterid where created = '2100-01-03' + + +insert into media (id, itemid, itemtypeid, name, description, length) values (1615821, 1165826, 103, 'MPG1 média', 'MPG1 média test', 0) + +select * from mediafile where mediaid = 1165827 +delete from mediafile where id =1938921 + +insert into mediafile (mediaid, storeid, filetypeid, relativepath) values (1615821, 81, 81, 'stadion.mpg') + +update ITEM set created='2010-08-02' where id=1165821 + +update ITEM set created='2010-07-20' where id > 1165821 and id < 1166000 + +select count(*) from media where id > 1165821 and id < 1166000 +update media set created='2010-07-20' where id > 1165821 and id < 1166000 + + +select * from storeuri +select * from log where created BETWEEN '2010-06-23' AND '2010-06-24' +select * from log where created BETWEEN '2010-06-24' AND '2010-06-25' + +update log set created = '2010-06-24 10:00:00' where id = 44 + +select * from ITEMTYPE +select * from metadata + +WITH NUMBEREDITEM AS ( +SELECT ROWNUMBER() OVER(ORDER BY i."NAME" ASC) AS RN,i.ID, i.NAME, i.DESCRIPTION, i.CREATED, i.HOUSEID, +FROM METADATA_0001 md INNER JOIN ITEM i ON (md.ID = i.ID) WHERE md.ID IN(SELECT ID FROM SESSION.SEARCHTEMP WHERE ITEMTYPEID = 1)) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 100 + +SELECT DISTINCT i.ID, i.ITEMTYPEID FROM ITEM i LEFT OUTER JOIN MEDIA m ON (m.ITEMID = I.ID) +LEFT OUTER JOIN METADATA_0003 i_0003 ON (i_0003.ID = i.ID) +LEFT OUTER JOIN METADATA_0003 m_0003 ON (m_0003.ID = i.ID) +LEFT OUTER JOIN METADATA_0004 i_0004 ON (i_0004.ID = i.ID) +LEFT OUTER JOIN METADATA_0004 m_0004 ON (m_0004.ID = i.ID) +LEFT OUTER JOIN METADATA_0001 i_0001 ON (i_0001.ID = i.ID) +LEFT OUTER JOIN METADATA_0001 m_0001 ON (m_0001.ID = i.ID) +LEFT OUTER JOIN METADATA_0002 i_0002 ON (i_0002.ID = i.ID) +LEFT OUTER JOIN METADATA_0002 m_0002 ON (m_0002.ID = i.ID) WHERE (i.ID > '0') + +TRUNCATE TABLE Metadatatype DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE + +select * from mediafile where mediaid = 3163 +select * from store + +WITH NUMBEREDITEM AS ( +SELECT ROWNUMBER() OVER(ORDER BY md."Gyártó ország" ASC) AS RN, +i.ID, i.NAME, i.DESCRIPTION, i.CREATED, i.HOUSEID, md."Kameraállás",md."Csatorna" FROM METADATA_0323 md INNER JOIN ITEM i ON (md.ID = i.ID) WHERE md.ID IN(SELECT ID FROM SESSION.SEARCHTEMP WHERE ITEMTYPEID = 323)) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 0 AND 10 + + +WITH NUMBEREDITEM AS +(SELECT ROWNUMBER() OVER(ORDER BY md."Fõszereplõ" DESC) AS RN, i.ID, i.NAME, i.DESCRIPTION, i.CREATED, i.HOUSEID, md."Fõszereplõ" FROM METADATA_0321 md INNER JOIN ITEM i ON (md.ID = i.ID) ) +SELECT * FROM NUMBEREDITEM + +, +select * from METADATA_0321 + +SELECT * FROM SESSION.SEARCHRESULTS +SELECT ID, ROWNUMBER() OVER(ORDER BY ID) AS ROWNUM FROM METADATATYPE WHERE ROWNUM BETWEEN 0 AND 3 + +WITH MDTPART AS +(SELECT ID, ROWNUMBER() OVER(ORDER BY ID) AS RN FROM METADATATYPE) +SELECT * FROM MDTPART +WHERE RN BETWEEN 0 AND 3 + + +SELECT ROWNUMBER() OVER() AS ROWNUM FROM METADATATYPE + +SELECT DISTINCT i.ID, i.ITEMTYPEID FROM ITEM i +SELECT DISTINCT i.ID, i.ITEMTYPEID FROM ITEM i LEFT OUTER JOIN MEDIA m ON (m.ITEMID = I.ID) LEFT OUTER JOIN METADATA_0323 i_0323 ON (i_0323.ID = i.ID) LEFT OUTER JOIN METADATA_0323 m_0323 ON (m_0323.ID = i.ID) LEFT OUTER JOIN METADATA_0324 i_0324 ON (i_032... + +declare global temporary table temp1(ID BIGINT, ITEMTYPEID BIGINT)on commit preserve rows not logged + + +select * from temp1 + +select DISTINCT i.id, i.itemtypeid from item i +left outer join media m on (m.itemid = i.id) +left outer join METADATA_0321 i_0321 on (i_0321.id = i.id) +left outer join METADATA_0322 i_0322 on (i_0322.id = i.id) +left outer join METADATA_0323 i_0323 on (i_0323.id = i.id) +left outer join METADATA_0324 i_0324 on (i_0324.id = i.id) +left outer join METADATA_0321 m_0321 on (m_0321.id = m.id) +left outer join METADATA_0322 m_0322 on (m_0322.id = m.id) +left outer join METADATA_0323 m_0323 on (m_0323.id = m.id) +left outer join METADATA_0324 m_0324 on (m_0324.id = m.id) +where i_0321."Fõszereplõ" is not null + + + +with temp1 as (select i.id, i.itemtypeid from item i) + + + +select * from METADATA_0321 where "Fõszereplõ" is not null + + + +SELECT i.ID, i.NAME, i.DESCRIPTION, i.CREATED, i.HOUSEID, md.* FROM METADATA_0323 md +INNER JOIN ITEM i ON (md.ID = i.ID) + WHERE (i.NAME LIKE '%test%') + +INNER JOIN MEDIA m ON (m.ITEMID = i.ID) + + +select * from sysibmadm.dbcfg +DROP PROCEDURE VASARY.GETITEMDETAILS +CREATE PROCEDURE VASARY.GETITEMDETAILS +(IN itemID BIGINT) +LANGUAGE SQL +DYNAMIC RESULT SETS 1 +BEGIN + DECLARE cur CURSOR WITH RETURN FOR + SELECT * FROM MEDIA WHERE ITEMID = itemID; + OPEN cur; +END +call GETITEMDETAILS ('721') +DECLARE v_sql varchar(200); +set v_sql ='SELECT COUNT(*) FROM DB2ADMIN.' || v_table_name; +prepare v_stmt from v_sql; +call GETITEMS + +SELECT FIELD1, FIELD2, FIELD3 +FROM MYTABLE +WHERE AGENTNBR = prmAgencyId +AND USERNAME = prmUsername; +DECLARE EXIT HANDLER FOR SQLEXCEPTION +SET retCode = -10; +DECLARE EXIT HANDLER FOR NOT FOUND +SET retCode = -1; + +CREATE PROCEDURE ITEMS() +P1: BEGIN + select count(*) from METADATA_0184; +END P1 + + +select distinct(itemtypeid) from item + +select count(*) from METADATA_0184 md inner join item it on (md.id = it.id) +select count(*) from METADATA_0185 md inner join item it on (md.id = it.id) +select count(*) from METADATA_0186 md inner join item it on (md.id = it.id and it.itemtypeid=186) + + +SELECT ENCODING_SCHEME + FROM SYSIBM.SYSTABLES + WHERE NAME = 'metadatatype' +UPDATE METADATAELEMENT SET NAME = 'aaaa', DESCRIPTION = 'sdsds', METADATATYPEID = '' WHERE ID = ? +select * from metadatatype +select * from metadataelement +select * from metadata where itemtypeid=310 +select * from metadata_0331 +select * from metadata_0322 +select * from metadata_0348 +select * from itemtype +select * from item +select * from media +select * from store +select * from storeuri +select count(*) from mediafile + +select count(*) from item +SELECT TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'VASARY' AND TABNAME LIKE 'METADATA\_%' ESCAPE '\' + +SELECT it.ID, it.NAME FROM ITEMTYPE it +LEFT OUTER JOIN METADATA md ON (it.ID = md.ITEMTYPEID) +LEFT OUTER JOIN METADATAELEMENT mde ON (md.METADATAELEMENTID = mde.ID) +LEFT OUTER JOIN METADATATYPE mdt ON (mde.METADATATYPEID = mdt.ID) +WHERE mde.NAME = 'Fõszereplõ' + +SELECT DISTINCT i.ID FROM ITEM i LEFT OUTER JOIN MEDIA m ON (m.ITEMID = i.ID) WHERE + +SELECT it.ID, it.NAME FROM ITEMTYPE it +LEFT OUTER JOIN METADATA md ON (it.ID = md.ITEMTYPEID) + +CREATE DISTINCT TYPE DATETIME AS TIMESTAMP WITH COMPARISONS +DROP TYPE DATETIME diff --git a/server/user.jobengine.osgi.db/database/reference.sql b/server/user.jobengine.osgi.db/database/reference.sql new file mode 100644 index 00000000..3617c778 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/reference.sql @@ -0,0 +1,45 @@ +ALTER TABLE DOMAININDEX ADD CONSTRAINT FK_DOMAININDEX_RECORDID FOREIGN KEY (ID) REFERENCES MASTERID (ID) +ALTER TABLE DOMAININDEX ADD CONSTRAINT FK_DOMAININDEX_METADATAID FOREIGN KEY (METADATAID) REFERENCES METADATA (ID) +ALTER TABLE DOMAININDEX ADD CONSTRAINT FK_DOMAININDEX_DOMAINID FOREIGN KEY (DOMAINID) REFERENCES DOMAIN (ID) +ALTER TABLE DOMAIN ADD CONSTRAINT FK_DOMAIN_DOMAINCATEGORYID FOREIGN KEY (DOMAINCATEGORYID) REFERENCES DOMAINCATEGORY (ID) +ALTER TABLE METADATAELEMENT ADD CONSTRAINT FK_METADATAELEMENT_METADATATYPEID FOREIGN KEY (METADATATYPEID) REFERENCES METADATATYPE (ID) +ALTER TABLE METADATA ADD CONSTRAINT FK_METADATA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) +ALTER TABLE METADATA ADD CONSTRAINT FK_METADATA_METADATAELEMENTID FOREIGN KEY (METADATAELEMENTID) REFERENCES METADATAELEMENT (ID) +ALTER TABLE ITEM ADD CONSTRAINT FK_ITEM_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID) +ALTER TABLE ITEM ADD CONSTRAINT FK_ITEM_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) +ALTER TABLE FOLDER ADD CONSTRAINT FK_FOLDER_PARENTID FOREIGN KEY (PARENTID) REFERENCES ITEM (ID) +ALTER TABLE FOLDER ADD CONSTRAINT FK_FOLDER_CHILDID FOREIGN KEY (CHILDID) REFERENCES ITEM (ID) +ALTER TABLE MEDIA ADD CONSTRAINT FK_MEDIA_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID) +ALTER TABLE MEDIA ADD CONSTRAINT FK_MEDIA_ITEMID FOREIGN KEY (ITEMID) REFERENCES ITEM (ID) +ALTER TABLE MEDIA ADD CONSTRAINT FK_MEDIA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) +ALTER TABLE MEDIAFILE ADD CONSTRAINT FK_MEDIAFILE_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +ALTER TABLE MEDIAFILE ADD CONSTRAINT FK_MEDIAFILE_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID) +ALTER TABLE MEDIAFILE ADD CONSTRAINT FK_MEDIAFILE_FILETYPEID FOREIGN KEY (FILETYPEID) REFERENCES FILETYPE (ID) +ALTER TABLE STOREURI ADD CONSTRAINT FK_STOREURI_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID) +ALTER TABLE SHOT ADD CONSTRAINT FK_SHOT_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +ALTER TABLE BREAK ADD CONSTRAINT FK_BREAK_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +ALTER TABLE SCENECONTENT ADD CONSTRAINT FK_SCENECONTENT_SCENEID FOREIGN KEY (SCENEID) REFERENCES SCENE (ID) +ALTER TABLE SCENECONTENT ADD CONSTRAINT FK_SCENECONTENT_SHOTID FOREIGN KEY (SHOTID) REFERENCES SHOT (ID) + +ALTER TABLE DOMAININDEX DROP CONSTRAINT FK_DOMAININDEX_ID +ALTER TABLE DOMAININDEX DROP CONSTRAINT FK_DOMAININDEX_METADATAID +ALTER TABLE DOMAININDEX DROP CONSTRAINT FK_DOMAININDEX_DOMAINID +ALTER TABLE DOMAIN DROP CONSTRAINT FK_DOMAIN_DOMAINCATEGORYID +ALTER TABLE METADATAELEMENT DROP CONSTRAINT FK_METADATAELEMENT_METADATATYPEID +ALTER TABLE METADATA DROP CONSTRAINT FK_METADATA_ITEMTYPEID +ALTER TABLE METADATA DROP CONSTRAINT FK_METADATA_METADATAELEMENTID +ALTER TABLE ITEM DROP CONSTRAINT FK_ITEM_ID +ALTER TABLE ITEM DROP CONSTRAINT FK_ITEM_ITEMTYPEID +ALTER TABLE FOLDER DROP CONSTRAINT FK_FOLDER_PARENTID +ALTER TABLE FOLDER DROP CONSTRAINT FK_FOLDER_CHILDID +ALTER TABLE MEDIA DROP CONSTRAINT FK_MEDIA_ID +ALTER TABLE MEDIA DROP CONSTRAINT FK_MEDIA_ITEMID +ALTER TABLE MEDIA DROP CONSTRAINT FK_MEDIA_ITEMTYPEID +ALTER TABLE MEDIAFILE DROP CONSTRAINT FK_MEDIAFILE_MEDIAID +ALTER TABLE MEDIAFILE DROP CONSTRAINT FK_MEDIAFILE_STOREID +ALTER TABLE MEDIAFILE DROP CONSTRAINT FK_MEDIAFILE_FILETYPEID +ALTER TABLE STOREURI DROP CONSTRAINT FK_STOREURI_STOREID +ALTER TABLE SHOT DROP CONSTRAINT FK_SHOT_MEDIAID +ALTER TABLE BREAK DROP CONSTRAINT FK_BREAK_MEDIAID +ALTER TABLE SCENECONTENT DROP CONSTRAINT FK_SCENECONTENT_SCENEID +ALTER TABLE SCENECONTENT DROP CONSTRAINT FK_SCENECONTENT_SHOTID \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/database/structure.sql b/server/user.jobengine.osgi.db/database/structure.sql new file mode 100644 index 00000000..7e08eae8 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/structure.sql @@ -0,0 +1,348 @@ +ALTER TABLE JOB ADD COLUMN PARENTJOBID BIGINT + +/*ezt futtasd*/ +ALTER TABLE METADATA DROP COLUMN TABLENAME +ALTER TABLE METADATA ADD COLUMN STATICTABLE VARCHAR (20) NULL +ALTER TABLE METADATA ADD COLUMN PARAMETER VARCHAR (20) NULL +/**/ + +DROP TABLE T20110527_134225 +CREATE INDEX IDX_METADATA_0383_C529 ON METADATA_0383 ("C529") +select * from METADATA_0382 + +ALTER TABLE METADATA_0382 ADD COLUMN C000 BIGINT +ALTER TABLE METADATA_0382 DROP COLUMN C000 +ALTER TABLE METADATA_0382 ADD COLUMN C000 BIGINT NOT NULL DEFAULT 0 + +ALTER TABLE METADATA_0382 ALTER COLUMN SET C000 BIGINT + + +call SYSPROC.ADMIN_CMD ('REORG TABLE QUERYOBJECT') + +SELECT TABNAME, STATUS, ACCESS_MODE, + SUBSTR( CONST_CHECKED, 1, 1 ) AS FK_CHECKED, + SUBSTR( CONST_CHECKED, 2, 1 ) AS CC_CHECKED + FROM SYSCAT.TABLES + + +REFRESH TABLE VASARY.METADATA_0381 +SET INTEGRITY FOR METADATA_0381 IMMEDIATE CHECKED +FORCE GENERATED + +ALTER TABLE METADATA_0261 ADD COLUMN "C432" VARCHAR (100) NOT NULL + +ALTER TABLE METADATA_0241 ADD COLUMN c1 BIGINT NOT NULL DEFAULT 0 +ALTER TABLE METADATA_0241 ALTER COLUMN c1 SET NULL + +REORG TABLE ITEMTYPE; +call SYSPROC.ADMIN_CMD ('REORG TABLE ITEM') +call SYSPROC.ADMIN_CMD ('REORG TABLE "BALAZS DOMBOVARI".ITEMTYPE') +call SYSPROC.ADMIN_CMD ('REORG TABLE "BALAZS DOMBOVARI".METADATA') + +SELECT TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'VASARY' AND TABNAME LIKE 'METADATA\_%' ESCAPE '\' + +DROP TABLE MEDIAFILE +DROP TABLE SCENECONTENT +DROP TABLE SHOT +DROP TABLE MEDIA +DROP TABLE ITEM +DROP TABLE MASTERID +DROP TABLE METADATA +DROP TABLE ITEMTYPE +DROP TABLE METADATAELEMENT +DROP TABLE METADATATYPE +DROP TABLE SCENE +DROP TABLE STOREURI +DROP TABLE FILETYPE +DROP TABLE STORE +DROP TABLE BREAK + +CREATE TABLE DOMAINCATEGORY +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL +) + +CREATE INDEX UDX_DOMAINCATEGORY_NAME ON DOMAINCATEGORY ("NAME") + + +CREATE TABLE DOMAIN +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + DOMAINCATEGORYID BIGINT NOT NULL, + DISPLAY VARCHAR(200) NOT NULL, + VALUE BLOB +) + +CREATE INDEX UDX_DOMAIN_DOMAINCATEGORYID_DISPLAY ON DOMAIN ("DOMAINCATEGORYID","DISPLAY") +CREATE INDEX UDX_DOMAIN_DOMAINCATEGORYID_VALUE ON DOMAIN ("DOMAINCATEGORYID","VALUE") + +CREATE TABLE DOMAININDEX +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + RECORDID BIGINT NOT NULL, + METADATAID BIGINT NOT NULL, + DOMAINID BIGINT NOT NULL +) + + +CREATE TABLE MASTERID +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +) + +CREATE TABLE METADATATYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DATATYPE VARCHAR(10) NOT NULL, + LENGTH INTEGER NOT NULL, + CONSTRAINT UIX_METADATATYPE_NAME UNIQUE (NAME) +) + +ALTER TABLE METADATATYPE ADD COLUMN BASETYPE VARCHAR(10) NOT NULL DEFAULT '' +ALTER TABLE METADATATYPE ADD COLUMN JAVATYPE VARCHAR(255) NOT NULL DEFAULT '' + + +CREATE TABLE METADATAELEMENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + METADATATYPEID BIGINT NOT NULL, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255), + CONSTRAINT UIX_METADATAELEMENT_NAME UNIQUE (NAME) +) + + +CREATE TABLE ITEMTYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255) NOT NULL, + CONSTRAINT UIX_ITEMTYPE_NAME UNIQUE (NAME) +) + +ALTER TABLE ITEMTYPE ADD COLUMN ISSTATIC CHARACTER (1) NULL +ALTER TABLE ITEMTYPE ADD CONSTRAINT CHK_ITEMTYPE_ISSTATIC CHECK (ISSTATIC in ('Y', 'N')) + + +select * from metadata +select * from metadataelement +select * from metadatatype + +CREATE TABLE METADATA +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + METADATAELEMENTID BIGINT NOT NULL, + ISDBINDEX CHARACTER (1) NOT NULL, + ISDBUNIQUE CHARACTER (1) NOT NULL, + ISDBNULLABLE CHARACTER (1) NOT NULL, + ISEDITABLE CHARACTER (1) NOT NULL, + GUITYPE VARCHAR(20) NOT NULL, + CONSTRAINT CHK_METADATA_ISDBINDEX CHECK (ISDBINDEX in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBUNIQUE CHECK (ISDBUNIQUE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBNULLABLE CHECK (ISDBNULLABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISEDITABLE CHECK (ISEDITABLE in ('Y', 'N')) +) + +ALTER TABLE METADATA DROP COLUMN TABLENAME +ALTER TABLE METADATA ADD COLUMN STATICTABLE VARCHAR (20) NULL +ALTER TABLE METADATA ADD COLUMN POJOFIELD VARCHAR (20) NULL +ALTER TABLE METADATA ADD COLUMN SQLFIELD VARCHAR (20) NULL +ALTER TABLE METADATA ADD COLUMN LISTTYPE VARCHAR (20) NULL DEFAULT 'LABEL' +ALTER TABLE METADATA ADD COLUMN ISLISTABLE CHARACTER (1) NOT NULL DEFAULT 'Y' +ALTER TABLE METADATA ADD CONSTRAINT CHK_METADATA_ISLISTABLE CHECK (ISLISTABLE in ('Y', 'N')) +ALTER TABLE METADATA ADD COLUMN PARAMETER VARCHAR (20) NULL + + +CREATE TABLE ITEM +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + TITLE VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, +) + +ALTER TABLE ITEM ALTER COLUMN CREATED DROP NOT NULL + +ALTER TABLE ITEM ADD COLUMN MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP +ALTER TABLE ITEM ADD COLUMN ISFOLDER CHARACTER (1) NOT NULL DEFAULT 'N' +ALTER TABLE ITEM ADD COLUMN ISFOLDER CHARACTER (1) NOT NULL DEFAULT 'N' +ALTER TABLE ITEM ADD CONSTRAINT CHK_ITEM_ISFOLDER CHECK (ISFOLDER in ('Y', 'N')) + +CREATE INDEX IDX_ITEM_ISFOLDER ON ITEM ("ISFOLDER") + +CREATE INDEX IDX_ITEM_TITLE ON ITEM ("TITLE") +CREATE INDEX IDX_ITEM_DESCRIPTION ON ITEM ("DESCRIPTION") +CREATE INDEX IDX_ITEM_HOUSEID ON ITEM ("HOUSEID") +CREATE INDEX IDX_ITEM_CREATED ON ITEM ("CREATED") + + +CREATE TABLE FOLDER +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + PARENTID BIGINT NOT NULL, + CHILDID BIGINT NOT NULL +) + +CREATE UNIQUE INDEX UDX_FOLDER_NODUPLICATE ON FOLDER ("PARENTID", "CHILDID") +ALTER TABLE FOLDER ADD CONSTRAINT CHK_FOLDER_SELFCHILD CHECK (PARENTID != CHILDID) + + +CREATE TABLE REMOTESTORE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + URI VARCHAR(1000) NOT NULL, + USERNAME VARCHAR(20), + PASSWORD VARCHAR(20), + ROOTPATH VARCHAR(255)NOT NULL +) + +update STOREURI set ROOTPATH = 'smb://localhost/' where ID = 1 + +CREATE TABLE QUERYOBJECT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + DATA BLOB +) + +ALTER TABLE QUERYOBJECT DROP COLUMN MODIFIED +ALTER TABLE QUERYOBJECT ADD COLUMN MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP + + +DROP TABLE QUERYOBJECT + +CREATE TABLE MEDIA +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMID BIGINT NOT NULL, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + TITLE VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + LENGTH BIGINT NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + ARCHIVED TIMESTAMP +) + +ALTER TABLE MEDIA ADD COLUMN MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP + +CREATE INDEX IDX_MEDIA_TITLE ON MEDIA ("TITLE") +CREATE INDEX IDX_MEDIA_ITEMID ON MEDIA ("ITEMID") +CREATE INDEX IDX_MEDIA_DESCRIPTION ON MEDIA ("DESCRIPTION") +CREATE INDEX IDX_MEDIA_HOUSEID ON MEDIA ("HOUSEID") +CREATE INDEX IDX_MEDIA_CREATED ON MEDIA ("CREATED") +CREATE INDEX IDX_MEDIA_ARCHIVED ON MEDIA ("ARCHIVED") +CREATE INDEX IDX_MEDIA_LENGTH ON MEDIA ("LENGTH") + +CREATE TABLE STORE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL +) + +CREATE TABLE FILETYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + VIDEOCODEC VARCHAR(10) NOT NULL, + AUDIOCODEC VARCHAR(10) NOT NULL, + VIDEOTRACKS INT NOT NULL, + AUDIOTRACKS INT NOT NULL, + FRAMERATE FLOAT NOT NULL +) + +CREATE TABLE MEDIAFILE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + STOREID BIGINT NOT NULL, + FILETYPEID BIGINT NOT NULL, + RELATIVEPATH VARCHAR(255) NOT NULL, + FILESTRUCTINFO VARCHAR(255) +) + +CREATE TABLE STOREURI +( + ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, + STOREID BIGINT NOT NULL, + URI VARCHAR(255) NOT NULL +) + +ALTER TABLE STOREURI ADD COLUMN ISSTREAM CHARACTER (1) NOT NULL DEFAULT 'N' +ALTER TABLE STOREURI ADD CONSTRAINT CHK_STOREURI_ISSTREAM CHECK (ISSTREAM in ('Y', 'N')) +update STOREURI set ISSOURCE = 'Y' +select * from storeuri +CREATE TABLE SHOT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB NOT NULL, + INPOINT BIGINT NOT NULL, + OUTPOINT BIGINT NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +) + +CREATE INDEX IDX_SHOT_DESCRIPTION ON SHOT ("DESCRIPTION") + +CREATE TABLE BREAK +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB NOT NULL, + INPOINT BIGINT NOT NULL, + BREAKTYPE VARCHAR(10) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +) + +CREATE TABLE SCENE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL +) + +ALTER TABLE SCENE DROP COLUMN MODIFIED +ALTER TABLE SCENE ADD COLUMN MODIFIED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL + +CREATE TABLE SCENECONTENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + SCENEID BIGINT NOT NULL, + SHOTID BIGINT NOT NULL, + POSITION BIGINT NOT NULL +) + + +CREATE TABLE JOB +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + FILENAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + SENT TIMESTAMP NOT NULL, + ACCEPTED TIMESTAMP, + FINISHED TIMESTAMP, + USERNAME VARCHAR(80) +) + +CREATE TABLE LOG +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + JOBID BIGINT NOT NULL, + ITEMID BIGINT NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MESSAGE VARCHAR(255) NOT NULL, + LEVEL VARCHAR(10) NOT NULL +) diff --git a/server/user.jobengine.osgi.db/database/structure1.sql b/server/user.jobengine.osgi.db/database/structure1.sql new file mode 100644 index 00000000..8192ec84 --- /dev/null +++ b/server/user.jobengine.osgi.db/database/structure1.sql @@ -0,0 +1,270 @@ +SELECT TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'VASARY' AND TABNAME LIKE 'METADATA\_%' ESCAPE '\' + +DROP TABLE MEDIAFILE +DROP TABLE SCENECONTENT +DROP TABLE SHOT +DROP TABLE MEDIA +DROP TABLE ITEM +DROP TABLE MASTERID +DROP TABLE METADATA +DROP TABLE ITEMTYPE +DROP TABLE METADATAELEMENT +DROP TABLE METADATATYPE +DROP TABLE SCENE +DROP TABLE STOREURI +DROP TABLE FILETYPE +DROP TABLE STORE +DROP TABLE BREAK + +CREATE TABLE MASTERID +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +) + +CREATE TABLE METADATATYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DATATYPE VARCHAR(10) NOT NULL, + LENGTH INTEGER NOT NULL, + CONSTRAINT UIX_METADATATYPE_NAME UNIQUE (NAME) +) + +CREATE TABLE METADATAELEMENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + METADATATYPEID BIGINT NOT NULL, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255), + CONSTRAINT UIX_METADATAELEMENT_NAME UNIQUE (NAME) +) + +CREATE TABLE ITEMTYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255) NOT NULL, + CONSTRAINT UIX_ITEMTYPE_NAME UNIQUE (NAME) +) + +CREATE TABLE METADATA +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + METADATAELEMENTID BIGINT NOT NULL, + ISDBINDEX CHARACTER (1) NOT NULL, + ISDBUNIQUE CHARACTER (1) NOT NULL, + ISDBNULLABLE CHARACTER (1) NOT NULL, + ISEDITABLE CHARACTER (1) NOT NULL, + GUITYPE VARCHAR(20) NOT NULL, + CONSTRAINT CHK_METADATA_ISDBINDEX CHECK (ISDBINDEX in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBUNIQUE CHECK (ISDBUNIQUE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBNULLABLE CHECK (ISDBNULLABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISEDITABLE CHECK (ISEDITABLE in ('Y', 'N')) +) + +CREATE TABLE ITEM +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + NAME VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + FOLDERID BIGINT NULL, + ISFOLDER CHARACTER (1) NOT NULL DEFAULT 'N', + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT CHK_ITEM_ISFOLDER CHECK (ISFOLDER in ('Y', 'N')) +) + +CREATE INDEX IDX_ITEM_NAME ON ITEM ("NAME") +CREATE INDEX IDX_ITEM_DESCRIPTION ON ITEM ("DESCRIPTION") +CREATE INDEX IDX_ITEM_HOUSEID ON ITEM ("HOUSEID") +CREATE INDEX IDX_ITEM_CREATED ON ITEM ("CREATED") + +CREATE TABLE MEDIA +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMID BIGINT NOT NULL, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + LENGTH BIGINT NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + ARCHIVED TIMESTAMP +) + +CREATE INDEX IDX_MEDIA_NAME ON MEDIA ("NAME") +CREATE INDEX IDX_MEDIA_ITEMID ON MEDIA ("ITEMID") +CREATE INDEX IDX_MEDIA_DESCRIPTION ON MEDIA ("DESCRIPTION") +CREATE INDEX IDX_MEDIA_HOUSEID ON MEDIA ("HOUSEID") +CREATE INDEX IDX_MEDIA_CREATED ON MEDIA ("CREATED") +CREATE INDEX IDX_MEDIA_ARCHIVED ON MEDIA ("ARCHIVED") + +CREATE TABLE STORE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL +) + +CREATE TABLE FILETYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + VIDEOCODEC VARCHAR(10) NOT NULL, + AUDIOCODEC VARCHAR(10) NOT NULL, + VIDEOTRACKS INT NOT NULL, + AUDIOTRACKS INT NOT NULL, + FRAMERATE FLOAT NOT NULL +) + +CREATE TABLE MEDIAFILE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + STOREID BIGINT NOT NULL, + FILETYPEID BIGINT NOT NULL, + RELATIVEPATH VARCHAR(255) NOT NULL, + FILESTRUCTINFO VARCHAR(255) +) + +CREATE TABLE STOREURI +( + ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, + STOREID BIGINT NOT NULL, + URI VARCHAR(255) NOT NULL +) + +CREATE TABLE SHOT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB NOT NULL, + INPOINT BIGINT NOT NULL, + OUTPOINT BIGINT NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +) + +CREATE INDEX IDX_SHOT_DESCRIPTION ON SHOT ("DESCRIPTION") + +CREATE TABLE BREAK +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB NOT NULL, + INPOINT BIGINT NOT NULL, + BREAKTYPE VARCHAR(10) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +) + +CREATE TABLE SCENE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +) + +CREATE TABLE SCENECONTENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + SCENEID BIGINT NOT NULL, + SHOTID BIGINT NOT NULL, + POSITION BIGINT NOT NULL +) + +CREATE TABLE JOB +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + FILENAME VARCHAR(255) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + SENT TIMESTAMP NOT NULL, + ACCEPTED TIMESTAMP, + FINISHED TIMESTAMP, + USERNAME VARCHAR(80) +) + +CREATE TABLE LOG +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + JOBID BIGINT NOT NULL, + ITEMID BIGINT NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MESSAGE VARCHAR(255) NOT NULL, + LEVEL VARCHAR(10) NOT NULL +) + +ALTER TABLE METADATAELEMENT ADD CONSTRAINT FK_METADATAELEMENT_METADATATYPEID FOREIGN KEY (METADATATYPEID) REFERENCES METADATATYPE (ID); +ALTER TABLE METADATA ADD CONSTRAINT FK_METADATA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID); +ALTER TABLE METADATA ADD CONSTRAINT FK_METADATA_METADATAELEMENTID FOREIGN KEY (METADATAELEMENTID) REFERENCES METADATAELEMENT (ID); +ALTER TABLE ITEM ADD CONSTRAINT FK_ITEM_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID); +ALTER TABLE ITEM ADD CONSTRAINT FK_ITEM_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID); +ALTER TABLE ITEM ADD CONSTRAINT FK_ITEM_FOLDERID FOREIGN KEY (FOLDERID) REFERENCES ITEM (ID); +ALTER TABLE MEDIA ADD CONSTRAINT FK_MEDIA_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID); +ALTER TABLE MEDIA ADD CONSTRAINT FK_MEDIA_ITEMID FOREIGN KEY (ITEMID) REFERENCES ITEM (ID); +ALTER TABLE MEDIA ADD CONSTRAINT FK_MEDIA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID); +ALTER TABLE MEDIAFILE ADD CONSTRAINT FK_MEDIAFILE_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID); +ALTER TABLE MEDIAFILE ADD CONSTRAINT FK_MEDIAFILE_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID); +ALTER TABLE MEDIAFILE ADD CONSTRAINT FK_MEDIAFILE_FILETYPEID FOREIGN KEY (FILETYPEID) REFERENCES FILETYPE (ID); +ALTER TABLE STOREURI ADD CONSTRAINT FK_STOREURI_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID); +ALTER TABLE SHOT ADD CONSTRAINT FK_SHOT_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID); +ALTER TABLE BREAK ADD CONSTRAINT FK_BREAK_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID); +ALTER TABLE SCENECONTENT ADD CONSTRAINT FK_SCENECONTENT_SCENEID FOREIGN KEY (SCENEID) REFERENCES SCENE (ID); +ALTER TABLE SCENECONTENT ADD CONSTRAINT FK_SCENECONTENT_SHOTID FOREIGN KEY (SHOTID) REFERENCES SHOT (ID); + + +ALTER TABLE METADATAELEMENT DROP CONSTRAINT FK_METADATAELEMENT_METADATATYPEID +ALTER TABLE METADATA DROP CONSTRAINT FK_METADATA_ITEMTYPEID +ALTER TABLE METADATA DROP CONSTRAINT FK_METADATA_METADATAELEMENTID +ALTER TABLE ITEM DROP CONSTRAINT FK_ITEM_ID +ALTER TABLE ITEM DROP CONSTRAINT FK_ITEM_ITEMTYPEID +ALTER TABLE ITEM DROP CONSTRAINT FK_ITEM_FOLDERID +ALTER TABLE MEDIA DROP CONSTRAINT FK_MEDIA_ID +ALTER TABLE MEDIA DROP CONSTRAINT FK_MEDIA_ITEMID +ALTER TABLE MEDIA DROP CONSTRAINT FK_MEDIA_ITEMTYPEID +ALTER TABLE MEDIAFILE DROP CONSTRAINT FK_MEDIAFILE_MEDIAID +ALTER TABLE MEDIAFILE DROP CONSTRAINT FK_MEDIAFILE_STOREID +ALTER TABLE MEDIAFILE DROP CONSTRAINT FK_MEDIAFILE_FILETYPEID +ALTER TABLE STOREURI DROP CONSTRAINT FK_STOREURI_STOREID +ALTER TABLE SHOT DROP CONSTRAINT FK_SHOT_MEDIAID +ALTER TABLE BREAK DROP CONSTRAINT FK_BREAK_MEDIAID +ALTER TABLE SCENECONTENT DROP CONSTRAINT FK_SCENECONTENT_SCENEID +ALTER TABLE SCENECONTENT DROP CONSTRAINT FK_SCENECONTENT_SHOTID + +call SET_CONSTRAINTS('YES') +call SET_CONSTRAINTS('NO') +select * from syscat.tabconst where tabschema='VASARY' and TYPE='F' + +drop procedure SET_CONSTRAINTS + +create procedure SET_CONSTRAINTS (ENFORCE VARCHAR(3)) +LANGUAGE SQL +BEGIN +declare v_tabname varchar(128); +declare v_constname varchar(128); +declare v_rows integer; +declare v_alter_table_sql varchar(256); +declare tmp_cursor cursor for SELECT tabname, constname FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA ORDER BY CONSTNAME,TABNAME, REFTABNAME; +select count(*) into v_rows from syscat.references WHERE TABSCHEMA = CURRENT SCHEMA; +open tmp_cursor; +while (v_rows > 0) DO +FETCH tmp_cursor INTO v_tabname, v_constname; +SET v_alter_table_sql = 'alter table ' || '"' || current SCHEMA || '"' || '.' || v_tabname || ' alter foreign key ' || v_constname; +IF (ENFORCE = 'NO') THEN + SET v_alter_table_sql = v_alter_table_sql || ' NOT ENFORCED'; +ELSE + SET v_alter_table_sql = v_alter_table_sql || ' ENFORCED'; +END IF; +execute immediate v_alter_table_sql; +SET v_rows = v_rows - 1; +end while; +close tmp_cursor; +END + +call SET_CONSTRAINTS('YES') + +SELECT TABNAME FROM SYSCAT.TABLES WHERE OWNER = 'VASARY' AND TABNAME LIKE 'METADATA\\_%' ESCAPE '\' +SELECT TABNAME FROM SYSCAT.TABLES WHERE TABNAME LIKE 'METADATA\_%' ESCAPE '\' \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/database/teszt.sql b/server/user.jobengine.osgi.db/database/teszt.sql new file mode 100644 index 00000000..81c5f26d --- /dev/null +++ b/server/user.jobengine.osgi.db/database/teszt.sql @@ -0,0 +1,57 @@ +CONNECT TO MF USER jobengine USING DaGus201@ + +WITH NUMBEREDITEM AS (SELECT ROWNUMBER() OVER (ORDER BY j."TEMPLATE" ASC) AS RN, j.ID, j.NAME, j.OWNER, j.STATUS, j.DESCRIPTION, j.TEMPLATE, j.SUBMITTED, j.FINISHED, j.PROGRESS FROM JOB j WHERE (j) SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN 1 AND 50 + +insert into "JOBENGINE"."JOB" ("NAME", "OWNER", "PRIORITY", "PROGRESS", "STATUS", "DESCRIPTION", "SUBMITTED", "FINISHED", "TEMPLATE") values('tesztjob2', 'dombi', 1, 1, 'FINISHED', 'finished', '2012-07-18 14:53:54', '2012-07-18 14:53:54', '1') + select * from JOB j where (j.OWNER = 'dombi') + select * from JOB j where (j.OWNER LIKE 'dombi') + update JOB set STATUS = 'FINISHED' where OWNER LIKE 'dombi' + + CREATE TABLE JOB +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + OWNER VARCHAR(80), + PRIORITY INT NOT NULL DEFAULT 0, + PROGRESS INT NOT NULL DEFAULT 0, + STATUS VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(200), + SUBMITTED TIMESTAMP NOT NULL, + FINISHED TIMESTAMP, + TEMPLATE VARCHAR(80) NOT NULL +) +drop table SHOT +CREATE TABLE SHOT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB, + INPOINT BIGINT NOT NULL, + OUTPOINT BIGINT NOT NULL, + DESCRIPTION VARCHAR(255), + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT FK_SHOT_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +) + +drop table shot + +select * from JOB j where (j.SUBMITTED LIKE '2012-08-30%') + +delete from SCENE + +drop table scene +CREATE TABLE SCENE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP +) + +ALTER TABLE MEDIA ADD POSTER BLOB + +update MEDIA set POSTER=(select THUMBNAIL from SHOT where ID=701) where ITEMID=2 + +select * from media m where (m.archived like '201%') + +update media set archived=(select current_date from sysibm.sysdummy1) where id=3 \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/database/trigger.sql b/server/user.jobengine.osgi.db/database/trigger.sql new file mode 100644 index 00000000..6ff2e19a --- /dev/null +++ b/server/user.jobengine.osgi.db/database/trigger.sql @@ -0,0 +1,30 @@ +SELECT * FROM FOLDER +TRUNCATE TABLE FOLDER DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE +UPDATE ITEM SET ISFOLDER='N' WHERE ISFOLDER='Y' +SELECT * FROM ITEM WHERE ISFOLDER='Y' fetch first 10 rows only + +SELECT * FROM ITEM fetch first 10 rows only + + +insert into FOLDER ("PARENTID", "CHILDID") values(1, 2) +insert into FOLDER ("PARENTID", "CHILDID") values(67776, 62376) + + +DELETE FROM FOLDER WHERE PARENTID = 61782 + +DELETE FROM FOLDER + + +DROP TRIGGER TRG_INSERT_FOLDER +CREATE TRIGGER TRG_INSERT_FOLDER + AFTER INSERT ON FOLDER + REFERENCING NEW AS N + FOR EACH ROW + UPDATE ITEM SET ISFOLDER = 'Y' WHERE ID = N.PARENTID AND ISFOLDER = 'N' + + +CREATE TRIGGER TRG_DELETE_FOLDER + AFTER DELETE ON FOLDER + REFERENCING OLD AS O + FOR EACH ROW + UPDATE ITEM SET ISFOLDER = 'N' WHERE ID = O.PARENTID AND NOT EXISTS (SELECT * FROM FOLDER WHERE PARENTID = O.PARENTID) diff --git a/server/user.jobengine.osgi.db/db-create.bat b/server/user.jobengine.osgi.db/db-create.bat new file mode 100644 index 00000000..6c77bba7 --- /dev/null +++ b/server/user.jobengine.osgi.db/db-create.bat @@ -0,0 +1,36 @@ +@ECHO ON + ECHO *** Begin deploy *** + + CALL settings.bat + + CALL :create + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + + CALL :deploy + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + + ECHO *** End of successful deploy *** + pause + GOTO :eof + + +:create + ECHO --- Creating %DB_NAME% database + db2 ATTACH TO %DB_INSTANCE% USER %DB_USER% USING %DB_PWD% + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + db2 CREATE DATABASE %DB_NAME% AUTOMATIC STORAGE YES USING CODESET UTF-8 TERRITORY hu COLLATE USING UCA500R1_S2 + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + GOTO :eof + +:deploy + ECHO --- Deploying SQL objects in %DB_NAME% database + db2 connect to %DB_NAME% user %DB_USER% using %DB_PWD% + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + db2 %DB_CMD_OPTIONS% database/db_create.sql + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + db2 connect reset >nul 2>&1 + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + GOTO :eof + + +@ECHO ON diff --git a/server/user.jobengine.osgi.db/db-drop.bat b/server/user.jobengine.osgi.db/db-drop.bat new file mode 100644 index 00000000..188eda3d --- /dev/null +++ b/server/user.jobengine.osgi.db/db-drop.bat @@ -0,0 +1,21 @@ +@ECHO OFF + ECHO *** Begin undeploy *** + + CALL settings.bat + + CALL :drop + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + + ECHO *** End of successful undeploy *** + pause + GOTO :eof + +:drop + ECHO --- Dropping %DB_NAME% database + db2 ATTACH TO %DB_INSTANCE% USER %DB_USER% USING %DB_PWD% + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + db2 DROP DATABASE %DB_NAME% + if %ERRORLEVEL% neq 0 exit /b %ERRORLEVEL% + GOTO :eof + +@ECHO ON diff --git a/server/user.jobengine.osgi.db/db-list-tables.bat b/server/user.jobengine.osgi.db/db-list-tables.bat new file mode 100644 index 00000000..5c2a581d --- /dev/null +++ b/server/user.jobengine.osgi.db/db-list-tables.bat @@ -0,0 +1,8 @@ +@ECHO OFF + + CALL settings.bat + db2 connect to %DB_NAME% user %DB_USER% using %DB_PWD% + db2 list tables + db2 connect reset >nul 2>&1 + pause +@ECHO ON diff --git a/server/user.jobengine.osgi.db/db2cmd.bak b/server/user.jobengine.osgi.db/db2cmd.bak new file mode 100644 index 00000000..ed0ce233 --- /dev/null +++ b/server/user.jobengine.osgi.db/db2cmd.bak @@ -0,0 +1,19 @@ +@echo off + +@set PROGRAMS=c:\Program Files + +@set SQLLIB=%PROGRAMS%\IBM\SQLLIB +@set INCLUDE=%SQLLIB%\INCLUDE +@set LIB=%SQLLIB%\LIB +@set CLASSPATH=.;%SQLLIB%\java\db2java.zip;%SQLLIB%\java\db2jcc.jar;%SQLLIB%\java\sqlj.zip;%SQLLIB%\java\db2jcc_license_cu.jar;%SQLLIB%\bin;%SQLLIB%\java\common.jar; +@set DB2PATH=%SQLLIB% +@set Path=%Path%;%SQLLIB%\db2tss\bin;%SQLLIB%\BIN;%SQLLIB%\FUNCTION; +@set DB2CLP=DB20FADE +@set DB2INSTANCE=DB2 + +@echo SQL : %JobEngineServer% +@echo PROGRAMS : %PROGRAMS% +@echo SQLLIB : %SQLLIB% +@rem echo PATH : %PATH% +@rem echo CLASSPATH : %CLASSPATH% +@echo on diff --git a/server/user.jobengine.osgi.db/db_create.bak b/server/user.jobengine.osgi.db/db_create.bak new file mode 100644 index 00000000..66d9b9f5 --- /dev/null +++ b/server/user.jobengine.osgi.db/db_create.bak @@ -0,0 +1,7 @@ +@rem "%ProgramFiles%\ibm\sqllib\bin\db2cmd" /c /i /w db2 -td@ -vf %JobEngineServer%\user.jobengine.osgi.db\database\createdb.sql > c:\createdb.log +@echo off +pushd "%~dp0" +call db2cmd.bat +db2 -td@ -vf database\db_create.sql > sql.log +notepad sql.log +del sql.log diff --git a/server/user.jobengine.osgi.db/db_drop.bak b/server/user.jobengine.osgi.db/db_drop.bak new file mode 100644 index 00000000..e3d6e382 --- /dev/null +++ b/server/user.jobengine.osgi.db/db_drop.bak @@ -0,0 +1,7 @@ +@rem "%ProgramFiles%\ibm\sqllib\bin\db2cmd" /c /i /w db2 -vtf %JobEngineServer%\user.jobengine.osgi.db\database\emptydb.sql > c:\emptydb.log +@echo off +pushd "%~dp0" +call db2cmd.bat +db2 -td@ -vf database\db_drop.sql > sql.log +notepad sql.log +del sql.log diff --git a/server/user.jobengine.osgi.db/deploy.launch b/server/user.jobengine.osgi.db/deploy.launch new file mode 100644 index 00000000..2fc40479 --- /dev/null +++ b/server/user.jobengine.osgi.db/deploy.launch @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO.java new file mode 100644 index 00000000..570f9098 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO.java @@ -0,0 +1,390 @@ +/*@lineinfo:filename=BreakDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class BreakIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int thumbnailNdx; + private int createdNdx; + private int mediaIdNdx; + private int inPointNdx; + private int breakTypeNdx; + private int idNdx; + public BreakIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + breakTypeNdx = findColumn("breakType"); + inPointNdx = findColumn("inPoint"); + mediaIdNdx = findColumn("mediaId"); + createdNdx = findColumn("created"); + thumbnailNdx = findColumn("thumbnail"); + } + public BreakIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + breakTypeNdx = findColumn("breakType"); + inPointNdx = findColumn("inPoint"); + mediaIdNdx = findColumn("mediaId"); + createdNdx = findColumn("created"); + thumbnailNdx = findColumn("thumbnail"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String breakType() + throws java.sql.SQLException + { + return resultSet.getString(breakTypeNdx); + } + public long inPoint() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(inPointNdx); + } + public long mediaId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(mediaIdNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public byte[] thumbnail() + throws java.sql.SQLException + { + return resultSet.getBytes(thumbnailNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^114*/ + +@SuppressWarnings("unused") +class BreakDAO extends EntityBaseDAO { + + public BreakDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + BreakIter iterator = (BreakIter) iter; + while (iterator.next()) { + Break entity = new Break(); + entity.setId(iterator.id()); + entity.setBreakType(ItemManagerData.toBreakType(iterator.breakType())); + entity.setInPoint(iterator.inPoint()); + entity.setMediaId(iterator.mediaId()); + entity.setCreated(iterator.created()); + entity.setThumbnail(iterator.thumbnail()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + BreakIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:43^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new BreakIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:43^111*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + BreakIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:50^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK WHERE MEDIAID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new BreakIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:50^116*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + BreakIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:57^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new BreakIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:57^96*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:63^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM BREAK WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:63^52*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:68^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE BREAK DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:68^86*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Break obj = (Break) entity; + long id = obj.getId(); + String breakType = obj.getBreakType().toString(); + long inPoint = obj.getInPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + /*@lineinfo:generated-code*//*@lineinfo:80^2*/ + +// ************************************************************ +// #sql [context] { UPDATE BREAK SET BREAKTYPE = :breakType, INPOINT = :inPoint, MEDIAID = :mediaId, THUMBNAIL = :thumbnail WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, breakType); + __sJT_stmt.setLong(2, inPoint); + __sJT_stmt.setLong(3, mediaId); + __sJT_stmt.setBytes(4, thumbnail); + __sJT_stmt.setLong(5, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:80^138*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Break obj = (Break) entity; + String breakType = obj.getBreakType().toString(); + long inPoint = obj.getInPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + /*@lineinfo:generated-code*//*@lineinfo:91^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO BREAK (BREAKTYPE, INPOINT, MEDIAID, THUMBNAIL) VALUES (:breakType, :inPoint, :mediaId, :thumbnail) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, BreakDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, breakType); + __sJT_stmt.setLong(2, inPoint); + __sJT_stmt.setLong(3, mediaId); + __sJT_stmt.setBytes(4, thumbnail); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:91^130*/ + } + +}/*@lineinfo:generated-code*/class BreakDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static BreakDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.BreakDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new BreakDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private BreakDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.BreakDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO_SJProfile0.ser new file mode 100644 index 00000000..99f14873 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/BreakDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainCategoryDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainCategoryDAO.java new file mode 100644 index 00000000..82d19d4a --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainCategoryDAO.java @@ -0,0 +1,373 @@ +/*@lineinfo:filename=DomainCategoryDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class DomainCategoryIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int nameNdx; + private int idNdx; + public DomainCategoryIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + } + public DomainCategoryIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^53*/ + +@SuppressWarnings("unused") +class DomainCategoryDAO extends EntityBaseDAO { + + public DomainCategoryDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + dao.addMissing(context, entity); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + dao.addMissing(context, entity); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + DomainCategoryIter iterator = (DomainCategoryIter) iter; + while (iterator.next()) { + DomainCategory entity = new DomainCategory(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + DomainCategoryIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:50^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME FROM DOMAINCATEGORY WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainCategoryDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new DomainCategoryIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:50^77*/ + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String name) throws SQLException{ + DomainCategoryIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:56^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME FROM DOMAINCATEGORY WHERE NAME = :name }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainCategoryDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setString(1, name); + iter = new DomainCategoryIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:56^81*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + DomainCategoryIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:63^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME FROM DOMAINCATEGORY ORDER BY NAME }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainCategoryDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new DomainCategoryIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:63^76*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:69^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM DOMAINCATEGORY WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainCategoryDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:69^61*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:74^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE DOMAINCATEGORY DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainCategoryDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:74^95*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainCategory obj = (DomainCategory) entity; + long id = obj.getId(); + String name = obj.getName(); + + /*@lineinfo:generated-code*//*@lineinfo:83^2*/ + +// ************************************************************ +// #sql [context] { UPDATE DOMAINCATEGORY SET NAME = :name WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainCategoryDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setLong(2, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:83^73*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainCategory obj = (DomainCategory) entity; + String name = obj.getName(); + + /*@lineinfo:generated-code*//*@lineinfo:91^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO DOMAINCATEGORY (NAME) VALUES (:name) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainCategoryDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:91^68*/ + } + + DomainCategory addMissing(String name) { + manager.traceIn(); + DomainCategory entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, name); + entity = (DomainCategory) getEntity(context, iter); + if (entity == null) { + entity = new DomainCategory(); + entity.setName(name); + add(context, entity); + } + + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } +}/*@lineinfo:generated-code*/class DomainCategoryDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static DomainCategoryDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.DomainCategoryDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new DomainCategoryDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private DomainCategoryDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.DomainCategoryDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainCategoryDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainCategoryDAO_SJProfile0.ser new file mode 100644 index 00000000..9491abe3 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainCategoryDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainDAO.java new file mode 100644 index 00000000..9081b997 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainDAO.java @@ -0,0 +1,517 @@ +/*@lineinfo:filename=DomainDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class DomainIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int valueNdx; + private int displayNdx; + private int domainCategoryIdNdx; + private int idNdx; + public DomainIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + domainCategoryIdNdx = findColumn("domainCategoryId"); + displayNdx = findColumn("display"); + valueNdx = findColumn("value"); + } + public DomainIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + domainCategoryIdNdx = findColumn("domainCategoryId"); + displayNdx = findColumn("display"); + valueNdx = findColumn("value"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long domainCategoryId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(domainCategoryIdNdx); + } + public String display() + throws java.sql.SQLException + { + return resultSet.getString(displayNdx); + } + public long value() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(valueNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^83*/ + +@SuppressWarnings("unused") +class DomainDAO extends EntityBaseDAO { + + public DomainDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + DomainIter iterator = (DomainIter) iter; + while (iterator.next()) { + Domain entity = new Domain(); + entity.setId(iterator.id()); + entity.setDomainCategoryId(iterator.domainCategoryId()); + entity.setDisplay(iterator.display()); + entity.setValue(iterator.value()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException { + DomainIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:40^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new DomainIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:40^97*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException { + DomainIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:47^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE DOMAINCATEGORYID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new DomainIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:47^111*/ + return iter; + } + + protected ResultSetIterImpl selectByRecordId(DefaultContext context, long recordId, long metadataId) throws SQLException { + DomainIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:53^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT d.ID, d.DOMAINCATEGORYID, d.DISPLAY, d.VALUE FROM DOMAIN d, DOMAININDEX i WHERE d.ID = i.DOMAINID AND i.METADATAID = :metadataId AND i.RECORDID = :recordId }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, metadataId); + __sJT_stmt.setLong(2, recordId); + iter = new DomainIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:53^189*/ + return iter; + } + + protected ResultSetIterImpl selectByDisplay(DefaultContext context, long id, String display) throws SQLException { + DomainIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:59^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE DOMAINCATEGORYID = :id AND DISPLAY = :display }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_stmt.setString(2, display); + iter = new DomainIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:59^134*/ + return iter; + } + + protected ResultSetIterImpl selectByDisplayFilter(DefaultContext context, long id, String displayFilter) throws SQLException { + DomainIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:65^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE DOMAINCATEGORYID = :id AND (UPPER(DISPLAY) LIKE :displayFilter) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setLong(1, id); + __sJT_stmt.setString(2, displayFilter); + iter = new DomainIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:65^152*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException { + DomainIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:72^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN ORDER BY DISPLAY }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 5); + try + { + iter = new DomainIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:72^99*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:78^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM DOMAIN WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:78^53*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:83^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE DOMAIN DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:83^87*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Domain obj = (Domain) entity; + long id = obj.getId(); + long domainCategoryid = obj.getDomainCategoryId(); + String display = obj.getDisplay(); + long value = obj.getValue(); + /*@lineinfo:generated-code*//*@lineinfo:93^2*/ + +// ************************************************************ +// #sql [context] { UPDATE DOMAIN SET DOMAINCATEGORYID = :domainCategoryid, DISPLAY = :display, VALUE = :value WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 8); + try + { + __sJT_stmt.setLong(1, domainCategoryid); + __sJT_stmt.setString(2, display); + __sJT_stmt.setLong(3, value); + __sJT_stmt.setLong(4, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:93^126*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Domain obj = (Domain) entity; + long domainCategoryid = obj.getDomainCategoryId(); + String display = obj.getDisplay(); + long value = obj.getValue(); + + /*@lineinfo:generated-code*//*@lineinfo:103^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO DOMAIN (DOMAINCATEGORYID, DISPLAY, VALUE) VALUES (:domainCategoryid, :display, :value) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainDAO_SJProfileKeys.getKey(0), 9); + try + { + __sJT_stmt.setLong(1, domainCategoryid); + __sJT_stmt.setString(2, display); + __sJT_stmt.setLong(3, value); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:103^118*/ + } + + void addMissing(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + DomainCategory domainCategory = (DomainCategory) entity; + if (domainCategory != null) { + long domainCategoryId = domainCategory.getId(); + List domains = domainCategory.getDomains(); + if (domains != null) { + for (Domain d: domains) { + d.setDomainCategoryId(domainCategoryId); + ResultSetIterImpl iter = selectByDisplay(context, domainCategoryId, d.getDisplay()); + Domain existing = (Domain) getEntity(context, iter); + if (existing == null) + add(context, d); + else + d.setId(existing.getId()); + } + } + } + manager.traceOut(); + } + + List getAll(DefaultContext context, IEntityBase entity, IEntityBase metadata) throws SQLException { + manager.traceIn(); + ResultSetIterImpl iter = selectByRecordId(context, entity.getId(), metadata.getId()); + List result = getList(context, iter, false); + manager.traceOut(); + return result; + } + + List getByDisplayFilter(long domainCategoryId, String filter) { + manager.traceIn(); + List result = null; + DefaultContext context = manager.getDbContext(); + try { + String displayFilter = (filter + "%").toUpperCase(); + ResultSetIterImpl iter = selectByDisplayFilter(context, domainCategoryId, displayFilter); + result = getList(context, iter, false); + } catch (Exception e) { + logger.error(e.getMessage()); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } + +}/*@lineinfo:generated-code*/class DomainDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static DomainDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.DomainDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new DomainDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private DomainDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.DomainDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainDAO_SJProfile0.ser new file mode 100644 index 00000000..c3519e45 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainIndexDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainIndexDAO.java new file mode 100644 index 00000000..76bf3721 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainIndexDAO.java @@ -0,0 +1,419 @@ +/*@lineinfo:filename=DomainIndexDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class DomainIndexIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int domainIdNdx; + private int metadataIdNdx; + private int recordIdNdx; + private int idNdx; + public DomainIndexIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + recordIdNdx = findColumn("recordId"); + metadataIdNdx = findColumn("metadataId"); + domainIdNdx = findColumn("domainId"); + } + public DomainIndexIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + recordIdNdx = findColumn("recordId"); + metadataIdNdx = findColumn("metadataId"); + domainIdNdx = findColumn("domainId"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long recordId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(recordIdNdx); + } + public long metadataId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(metadataIdNdx); + } + public long domainId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(domainIdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^84*/ + +@SuppressWarnings("unused") +class DomainIndexDAO extends EntityBaseDAO { + + public DomainIndexDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + DomainIndexIter iterator = (DomainIndexIter) iter; + while (iterator.next()) { + DomainIndex entity = new DomainIndex(); + entity.setId(iterator.id()); + entity.setRecordId(iterator.recordId()); + entity.setMetadataId(iterator.metadataId()); + entity.setDomainId(iterator.domainId()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + DomainIndexIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:40^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, RECORDID, METADATAID, DOMAINID FROM DOMAININDEX WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new DomainIndexIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:40^100*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + DomainIndexIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:47^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, RECORDID, METADATAID, DOMAINID FROM DOMAININDEX WHERE RECORDID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new DomainIndexIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:47^106*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + DomainIndexIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:54^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, RECORDID, METADATAID, DOMAINID FROM DOMAININDEX }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new DomainIndexIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:54^85*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:60^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM DOMAININDEX WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:60^58*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:65^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE DOMAININDEX DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:65^92*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainIndex obj = (DomainIndex) entity; + long id = obj.getId(); + long recordId = obj.getRecordId(); + long metadataId = obj.getMetadataId(); + long domainId = obj.getDomainId(); + + /*@lineinfo:generated-code*//*@lineinfo:76^2*/ + +// ************************************************************ +// #sql [context] { UPDATE DOMAININDEX SET RECORDID = :recordId, METADATAID = :metadataId, DOMAINID = :domainId WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, recordId); + __sJT_stmt.setLong(2, metadataId); + __sJT_stmt.setLong(3, domainId); + __sJT_stmt.setLong(4, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:76^126*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainIndex obj = (DomainIndex) entity; + long recordId = obj.getRecordId(); + long metadataId = obj.getMetadataId(); + long domainId = obj.getDomainId(); + + /*@lineinfo:generated-code*//*@lineinfo:86^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO DomainIndex (RECORDID, METADATAID, DOMAINID) VALUES (:recordId, :metadataId, :domainId) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setLong(1, recordId); + __sJT_stmt.setLong(2, metadataId); + __sJT_stmt.setLong(3, domainId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:86^119*/ + } + + void addAll(DefaultContext context, IEntityBase record, IEntityBase metadata, IEntityBase entity) throws SQLException { + manager.traceIn(); + DomainCategory domainCategory = (DomainCategory) entity; + if (domainCategory != null && metadata != null && record != null) { + List domains = domainCategory.getDomains(); + if (domains != null) { + for (Domain domain: domains) { + DomainIndex domainIndex = new DomainIndex(record.getId(), metadata.getId(), domain.getId()); + add(context, domainIndex); + } + } + } + manager.traceOut(); + } + + void removeAll(DefaultContext context, IEntityBase entity, IEntityBase metadata) throws SQLException { + manager.traceIn(); + long recordId = entity.getId(); + long metadataId = metadata.getId(); + /*@lineinfo:generated-code*//*@lineinfo:108^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM DOMAININDEX WHERE RECORDID = :recordId AND METADATAID = :metadataId }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, DomainIndexDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setLong(1, recordId); + __sJT_stmt.setLong(2, metadataId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:108^99*/ + manager.traceOut(); + } + +}/*@lineinfo:generated-code*/class DomainIndexDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static DomainIndexDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.DomainIndexDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new DomainIndexDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private DomainIndexDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.DomainIndexDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainIndexDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainIndexDAO_SJProfile0.ser new file mode 100644 index 00000000..64acc7fa Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/DomainIndexDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/EntityBaseDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/EntityBaseDAO.java new file mode 100644 index 00000000..86ec7f16 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/EntityBaseDAO.java @@ -0,0 +1,764 @@ +/*@lineinfo:filename=EntityBaseDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import user.commons.logging.LogUtils; +import java.sql.SQLException; +import java.sql.ResultSet; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import sqlj.runtime.ref.DefaultContext; +import sqlj.runtime.ref.ResultSetIterImpl; +/** + * Az entit\ufffd\ufffd\ufffdsok alap DAO oszt\ufffd\ufffd\ufffdlya. + */ +@SuppressWarnings("unused") +public abstract class EntityBaseDAO implements IEntityBaseDAO { + protected ItemManager manager; + protected static final Logger logger = LogManager.getLogger(); + + public EntityBaseDAO(ItemManager manager) { + this.manager = manager; + } + + @SuppressWarnings("rawtypes") + protected void checkNull(Object obj, Class type) { + if (obj == null) + throw new IllegalArgumentException(type.getName() + " can not be null."); + } + + @Override + public void add(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + add(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + public void add(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + try { + checkNull(entity, IEntityBase.class); + beforeAdd(context, entity); + long id = entity.getId(); + + insert(context, entity); + if (id == 0) { + /*@lineinfo:generated-code*//*@lineinfo:51^4*/ + +// ************************************************************ +// #sql [context] { SELECT IDENTITY_VAL_LOCAL() INTO :id, FROM SYSIBM.SYSDUMMY1 }; +// ************************************************************ + +{ + sqlj.runtime.profile.RTResultSet __sJT_rtRs; + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_rtRs = __sJT_execCtx.executeQuery(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } + try + { + sqlj.runtime.ref.ResultSetIterImpl.checkColumns(__sJT_rtRs, 1); + if (!__sJT_rtRs.next()) + { + sqlj.runtime.error.RuntimeRefErrors.raise_NO_ROW_SELECT_INTO(); + } + id = __sJT_rtRs.getLongNoNull(1); + if (__sJT_rtRs.next()) + { + sqlj.runtime.error.RuntimeRefErrors.raise_MULTI_ROW_SELECT_INTO(); + } + } + finally + { + __sJT_rtRs.close(); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:51^80*/ + entity.setId(id); + } + afterAdd(context, entity); + /*@lineinfo:generated-code*//*@lineinfo:55^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:55^27*/ + if (useMemoryCache()) + manager.storeCached(entity.getId(), entity); + + } catch (Exception e) { + try { + /*@lineinfo:generated-code*//*@lineinfo:61^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:61^30*/ + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + @Override + public IEntityBase get(long id) { + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + entity = get(context, id); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return entity; + } + + public IEntityBase get(DefaultContext context, long id) { + manager.traceIn(); + IEntityBase entity = null; + try { + if (id == 0) + throw new IllegalArgumentException("Cannot get EntityBase with 0 ID."); + if (useMemoryCache()) + entity = manager.retrieveCached(getCacheType(), id); + if (entity == null) { + ResultSetIterImpl iter = selectByKey(context, id); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + if (useMemoryCache()) + manager.storeCached(id, entity); + } + afterGet(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return entity; + } + + @Override + public List getAll() { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + result = getAll(context); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return result; + } + + public List getAll(DefaultContext context) { + manager.traceIn(); + List result = null; + try { + ResultSetIterImpl iter = selectAll(context); + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, false, true); + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return result; + } + + @Override + public List getAll(long id) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + result = getAll(context, id); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return result; + } + + public List getAll(DefaultContext context, long id) { + manager.traceIn(); + List result = null; + try { + ResultSetIterImpl iter = selectByForeignKey(context, id); + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, false, true); + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return result; + } + + protected IEntityBase getEntity(DefaultContext context, ResultSetIterImpl iter) { + manager.traceIn(); + IEntityBase entity = null; + try { + List result = getList(context, iter, false, false); + if (result != null) { + if (result.size() != 1) + throw new IllegalStateException("Expected one, found " + result.size() + "."); + entity = result.get(0); + } + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return entity; + } + +// protected List getList(ResultSetIterImpl iter) { +// List result = null; +// DefaultContext context = manager.getDbContext(); +// try { +// result = getList(context, iter); +// } catch (Exception e) { +// throw new ItemManagerException(e); +// } finally { +// manager.putDbContext(context); +// } +// return result; +// } + + protected List getList(ResultSetIterImpl iter, boolean isChunked) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + result = getList(context, iter, isChunked, true); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return result; + } + + protected List getList(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) { + return getList(context, iter, isChunked, true); + } + + protected List getList(DefaultContext context, ResultSetIterImpl iter, boolean isChunked, boolean enablecache) { + manager.traceIn(); + List result = null; + try { + if (useMemoryCache() && enablecache) + result = manager.getAllCached(getCacheType()); + + if (result == null) { + result = entities(context, iter, isChunked); + if (useMemoryCache() && enablecache) + manager.setAllCached(getCacheType(), result); + } + + /*@lineinfo:generated-code*//*@lineinfo:222^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:222^27*/ + } catch (Exception e) { + try { + /*@lineinfo:generated-code*//*@lineinfo:225^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:225^30*/ + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + return result; + } + + @Override + public void modify(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + modify(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + @Override + public void merge(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + if (entity.getId() == 0) + add(entity); + else + modify(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + public void modify(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + try { + checkNull(entity, IEntityBase.class); + long id = entity.getId(); + entity.checkParameter("ID", id, false); + update(context, entity); + afterModify(context, entity); + /*@lineinfo:generated-code*//*@lineinfo:269^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:269^27*/ + if (useMemoryCache()) + manager.storeCached(entity.getId(), entity); + } catch (Exception e) { + try { + /*@lineinfo:generated-code*//*@lineinfo:274^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:274^30*/ + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + @Override + public void remove(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + remove(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + public void remove(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + try { + checkNull(entity, IEntityBase.class); + long id = entity.getId(); + entity.checkParameter("ID", id, false); + beforeDelete(context, entity); + delete(context, id); + afterDelete(context, entity); + /*@lineinfo:generated-code*//*@lineinfo:303^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:303^27*/ + if (useMemoryCache()) + manager.removeCached(getCacheType(), entity.getId()); + } catch (Exception e) { + try { + /*@lineinfo:generated-code*//*@lineinfo:308^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 8); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:308^30*/ + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + public void remove(List ids) { + DefaultContext context = manager.getDbContext(); + try { + remove(context, ids); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + protected void remove(DefaultContext context, List ids) { + manager.traceIn(); + try { + for (long id : ids) + delete(context, id); + /*@lineinfo:generated-code*//*@lineinfo:332^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 9); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:332^27*/ + if (useMemoryCache()) { + for (long id : ids) + manager.removeCached(getCacheType(), id); + } + } catch (Exception e) { + try { + /*@lineinfo:generated-code*//*@lineinfo:339^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 10); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:339^30*/ + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + @Override + public void truncate() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + truncateTable(context); + /*@lineinfo:generated-code*//*@lineinfo:353^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, EntityBaseDAO_SJProfileKeys.getKey(0), 11); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:353^27*/ + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + + protected void afterGet(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void beforeAdd(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void afterDelete(DefaultContext context, IEntityBase entity) throws SQLException { } + + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + return null; + } + + public List entities(DefaultContext context, ResultSet rs) throws SQLException { + return null; + } + + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException { + return null; + } + + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException { + return null; + } + + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException { + return null; + } + + protected void delete(DefaultContext context, long id) throws SQLException { } + + protected void truncateTable(DefaultContext context) throws SQLException { } + + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException { } + + protected void update(DefaultContext context, IEntityBase entity) throws SQLException { } + + protected boolean useMemoryCache() { return false; } + + protected Class getCacheType() { return null; } +}/*@lineinfo:generated-code*/class EntityBaseDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static EntityBaseDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.EntityBaseDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new EntityBaseDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private EntityBaseDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.EntityBaseDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/EntityBaseDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/EntityBaseDAO_SJProfile0.ser new file mode 100644 index 00000000..68910d52 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/EntityBaseDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/FileTypeDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FileTypeDAO.java new file mode 100644 index 00000000..a816b707 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FileTypeDAO.java @@ -0,0 +1,436 @@ +/*@lineinfo:filename=FileTypeDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.util.List; +import java.util.ArrayList; +import java.sql.SQLException; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class FileTypeIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int frameRateNdx; + private int audioTracksNdx; + private int videoTracksNdx; + private int audioCodecNdx; + private int videoCodecNdx; + private int descriptionNdx; + private int nameNdx; + private int idNdx; + public FileTypeIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + videoCodecNdx = findColumn("videoCodec"); + audioCodecNdx = findColumn("audioCodec"); + videoTracksNdx = findColumn("videoTracks"); + audioTracksNdx = findColumn("audioTracks"); + frameRateNdx = findColumn("frameRate"); + } + public FileTypeIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + videoCodecNdx = findColumn("videoCodec"); + audioCodecNdx = findColumn("audioCodec"); + videoTracksNdx = findColumn("videoTracks"); + audioTracksNdx = findColumn("audioTracks"); + frameRateNdx = findColumn("frameRate"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public String videoCodec() + throws java.sql.SQLException + { + return resultSet.getString(videoCodecNdx); + } + public String audioCodec() + throws java.sql.SQLException + { + return resultSet.getString(audioCodecNdx); + } + public int videoTracks() + throws java.sql.SQLException + { + return resultSet.getIntNoNull(videoTracksNdx); + } + public int audioTracks() + throws java.sql.SQLException + { + return resultSet.getIntNoNull(audioTracksNdx); + } + public float frameRate() + throws java.sql.SQLException + { + return resultSet.getFloatNoNull(frameRateNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^156*/ + +@SuppressWarnings("unused") +class FileTypeDAO extends EntityBaseDAO { + + public FileTypeDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + FileTypeIter iterator = (FileTypeIter) iter; + while (iterator.next()) { + FileType entity = new FileType(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setVideoCodec(iterator.videoCodec()); + entity.setAudioCodec(iterator.audioCodec()); + entity.setVideoTracks(iterator.videoTracks()); + entity.setAudioTracks(iterator.audioTracks()); + entity.setFrameRate(iterator.frameRate()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + FileTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:44^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE FROM FILETYPE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FileTypeDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new FileTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:44^145*/ + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String name) throws SQLException{ + FileTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:50^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE FROM FILETYPE WHERE NAME = :name }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FileTypeDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setString(1, name); + iter = new FileTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:50^149*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + FileTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:57^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE FROM FILETYPE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FileTypeDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new FileTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:57^130*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:63^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM FILETYPE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FileTypeDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:63^55*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:68^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE FILETYPE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FileTypeDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:68^89*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + FileType obj = (FileType) entity; + long id = entity.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + String audioCodec = obj.getAudioCodec(); + String videoCodec = obj.getVideoCodec(); + int videoTracks = obj.getVideoTracks(); + int audioTracks = obj.getAudioTracks(); + float frameRate = obj.getFrameRate(); + + /*@lineinfo:generated-code*//*@lineinfo:83^2*/ + +// ************************************************************ +// #sql [context] { UPDATE INSERT FILETYPE SET NAME = :name, DESCRIPTION = :description, VIDEOCODEC = :videoCodec, AUDIOCODEC = :audioCodec, +// VIDEOTRACKS = :videoTracks, AUDIOTRACKS = :audioTracks, FRAMERATE = :frameRate WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FileTypeDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setString(3, videoCodec); + __sJT_stmt.setString(4, audioCodec); + __sJT_stmt.setInt(5, videoTracks); + __sJT_stmt.setInt(6, audioTracks); + __sJT_stmt.setFloat(7, frameRate); + __sJT_stmt.setLong(8, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:84^97*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + FileType obj = (FileType) entity; + String name = obj.getName(); + String description = obj.getDescription(); + String audioCodec = obj.getAudioCodec(); + String videoCodec = obj.getVideoCodec(); + int videoTracks = obj.getVideoTracks(); + int audioTracks = obj.getAudioTracks(); + float frameRate = obj.getFrameRate(); + + /*@lineinfo:generated-code*//*@lineinfo:98^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO FILETYPE (NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE) +// VALUES (:name, :description, :videoCodec, :audioCodec, :videoTracks, :audioTracks, :frameRate) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FileTypeDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setString(3, videoCodec); + __sJT_stmt.setString(4, audioCodec); + __sJT_stmt.setInt(5, videoTracks); + __sJT_stmt.setInt(6, audioTracks); + __sJT_stmt.setFloat(7, frameRate); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:99^97*/ + } + + public IEntityBase getByName(String name) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, name); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } +}/*@lineinfo:generated-code*/class FileTypeDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static FileTypeDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.FileTypeDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new FileTypeDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private FileTypeDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.FileTypeDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/FileTypeDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FileTypeDAO_SJProfile0.ser new file mode 100644 index 00000000..3ddac06a Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FileTypeDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO.java new file mode 100644 index 00000000..73984061 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO.java @@ -0,0 +1,312 @@ +/*@lineinfo:filename=FolderDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class FolderIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int childIdNdx; + private int parentIdNdx; + private int idNdx; + public FolderIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + parentIdNdx = findColumn("parentId"); + childIdNdx = findColumn("childId"); + } + public FolderIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + parentIdNdx = findColumn("parentId"); + childIdNdx = findColumn("childId"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long parentId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(parentIdNdx); + } + public long childId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(childIdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^61*/ + +@SuppressWarnings("unused") +public class FolderDAO extends EntityBaseDAO { + + public FolderDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + FolderIter iterator = (FolderIter) iter; + while (iterator.next()) { + Folder entity = new Folder(); + entity.setId(iterator.id()); + entity.setParentId(iterator.parentId()); + entity.setChildId(iterator.childId()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + FolderIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:38^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new FolderIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:38^82*/ + return iter; + } + + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + FolderIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:44^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER WHERE CHILDID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new FolderIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:44^87*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + FolderIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:51^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new FolderIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:51^67*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:57^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM FOLDER WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:57^53*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:62^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE FOLDER DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:62^87*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Folder obj = (Folder) entity; + long parentId = obj.getParentId(); + long childId = obj.getChildId(); + + /*@lineinfo:generated-code*//*@lineinfo:71^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO FOLDER (PARENTID, CHILDID) VALUES (:parentId, :childId) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, FolderDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, parentId); + __sJT_stmt.setLong(2, childId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:71^87*/ + } + +}/*@lineinfo:generated-code*/class FolderDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static FolderDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.FolderDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new FolderDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private FolderDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.FolderDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO_SJProfile0.ser new file mode 100644 index 00000000..720022ad Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/FolderDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/HelperDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/HelperDAO.java new file mode 100644 index 00000000..1ca8b407 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/HelperDAO.java @@ -0,0 +1,244 @@ +/*@lineinfo:filename=HelperDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import java.sql.SQLException; +import java.sql.ResultSet; +import java.util.List; + +import sqlj.runtime.ref.DefaultContext; + +@SuppressWarnings("unused") +public class HelperDAO { + static protected ItemManager manager; + + static { + manager = ItemManager.getInstance(); + } + + static void foreignKeysOn() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + /*@lineinfo:generated-code*//*@lineinfo:22^3*/ + +// ************************************************************ +// #sql [context] { CALL SET_CONSTRAINTS('YES') }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelperDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_execCtx.execute(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:22^48*/ + /*@lineinfo:generated-code*//*@lineinfo:23^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelperDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:23^27*/ + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + + static void foreignKeysOff() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + /*@lineinfo:generated-code*//*@lineinfo:36^6*/ + +// ************************************************************ +// #sql [context] { CALL SET_CONSTRAINTS('NO') }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelperDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_execCtx.execute(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:36^50*/ + /*@lineinfo:generated-code*//*@lineinfo:37^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelperDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:37^27*/ + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + + static void dropDynamicData() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + /*@lineinfo:generated-code*//*@lineinfo:50^6*/ + +// ************************************************************ +// #sql [context] { CALL DROP_DYNAMIC_DATA() }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelperDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.execute(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:50^48*/ + /*@lineinfo:generated-code*//*@lineinfo:51^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelperDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:51^27*/ + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + +}/*@lineinfo:generated-code*/class HelperDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static HelperDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.HelperDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new HelperDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private HelperDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.HelperDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/HelperDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/HelperDAO_SJProfile0.ser new file mode 100644 index 00000000..eedd5121 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/HelperDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemDAO.java new file mode 100644 index 00000000..a7eb3fcd --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemDAO.java @@ -0,0 +1,511 @@ +/*@lineinfo:filename=ItemDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.List; + +@SuppressWarnings("unused") +public class ItemDAO extends EntityBaseDAO { + + public ItemDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void beforeAdd(DefaultContext context, IEntityBase entity) throws SQLException { + long id = manager.getMasterId(context); + entity.setId(id); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.add(context, entity); + MediaDAO daoMedia = (MediaDAO) manager.getBaseDAO(Media.class); + daoMedia.addAll(context, entity); + readAutoGeneratedValues(context, (Item) entity); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.modify(context, entity); + readAutoGeneratedValues(context, (Item) entity); + } + + private void readAutoGeneratedValues(DefaultContext context, Item item) { + Item newItem = (Item) get(context, item.getId()); + if (newItem != null) { + item.setCreated(newItem.getCreated()); + item.setModified(newItem.getModified()); + } + } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.remove(context, entity); + MediaDAO daoMedia = (MediaDAO) manager.getBaseDAO(Media.class); + daoMedia.removeAll(context, entity); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ItemIter iterator = (ItemIter) iter; + while (iterator.next()) { + Item entity = toEntity(iterator); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + public List entities(DefaultContext context, ResultSetIterImpl iter, int maxRecords) throws SQLException { + List result = null; + ItemIter iterator = (ItemIter) iter; + while (iterator.next() && maxRecords > 0) { + Item entity = toEntity(iterator); + if (result == null) + result = new ArrayList(); + result.add(entity); + maxRecords--; + } + iterator.close(); + return result; + } + + private Item toEntity(ItemIter iterator) throws SQLException { + Item entity = new Item(); + entity.setId(iterator.id()); + entity.setTitle(iterator.title()); + entity.setDescription(iterator.description()); + entity.setItemTypeId(iterator.itemTypeId()); + entity.setHouseId(iterator.houseId()); + entity.setCreated(iterator.created()); + entity.setIsFolder(iterator.isFolder().equals("Y") ? true : false); + return entity; + } + + @Override + public List entities(DefaultContext context, ResultSet rs) throws SQLException { + ItemIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:100^2*/ + +// ************************************************************ +// #sql [context] iter = { CAST :rs }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setObject(2, rs); + __sJT_execCtx.executeUpdate(); + iter = ((ItemIter)(__sJT_stmt.getObject(1, ItemIter.class))); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:100^35*/ + return entities(context, iter, false) ; + } + + public List entities(DefaultContext context, ResultSet rs, int maxRecords) throws SQLException { + ItemIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:106^2*/ + +// ************************************************************ +// #sql [context] iter = { CAST :rs }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setObject(2, rs); + __sJT_execCtx.executeUpdate(); + iter = ((ItemIter)(__sJT_stmt.getObject(1, ItemIter.class))); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:106^35*/ + return entities(context, iter, maxRecords) ; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + ItemIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:113^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + iter = new ItemIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:113^121*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + ItemIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:120^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 3); + try + { + iter = new ItemIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:120^106*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:126^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM ITEM WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:126^51*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:131^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE ITEM DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:131^85*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Item obj = (Item) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + String isFolder = obj.getIsFolder() == true ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:144^2*/ + +// ************************************************************ +// #sql [context] { UPDATE ITEM SET TITLE = :title, DESCRIPTION = :description, ITEMTYPEID = :itemTypeId, HOUSEID = :houseId, ISFOLDER = :isFolder WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, title); + __sJT_stmt.setString(2, description); + __sJT_stmt.setLong(3, itemTypeId); + __sJT_stmt.setString(4, houseId); + __sJT_stmt.setString(5, isFolder); + __sJT_stmt.setLong(6, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:144^161*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Item obj = (Item) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + String isFolder = obj.getIsFolder() == true ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:157^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO ITEM (ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, ISFOLDER) VALUES (:id, :title, :description, :itemTypeId, :houseId, :isFolder) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setLong(1, id); + __sJT_stmt.setString(2, title); + __sJT_stmt.setString(3, description); + __sJT_stmt.setLong(4, itemTypeId); + __sJT_stmt.setString(5, houseId); + __sJT_stmt.setString(6, isFolder); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:157^161*/ + } + + protected ResultSetIterImpl selectFolders(DefaultContext context, long id) throws SQLException{ + ItemIter iter = null; + if (id == 0) { + /*@lineinfo:generated-code*//*@lineinfo:163^3*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ID IN ( +// SELECT DISTINCT(f.PARENTID) FROM FOLDER f LEFT JOIN FOLDER p ON (f.PARENTID = p.CHILDID) WHERE P.PARENTID IS NULL +// ) ORDER BY TITLE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 8); + try + { + iter = new ItemIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:165^20*/ + } else { + /*@lineinfo:generated-code*//*@lineinfo:167^3*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ISFOLDER = 'Y' AND ID IN ( +// SELECT CHILDID FROM FOLDER WHERE PARENTID = :id +// ) ORDER BY TITLE +// }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemDAO_SJProfileKeys.getKey(0), 9); + try + { + __sJT_stmt.setLong(1, id); + iter = new ItemIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:171^3*/ + } + return iter; + } + +// protected ResultSetIterImpl selectFolderContents(DefaultContext context, long id) throws SQLException{ +// ItemIter iter = null; +// #sql [context] iter = { +// SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ID IN ( +// SELECT CHILDID FROM FOLDER WHERE PARENTID = :id +// ) ORDER BY ISFOLDER DESC, TITLE +// }; +// return iter; +// } + + public List getFolders(long id) { + manager.traceIn(); + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectFolders(context, id); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +}/*@lineinfo:generated-code*/class ItemDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static ItemDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.ItemDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new ItemDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private ItemDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.ItemDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemDAO_SJProfile0.ser new file mode 100644 index 00000000..e38149e9 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemIter.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemIter.java new file mode 100644 index 00000000..5eb8196c --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemIter.java @@ -0,0 +1,86 @@ +/*@lineinfo:filename=ItemIter*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import java.sql.Timestamp; + +/*@lineinfo:generated-code*//*@lineinfo:5^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +public class ItemIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int isFolderNdx; + private int createdNdx; + private int houseIdNdx; + private int itemTypeIdNdx; + private int descriptionNdx; + private int titleNdx; + private int idNdx; + public ItemIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + titleNdx = findColumn("title"); + descriptionNdx = findColumn("description"); + itemTypeIdNdx = findColumn("itemTypeId"); + houseIdNdx = findColumn("houseId"); + createdNdx = findColumn("created"); + isFolderNdx = findColumn("isFolder"); + } + public ItemIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + titleNdx = findColumn("title"); + descriptionNdx = findColumn("description"); + itemTypeIdNdx = findColumn("itemTypeId"); + houseIdNdx = findColumn("houseId"); + createdNdx = findColumn("created"); + isFolderNdx = findColumn("isFolder"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String title() + throws java.sql.SQLException + { + return resultSet.getString(titleNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public long itemTypeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(itemTypeIdNdx); + } + public String houseId() + throws java.sql.SQLException + { + return resultSet.getString(houseIdNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public String isFolder() + throws java.sql.SQLException + { + return resultSet.getString(isFolderNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:5^140*//*@lineinfo:generated-code*/ \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemTypeDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemTypeDAO.java new file mode 100644 index 00000000..6fe01721 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemTypeDAO.java @@ -0,0 +1,418 @@ +/*@lineinfo:filename=ItemTypeDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.jobengine.db.ItemManagerData.SignalType; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class ItemTypeIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int isStaticNdx; + private int descriptionNdx; + private int nameNdx; + private int idNdx; + public ItemTypeIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + isStaticNdx = findColumn("isStatic"); + } + public ItemTypeIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + isStaticNdx = findColumn("isStatic"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public String isStatic() + throws java.sql.SQLException + { + return resultSet.getString(isStaticNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^84*/ + +@SuppressWarnings("unused") +class ItemTypeDAO extends EntityBaseDAO { + + public ItemTypeDAO(ItemManager manager) { + super(manager); + } + + @Override + protected boolean useMemoryCache() { return true; } + + @Override + protected Class getCacheType() { return ItemType.class; } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + MetadataDAO dao = (MetadataDAO) manager.getBaseDAO(Metadata.class); + dao.removeAll(context, entity.getId()); + } + + @Override + protected void afterDelete(DefaultContext context, IEntityBase entity) throws SQLException { + manager.notifyItemTypeChange(entity, SignalType.DELETE); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + ItemType obj = (ItemType) entity; + MetadataDAO dao = (MetadataDAO) manager.getBaseDAO(Metadata.class); + dao.addAll(context, obj); + manager.notifyItemTypeChange(entity, SignalType.CREATE); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + manager.notifyItemTypeChange(entity, SignalType.UPDATE); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ItemTypeIter iterator = (ItemTypeIter) iter; + while (iterator.next()) { + ItemType entity = new ItemType(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setIsStatic(iterator.isStatic() == null || iterator.isStatic().equals("N") ? false : true); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + ItemTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:71^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, ISSTATIC FROM ITEMTYPE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemTypeDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new ItemTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:71^94*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + ItemTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:83^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, ISSTATIC FROM ITEMTYPE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemTypeDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new ItemTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:83^79*/ + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String filterName) throws SQLException{ + ItemTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:89^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, ISSTATIC FROM ITEMTYPE WHERE NAME = :filterName }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemTypeDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setString(1, filterName); + iter = new ItemTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:89^104*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:95^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM ITEMTYPE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemTypeDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:95^55*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:100^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE ITEMTYPE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemTypeDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:100^89*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + ItemType obj = (ItemType) entity; + long id = obj.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + String isStatic = obj.getIsStatic() ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:111^2*/ + +// ************************************************************ +// #sql [context] { UPDATE ITEMTYPE SET NAME = :name, DESCRIPTION = :description, ISSTATIC = :isStatic WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemTypeDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setString(3, isStatic); + __sJT_stmt.setLong(4, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:111^117*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + ItemType obj = (ItemType) entity; + String name = obj.getName(); + String description = obj.getDescription(); + String isStatic = obj.getIsStatic() ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:121^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO ITEMTYPE (NAME, DESCRIPTION, ISSTATIC) VALUES (:name, :description, :isStatic) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ItemTypeDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setString(3, isStatic); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:121^110*/ + } + + public ItemType get(String filterName) { + manager.traceIn(); + ItemType result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, filterName); + result = (ItemType) getEntity(context, iter); + } catch (Exception e) { + logger.error(e.getMessage()); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } + +}/*@lineinfo:generated-code*/class ItemTypeDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static ItemTypeDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.ItemTypeDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new ItemTypeDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private ItemTypeDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.ItemTypeDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemTypeDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemTypeDAO_SJProfile0.ser new file mode 100644 index 00000000..34801f22 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ItemTypeDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobDAO.java new file mode 100644 index 00000000..4fc164cd --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobDAO.java @@ -0,0 +1,402 @@ +/*@lineinfo:filename=JobDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.Job; +import user.commons.JobStatus; +import java.sql.Timestamp; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.ResultSet; +import java.util.List; +import java.util.ArrayList; +import java.io.ByteArrayOutputStream; +import java.io.ObjectOutputStream; + + +@SuppressWarnings("unused") +class JobDAO extends EntityBaseDAO { + private ItemManager manager; + + public JobDAO(ItemManager manager) { + super(manager); + this.manager = manager; + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + JobIter iterator = (JobIter) iter; + while (iterator.next()) { + Job entity = new Job(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setOwner(iterator.owner()); + entity.setPriority(iterator.priority()); + entity.setProgress(iterator.progress()); + entity.setStatus(JobStatus.valueOf(iterator.status())); + entity.setDescription(iterator.description()); + entity.setSubmitted(iterator.submitted()); + entity.setFinished(iterator.finished()); + entity.setTemplate(iterator.template()); + entity.setScheduledTime(iterator.scheduledTime()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + public List entities(DefaultContext context, ResultSet rs) throws SQLException { + JobIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:55^2*/ + +// ************************************************************ +// #sql [context] iter = { CAST :rs }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setObject(2, rs); + __sJT_execCtx.executeUpdate(); + iter = ((JobIter)(__sJT_stmt.getObject(1, JobIter.class))); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:55^35*/ + return entities(context, iter, false); + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + JobIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:62^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME FROM JOB WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new JobIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:62^160*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + JobIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:69^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME FROM JOB }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new JobIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:69^145*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:75^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM JOB WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:75^50*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:80^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE JOB DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:80^84*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Job obj = (Job) entity; + long id = obj.getId(); + String name = obj.getName(); + String owner = obj.getOwner(); + int priority = obj.getPriority(); + int progress = obj.getProgress(); + String status = obj.getStatus().toString(); + String description = obj.getDescription(); + Timestamp submitted = obj.getSubmitted(); + Timestamp finished = obj.getFinished(); + String template = obj.getTemplate(); + Timestamp scheduledTime = obj.getScheduledTime(); + + /*@lineinfo:generated-code*//*@lineinfo:98^2*/ + +// ************************************************************ +// #sql [context] { UPDATE JOB SET NAME = :name, OWNER = :owner, PRIORITY = :priority, PROGRESS = :progress, STATUS = :status, DESCRIPTION = :description, SUBMITTED = :submitted, FINISHED = :finished, TEMPLATE = :template, SCHEDULEDTIME = :scheduledTime WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, owner); + __sJT_stmt.setInt(3, priority); + __sJT_stmt.setInt(4, progress); + __sJT_stmt.setString(5, status); + __sJT_stmt.setString(6, description); + __sJT_stmt.setTimestamp(7, submitted); + __sJT_stmt.setTimestamp(8, finished); + __sJT_stmt.setString(9, template); + __sJT_stmt.setTimestamp(10, scheduledTime); + __sJT_stmt.setLong(11, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:98^268*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Job obj = (Job) entity; + String name = obj.getName(); + String owner = obj.getOwner(); + int priority = obj.getPriority(); + int progress = obj.getProgress(); + String status = obj.getStatus().toString(); + String description = obj.getDescription(); + Timestamp submitted = obj.getSubmitted(); + Timestamp finished = obj.getFinished(); + String template = obj.getTemplate(); + Timestamp scheduledTime = obj.getScheduledTime(); + + /*@lineinfo:generated-code*//*@lineinfo:115^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO JOB (NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME) +// VALUES (:name, :owner, :priority, :progress, :status, :description, :submitted, :finished, :template, :scheduledTime) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, owner); + __sJT_stmt.setInt(3, priority); + __sJT_stmt.setInt(4, progress); + __sJT_stmt.setString(5, status); + __sJT_stmt.setString(6, description); + __sJT_stmt.setTimestamp(7, submitted); + __sJT_stmt.setTimestamp(8, finished); + __sJT_stmt.setString(9, template); + __sJT_stmt.setTimestamp(10, scheduledTime); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:116^120*/ + } + + public List getAllIncomplete(String template) { + manager.traceIn(); + List result = null; + DefaultContext context = manager.getDbContext(); + try { + JobIter iter = null; + //ResultSetIterImpl iter = null; + /*@lineinfo:generated-code*//*@lineinfo:126^3*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME +// FROM JOB WHERE TEMPLATE = :template +// AND STATUS IN ('EXECUTING', 'WAIT_EXECUTOR', 'WAIT_SUSPEND', 'SUSPENDED', 'RUNABLE') }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, template); + iter = new JobIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:128^93*/ + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +}/*@lineinfo:generated-code*/class JobDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static JobDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.JobDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new JobDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private JobDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.JobDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobDAO_SJProfile0.ser new file mode 100644 index 00000000..08c8fa81 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobIter.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobIter.java new file mode 100644 index 00000000..9763f105 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobIter.java @@ -0,0 +1,118 @@ +/*@lineinfo:filename=JobIter*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import java.sql.Timestamp; + +/*@lineinfo:generated-code*//*@lineinfo:5^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +public class JobIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int scheduledTimeNdx; + private int templateNdx; + private int finishedNdx; + private int submittedNdx; + private int descriptionNdx; + private int statusNdx; + private int progressNdx; + private int priorityNdx; + private int ownerNdx; + private int nameNdx; + private int idNdx; + public JobIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + ownerNdx = findColumn("owner"); + priorityNdx = findColumn("priority"); + progressNdx = findColumn("progress"); + statusNdx = findColumn("status"); + descriptionNdx = findColumn("description"); + submittedNdx = findColumn("submitted"); + finishedNdx = findColumn("finished"); + templateNdx = findColumn("template"); + scheduledTimeNdx = findColumn("scheduledTime"); + } + public JobIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + ownerNdx = findColumn("owner"); + priorityNdx = findColumn("priority"); + progressNdx = findColumn("progress"); + statusNdx = findColumn("status"); + descriptionNdx = findColumn("description"); + submittedNdx = findColumn("submitted"); + finishedNdx = findColumn("finished"); + templateNdx = findColumn("template"); + scheduledTimeNdx = findColumn("scheduledTime"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String owner() + throws java.sql.SQLException + { + return resultSet.getString(ownerNdx); + } + public int priority() + throws java.sql.SQLException + { + return resultSet.getIntNoNull(priorityNdx); + } + public int progress() + throws java.sql.SQLException + { + return resultSet.getIntNoNull(progressNdx); + } + public String status() + throws java.sql.SQLException + { + return resultSet.getString(statusNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public Timestamp submitted() + throws java.sql.SQLException + { + return resultSet.getTimestamp(submittedNdx); + } + public Timestamp finished() + throws java.sql.SQLException + { + return resultSet.getTimestamp(finishedNdx); + } + public String template() + throws java.sql.SQLException + { + return resultSet.getString(templateNdx); + } + public Timestamp scheduledTime() + throws java.sql.SQLException + { + return resultSet.getTimestamp(scheduledTimeNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:5^209*//*@lineinfo:generated-code*/ \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobParametersDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobParametersDAO.java new file mode 100644 index 00000000..c651dd94 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobParametersDAO.java @@ -0,0 +1,312 @@ +/*@lineinfo:filename=JobParametersDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.Job; +import user.commons.JobStatus; +import java.sql.Timestamp; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.ResultSet; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:15^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class JobParametersIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int dataNdx; + private int idNdx; + public JobParametersIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + dataNdx = findColumn("data"); + } + public JobParametersIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + dataNdx = findColumn("data"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public byte[] data() + throws java.sql.SQLException + { + return resultSet.getBytes(dataNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:15^52*/ + +@SuppressWarnings("unused") +class JobParametersDAO extends EntityBaseDAO { + + public JobParametersDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + JobParametersIter iterator = (JobParametersIter) iter; + while (iterator.next()) { + JobParameters entity = new JobParameters(); + entity.setId(iterator.id()); + entity.setData(iterator.data()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + JobParametersIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:43^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DATA FROM JOBPARAMETERS WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobParametersDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new JobParametersIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:43^76*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + JobParametersIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:50^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DATA FROM JOBPARAMETERS }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobParametersDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new JobParametersIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:50^61*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:56^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM JOBPARAMETERS WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobParametersDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:56^60*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:61^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE JOBPARAMETERS DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobParametersDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:61^94*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + JobParameters obj = (JobParameters) entity; + long id = obj.getId(); + byte[] data = obj.getData(); + + /*@lineinfo:generated-code*//*@lineinfo:70^2*/ + +// ************************************************************ +// #sql [context] { UPDATE JOBPARAMETERS DATA = :data WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobParametersDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setBytes(1, data); + __sJT_stmt.setLong(2, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:70^68*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + JobParameters obj = (JobParameters) entity; + long id = obj.getId(); + byte[] data = obj.getData(); + + /*@lineinfo:generated-code*//*@lineinfo:79^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO JOBPARAMETERS (ID, DATA) VALUES (:id, :data) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, JobParametersDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, id); + __sJT_stmt.setBytes(2, data); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:79^76*/ + } +}/*@lineinfo:generated-code*/class JobParametersDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static JobParametersDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.JobParametersDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new JobParametersDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private JobParametersDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.JobParametersDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobParametersDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobParametersDAO_SJProfile0.ser new file mode 100644 index 00000000..121a755e Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/JobParametersDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO.java new file mode 100644 index 00000000..ba6c52aa --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO.java @@ -0,0 +1,169 @@ +/*@lineinfo:filename=MasterIdDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:11^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MasterIdIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int createdNdx; + private int idNdx; + public MasterIdIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + createdNdx = findColumn("created"); + } + public MasterIdIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + createdNdx = findColumn("created"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:11^53*/ + +@SuppressWarnings("unused") +class MasterIdDAO extends EntityBaseDAO { + + public MasterIdDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ShotIter iterator = (ShotIter) iter; + while (iterator.next()) { + MasterId entity = new MasterId(); + entity.setId(iterator.id()); + entity.setCreated(iterator.created()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MasterId obj = (MasterId) entity; + obj.setCreated(new Timestamp(new Date().getTime())); + Timestamp created = obj.getCreated(); + + /*@lineinfo:generated-code*//*@lineinfo:44^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO MASTERID (CREATED) VALUES (:created) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MasterIdDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setTimestamp(1, created); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:44^68*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:49^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE MASTERID DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MasterIdDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:49^89*/ + } +}/*@lineinfo:generated-code*/class MasterIdDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MasterIdDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MasterIdDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MasterIdDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MasterIdDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MasterIdDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO_SJProfile0.ser new file mode 100644 index 00000000..e84d790b Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MasterIdDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaDAO.java new file mode 100644 index 00000000..8c38cf34 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaDAO.java @@ -0,0 +1,507 @@ +/*@lineinfo:filename=MediaDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.Timestamp; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MediaIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int posterNdx; + private int archivedNdx; + private int createdNdx; + private int lengthNdx; + private int houseIdNdx; + private int itemTypeIdNdx; + private int itemIdNdx; + private int descriptionNdx; + private int titleNdx; + private int idNdx; + public MediaIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + titleNdx = findColumn("title"); + descriptionNdx = findColumn("description"); + itemIdNdx = findColumn("itemId"); + itemTypeIdNdx = findColumn("itemTypeId"); + houseIdNdx = findColumn("houseId"); + lengthNdx = findColumn("length"); + createdNdx = findColumn("created"); + archivedNdx = findColumn("archived"); + posterNdx = findColumn("poster"); + } + public MediaIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + titleNdx = findColumn("title"); + descriptionNdx = findColumn("description"); + itemIdNdx = findColumn("itemId"); + itemTypeIdNdx = findColumn("itemTypeId"); + houseIdNdx = findColumn("houseId"); + lengthNdx = findColumn("length"); + createdNdx = findColumn("created"); + archivedNdx = findColumn("archived"); + posterNdx = findColumn("poster"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String title() + throws java.sql.SQLException + { + return resultSet.getString(titleNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public long itemId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(itemIdNdx); + } + public long itemTypeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(itemTypeIdNdx); + } + public String houseId() + throws java.sql.SQLException + { + return resultSet.getString(houseIdNdx); + } + public long length() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(lengthNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public Timestamp archived() + throws java.sql.SQLException + { + return resultSet.getTimestamp(archivedNdx); + } + public byte[] poster() + throws java.sql.SQLException + { + return resultSet.getBytes(posterNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^178*/ + +@SuppressWarnings("unused") +class MediaDAO extends EntityBaseDAO { + + public MediaDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void beforeAdd(DefaultContext context, IEntityBase entity) throws SQLException { + long id = manager.getMasterId(context); + entity.setId(id); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + Media media = (Media) entity; + if (!media.getIsPartialEnabled()) { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.add(context, entity); + } + MediaFileDAO daoMf = (MediaFileDAO) manager.getBaseDAO(MediaFile.class); + daoMf.addAll(context, entity); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.modify(context, entity); + } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.remove(context, entity); + MediaFileDAO daoMf = (MediaFileDAO) manager.getBaseDAO(MediaFile.class); + daoMf.removeAll(context, entity.getId()); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MediaIter iterator = (MediaIter) iter; + while (iterator.next()) { + Media entity = new Media(); + entity.setId(iterator.id()); + entity.setTitle(iterator.title()); + entity.setDescription(iterator.description()); + entity.setItemId(iterator.itemId()); + entity.setItemTypeId(iterator.itemTypeId()); + entity.setHouseId(iterator.houseId()); + entity.setLength(iterator.length()); + entity.setCreated(iterator.created()); + entity.setArchived(iterator.archived()); + entity.setPoster(iterator.poster()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MediaIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:78^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, CREATED, ARCHIVED, POSTER FROM MEDIA WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new MediaIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:78^146*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + MediaIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:85^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, CREATED, ARCHIVED, POSTER FROM MEDIA WHERE ITEMID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new MediaIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:85^150*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MediaIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:92^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, CREATED, ARCHIVED, POSTER FROM MEDIA }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new MediaIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:92^131*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:98^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM MEDIA WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:98^52*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:103^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE MEDIA DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:103^86*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Media obj = (Media) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemId = obj.getItemId(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + long length = obj.getLength(); + byte[] poster = obj.getPoster(); + Timestamp archived = obj.getArchived(); + + /*@lineinfo:generated-code*//*@lineinfo:119^2*/ + +// ************************************************************ +// #sql [context] { UPDATE MEDIA SET TITLE = :title, DESCRIPTION = :description, ITEMID = :itemId, ITEMTYPEID = :itemTypeId, HOUSEID = :houseId, LENGTH = :length, POSTER = :poster, ARCHIVED = :archived WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, title); + __sJT_stmt.setString(2, description); + __sJT_stmt.setLong(3, itemId); + __sJT_stmt.setLong(4, itemTypeId); + __sJT_stmt.setString(5, houseId); + __sJT_stmt.setLong(6, length); + __sJT_stmt.setBytes(7, poster); + __sJT_stmt.setTimestamp(8, archived); + __sJT_stmt.setLong(9, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:119^216*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Media obj = (Media) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemId = obj.getItemId(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + long length = obj.getLength(); + byte[] poster = obj.getPoster(); + Timestamp archived = obj.getArchived(); + + /*@lineinfo:generated-code*//*@lineinfo:135^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO MEDIA (ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, POSTER, ARCHIVED) VALUES (:id, :title, :description, :itemId, :itemTypeId, :houseId, :length, :poster, :archived) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setLong(1, id); + __sJT_stmt.setString(2, title); + __sJT_stmt.setString(3, description); + __sJT_stmt.setLong(4, itemId); + __sJT_stmt.setLong(5, itemTypeId); + __sJT_stmt.setString(6, houseId); + __sJT_stmt.setLong(7, length); + __sJT_stmt.setBytes(8, poster); + __sJT_stmt.setTimestamp(9, archived); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:135^213*/ + } + + /** + * Besz\ufffdrja az Item objektumhoz kapcsol\ufffdd\ufffd statikus/dinamikus Media adatokat. + */ + void addAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Item item = (Item) entity; + if (item != null) { + long itemId = item.getId(); + List medias = item.getMedias(); + if (medias != null) { + for (Media m: medias) { + m.setItemId(itemId); + add(context, m); + } + } + } + manager.traceOut(); + } + + void removeAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Item item = (Item) entity; + if (item != null) { + List medias = item.getMedias(); + if (medias != null) { + for (Media media: medias) + remove(context, media); + } + } + manager.traceOut(); + } + +}/*@lineinfo:generated-code*/class MediaDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MediaDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MediaDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MediaDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MediaDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MediaDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaDAO_SJProfile0.ser new file mode 100644 index 00000000..ea938a1c Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaFileDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaFileDAO.java new file mode 100644 index 00000000..515f10d4 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaFileDAO.java @@ -0,0 +1,442 @@ +/*@lineinfo:filename=MediaFileDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MediaFileIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int fileStructInfoNdx; + private int relativePathNdx; + private int fileTypeIdNdx; + private int storeIdNdx; + private int mediaIdNdx; + private int idNdx; + public MediaFileIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + mediaIdNdx = findColumn("mediaId"); + storeIdNdx = findColumn("storeId"); + fileTypeIdNdx = findColumn("fileTypeId"); + relativePathNdx = findColumn("relativePath"); + fileStructInfoNdx = findColumn("fileStructInfo"); + } + public MediaFileIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + mediaIdNdx = findColumn("mediaId"); + storeIdNdx = findColumn("storeId"); + fileTypeIdNdx = findColumn("fileTypeId"); + relativePathNdx = findColumn("relativePath"); + fileStructInfoNdx = findColumn("fileStructInfo"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long mediaId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(mediaIdNdx); + } + public long storeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(storeIdNdx); + } + public long fileTypeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(fileTypeIdNdx); + } + public String relativePath() + throws java.sql.SQLException + { + return resultSet.getString(relativePathNdx); + } + public String fileStructInfo() + throws java.sql.SQLException + { + return resultSet.getString(fileStructInfoNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^124*/ + +@SuppressWarnings("unused") +public class MediaFileDAO extends EntityBaseDAO { + + public MediaFileDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MediaFileIter iterator = (MediaFileIter) iter; + while (iterator.next()) { + MediaFile entity = new MediaFile(); + entity.setId(iterator.id()); + entity.setMediaId(iterator.mediaId()); + entity.setStoreId(iterator.storeId()); + entity.setFileTypeId(iterator.fileTypeId()); + entity.setRelativePath(iterator.relativePath()); + entity.setFileStructInfo(iterator.fileStructInfo()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MediaFileIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:42^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO FROM MEDIAFILE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new MediaFileIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:42^126*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + MediaFileIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:49^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO FROM MEDIAFILE WHERE MEDIAID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new MediaFileIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:49^131*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MediaFileIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:56^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO FROM MEDIAFILE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new MediaFileIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:56^111*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:62^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM MEDIAFILE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:62^56*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:67^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE MEDIAFILE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:67^90*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + MediaFile obj = (MediaFile) entity; + long id = obj.getId(); + long mediaId = obj.getMediaId(); + long storeId = obj.getStoreId(); + long fileTypeId = obj.getFileTypeId(); + String relativePath = obj.getRelativePath(); + String fileStructInfo = obj.getFileStructInfo(); + + /*@lineinfo:generated-code*//*@lineinfo:80^2*/ + +// ************************************************************ +// #sql [context] { UPDATE MEDIAFILE SET MEDIAID = :mediaId, STOREID = :storeId, FILETYPEID = :fileTypeId, RELATIVEPATH = :relativePath, FILESTRUCTINFO = :fileStructInfo WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, mediaId); + __sJT_stmt.setLong(2, storeId); + __sJT_stmt.setLong(3, fileTypeId); + __sJT_stmt.setString(4, relativePath); + __sJT_stmt.setString(5, fileStructInfo); + __sJT_stmt.setLong(6, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:80^184*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MediaFile obj = (MediaFile) entity; + long mediaId = obj.getMediaId(); + long storeId = obj.getStoreId(); + long fileTypeId = obj.getFileTypeId(); + String relativePath = obj.getRelativePath(); + String fileStructInfo = obj.getFileStructInfo(); + + /*@lineinfo:generated-code*//*@lineinfo:92^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO MEDIAFILE (MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO) VALUES (:mediaId, :storeId, :fileTypeId, :relativePath, :fileStructInfo) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setLong(1, mediaId); + __sJT_stmt.setLong(2, storeId); + __sJT_stmt.setLong(3, fileTypeId); + __sJT_stmt.setString(4, relativePath); + __sJT_stmt.setString(5, fileStructInfo); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:92^175*/ + } + + void addAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Media media = (Media) entity; + if (media != null) { + List mediaFiles = media.getMediaFiles(); + if (mediaFiles != null) { + for (MediaFile mf: mediaFiles) { + long mediaId = media.getId(); + mf.setMediaId(mediaId); + add(context, mf); + } + } + } + manager.traceOut(); + } + + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + /*@lineinfo:generated-code*//*@lineinfo:113^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM MEDIAFILE WHERE MEDIAID = :filterId }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MediaFileDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setLong(1, filterId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:113^67*/ + manager.traceOut(); + } +}/*@lineinfo:generated-code*/class MediaFileDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MediaFileDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MediaFileDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MediaFileDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MediaFileDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MediaFileDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaFileDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaFileDAO_SJProfile0.ser new file mode 100644 index 00000000..4b652a8a Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MediaFileDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO.java new file mode 100644 index 00000000..3dc91a08 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO.java @@ -0,0 +1,906 @@ +/*@lineinfo:filename=MetadataDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.jobengine.db.ItemManagerData.SignalType; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:12^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MetadataIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int metadataElementIdNdx; + private int itemTypeIdNdx; + private int parameterNdx; + private int staticTableNdx; + private int sqlFieldNdx; + private int pojoFieldNdx; + private int listTypeNdx; + private int guiTypeNdx; + private int isSearchableNdx; + private int isGeneratedNdx; + private int isListableNdx; + private int isEditableNdx; + private int isDbNullableNdx; + private int isDbUniqueNdx; + private int isDbIndexNdx; + private int idNdx; + public MetadataIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + isDbIndexNdx = findColumn("isDbIndex"); + isDbUniqueNdx = findColumn("isDbUnique"); + isDbNullableNdx = findColumn("isDbNullable"); + isEditableNdx = findColumn("isEditable"); + isListableNdx = findColumn("isListable"); + isGeneratedNdx = findColumn("isGenerated"); + isSearchableNdx = findColumn("isSearchable"); + guiTypeNdx = findColumn("guiType"); + listTypeNdx = findColumn("listType"); + pojoFieldNdx = findColumn("pojoField"); + sqlFieldNdx = findColumn("sqlField"); + staticTableNdx = findColumn("staticTable"); + parameterNdx = findColumn("parameter"); + itemTypeIdNdx = findColumn("itemTypeId"); + metadataElementIdNdx = findColumn("metadataElementId"); + } + public MetadataIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + isDbIndexNdx = findColumn("isDbIndex"); + isDbUniqueNdx = findColumn("isDbUnique"); + isDbNullableNdx = findColumn("isDbNullable"); + isEditableNdx = findColumn("isEditable"); + isListableNdx = findColumn("isListable"); + isGeneratedNdx = findColumn("isGenerated"); + isSearchableNdx = findColumn("isSearchable"); + guiTypeNdx = findColumn("guiType"); + listTypeNdx = findColumn("listType"); + pojoFieldNdx = findColumn("pojoField"); + sqlFieldNdx = findColumn("sqlField"); + staticTableNdx = findColumn("staticTable"); + parameterNdx = findColumn("parameter"); + itemTypeIdNdx = findColumn("itemTypeId"); + metadataElementIdNdx = findColumn("metadataElementId"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String isDbIndex() + throws java.sql.SQLException + { + return resultSet.getString(isDbIndexNdx); + } + public String isDbUnique() + throws java.sql.SQLException + { + return resultSet.getString(isDbUniqueNdx); + } + public String isDbNullable() + throws java.sql.SQLException + { + return resultSet.getString(isDbNullableNdx); + } + public String isEditable() + throws java.sql.SQLException + { + return resultSet.getString(isEditableNdx); + } + public String isListable() + throws java.sql.SQLException + { + return resultSet.getString(isListableNdx); + } + public String isGenerated() + throws java.sql.SQLException + { + return resultSet.getString(isGeneratedNdx); + } + public String isSearchable() + throws java.sql.SQLException + { + return resultSet.getString(isSearchableNdx); + } + public String guiType() + throws java.sql.SQLException + { + return resultSet.getString(guiTypeNdx); + } + public String listType() + throws java.sql.SQLException + { + return resultSet.getString(listTypeNdx); + } + public String pojoField() + throws java.sql.SQLException + { + return resultSet.getString(pojoFieldNdx); + } + public String sqlField() + throws java.sql.SQLException + { + return resultSet.getString(sqlFieldNdx); + } + public String staticTable() + throws java.sql.SQLException + { + return resultSet.getString(staticTableNdx); + } + public String parameter() + throws java.sql.SQLException + { + return resultSet.getString(parameterNdx); + } + public long itemTypeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(itemTypeIdNdx); + } + public long metadataElementId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(metadataElementIdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:12^318*/ + +@SuppressWarnings("unused") +class MetadataDAO extends EntityBaseDAO { + + public MetadataDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) + createTable(context.getConnection(), entity); + manager.notifyItemTypeChange(entity, SignalType.CREATE); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) { + dropTable(context.getConnection(), entity); + createTable(context.getConnection(), entity); + } + manager.notifyItemTypeChange(entity, SignalType.UPDATE); + } + + @Override + protected void afterDelete(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) + dropTable(context.getConnection(), entity); + manager.notifyItemTypeChange(entity, SignalType.DELETE); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MetadataIter iterator = (MetadataIter) iter; + while (iterator.next()) { + Metadata entity = new Metadata(); + entity.setId(iterator.id()); + entity.setIsDbIndex(iterator.isDbIndex().equals("Y") ? true : false); + entity.setIsDbUnique(iterator.isDbUnique().equals("Y") ? true : false); + entity.setIsDbNullable(iterator.isDbNullable().equals("Y") ? true : false); + entity.setIsEditable(iterator.isEditable().equals("Y") ? true : false); + entity.setIsListable(iterator.isListable().equals("Y") ? true : false); + entity.setIsGenerated(iterator.isGenerated().equals("Y") ? true : false); + entity.setIsSearchable(iterator.isSearchable().equals("Y") ? true : false); + entity.setGuiType(ItemManagerData.toGuiType(iterator.guiType())); + entity.setListType(ItemManagerData.toListType(iterator.listType())); + entity.setPojoField(iterator.pojoField()); + entity.setSqlField(iterator.sqlField()); + entity.setStaticTable(ItemManagerData.toStaticTable(iterator.staticTable())); + entity.setParameter(iterator.parameter()); + entity.setItemTypeId(iterator.itemTypeId()); + entity.setMetadataElementId(iterator.metadataElementId()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:81^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:81^248*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:88^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE,GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE ITEMTYPEID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:88^255*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:95^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:95^233*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:101^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM METADATA WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:101^55*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:106^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE METADATA DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:106^89*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Metadata obj = (Metadata) entity; + long id = obj.getId(); + String isDbIndex = obj.getIsDbIndex() == true ? "Y" : "N"; + String isDbUnique = obj.getIsDbUnique() == true ? "Y" : "N"; + String isDbNullable = obj.getIsDbNullable() == true ? "Y" : "N"; + String isEditable = obj.getIsEditable() == true ? "Y" : "N"; + String isListable = obj.getIsListable() == true ? "Y" : "N"; + String isGenerated = obj.getIsGenerated() == true ? "Y" : "N"; + String isSearchable = obj.getIsSearchable() == true ? "Y" : "N"; + String guiType = obj.getGuiType().toString(); + String listType = obj.getListType().toString(); + String pojoField = obj.getPojoField(); + String sqlField = obj.getSqlField(); + String staticTable = obj.getStaticTable() == null ? null : obj.getStaticTable().toString(); + String parameter = obj.getParameter(); + long itemTypeId = obj.getItemTypeId(); + long metadataElementId = obj.getMetadataElementId(); + + /*@lineinfo:generated-code*//*@lineinfo:129^2*/ + +// ************************************************************ +// #sql [context] { UPDATE METADATA SET ISDBINDEX = :isDbIndex, ISDBUNIQUE = :isDbUnique, ISDBNULLABLE = :isDbNullable, ISEDITABLE = :isEditable, ISLISTABLE = :isListable, ISGENERATED = :isGenerated, ISSEARCHABLE = :isSearchable, GUITYPE = :guiType, LISTTYPE = :listType, POJOFIELD = :pojoField, SQLFIELD = :sqlField, STATICTABLE = :staticTable, PARAMETER = :parameter, ITEMTYPEID = :itemTypeId, METADATAELEMENTID = :metadataElementId WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, isDbIndex); + __sJT_stmt.setString(2, isDbUnique); + __sJT_stmt.setString(3, isDbNullable); + __sJT_stmt.setString(4, isEditable); + __sJT_stmt.setString(5, isListable); + __sJT_stmt.setString(6, isGenerated); + __sJT_stmt.setString(7, isSearchable); + __sJT_stmt.setString(8, guiType); + __sJT_stmt.setString(9, listType); + __sJT_stmt.setString(10, pojoField); + __sJT_stmt.setString(11, sqlField); + __sJT_stmt.setString(12, staticTable); + __sJT_stmt.setString(13, parameter); + __sJT_stmt.setLong(14, itemTypeId); + __sJT_stmt.setLong(15, metadataElementId); + __sJT_stmt.setLong(16, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:129^449*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Metadata obj = (Metadata) entity; + String isDbIndex = obj.getIsDbIndex() == true ? "Y" : "N"; + String isDbUnique = obj.getIsDbUnique() == true ? "Y" : "N"; + String isDbNullable = obj.getIsDbNullable() == true ? "Y" : "N"; + String isEditable = obj.getIsEditable() == true ? "Y" : "N"; + String isListable = obj.getIsListable() == true ? "Y" : "N"; + String isGenerated = obj.getIsGenerated() == true ? "Y" : "N"; + String isSearchable = obj.getIsSearchable() == true ? "Y" : "N"; + String guiType = obj.getGuiType().toString(); + String listType = obj.getListType().toString(); + String pojoField = obj.getPojoField(); + String sqlField = obj.getSqlField(); + String staticTable = obj.getStaticTable() == null ? null : obj.getStaticTable().toString(); + String parameter = obj.getParameter(); + long itemTypeId = obj.getItemTypeId(); + long metadataElementId = obj.getMetadataElementId(); + + /*@lineinfo:generated-code*//*@lineinfo:151^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO METADATA (ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID) +// VALUES (:isDbIndex, :isDbUnique, :isDbNullable, :isEditable, :isListable, :isGenerated, :isSearchable, :guiType, :listType, :pojoField, :sqlField, :staticTable, :parameter, :itemTypeId, :metadataElementId) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, isDbIndex); + __sJT_stmt.setString(2, isDbUnique); + __sJT_stmt.setString(3, isDbNullable); + __sJT_stmt.setString(4, isEditable); + __sJT_stmt.setString(5, isListable); + __sJT_stmt.setString(6, isGenerated); + __sJT_stmt.setString(7, isSearchable); + __sJT_stmt.setString(8, guiType); + __sJT_stmt.setString(9, listType); + __sJT_stmt.setString(10, pojoField); + __sJT_stmt.setString(11, sqlField); + __sJT_stmt.setString(12, staticTable); + __sJT_stmt.setString(13, parameter); + __sJT_stmt.setLong(14, itemTypeId); + __sJT_stmt.setLong(15, metadataElementId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:152^208*/ + } + + public IEntityBase get(String name) { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + IEntityBase entity = null; + try { + MetadataIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:161^3*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE NAME = :name }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, name); + iter = new MetadataIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:161^253*/ + List result = entities(context, iter, false); + if (result != null && result.size() == 1) + entity = result.get(0); + /*@lineinfo:generated-code*//*@lineinfo:165^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 8); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:165^27*/ + } catch (Exception e) { + logger.error(e.getMessage()); + try { + /*@lineinfo:generated-code*//*@lineinfo:169^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 9); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:169^30*/ + } catch(Exception e1) { + } + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + + /** + * Besz\ufffdrja az ItemType objektumhoz kapcsol\ufffdd\ufffd Metadata adatokat. + */ + void addAll(DefaultContext context, ItemType itemType) throws SQLException { + List metadatas = itemType.getMetadatas(); + if (metadatas != null) { + for (Metadata metadata: metadatas) { + metadata.setItemTypeId(itemType.getId()); + add(context, metadata); + } + } + } + + /** + * T\ufffdrli a param\ufffdterk\ufffdnt kapott ItemType azonos\ufffdt\ufffdhoz tartoz\ufffd Metadata bejegyz\ufffdseket. + */ + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + /*@lineinfo:generated-code*//*@lineinfo:197^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM METADATA WHERE ITEMTYPEID = :filterId }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataDAO_SJProfileKeys.getKey(0), 10); + try + { + __sJT_stmt.setLong(1, filterId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:197^69*/ + manager.traceOut(); + } + +// void addColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String create = metadata.getCreateSQL(); +// List commands = new ArrayList(); +// if (create != null) { +// commands.add("ALTER TABLE " + tableName + " ADD COLUMN " + create); +// String index = metadata.getIndexSQL(); +// if (index != null) +// commands.add(index); +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// } +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } +// +// void modifyColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String columnName = metadata.getColumnName(); +// List commands = new ArrayList(); +// commands.add("ALTER TABLE " + tableName + " DROP COLUMN " + columnName); +// String create = metadata.getCreateSQL(); +// if (create != null) { +// commands.add("ALTER TABLE " + tableName + " ADD COLUMN " + create); +// String index = metadata.getIndexSQL(); +// if (index != null) { +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// commands.add(index); +// } +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// } +// st = connection.createStatement(); +// for (String sql: commands) { +// System.out.println(sql); +// st.execute(sql); +// } +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } +// +// void removeColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String columnName = metadata.getColumnName(); +// List commands = new ArrayList(); +// commands.add("ALTER TABLE " + tableName + " DROP COLUMN " + columnName); +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } + +// void dropMetadataTable(Connection connection, ItemType itemType) throws SQLException { +// manager.traceIn(); +// String tableName = itemType.getTableName().toString(); +// Statement st = null; +// try { +// st = connection.createStatement(); +// st.execute("DROP TABLE " + tableName); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// manager.traceOut(); +// } +// +// void createMetadataTable(Connection connection, ItemType itemType) throws SQLException { +// manager.traceIn(); +// List commands = new ArrayList(); +// List indexes = new ArrayList(); +// String tableName = itemType.getTableName().toString(); +// StringBuilder sb = new StringBuilder(); +// sb.append("CREATE TABLE " + tableName + "("); +// sb.append("ID BIGINT NOT NULL PRIMARY KEY,"); +// sb.append("CONSTRAINT FK_" + tableName + "_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID)"); +// +// List metadatas = itemType.getMetadatas(); +// if (metadatas != null) { +// for (Metadata md : metadatas) { +// String create = md.getCreateSQL(); +// if (create != null) { +// sb.append(", "); +// sb.append(create); +// } +// String index = md.getIndexSQL(); +// if (index != null) +// indexes.add(index); +// } +// } +// sb.append(")"); +// commands.add(sb.toString()); +// commands.addAll(indexes); +// +// Statement st = null; +// try { +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// manager.traceOut(); +// } + + void createTable(Connection connection, IEntityBase entity) throws SQLException { + manager.traceIn(); + Statement st = null; + Metadata metadata = (Metadata) entity; + try { + String tableName = metadata.getTableName(); + String columnSql = metadata.getCreateSQL(); + String sql = String.format("CREATE TABLE %1$s (ID BIGINT NOT NULL PRIMARY KEY, %2$s, CONSTRAINT FK_%1$s_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID))", tableName, columnSql); + st = connection.createStatement(); + logger.debug(sql); + st.execute(sql); + String index = metadata.getIndexSQL(); + if (index != null) { + logger.debug(index); + st.execute(index); + } + } + catch (SQLException e) { + throw new SQLException(e); + } finally { + try{ + if (st != null) + st.close(); + } catch (Exception e1) { } + } + manager.traceOut(); + } + + void dropTable(Connection connection, IEntityBase entity) throws SQLException { + manager.traceIn(); + Metadata metadata = (Metadata) entity; + String tableName = metadata.getTableName(); + Statement st = null; + try { + st = connection.createStatement(); + String sql = "DROP TABLE " + tableName; + logger.debug(sql); + st.execute(sql); + } + catch (SQLException e) { + throw new SQLException(e); + } finally { + try{ + if (st != null) + st.close(); + } catch (Exception e1) { } + } + manager.traceOut(); + } +}/*@lineinfo:generated-code*/class MetadataDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MetadataDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MetadataDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MetadataDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MetadataDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MetadataDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO_SJProfile0.ser new file mode 100644 index 00000000..aeda1309 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataElementDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataElementDAO.java new file mode 100644 index 00000000..69ff5517 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataElementDAO.java @@ -0,0 +1,351 @@ +/*@lineinfo:filename=MetadataElementDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MetadataElementIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int domainCategoryIdNdx; + private int metadataTypeIdNdx; + private int descriptionNdx; + private int nameNdx; + private int idNdx; + public MetadataElementIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + metadataTypeIdNdx = findColumn("metadataTypeId"); + domainCategoryIdNdx = findColumn("domainCategoryId"); + } + public MetadataElementIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + metadataTypeIdNdx = findColumn("metadataTypeId"); + domainCategoryIdNdx = findColumn("domainCategoryId"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public long metadataTypeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(metadataTypeIdNdx); + } + public Long domainCategoryId() + throws java.sql.SQLException + { + return resultSet.getLongWrapper(domainCategoryIdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^118*/ + +@SuppressWarnings("unused") +class MetadataElementDAO extends EntityBaseDAO { + + public MetadataElementDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MetadataElementIter iterator = (MetadataElementIter) iter; + while (iterator.next()) { + + MetadataElement entity = new MetadataElement(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setMetadataTypeId(iterator.metadataTypeId()); + entity.setDomainCategoryId(iterator.domainCategoryId()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MetadataElementIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:42^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, METADATATYPEID, DOMAINCATEGORYID FROM METADATAELEMENT WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataElementDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new MetadataElementIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:42^125*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MetadataElementIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:54^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, METADATATYPEID, DOMAINCATEGORYID FROM METADATAELEMENT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataElementDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new MetadataElementIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:54^110*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:60^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM METADATAELEMENT WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataElementDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:60^62*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:65^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE METADATAELEMENT DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataElementDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:65^96*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataElement obj = (MetadataElement) entity; + long id = obj.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + long metadataTypeId = obj.getMetadataTypeId(); + Long DomainCategoryId = obj.getDomainCategoryId(); + + /*@lineinfo:generated-code*//*@lineinfo:77^2*/ + +// ************************************************************ +// #sql [context] { UPDATE METADATAELEMENT SET NAME = :name, DESCRIPTION = :description, METADATATYPEID = :metadataTypeId, DOMAINCATEGORYID = :DomainCategoryId WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataElementDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setLong(3, metadataTypeId); + __sJT_stmt.setLongWrapper(4, DomainCategoryId); + __sJT_stmt.setLong(5, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:77^174*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataElement obj = (MetadataElement) entity; + String name = obj.getName(); + String description = obj.getDescription(); + long metadataTypeId = obj.getMetadataTypeId(); + Long DomainCategoryId = obj.getDomainCategoryId(); + + /*@lineinfo:generated-code*//*@lineinfo:88^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO METADATAELEMENT (NAME, DESCRIPTION, METADATATYPEID, DOMAINCATEGORYID) VALUES (:name, :description, :metadataTypeId, :DomainCategoryId) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataElementDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setLong(3, metadataTypeId); + __sJT_stmt.setLongWrapper(4, DomainCategoryId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:88^166*/ + } + +}/*@lineinfo:generated-code*/class MetadataElementDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MetadataElementDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MetadataElementDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MetadataElementDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MetadataElementDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MetadataElementDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataElementDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataElementDAO_SJProfile0.ser new file mode 100644 index 00000000..30a8d013 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataElementDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataTypeDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataTypeDAO.java new file mode 100644 index 00000000..9adc7dce --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataTypeDAO.java @@ -0,0 +1,363 @@ +/*@lineinfo:filename=MetadataTypeDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class MetadataTypeIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int lengthNdx; + private int baseTypeNdx; + private int javaTypeNdx; + private int dataTypeNdx; + private int nameNdx; + private int idNdx; + public MetadataTypeIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + dataTypeNdx = findColumn("dataType"); + javaTypeNdx = findColumn("javaType"); + baseTypeNdx = findColumn("baseType"); + lengthNdx = findColumn("length"); + } + public MetadataTypeIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + dataTypeNdx = findColumn("dataType"); + javaTypeNdx = findColumn("javaType"); + baseTypeNdx = findColumn("baseType"); + lengthNdx = findColumn("length"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String dataType() + throws java.sql.SQLException + { + return resultSet.getString(dataTypeNdx); + } + public String javaType() + throws java.sql.SQLException + { + return resultSet.getString(javaTypeNdx); + } + public String baseType() + throws java.sql.SQLException + { + return resultSet.getString(baseTypeNdx); + } + public int length() + throws java.sql.SQLException + { + return resultSet.getIntNoNull(lengthNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^114*/ + +@SuppressWarnings("unused") +class MetadataTypeDAO extends EntityBaseDAO { + + public MetadataTypeDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MetadataTypeIter iterator = (MetadataTypeIter) iter; + while (iterator.next()) { + + MetadataType entity = new MetadataType(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDataType(iterator.dataType()); + entity.setJavaType(iterator.javaType()); + entity.setType(ItemManagerData.toBaseType(iterator.baseType()), iterator.length()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MetadataTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:42^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DATATYPE, BASETYPE, JAVATYPE, LENGTH FROM METADATATYPE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataTypeDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new MetadataTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:42^113*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MetadataTypeIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:54^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DATATYPE, BASETYPE, JAVATYPE, LENGTH FROM METADATATYPE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataTypeDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new MetadataTypeIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:54^98*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:60^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM METADATATYPE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataTypeDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:60^59*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:65^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE METADATATYPE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataTypeDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:65^93*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataType obj = (MetadataType) entity; + long id = obj.getId(); + String name = obj.getName(); + String dataType = obj.getDataType(); + String javaType = obj.getJavaType(); + String baseType = obj.getBaseType().toString(); + int length = obj.getLength(); + + /*@lineinfo:generated-code*//*@lineinfo:78^2*/ + +// ************************************************************ +// #sql [context] { UPDATE METADATATYPE SET NAME = :name, DATATYPE = :dataType, BASETYPE = :baseType, JAVATYPE = :javaType, LENGTH = :length WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataTypeDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, dataType); + __sJT_stmt.setString(3, baseType); + __sJT_stmt.setString(4, javaType); + __sJT_stmt.setInt(5, length); + __sJT_stmt.setLong(6, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:78^155*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataType obj = (MetadataType) entity; + String name = obj.getName(); + String dataType = obj.getDataType(); + String javaType = obj.getJavaType(); + String baseType = obj.getBaseType().toString(); + int length = obj.getLength(); + + /*@lineinfo:generated-code*//*@lineinfo:90^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO METADATATYPE (NAME, DATATYPE, BASETYPE, JAVATYPE, LENGTH) VALUES (:name, :dataType, :baseType, :javaType, :length) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, MetadataTypeDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, dataType); + __sJT_stmt.setString(3, baseType); + __sJT_stmt.setString(4, javaType); + __sJT_stmt.setInt(5, length); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:90^146*/ + } + +}/*@lineinfo:generated-code*/class MetadataTypeDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static MetadataTypeDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.MetadataTypeDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new MetadataTypeDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private MetadataTypeDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.MetadataTypeDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataTypeDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataTypeDAO_SJProfile0.ser new file mode 100644 index 00000000..fea5ad07 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/MetadataTypeDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/RemoteStoreDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/RemoteStoreDAO.java new file mode 100644 index 00000000..b561df7f --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/RemoteStoreDAO.java @@ -0,0 +1,372 @@ +/*@lineinfo:filename=RemoteStoreDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.remotestore.RemoteStore; +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class RemoteStoreIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int rootPathNdx; + private int passwordNdx; + private int userNameNdx; + private int uriNdx; + private int descriptionNdx; + private int nameNdx; + private int idNdx; + public RemoteStoreIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + uriNdx = findColumn("uri"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rootPathNdx = findColumn("rootPath"); + } + public RemoteStoreIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + descriptionNdx = findColumn("description"); + uriNdx = findColumn("uri"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rootPathNdx = findColumn("rootPath"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public String uri() + throws java.sql.SQLException + { + return resultSet.getString(uriNdx); + } + public String userName() + throws java.sql.SQLException + { + return resultSet.getString(userNameNdx); + } + public String password() + throws java.sql.SQLException + { + return resultSet.getString(passwordNdx); + } + public String rootPath() + throws java.sql.SQLException + { + return resultSet.getString(rootPathNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^133*/ + +@SuppressWarnings("unused") +public class RemoteStoreDAO extends EntityBaseDAO { + + public RemoteStoreDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + RemoteStoreIter iterator = (RemoteStoreIter) iter; + while (iterator.next()) { + RemoteStore entity = new RemoteStore(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setUri(iterator.uri()); + entity.setUserName(iterator.userName()); + entity.setPassword(iterator.password()); + entity.setRootPath(iterator.rootPath()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + RemoteStoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:44^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, URI, USERNAME, PASSWORD, ROOTPATH FROM REMOTESTORE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, RemoteStoreDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new RemoteStoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:44^122*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + RemoteStoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:51^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, URI, USERNAME, PASSWORD, ROOTPATH FROM REMOTESTORE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, RemoteStoreDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new RemoteStoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:51^107*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:57^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM REMOTESTORE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, RemoteStoreDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:57^58*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:62^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE REMOTESTORE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, RemoteStoreDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:62^92*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + RemoteStore obj = (RemoteStore) entity; + long id = obj.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + String uri = obj.getUri(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + + /*@lineinfo:generated-code*//*@lineinfo:76^2*/ + +// ************************************************************ +// #sql [context] { UPDATE REMOTESTORE SET NAME = :name, DESCRIPTION = :description, URI = :uri, USERNAME = :userName, PASSWORD = :password, ROOTPATH = :rootPath WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, RemoteStoreDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setString(3, uri); + __sJT_stmt.setString(4, userName); + __sJT_stmt.setString(5, password); + __sJT_stmt.setString(6, rootPath); + __sJT_stmt.setLong(7, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:76^176*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + RemoteStore obj = (RemoteStore) entity; + String name = obj.getName(); + String description = obj.getDescription(); + String uri = obj.getUri(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + + /*@lineinfo:generated-code*//*@lineinfo:89^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO REMOTESTORE (NAME, DESCRIPTION, URI, USERNAME, PASSWORD, ROOTPATH) VALUES (:name, :description, :uri, :userName, :password, :rootPath) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, RemoteStoreDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, description); + __sJT_stmt.setString(3, uri); + __sJT_stmt.setString(4, userName); + __sJT_stmt.setString(5, password); + __sJT_stmt.setString(6, rootPath); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:89^166*/ + } + +}/*@lineinfo:generated-code*/class RemoteStoreDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static RemoteStoreDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.RemoteStoreDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new RemoteStoreDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private RemoteStoreDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.RemoteStoreDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/RemoteStoreDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/RemoteStoreDAO_SJProfile0.ser new file mode 100644 index 00000000..0d11323f Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/RemoteStoreDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneContentDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneContentDAO.java new file mode 100644 index 00000000..c5d7c1e1 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneContentDAO.java @@ -0,0 +1,478 @@ +/*@lineinfo:filename=SceneContentDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:9^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class SceneContentIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int positionNdx; + private int shotIdNdx; + private int sceneIdNdx; + private int idNdx; + public SceneContentIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + sceneIdNdx = findColumn("sceneId"); + shotIdNdx = findColumn("shotId"); + positionNdx = findColumn("position"); + } + public SceneContentIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + sceneIdNdx = findColumn("sceneId"); + shotIdNdx = findColumn("shotId"); + positionNdx = findColumn("position"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long sceneId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(sceneIdNdx); + } + public long shotId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(shotIdNdx); + } + public long position() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(positionNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:9^80*/ + +@SuppressWarnings("unused") +public class SceneContentDAO extends EntityBaseDAO { + + public SceneContentDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + SceneContentIter iterator = (SceneContentIter) iter; + while (iterator.next()) { + SceneContent entity = new SceneContent(); + entity.setId(iterator.id()); + entity.setSceneId(iterator.sceneId()); + entity.setShotId(iterator.shotId()); + entity.setPosition(iterator.position()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + //TODO + void addAll(DefaultContext context, Scene scene) throws SQLException { + manager.traceIn(); + if (scene != null) + { + for (SceneContent sc: scene.getSceneContents()) { + sc.setSceneId(scene.getId()); + long sceneId = sc.getSceneId(); + long shotId = sc.getShotId(); + long position = sc.getPosition(); + long id = 0; + + /*@lineinfo:generated-code*//*@lineinfo:49^4*/ + +// ************************************************************ +// #sql [context] { INSERT INTO SCENECONTENT (SCENEID, SHOTID, POSITION) VALUES (:sceneId, :shotId, :position) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, sceneId); + __sJT_stmt.setLong(2, shotId); + __sJT_stmt.setLong(3, position); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:49^112*/ + /*@lineinfo:generated-code*//*@lineinfo:50^4*/ + +// ************************************************************ +// #sql [context] { SELECT IDENTITY_VAL_LOCAL() INTO :id, FROM SYSIBM.SYSDUMMY1 }; +// ************************************************************ + +{ + sqlj.runtime.profile.RTResultSet __sJT_rtRs; + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_rtRs = __sJT_execCtx.executeQuery(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } + try + { + sqlj.runtime.ref.ResultSetIterImpl.checkColumns(__sJT_rtRs, 1); + if (!__sJT_rtRs.next()) + { + sqlj.runtime.error.RuntimeRefErrors.raise_NO_ROW_SELECT_INTO(); + } + id = __sJT_rtRs.getLongNoNull(1); + if (__sJT_rtRs.next()) + { + sqlj.runtime.error.RuntimeRefErrors.raise_MULTI_ROW_SELECT_INTO(); + } + } + finally + { + __sJT_rtRs.close(); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:50^80*/ + + sc.setId(id); + } + } + manager.traceOut(); + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + SceneContentIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:61^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, SCENEID, SHOTID, POSITION FROM SCENECONTENT WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + iter = new SceneContentIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:61^95*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + SceneContentIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:68^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, SCENEID, SHOTID, POSITION FROM SCENECONTENT WHERE SCENEID = :id ORDER BY POSITION }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + iter = new SceneContentIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:68^118*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + SceneContentIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:75^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, SCENEID, SHOTID, POSITION FROM SCENECONTENT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 4); + try + { + iter = new SceneContentIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:75^80*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:81^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM SCENECONTENT WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:81^59*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:86^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE SCENECONTENT DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:86^93*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + SceneContent obj = (SceneContent) entity; + long id = obj.getId(); + long sceneId = obj.getSceneId(); + long shotId = obj.getShotId(); + long position = obj.getPosition(); + + /*@lineinfo:generated-code*//*@lineinfo:97^2*/ + +// ************************************************************ +// #sql [context] { UPDATE SCENECONTENT SET SCENEID = :sceneId, SHOTID = :shotId, POSITION = :position WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setLong(1, sceneId); + __sJT_stmt.setLong(2, shotId); + __sJT_stmt.setLong(3, position); + __sJT_stmt.setLong(4, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:97^117*/ + + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + SceneContent obj = (SceneContent) entity; + long sceneId = obj.getSceneId(); + long shotId = obj.getShotId(); + long position = obj.getPosition(); + + /*@lineinfo:generated-code*//*@lineinfo:108^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO SCENECONTENT (SCENEID, SHOTID, POSITION) VALUES (:sceneId, :shotId, :position) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneContentDAO_SJProfileKeys.getKey(0), 8); + try + { + __sJT_stmt.setLong(1, sceneId); + __sJT_stmt.setLong(2, shotId); + __sJT_stmt.setLong(3, position); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:108^110*/ + } + + public List getSceneContents(long id) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByForeignKey(context, id); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +}/*@lineinfo:generated-code*/class SceneContentDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static SceneContentDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.SceneContentDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new SceneContentDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private SceneContentDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.SceneContentDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneContentDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneContentDAO_SJProfile0.ser new file mode 100644 index 00000000..58ee6700 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneContentDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneDAO.java new file mode 100644 index 00000000..645712dc --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneDAO.java @@ -0,0 +1,513 @@ +/*@lineinfo:filename=SceneDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:13^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class SceneIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int createdNdx; + private int nameNdx; + private int idNdx; + public SceneIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + createdNdx = findColumn("created"); + } + public SceneIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + createdNdx = findColumn("created"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:13^63*/ + +@SuppressWarnings("unused") +public class SceneDAO extends EntityBaseDAO { + + public SceneDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + SceneIter iterator = (SceneIter) iter; + while (iterator.next()) { + Scene entity = new Scene(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); +// entity.setModified(iterator.modified()); + entity.setCreated(iterator.created()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String nameFilter) throws SQLException{ + SceneIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:42^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE WHERE (UPPER(NAME) LIKE :nameFilter) ORDER BY CREATED DESC }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setString(1, nameFilter); + iter = new SceneIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:42^120*/ + return iter; + } + + protected ResultSetIterImpl selectByModified(DefaultContext context) throws SQLException{ + SceneIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:48^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE ORDER BY CREATED DESC FETCH FIRST 5 ROWS ONLY }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new SceneIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:48^107*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + SceneIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:55^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + iter = new SceneIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:55^77*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + SceneIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:67^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 3); + try + { + iter = new SceneIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:67^62*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:73^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM SCENE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:73^52*/ + /*@lineinfo:generated-code*//*@lineinfo:74^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM SCENECONTENT WHERE SCENEID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:74^64*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:79^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE SCENE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:79^86*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Scene obj = (Scene) entity; + long id = obj.getId(); + String name = obj.getName(); + + /*@lineinfo:generated-code*//*@lineinfo:88^2*/ + +// ************************************************************ +// #sql [context] { UPDATE SCENE SET NAME = :name WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setLong(2, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:88^64*/ + + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Scene obj = (Scene) entity; + String name = obj.getName(); + + /*@lineinfo:generated-code*//*@lineinfo:97^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO SCENE (NAME) VALUES (:name) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SceneDAO_SJProfileKeys.getKey(0), 8); + try + { + __sJT_stmt.setString(1, name); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:97^59*/ + } + + //TODO + public List search(Timestamp dateFilter, String nameFilter) { + manager.traceIn(); + List result = new ArrayList(); + ResultSet rs = null; + PreparedStatement st = null; + DefaultContext context = manager.getDbContext(); + Connection connection = context.getConnection(); + try { + StringBuilder sb = new StringBuilder(); + + sb.append("SELECT ID, NAME, CREATED FROM SCENE "); + + String filter = ""; + if (dateFilter != null) { +// filter = String.format(" (CREATED > '%1$s' AND CREATED < '%2$s') ", +// ItemManagerData.toDateString(new Date(dateFilter.getTime()), 0, Calendar.DAY_OF_MONTH), +// ItemManagerData.toDateString(new Date(dateFilter.getTime()), 1, Calendar.DAY_OF_MONTH)); + } + if (nameFilter != null && nameFilter.length() > 2) { + if (filter.length() > 0) { + filter += "AND"; + } + filter += String.format(" (UPPER(NAME) LIKE UPPER('%1$s')) ", nameFilter + "%"); + } + if (filter.length() > 0) { + sb.append("WHERE"); + sb.append(filter); + } + + sb.append("ORDER BY NAME"); + st = connection.prepareStatement(sb.toString()); + + rs = st.executeQuery(); + while (rs.next()) { + Scene s = new Scene(); + s.setId(rs.getLong("ID")); + s.setName(rs.getString("NAME")); + s.setCreated(rs.getTimestamp("CREATED")); + s.setChunked(true); + result.add(s); + } + connection.commit(); + } catch (Exception e) { + try { + connection.rollback(); + } catch(Exception e1) { + } + throw new ItemManagerException(e.getMessage()); + } finally { + try{ + if (rs != null) + rs.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + try{ + if (st != null) + st.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } + + public List getFilteredEntities(String nameFilter, boolean isChunked){ + manager.traceIn(); + List result = new ArrayList(); + if (isChunked == true) { + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = null; + if (nameFilter != null) { + String filter = ("%" + nameFilter + "%").toUpperCase(); + iter = selectByName(context, filter); + } else { + iter = selectByModified(context); + } + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, isChunked); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + manager.traceOut(); + return result; + } +}/*@lineinfo:generated-code*/class SceneDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static SceneDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.SceneDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new SceneDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private SceneDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.SceneDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneDAO_SJProfile0.ser new file mode 100644 index 00000000..b719c375 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SceneDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/SearchDefinitionDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SearchDefinitionDAO.java new file mode 100644 index 00000000..2f54253d --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SearchDefinitionDAO.java @@ -0,0 +1,440 @@ +/*@lineinfo:filename=SearchDefinitionDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class SearchDefinitionIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int dataNdx; + private int modifiedNdx; + private int createdNdx; + private int nameNdx; + private int idNdx; + public SearchDefinitionIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + createdNdx = findColumn("created"); + modifiedNdx = findColumn("modified"); + dataNdx = findColumn("data"); + } + public SearchDefinitionIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + createdNdx = findColumn("created"); + modifiedNdx = findColumn("modified"); + dataNdx = findColumn("data"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public Timestamp modified() + throws java.sql.SQLException + { + return resultSet.getTimestamp(modifiedNdx); + } + public byte[] data() + throws java.sql.SQLException + { + return resultSet.getBytes(dataNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^107*/ + +@SuppressWarnings("unused") +public class SearchDefinitionDAO extends EntityBaseDAO { + + public SearchDefinitionDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + SearchDefinitionIter iterator = (SearchDefinitionIter) iter; + while (iterator.next()) { + SearchDefinition entity = new SearchDefinition(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setCreated(iterator.created()); + entity.setModified(iterator.modified()); + if(isChunked == false){ + entity.setData(iterator.data()); + } + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String nameFilter) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:43^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION WHERE (UPPER(NAME) LIKE :nameFilter) ORDER BY CREATED DESC }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setString(1, nameFilter); + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:43^147*/ + return iter; + } + + protected ResultSetIterImpl selectByModified(DefaultContext context) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:49^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION ORDER BY CREATED DESC FETCH FIRST 5 ROWS ONLY }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:49^134*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:56^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:56^104*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:63^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 3); + try + { + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:63^88*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:69^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM SEARCHDEFINITION WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:69^63*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:74^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE SEARCHDEFINITION DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:74^97*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + SearchDefinition obj = (SearchDefinition) entity; + long id = obj.getId(); + String name = obj.getName(); + Timestamp created = obj.getCreated(); + Timestamp modified = obj.getModified(); + byte[] data = obj.getData(); + + /*@lineinfo:generated-code*//*@lineinfo:86^2*/ + +// ************************************************************ +// #sql [context] { UPDATE SEARCHDEFINITION SET NAME = :name, CREATED = :created, MODIFIED = :modified, DATA = :data WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setTimestamp(2, created); + __sJT_stmt.setTimestamp(3, modified); + __sJT_stmt.setBytes(4, data); + __sJT_stmt.setLong(5, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:86^131*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + SearchDefinition obj = (SearchDefinition) entity; + String name = obj.getName(); + Timestamp created = obj.getCreated(); + Timestamp modified = obj.getModified(); + byte[] data = obj.getData(); + + /*@lineinfo:generated-code*//*@lineinfo:97^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO SEARCHDEFINITION (NAME, CREATED, MODIFIED, DATA) VALUES (:name, :created, :modified, :data) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setTimestamp(2, created); + __sJT_stmt.setTimestamp(3, modified); + __sJT_stmt.setBytes(4, data); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:97^123*/ + } + + public List getFilteredEntities(String nameFilter, boolean isChunked){ + manager.traceIn(); + List result = new ArrayList(); + if (isChunked == true) { + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = null; + if (nameFilter != null) { + String filter = ("%" + nameFilter + "%").toUpperCase(); + iter = selectByName(context, filter); + } else { + iter = selectByModified(context); + } + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, isChunked); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + manager.traceOut(); + return result; + } + +}/*@lineinfo:generated-code*/class SearchDefinitionDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static SearchDefinitionDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.SearchDefinitionDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new SearchDefinitionDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private SearchDefinitionDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.SearchDefinitionDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/SearchDefinitionDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SearchDefinitionDAO_SJProfile0.ser new file mode 100644 index 00000000..c6d41b40 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/SearchDefinitionDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ShotDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ShotDAO.java new file mode 100644 index 00000000..82203c59 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ShotDAO.java @@ -0,0 +1,417 @@ +/*@lineinfo:filename=ShotDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; +import java.util.ArrayList; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class ShotIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int thumbnailNdx; + private int createdNdx; + private int mediaIdNdx; + private int outPointNdx; + private int inPointNdx; + private int descriptionNdx; + private int idNdx; + public ShotIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + descriptionNdx = findColumn("description"); + inPointNdx = findColumn("inPoint"); + outPointNdx = findColumn("outPoint"); + mediaIdNdx = findColumn("mediaId"); + createdNdx = findColumn("created"); + thumbnailNdx = findColumn("thumbnail"); + } + public ShotIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + descriptionNdx = findColumn("description"); + inPointNdx = findColumn("inPoint"); + outPointNdx = findColumn("outPoint"); + mediaIdNdx = findColumn("mediaId"); + createdNdx = findColumn("created"); + thumbnailNdx = findColumn("thumbnail"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public long inPoint() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(inPointNdx); + } + public long outPoint() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(outPointNdx); + } + public long mediaId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(mediaIdNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public byte[] thumbnail() + throws java.sql.SQLException + { + return resultSet.getBytes(thumbnailNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^130*/ + +@SuppressWarnings("unused") +class ShotDAO extends EntityBaseDAO { + + public ShotDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ShotIter iterator = (ShotIter) iter; + while (iterator.next()) { + Shot entity = new Shot(); + entity.setId(iterator.id()); + entity.setDescription(iterator.description()); + entity.setInPoint(iterator.inPoint()); + entity.setOutPoint(iterator.outPoint()); + entity.setMediaId(iterator.mediaId()); + entity.setCreated(iterator.created()); + entity.setThumbnail(iterator.thumbnail()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + ShotIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:44^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, CREATED, THUMBNAIL FROM SHOT WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ShotDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new ShotIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:44^122*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + ShotIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:51^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, CREATED, THUMBNAIL FROM SHOT WHERE MEDIAID = :id ORDER BY INPOINT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ShotDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new ShotIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:51^144*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + ShotIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:58^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, CREATED, THUMBNAIL FROM SHOT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ShotDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new ShotIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:58^107*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:64^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM SHOT WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ShotDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:64^51*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:69^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE SHOT DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ShotDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:69^85*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Shot obj = (Shot) entity; + long id = obj.getId(); + String description = obj.getDescription(); + long inPoint = obj.getInPoint(); + long outPoint = obj.getOutPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + /*@lineinfo:generated-code*//*@lineinfo:82^2*/ + +// ************************************************************ +// #sql [context] { UPDATE SHOT SET DESCRIPTION = :description, INPOINT = :inPoint, OUTPOINT = :outPoint, MEDIAID = :mediaId, THUMBNAIL = :thumbnail WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ShotDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, description); + __sJT_stmt.setLong(2, inPoint); + __sJT_stmt.setLong(3, outPoint); + __sJT_stmt.setLong(4, mediaId); + __sJT_stmt.setBytes(5, thumbnail); + __sJT_stmt.setLong(6, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:82^163*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Shot obj = (Shot) entity; + String description = obj.getDescription(); + long inPoint = obj.getInPoint(); + long outPoint = obj.getOutPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + /*@lineinfo:generated-code*//*@lineinfo:94^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO SHOT (DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, THUMBNAIL) VALUES (:description, :inPoint, :outPoint, :mediaId, :thumbnail) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, ShotDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, description); + __sJT_stmt.setLong(2, inPoint); + __sJT_stmt.setLong(3, outPoint); + __sJT_stmt.setLong(4, mediaId); + __sJT_stmt.setBytes(5, thumbnail); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:94^154*/ + } + + public List getShots(long id) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByForeignKey(context, id); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +}/*@lineinfo:generated-code*/class ShotDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static ShotDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.ShotDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new ShotDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private ShotDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.ShotDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/ShotDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ShotDAO_SJProfile0.ser new file mode 100644 index 00000000..8d66ca82 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/ShotDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO.java new file mode 100644 index 00000000..d5e8ffb0 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO.java @@ -0,0 +1,448 @@ +/*@lineinfo:filename=StoreDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.StoreUri; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class StoreIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int isLowresNdx; + private int isSystemNdx; + private int nameNdx; + private int idNdx; + public StoreIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + isSystemNdx = findColumn("isSystem"); + isLowresNdx = findColumn("isLowres"); + } + public StoreIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + isSystemNdx = findColumn("isSystem"); + isLowresNdx = findColumn("isLowres"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public String isSystem() + throws java.sql.SQLException + { + return resultSet.getString(isSystemNdx); + } + public String isLowres() + throws java.sql.SQLException + { + return resultSet.getString(isLowresNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^78*/ + +@SuppressWarnings("unused") +class StoreDAO extends EntityBaseDAO { + + public StoreDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + StoreUriDAO dao = (StoreUriDAO) manager.getBaseDAO(StoreUri.class); + dao.addAll(context, entity); + } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + StoreUriDAO dao = (StoreUriDAO) manager.getBaseDAO(StoreUri.class); + dao.removeAll(context, entity.getId()); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + StoreIter iterator = (StoreIter) iter; + while (iterator.next()) { + Store entity = new Store(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setSystem(iterator.isSystem().equals("Y") ? true : false); + entity.setLowres(iterator.isLowres().equals("Y") ? true : false); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:53^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:53^88*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:60^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:60^73*/ + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String name) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:66^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE NAME = :name }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setString(1, name); + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:66^92*/ + return iter; + } + + protected ResultSetIterImpl selectBySystem(DefaultContext context, String lowres) throws SQLException{ + StoreIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:72^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE ISSYSTEM = 'Y' AND ISLOWRES = :lowres }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setString(1, lowres); + iter = new StoreIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:72^117*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:78^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM STORE WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:78^52*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:83^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE STORE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:83^86*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Store obj = (Store) entity; + long id = obj.getId(); + String name = obj.getName(); + String isSystem = obj.isSystem() == true ? "Y" : "N"; + String isLowres = obj.isLowres() == true ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:94^2*/ + +// ************************************************************ +// #sql [context] { UPDATE STORE SET NAME = :name, ISSYSTEM = :isSystem, ISLOWRES = :isLowres WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, isSystem); + __sJT_stmt.setString(3, isLowres); + __sJT_stmt.setLong(4, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:94^108*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Store obj = (Store) entity; + String name = obj.getName(); + String isSystem = obj.isSystem() == true ? "Y" : "N"; + String isLowres = obj.isLowres() == true ? "Y" : "N"; + + /*@lineinfo:generated-code*//*@lineinfo:104^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO STORE (NAME, ISSYSTEM, ISLOWRES) VALUES (:name, :isSystem, :isLowres) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setString(2, isSystem); + __sJT_stmt.setString(3, isLowres); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:104^101*/ + } + + public IEntityBase getByName(String name) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, name); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + + + public IEntityBase getSystemStore(boolean lowres) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectBySystem(context, lowres ? "Y" : "N"); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + +}/*@lineinfo:generated-code*/class StoreDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static StoreDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.StoreDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new StoreDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private StoreDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.StoreDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO_SJProfile0.ser new file mode 100644 index 00000000..18b9e5d5 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO.java new file mode 100644 index 00000000..ecd56f04 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO.java @@ -0,0 +1,524 @@ +/*@lineinfo:filename=StoreUriDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.StoreUri; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.DeliveryMethod; + +/*@lineinfo:generated-code*//*@lineinfo:12^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class StoreUriIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int protocolNdx; + private int deliveryNdx; + private int portNumberNdx; + private int rootPathNdx; + private int passwordNdx; + private int userNameNdx; + private int isTargetNdx; + private int isSourceNdx; + private int isStreamNdx; + private int uriNdx; + private int storeIdNdx; + private int idNdx; + public StoreUriIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + storeIdNdx = findColumn("storeId"); + uriNdx = findColumn("uri"); + isStreamNdx = findColumn("isStream"); + isSourceNdx = findColumn("isSource"); + isTargetNdx = findColumn("isTarget"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rootPathNdx = findColumn("rootPath"); + portNumberNdx = findColumn("portNumber"); + deliveryNdx = findColumn("delivery"); + protocolNdx = findColumn("protocol"); + } + public StoreUriIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + storeIdNdx = findColumn("storeId"); + uriNdx = findColumn("uri"); + isStreamNdx = findColumn("isStream"); + isSourceNdx = findColumn("isSource"); + isTargetNdx = findColumn("isTarget"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rootPathNdx = findColumn("rootPath"); + portNumberNdx = findColumn("portNumber"); + deliveryNdx = findColumn("delivery"); + protocolNdx = findColumn("protocol"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public long storeId() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(storeIdNdx); + } + public String uri() + throws java.sql.SQLException + { + return resultSet.getString(uriNdx); + } + public String isStream() + throws java.sql.SQLException + { + return resultSet.getString(isStreamNdx); + } + public String isSource() + throws java.sql.SQLException + { + return resultSet.getString(isSourceNdx); + } + public String isTarget() + throws java.sql.SQLException + { + return resultSet.getString(isTargetNdx); + } + public String userName() + throws java.sql.SQLException + { + return resultSet.getString(userNameNdx); + } + public String password() + throws java.sql.SQLException + { + return resultSet.getString(passwordNdx); + } + public String rootPath() + throws java.sql.SQLException + { + return resultSet.getString(rootPathNdx); + } + public Integer portNumber() + throws java.sql.SQLException + { + return resultSet.getIntWrapper(portNumberNdx); + } + public String delivery() + throws java.sql.SQLException + { + return resultSet.getString(deliveryNdx); + } + public String protocol() + throws java.sql.SQLException + { + return resultSet.getString(protocolNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:12^216*/ + +@SuppressWarnings("unused") + +class StoreUriDAO extends EntityBaseDAO { + + public StoreUriDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + StoreUriIter iterator = (StoreUriIter) iter; + while (iterator.next()) { + StoreUri entity = new StoreUri(); + entity.setId(iterator.id()); + entity.setStoreId(iterator.storeId()); + entity.setUri(iterator.uri()); + entity.setStream(iterator.isStream().equals("Y") ? true : false); + entity.setSource(iterator.isSource().equals("Y") ? true : false); + entity.setTarget(iterator.isTarget().equals("Y") ? true : false); + entity.setUserName(iterator.userName()); + entity.setPassword(iterator.password()); + entity.setRootPath(iterator.rootPath()); + entity.setPortNumber(iterator.portNumber()); + entity.setDelivery(ItemManagerData.toDeliveryMethod(iterator.delivery())); + entity.setProtocol(ItemManagerData.toRemoteStoreProtocol(iterator.protocol())); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + StoreUriIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:52^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new StoreUriIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:52^171*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + StoreUriIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:59^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI WHERE STOREID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 1); + try + { + __sJT_stmt.setLong(1, id); + iter = new StoreUriIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:59^176*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + StoreUriIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:66^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 2); + try + { + iter = new StoreUriIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:66^156*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:72^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM STOREURI WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:72^55*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:77^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE STOREURI DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:77^89*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + StoreUri obj = (StoreUri) entity; + long id = obj.getId(); + long storeId = obj.getStoreId(); + String uri = obj.getUri(); + String isStream = obj.isStream() == true ? "Y" : "N"; + String isSource = obj.isSource() == true ? "Y" : "N"; + String isTarget = obj.isTarget() == true ? "Y" : "N"; + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + Integer portNumber = obj.getPortNumber(); + String delivery = obj.getDelivery() == null ? null : obj.getDelivery().toString(); + String protocol = obj.getProtocol() == null ? null : obj.getProtocol().toString(); + + /*@lineinfo:generated-code*//*@lineinfo:96^2*/ + +// ************************************************************ +// #sql [context] { UPDATE STOREURI SET STOREID = :storeId, URI = :uri, ISSTREAM = :isStream, ISSOURCE = :isSource, ISTARGET = :isTarget, USERNAME = :userName, PASSWORD = :password, ROOTPATH = :rootPath, PORTNUMBER = :portNumber, DELIVERY = :delivery, PROTOCOL = :protocol WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setLong(1, storeId); + __sJT_stmt.setString(2, uri); + __sJT_stmt.setString(3, isStream); + __sJT_stmt.setString(4, isSource); + __sJT_stmt.setString(5, isTarget); + __sJT_stmt.setString(6, userName); + __sJT_stmt.setString(7, password); + __sJT_stmt.setString(8, rootPath); + __sJT_stmt.setIntWrapper(9, portNumber); + __sJT_stmt.setString(10, delivery); + __sJT_stmt.setString(11, protocol); + __sJT_stmt.setLong(12, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:96^287*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + StoreUri obj = (StoreUri) entity; + long storeId = obj.getStoreId(); + String uri = obj.getUri(); + String isStream = obj.isStream() == true ? "Y" : "N"; + String isSource = obj.isSource() == true ? "Y" : "N"; + String isTarget = obj.isTarget() == true ? "Y" : "N"; + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + Integer portNumber = obj.getPortNumber(); + String delivery = obj.getDelivery() == null ? null : obj.getDelivery().toString(); + String protocol = obj.getProtocol() == null ? null : obj.getProtocol().toString(); + + /*@lineinfo:generated-code*//*@lineinfo:114^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO STOREURI (STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL) VALUES (:storeId, :uri, :isStream, :isSource, :isTarget, :userName, :password, :rootPath, :portNumber, :delivery, :protocol) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setLong(1, storeId); + __sJT_stmt.setString(2, uri); + __sJT_stmt.setString(3, isStream); + __sJT_stmt.setString(4, isSource); + __sJT_stmt.setString(5, isTarget); + __sJT_stmt.setString(6, userName); + __sJT_stmt.setString(7, password); + __sJT_stmt.setString(8, rootPath); + __sJT_stmt.setIntWrapper(9, portNumber); + __sJT_stmt.setString(10, delivery); + __sJT_stmt.setString(11, protocol); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:114^272*/ + } + + void addAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Store store = (Store) entity; + if (store != null && store.getStoreUris() != null) { + for (StoreUri su: store.getStoreUris()) { + su.setStoreId(store.getId()); + add(context, su); + } + } + manager.traceOut(); + } + + /** + * T\ufffdrli a param\ufffdterk\ufffdnt kapott Store azonos\ufffdt\ufffdhoz tartoz\ufffd StoreUri bejegyz\ufffdseket. + */ + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + /*@lineinfo:generated-code*//*@lineinfo:134^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM STOREURI WHERE STOREID = :filterId }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, StoreUriDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setLong(1, filterId); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:134^66*/ + manager.traceOut(); + } + +}/*@lineinfo:generated-code*/class StoreUriDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static StoreUriDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.StoreUriDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new StoreUriDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private StoreUriDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.StoreUriDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO_SJProfile0.ser new file mode 100644 index 00000000..48509c90 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/StoreUriDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/UserInfoDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/UserInfoDAO.java new file mode 100644 index 00000000..56f38964 --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/UserInfoDAO.java @@ -0,0 +1,477 @@ +/*@lineinfo:filename=UserInfoDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class UserInfoIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int lastLoginNdx; + private int createdNdx; + private int rightsNdx; + private int passwordNdx; + private int userNameNdx; + private int fullNameNdx; + private int idNdx; + public UserInfoIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + fullNameNdx = findColumn("fullName"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rightsNdx = findColumn("rights"); + createdNdx = findColumn("created"); + lastLoginNdx = findColumn("lastLogin"); + } + public UserInfoIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + fullNameNdx = findColumn("fullName"); + userNameNdx = findColumn("userName"); + passwordNdx = findColumn("password"); + rightsNdx = findColumn("rights"); + createdNdx = findColumn("created"); + lastLoginNdx = findColumn("lastLogin"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String fullName() + throws java.sql.SQLException + { + return resultSet.getString(fullNameNdx); + } + public String userName() + throws java.sql.SQLException + { + return resultSet.getString(userNameNdx); + } + public String password() + throws java.sql.SQLException + { + return resultSet.getString(passwordNdx); + } + public int rights() + throws java.sql.SQLException + { + return resultSet.getIntNoNull(rightsNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public Timestamp lastLogin() + throws java.sql.SQLException + { + return resultSet.getTimestamp(lastLoginNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^137*/ + +@SuppressWarnings("unused") +public class UserInfoDAO extends EntityBaseDAO { + private String generalPassword = "xwXbgTer"; + + public UserInfoDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + UserInfoIter iterator = (UserInfoIter) iter; + while (iterator.next()) { + UserInfo entity = new UserInfo(); + entity.setId(iterator.id()); + entity.setFullName(iterator.fullName()); + entity.setUserName(iterator.userName()); + if (!isChunked) + entity.setPassword(iterator.password()); + entity.setRights(iterator.rights()); + entity.setCreated(iterator.created()); + entity.setLastLogin(iterator.lastLogin()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + UserInfoIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:45^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, FULLNAME, USERNAME, PASSWORD, RIGHTS, CREATED, LASTLOGIN FROM USERINFO WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new UserInfoIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:45^123*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + UserInfoIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:52^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, FULLNAME, USERNAME, PASSWORD, RIGHTS, CREATED, LASTLOGIN FROM USERINFO ORDER BY FULLNAME }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new UserInfoIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:52^126*/ + return iter; + } + + protected ResultSetIterImpl selectByUserPassword(DefaultContext context, String user, String password) throws SQLException{ + UserInfoIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:58^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, FULLNAME, USERNAME, PASSWORD, RIGHTS, CREATED, LASTLOGIN FROM USERINFO WHERE PASSWORD = :password AND USERNAME = :user }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setString(1, password); + __sJT_stmt.setString(2, user); + iter = new UserInfoIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:58^156*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:64^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM USERINFO WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:64^55*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:69^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE USERINFO DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:69^89*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + UserInfo obj = (UserInfo) entity; + long id = obj.getId(); + String fullName = obj.getFullName(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + int rights = obj.getRights(); + Timestamp lastLogin = obj.getLastLogin(); + /*@lineinfo:generated-code*//*@lineinfo:81^2*/ + +// ************************************************************ +// #sql [context] { UPDATE USERINFO SET FULLNAME = :fullName, USERNAME = :userName, PASSWORD = :password, RIGHTS = :rights, LASTLOGIN = :lastLogin WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setString(1, fullName); + __sJT_stmt.setString(2, userName); + __sJT_stmt.setString(3, password); + __sJT_stmt.setInt(4, rights); + __sJT_stmt.setTimestamp(5, lastLogin); + __sJT_stmt.setLong(6, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:81^161*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + UserInfo obj = (UserInfo) entity; + String fullName = obj.getFullName(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + int rights = obj.getRights(); + /*@lineinfo:generated-code*//*@lineinfo:91^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO USERINFO (FULLNAME, USERNAME, PASSWORD, RIGHTS) VALUES (:fullName, :userName, :password, :rights) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, fullName); + __sJT_stmt.setString(2, userName); + __sJT_stmt.setString(3, password); + __sJT_stmt.setInt(4, rights); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:91^129*/ + } + + public IEntityBase get(String user, String password) { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + IEntityBase entity = null; + try { + ResultSetIterImpl iter = selectByUserPassword(context, user, password); + List result = entities(context, iter, true); + if (result != null && result.size() == 1) + entity = result.get(0); + /*@lineinfo:generated-code*//*@lineinfo:103^3*/ + +// ************************************************************ +// #sql [context] { COMMIT }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:103^27*/ + } catch (Exception e) { + logger.error(e.getMessage()); + try { + /*@lineinfo:generated-code*//*@lineinfo:107^4*/ + +// ************************************************************ +// #sql [context] { ROLLBACK }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, UserInfoDAO_SJProfileKeys.getKey(0), 8); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:107^30*/ + } catch(Exception e1) { + } + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + +}/*@lineinfo:generated-code*/class UserInfoDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static UserInfoDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.UserInfoDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new UserInfoDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private UserInfoDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.UserInfoDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/UserInfoDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/UserInfoDAO_SJProfile0.ser new file mode 100644 index 00000000..c3788921 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/UserInfoDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/WorkflowActionDAO.java b/server/user.jobengine.osgi.db/generated/user/jobengine/db/WorkflowActionDAO.java new file mode 100644 index 00000000..60aa24dc --- /dev/null +++ b/server/user.jobengine.osgi.db/generated/user/jobengine/db/WorkflowActionDAO.java @@ -0,0 +1,477 @@ +/*@lineinfo:filename=WorkflowActionDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; +import java.util.ArrayList; + + +/*@lineinfo:generated-code*//*@lineinfo:11^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class WorkflowActionIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int sizeNdx; + private int tagNdx; + private int destinationNdx; + private int sourceNdx; + private int descriptionNdx; + private int houseIdNdx; + private int successfulNdx; + private int finishedNdx; + private int startedNdx; + private int touchedNdx; + private int idNdx; + public WorkflowActionIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + touchedNdx = findColumn("touched"); + startedNdx = findColumn("started"); + finishedNdx = findColumn("finished"); + successfulNdx = findColumn("successful"); + houseIdNdx = findColumn("houseId"); + descriptionNdx = findColumn("description"); + sourceNdx = findColumn("source"); + destinationNdx = findColumn("destination"); + tagNdx = findColumn("tag"); + sizeNdx = findColumn("size"); + } + public WorkflowActionIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + touchedNdx = findColumn("touched"); + startedNdx = findColumn("started"); + finishedNdx = findColumn("finished"); + successfulNdx = findColumn("successful"); + houseIdNdx = findColumn("houseId"); + descriptionNdx = findColumn("description"); + sourceNdx = findColumn("source"); + destinationNdx = findColumn("destination"); + tagNdx = findColumn("tag"); + sizeNdx = findColumn("size"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public Timestamp touched() + throws java.sql.SQLException + { + return resultSet.getTimestamp(touchedNdx); + } + public Timestamp started() + throws java.sql.SQLException + { + return resultSet.getTimestamp(startedNdx); + } + public Timestamp finished() + throws java.sql.SQLException + { + return resultSet.getTimestamp(finishedNdx); + } + public String successful() + throws java.sql.SQLException + { + return resultSet.getString(successfulNdx); + } + public String houseId() + throws java.sql.SQLException + { + return resultSet.getString(houseIdNdx); + } + public String description() + throws java.sql.SQLException + { + return resultSet.getString(descriptionNdx); + } + public String source() + throws java.sql.SQLException + { + return resultSet.getString(sourceNdx); + } + public String destination() + throws java.sql.SQLException + { + return resultSet.getString(destinationNdx); + } + public String tag() + throws java.sql.SQLException + { + return resultSet.getString(tagNdx); + } + public long size() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(sizeNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:11^211*/ + +@SuppressWarnings("unused") +class WorkflowActionDAO extends EntityBaseDAO { + + public WorkflowActionDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + WorkflowActionIter iterator = (WorkflowActionIter) iter; + while (iterator.next()) { + WorkflowAction entity = new WorkflowAction(); + entity.setId(iterator.id()); + entity.setTouched(iterator.touched()); + entity.setStarted(iterator.started()); + entity.setFinished(iterator.finished()); + entity.setSuccessful(iterator.successful().equals("Y") ? true : false); + entity.setHouseId(iterator.houseId()); + entity.setDescription(iterator.description()); + entity.setSource(iterator.source()); + entity.setDestination(iterator.destination()); + entity.setTag(iterator.tag()); + entity.setSize(iterator.size()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + WorkflowActionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:49^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE FROM WORKFLOWACTION WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, WorkflowActionDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setLong(1, id); + iter = new WorkflowActionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:49^165*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + WorkflowActionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:56^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE FROM WORKFLOWACTION }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, WorkflowActionDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new WorkflowActionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:56^150*/ + return iter; + } + + private ResultSetIterImpl selectByFinished(DefaultContext context, Timestamp begin, Timestamp end) throws SQLException{ + WorkflowActionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:62^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE FROM WORKFLOWACTION WHERE FINISHED BETWEEN :begin AND :end ORDER BY HOUSEID }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, WorkflowActionDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setTimestamp(1, begin); + __sJT_stmt.setTimestamp(2, end); + iter = new WorkflowActionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:62^207*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:68^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM WORKFLOWACTION WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, WorkflowActionDAO_SJProfileKeys.getKey(0), 3); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:68^61*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:73^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE WORKFLOWACTION DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, WorkflowActionDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:73^95*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + WorkflowAction obj = (WorkflowAction) entity; + + long id = obj.getId(); + Timestamp touched = obj.getTouched(); + Timestamp started = obj.getStarted(); + Timestamp finished = obj.getFinished(); + String successful = obj.isSuccessful() ? "Y" : "N"; + String houseId = obj.getHouseId(); + String description = obj.getDescription(); + String source = obj.getSource(); + String destination = obj.getDestination(); + String tag = obj.getTag(); + long size = obj.getSize(); + + /*@lineinfo:generated-code*//*@lineinfo:92^2*/ + +// ************************************************************ +// #sql [context] { UPDATE WORKFLOWACTION SET TOUCHED = :touched, STARTED = :started, FINISHED = :finished, SUCCESSFUL = :successful, HOUSEID = :houseId, DESCRIPTION = :description, SOURCE = :source, DESTINATION = :destination, TAG = :tag, SIZE = :size WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, WorkflowActionDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_stmt.setTimestamp(1, touched); + __sJT_stmt.setTimestamp(2, started); + __sJT_stmt.setTimestamp(3, finished); + __sJT_stmt.setString(4, successful); + __sJT_stmt.setString(5, houseId); + __sJT_stmt.setString(6, description); + __sJT_stmt.setString(7, source); + __sJT_stmt.setString(8, destination); + __sJT_stmt.setString(9, tag); + __sJT_stmt.setLong(10, size); + __sJT_stmt.setLong(11, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:92^267*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + WorkflowAction obj = (WorkflowAction) entity; + + long id = obj.getId(); + Timestamp touched = obj.getTouched(); + Timestamp started = obj.getStarted(); + Timestamp finished = obj.getFinished(); + String successful = obj.isSuccessful() ? "Y" : "N"; + String houseId = obj.getHouseId(); + String description = obj.getDescription(); + String source = obj.getSource(); + String destination = obj.getDestination(); + String tag = obj.getTag(); + long size = obj.getSize(); + + /*@lineinfo:generated-code*//*@lineinfo:111^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO WORKFLOWACTION (TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE) VALUES (:touched, :started, :finished, :successful, :houseId, :description, :source, :destination, :tag, :size) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, WorkflowActionDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setTimestamp(1, touched); + __sJT_stmt.setTimestamp(2, started); + __sJT_stmt.setTimestamp(3, finished); + __sJT_stmt.setString(4, successful); + __sJT_stmt.setString(5, houseId); + __sJT_stmt.setString(6, description); + __sJT_stmt.setString(7, source); + __sJT_stmt.setString(8, destination); + __sJT_stmt.setString(9, tag); + __sJT_stmt.setLong(10, size); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:111^253*/ + } + + public List getWorkflowActions(Timestamp begin, Timestamp end) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByFinished(context, begin, end); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +}/*@lineinfo:generated-code*/class WorkflowActionDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static WorkflowActionDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.WorkflowActionDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new WorkflowActionDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private WorkflowActionDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.WorkflowActionDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/generated/user/jobengine/db/WorkflowActionDAO_SJProfile0.ser b/server/user.jobengine.osgi.db/generated/user/jobengine/db/WorkflowActionDAO_SJProfile0.ser new file mode 100644 index 00000000..d18a0605 Binary files /dev/null and b/server/user.jobengine.osgi.db/generated/user/jobengine/db/WorkflowActionDAO_SJProfile0.ser differ diff --git a/server/user.jobengine.osgi.db/lib/hamcrest/hamcrest-core-1.1.jar b/server/user.jobengine.osgi.db/lib/hamcrest/hamcrest-core-1.1.jar new file mode 100644 index 00000000..5f1d5ce0 Binary files /dev/null and b/server/user.jobengine.osgi.db/lib/hamcrest/hamcrest-core-1.1.jar differ diff --git a/server/user.jobengine.osgi.db/lib/hamcrest/hamcrest-library-1.1.jar b/server/user.jobengine.osgi.db/lib/hamcrest/hamcrest-library-1.1.jar new file mode 100644 index 00000000..40610c9b Binary files /dev/null and b/server/user.jobengine.osgi.db/lib/hamcrest/hamcrest-library-1.1.jar differ diff --git a/server/user.jobengine.osgi.db/lib/jmock/jmock-2.5.1.jar b/server/user.jobengine.osgi.db/lib/jmock/jmock-2.5.1.jar new file mode 100644 index 00000000..4415dfbc Binary files /dev/null and b/server/user.jobengine.osgi.db/lib/jmock/jmock-2.5.1.jar differ diff --git a/server/user.jobengine.osgi.db/lib/jmock/jmock-junit4-2.5.1.jar b/server/user.jobengine.osgi.db/lib/jmock/jmock-junit4-2.5.1.jar new file mode 100644 index 00000000..fb3697af Binary files /dev/null and b/server/user.jobengine.osgi.db/lib/jmock/jmock-junit4-2.5.1.jar differ diff --git a/server/user.jobengine.osgi.db/pom.xml b/server/user.jobengine.osgi.db/pom.xml new file mode 100644 index 00000000..d59dcf0e --- /dev/null +++ b/server/user.jobengine.osgi.db/pom.xml @@ -0,0 +1,15 @@ + + + + ../-modules + user.jobengine + MediaCube + 1.0.0 + + 4.0.0 + user.jobengine.osgi.db + eclipse-plugin + 1.0.0 + \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/settings.bat b/server/user.jobengine.osgi.db/settings.bat new file mode 100644 index 00000000..d2fc7342 --- /dev/null +++ b/server/user.jobengine.osgi.db/settings.bat @@ -0,0 +1,19 @@ +::Database:: + +SET DB_INSTANCE=DB2 +SET DB_HOST=localhost +SET DB_PORT=50000 +SET DB_NAME=JE +SET DB_URL=jdbc:db2://%DB_HOST%:%DB_PORT%/%DB_NAME%:retrieveMessagesFromServerOnGetMessage=true; +SET DB_SCHEMA=DB2ADMIN +SET DB_USER=db2admin +SET DB_PWD=salabakter +SET DB_CMD_OPTIONS=-td@ -f +SET DB2CLP=DB20FADE + +::Remote:: +SET DB_REMOTE_HOST=10.228.198.1 +SET REMOTE_LOCATION=/tmp/mediaarch +SET REMOTE_SERVER_HOSTKEY=ssh-ed25519 256 86:5b:9b:bc:df:7b:df:90:c6:bf:60:69:d2:c9:61:62 +SET REMOTE_SERVER_ADDRESS=scp://db2admin:password@%DB_REMOTE_HOST% + diff --git a/server/user.jobengine.osgi.db/sql/1-CreateDB.db2 b/server/user.jobengine.osgi.db/sql/1-CreateDB.db2 new file mode 100644 index 00000000..95aee279 --- /dev/null +++ b/server/user.jobengine.osgi.db/sql/1-CreateDB.db2 @@ -0,0 +1,7 @@ +--execute with +-- db2start +-- db2 -td@ -f 1-CreateDB.db2 + +ATTACH TO "DB2" USER db2admin USING salabakter@ +--DROP DATABASE "MC"@ +CREATE DATABASE "MC" AUTOMATIC STORAGE YES USING CODESET UTF-8 TERRITORY hu COLLATE USING UCA500R1_S2 PAGESIZE 32 K@ \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/sql/2-CreateStructure.db2 b/server/user.jobengine.osgi.db/sql/2-CreateStructure.db2 new file mode 100644 index 00000000..16edacbe --- /dev/null +++ b/server/user.jobengine.osgi.db/sql/2-CreateStructure.db2 @@ -0,0 +1,385 @@ +--execute with +-- db2 -td@ -vmf 2-CreateStructure.db2 + +CONNECT TO MC USER db2admin USING salabakter@ + +CREATE PROCEDURE SET_CONSTRAINTS(ENFORCE VARCHAR(3)) +LANGUAGE SQL +BEGIN + DECLARE v_tabname VARCHAR(128); + DECLARE v_constname VARCHAR(128); + DECLARE v_rows INTEGER; + DECLARE v_alter_table_sql VARCHAR(256); + DECLARE tmp_cursor CURSOR FOR SELECT tabname, constname FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA ORDER BY CONSTNAME,TABNAME, REFTABNAME; + SELECT count(*) INTO v_rows FROM syscat.references WHERE TABSCHEMA = CURRENT SCHEMA; + OPEN tmp_cursor; + WHILE (v_rows > 0) DO + FETCH tmp_cursor INTO v_tabname, v_constname; + SET v_alter_table_sql = 'alter table ' || '"' || current SCHEMA || '"' || '.' || v_tabname || ' alter foreign key ' || v_constname; + IF (ENFORCE = 'NO') THEN + SET v_alter_table_sql = v_alter_table_sql || ' NOT ENFORCED'; + ELSE + SET v_alter_table_sql = v_alter_table_sql || ' ENFORCED'; + END IF; + EXECUTE IMMEDIATE v_alter_table_sql; + SET v_rows = v_rows - 1; + END while; + CLOSE tmp_cursor; +END @ + +CREATE PROCEDURE DROP_DYNAMIC_DATA() +LANGUAGE SQL +BEGIN + DECLARE v_tabname VARCHAR(128); + DECLARE v_rows INTEGER; + DECLARE v_drop_table_sql VARCHAR(256); + DECLARE tmp_cursor CURSOR FOR SELECT tabname FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + SELECT count(*) INTO v_rows FROM syscat.tables WHERE tabname LIKE 'METADATA\_%' ESCAPE '\' AND TABSCHEMA = CURRENT SCHEMA; + OPEN tmp_cursor; + WHILE (v_rows > 0) DO + FETCH tmp_cursor INTO v_tabname; + SET v_drop_table_sql = 'drop table ' || '"' || current SCHEMA || '"' || '.' || v_tabname; + EXECUTE IMMEDIATE v_drop_table_sql; + SET v_rows = v_rows - 1; + END while; + CLOSE tmp_cursor; +END @ + +CREATE TABLE MASTERID +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +)@ + +CREATE TABLE DOMAINCATEGORY +( + ID BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL +)@ + +CREATE UNIQUE INDEX UDX_DOMAINCATEGORY_NAME ON DOMAINCATEGORY ("NAME")@ + +CREATE TABLE DOMAIN +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + DOMAINCATEGORYID BIGINT NOT NULL, + DISPLAY VARCHAR(200) NOT NULL, + VALUE BIGINT, + CONSTRAINT FK_DOMAIN_DOMAINCATEGORYID FOREIGN KEY (DOMAINCATEGORYID) REFERENCES DOMAINCATEGORY (ID) +)@ + +CREATE INDEX UDX_DOMAIN_DOMAINCATEGORYID_DISPLAY ON DOMAIN ("DOMAINCATEGORYID","DISPLAY")@ + +CREATE TABLE ITEMTYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR (40) NOT NULL, + DESCRIPTION VARCHAR (255) NOT NULL, + ISSTATIC CHARACTER (1) NOT NULL, + CONSTRAINT CHK_ITEMTYPE_ISSTATIC CHECK (ISSTATIC in ('Y', 'N')) +)@ + +CREATE UNIQUE INDEX UDX_ITEMTYPE_NAME ON ITEMTYPE ("NAME")@ + +CREATE TABLE METADATATYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DATATYPE VARCHAR(10) NOT NULL, + LENGTH INTEGER NOT NULL, + BASETYPE VARCHAR(10) NOT NULL DEFAULT '', + JAVATYPE VARCHAR(255) NOT NULL DEFAULT '' +)@ + +CREATE UNIQUE INDEX UDX_METADATATYPE_NAME ON METADATATYPE ("NAME")@ + +CREATE TABLE METADATAELEMENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + METADATATYPEID BIGINT NOT NULL, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + DOMAINCATEGORYID BIGINT , + CONSTRAINT FK_METADATAELEMENT_METADATATYPEID FOREIGN KEY (METADATATYPEID) REFERENCES METADATATYPE (ID), + CONSTRAINT FK_METADATAELEMENT_DOMAINCATEGORYID FOREIGN KEY (DOMAINCATEGORYID) REFERENCES DOMAINCATEGORY (ID) +)@ + +CREATE UNIQUE INDEX UDX_METADATAELEMENT_NAME ON METADATAELEMENT ("NAME")@ + +CREATE TABLE METADATA +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + METADATAELEMENTID BIGINT NOT NULL, + ISDBINDEX CHARACTER(1) NOT NULL, + ISDBUNIQUE CHARACTER(1) NOT NULL, + ISDBNULLABLE CHARACTER(1) NOT NULL, + ISLISTABLE CHARACTER(1) NOT NULL, + ISEDITABLE CHARACTER(1) NOT NULL, + ISGENERATED CHARACTER(1) NOT NULL, + ISSEARCHABLE CHARACTER(1) NOT NULL, + GUITYPE VARCHAR(20) NOT NULL, + LISTTYPE VARCHAR(20) NOT NULL, + STATICTABLE VARCHAR(20) , + POJOFIELD VARCHAR(20) , + SQLFIELD VARCHAR(20) , + PARAMETER VARCHAR(20) , + DOMAINCATEGORYID BIGINT, + CONSTRAINT CHK_METADATA_ISDBINDEX CHECK (ISDBINDEX in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBUNIQUE CHECK (ISDBUNIQUE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISDBNULLABLE CHECK (ISDBNULLABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISEDITABLE CHECK (ISEDITABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISLISTABLE CHECK (ISLISTABLE in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISGENERATED CHECK (ISGENERATED in ('Y', 'N')), + CONSTRAINT CHK_METADATA_ISSEARCHABLE CHECK (ISGENERATED in ('Y', 'N')), + CONSTRAINT FK_METADATA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID), + CONSTRAINT FK_METADATA_METADATAELEMENTID FOREIGN KEY (METADATAELEMENTID) REFERENCES METADATAELEMENT (ID) +)@ + +CREATE TABLE DOMAININDEX +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + RECORDID BIGINT NOT NULL, + METADATAID BIGINT NOT NULL, + DOMAINID BIGINT NOT NULL, + CONSTRAINT FK_DOMAININDEX_RECORDID FOREIGN KEY (RECORDID) REFERENCES MASTERID (ID), + CONSTRAINT FK_DOMAININDEX_METADATAID FOREIGN KEY (METADATAID) REFERENCES METADATA (ID), + CONSTRAINT FK_DOMAININDEX_DOMAINID FOREIGN KEY (DOMAINID) REFERENCES DOMAIN (ID) +)@ + +CREATE TABLE ITEM +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + TITLE VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + ISFOLDER CHARACTER(1) NOT NULL DEFAULT 'N', + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP, + CONSTRAINT CHK_ITEM_ISFOLDER CHECK (ISFOLDER in ('Y', 'N')), + CONSTRAINT FK_ITEM_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID), + CONSTRAINT FK_ITEM_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) +)@ + + +CREATE INDEX IDX_ITEM_TITLE ON ITEM ("TITLE")@ +CREATE INDEX IDX_ITEM_DESCRIPTION ON ITEM ("DESCRIPTION")@ +CREATE INDEX IDX_ITEM_HOUSEID ON ITEM ("HOUSEID")@ +CREATE INDEX IDX_ITEM_CREATED ON ITEM ("CREATED")@ +CREATE INDEX IDX_ITEM_ISFOLDER ON ITEM ("ISFOLDER")@ + +CREATE TABLE FOLDER +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + PARENTID BIGINT NOT NULL, + CHILDID BIGINT NOT NULL, + CONSTRAINT CHK_FOLDER_SELFCHILD CHECK (PARENTID != CHILDID), + CONSTRAINT FK_FOLDER_PARENTID FOREIGN KEY (PARENTID) REFERENCES ITEM (ID), + CONSTRAINT FK_FOLDER_CHILDID FOREIGN KEY (CHILDID) REFERENCES ITEM (ID) +)@ + +CREATE UNIQUE INDEX UDX_FOLDER_NODUPLICATE ON FOLDER ("PARENTID", "CHILDID")@ + +CREATE TRIGGER TRG_INSERT_FOLDER AFTER INSERT ON FOLDER +REFERENCING NEW AS N + FOR EACH ROW UPDATE ITEM SET ISFOLDER = 'Y' WHERE ID = N.PARENTID AND ISFOLDER = 'N'@ + + +CREATE TRIGGER TRG_DELETE_FOLDER AFTER DELETE ON FOLDER +REFERENCING OLD AS O + FOR EACH ROW UPDATE ITEM SET ISFOLDER = 'N' WHERE ID = O.PARENTID AND NOT EXISTS (SELECT * FROM FOLDER WHERE PARENTID = O.PARENTID)@ + + +CREATE TABLE MEDIA +( + ID BIGINT NOT NULL PRIMARY KEY, + ITEMID BIGINT NOT NULL, + ITEMTYPEID BIGINT NOT NULL, + HOUSEID VARCHAR(40), + TITLE VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255) NOT NULL, + LENGTH BIGINT NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP, + ARCHIVED TIMESTAMP, + POSTER BLOB, + CONSTRAINT FK_MEDIA_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID), + CONSTRAINT FK_MEDIA_ITEMID FOREIGN KEY (ITEMID) REFERENCES ITEM (ID), + CONSTRAINT FK_MEDIA_ITEMTYPEID FOREIGN KEY (ITEMTYPEID) REFERENCES ITEMTYPE (ID) +)@ + +CREATE INDEX IDX_MEDIA_TITLE ON MEDIA ("TITLE")@ +CREATE INDEX IDX_MEDIA_ITEMID ON MEDIA ("ITEMID")@ +CREATE INDEX IDX_MEDIA_DESCRIPTION ON MEDIA ("DESCRIPTION")@ +CREATE INDEX IDX_MEDIA_HOUSEID ON MEDIA ("HOUSEID")@ +CREATE INDEX IDX_MEDIA_CREATED ON MEDIA ("CREATED")@ +CREATE INDEX IDX_MEDIA_ARCHIVED ON MEDIA ("ARCHIVED")@ +CREATE INDEX IDX_MEDIA_LENGTH ON MEDIA ("LENGTH")@ + +CREATE TABLE FILETYPE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + DESCRIPTION VARCHAR(255), + VIDEOCODEC VARCHAR(10) NOT NULL, + AUDIOCODEC VARCHAR(10) NOT NULL, + VIDEOTRACKS INT NOT NULL, + AUDIOTRACKS INT NOT NULL, + FRAMERATE FLOAT NOT NULL +)@ + +CREATE UNIQUE INDEX UDX_FILETYPE_NAME ON FILETYPE ("NAME")@ + +CREATE TABLE STORE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + ISSYSTEM CHARACTER(1) NOT NULL DEFAULT 'N', + ISLOWRES CHARACTER(1) NOT NULL DEFAULT 'N', + CONSTRAINT CHK_STORE_ISSYSTEM CHECK (ISSYSTEM in ('Y', 'N')), + CONSTRAINT CHK_STORE_ISLOWRES CHECK (ISLOWRES in ('Y', 'N')) +)@ + +CREATE UNIQUE INDEX UDX_STORE_NAME ON STORE ("NAME")@ + +CREATE TABLE MEDIAFILE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + STOREID BIGINT NOT NULL, + FILETYPEID BIGINT NOT NULL, + RELATIVEPATH VARCHAR(255) NOT NULL, + FILESTRUCTINFO VARCHAR(255), + CONSTRAINT FK_MEDIAFILE_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID), + CONSTRAINT FK_MEDIAFILE_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID), + CONSTRAINT FK_MEDIAFILE_FILETYPEID FOREIGN KEY (FILETYPEID) REFERENCES FILETYPE (ID) +)@ + +CREATE TABLE STOREURI +( + ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, + STOREID BIGINT NOT NULL, + PROTOCOL VARCHAR(20) , + DELIVERY VARCHAR(20) , + URI VARCHAR(255) NOT NULL, + ISSTREAM CHARACTER(1) NOT NULL DEFAULT 'N', + ISSOURCE CHARACTER(1) NOT NULL DEFAULT 'N', + ISTARGET CHARACTER(1) NOT NULL DEFAULT 'N', + USERNAME VARCHAR(20), + PASSWORD VARCHAR(20), + ROOTPATH VARCHAR(255), + PORTNUMBER INT, + CONSTRAINT CHK_STOREURI_ISSTREAM CHECK (ISSTREAM in ('Y', 'N')), + CONSTRAINT CHK_STOREURI_ISSOURCE CHECK (ISSOURCE in ('Y', 'N')), + CONSTRAINT CHK_STOREURI_ISTARGET CHECK (ISTARGET in ('Y', 'N')), + CONSTRAINT FK_STOREURI_STOREID FOREIGN KEY (STOREID) REFERENCES STORE (ID) +)@ + +CREATE TABLE SHOT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB, + INPOINT BIGINT NOT NULL, + OUTPOINT BIGINT NOT NULL, + DESCRIPTION VARCHAR(255), + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT FK_SHOT_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +)@ + +CREATE INDEX IDX_SHOT_DESCRIPTION ON SHOT ("DESCRIPTION")@ + +CREATE TABLE BREAK +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + MEDIAID BIGINT NOT NULL, + THUMBNAIL BLOB NOT NULL, + INPOINT BIGINT NOT NULL, + BREAKTYPE VARCHAR(10) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT FK_BREAK_MEDIAID FOREIGN KEY (MEDIAID) REFERENCES MEDIA (ID) +)@ + +CREATE TABLE SCENE +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP +)@ + +CREATE TABLE SCENECONTENT +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + SCENEID BIGINT NOT NULL, + SHOTID BIGINT NOT NULL, + POSITION BIGINT NOT NULL, + CONSTRAINT FK_SCENECONTENT_SCENEID FOREIGN KEY (SCENEID) REFERENCES SCENE (ID), + CONSTRAINT FK_SCENECONTENT_SHOTID FOREIGN KEY (SHOTID) REFERENCES SHOT (ID) +)@ + +CREATE TABLE SEARCHDEFINITION +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(40) NOT NULL, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP, + DATA BLOB +)@ +CREATE UNIQUE INDEX UDX_SEARCHDEFINITION_NAME ON SEARCHDEFINITION ("NAME")@ + +CREATE TABLE USERINFO +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + FULLNAME VARCHAR(80) NOT NULL, + USERNAME VARCHAR(20) NOT NULL, + PASSWORD VARCHAR(20) NOT NULL FOR BIT DATA, + CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, + LASTLOGIN TIMESTAMP, + RIGHTS INT NOT NULL DEFAULT 0 +)@ + +CREATE UNIQUE INDEX UDX_USERINFO_USERNAME ON USERINFO ("USERNAME")@ +CREATE INDEX IDX_ITEM_USERNAMEPASSWORD ON USERINFO ("USERNAME", "PASSWORD")@ + +CREATE TABLE JOB +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + NAME VARCHAR(80) NOT NULL, + OWNER VARCHAR(80), + PRIORITY INT NOT NULL DEFAULT 0, + PROGRESS INT NOT NULL DEFAULT 0, + STATUS VARCHAR(80) NOT NULL, + DESCRIPTION VARCHAR(200), + SUBMITTED TIMESTAMP NOT NULL, + FINISHED TIMESTAMP, + TEMPLATE VARCHAR(80) NOT NULL, + SCHEDULEDTIME TIMESTAMP +)@ + +CREATE TABLE JOBPARAMETERS +( + ID BIGINT NOT NULL PRIMARY KEY, + DATA BLOB +)@ + +CREATE TABLE WORKFLOWACTION +( + ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY, + TOUCHED TIMESTAMP NOT NULL, + STARTED TIMESTAMP NOT NULL, + FINISHED TIMESTAMP NOT NULL, + SUCCESSFUL CHARACTER(1) NOT NULL DEFAULT 'N', + HOUSEID VARCHAR(40), + DESCRIPTION VARCHAR(255) NOT NULL, + SOURCE VARCHAR(255) NOT NULL, + DESTINATION VARCHAR(255) NOT NULL, + TAG VARCHAR(40) NOT NULL, + SIZE BIGINT NOT NULL, + CONSTRAINT CHK_WORKFLOWACTION_SUCCESSFUL CHECK (SUCCESSFUL in ('Y', 'N')) +)@ + +CREATE INDEX IDX_WORKFLOWACTION_FINISHED ON WORKFLOWACTION ("FINISHED")@ +CREATE INDEX IDX_WORKFLOWACTION_HOUSEID ON WORKFLOWACTION ("HOUSEID")@ + diff --git a/server/user.jobengine.osgi.db/sql/3-EnableJSON.db2 b/server/user.jobengine.osgi.db/sql/3-EnableJSON.db2 new file mode 100644 index 00000000..5e55ab29 --- /dev/null +++ b/server/user.jobengine.osgi.db/sql/3-EnableJSON.db2 @@ -0,0 +1,3 @@ +--execute with +-- cd /home/db2admin/sqllib/json/bin +-- ./db2nosql.sh -db MC -user db2admin -password password -enable true diff --git a/server/user.jobengine.osgi.db/src/user/commons/CommonsException.java b/server/user.jobengine.osgi.db/src/user/commons/CommonsException.java new file mode 100644 index 00000000..c7b2c237 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/CommonsException.java @@ -0,0 +1,12 @@ +package user.commons; + +/** + * Commons kivétel. + */ +public class CommonsException extends RuntimeException { + private static final long serialVersionUID = -2357518580850559771L; + + public CommonsException(String message) { + super(message); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/commons/CommonsProperties.java b/server/user.jobengine.osgi.db/src/user/commons/CommonsProperties.java new file mode 100644 index 00000000..26fc3a9a --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/CommonsProperties.java @@ -0,0 +1,89 @@ +package user.commons; + +import java.util.Hashtable; +import java.util.Map; + +/** + * Hashtable alapú paraméter tároló. + * A paraméterek típus helyesen írhatóak be és vehetõek ki. + */ +public class CommonsProperties { + static public void checkParameter(String name, double parameter) { + if (parameter == 0) { + String msg = name + " cannot be 0."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, int parameter) { + if (parameter == 0) { + String msg = name + " cannot be 0."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, long parameter) { + if (parameter == 0) { + String msg = name + " cannot be 0."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, Object parameter) { + if (parameter == null) { + String msg = name + " cannot be null."; + throw new IllegalArgumentException(msg); + } + } + + static public void checkParameter(String name, String parameter) { + if (parameter == null) { + String msg = name + " cannot be null."; + throw new NullPointerException(msg); + } + if (parameter.trim().equals("")) { + String msg = name + " cannot be empty."; + throw new IllegalArgumentException(msg); + } + } + + protected Map properties = new Hashtable(); + + public void add(String key, Object value) { + properties.put(key, value); + } + + public Object get(String key) { + if (properties.containsKey(key) == false) + throw new CommonsException("Key not available: " + key); + return properties.get(key); + } + + public boolean getBool(String key) { + Object value = get(key); + if (!(value instanceof Boolean)) + throw new CommonsException("Property doesn't contains Boolean value: " + key); + return Boolean.parseBoolean(value.toString()); + } + + public int getInt(String key) { + Object value = get(key); + if (!(value instanceof Integer)) + throw new CommonsException("Property doesn't contains Integer value." + key); + return Integer.parseInt(value.toString()); + } + + public long getLong(String key) { + Object value = get(key); + if (!(value instanceof Long)) + throw new CommonsException("Property doesn't contains Long value." + key); + return Long.parseLong(value.toString()); + } + + public String getString(String key) { + Object value = get(key); + if (!(value instanceof String)) + throw new CommonsException("Property doesn't contains String value." + key); + return value.toString(); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/commons/SequenceGenerator.java b/server/user.jobengine.osgi.db/src/user/commons/SequenceGenerator.java new file mode 100644 index 00000000..47f5e5ac --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/SequenceGenerator.java @@ -0,0 +1,31 @@ +package user.commons; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; + +public class SequenceGenerator { + static private String persistFile = "c:\\id.generator"; + static private long id = 0; + + static public long getId() { + try { + DataInputStream inStream = new DataInputStream(new FileInputStream(persistFile)); + id = inStream.readLong(); + inStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + id++; + + try { + DataOutputStream outStream = new DataOutputStream(new FileOutputStream(persistFile)); + outStream.writeLong(id); + } catch (Exception e) { + e.printStackTrace(); + } + return id; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/commons/pool/ConnectionPool.java b/server/user.jobengine.osgi.db/src/user/commons/pool/ConnectionPool.java new file mode 100644 index 00000000..19da13e8 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/pool/ConnectionPool.java @@ -0,0 +1,69 @@ +package user.commons.pool; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +/** + * Adatbázis kapcsolat erõforrás kezelõ. + * + */ +public class ConnectionPool extends ResourcePool { + public ConnectionPool(ConnectionPoolProperties properties) { + super(properties); + } + + public Connection borrowObject() { + return (Connection) super.borrowObject(); + } + + protected boolean checkObject(Object resourceObject) { + Connection connection = (Connection) resourceObject; + boolean closed = false; + try { + closed = connection.isClosed(); + } catch (SQLException e) { + } + return closed; + } + + protected Connection createObject() { + ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties(); + Connection connection = null; + try { + Class.forName(cpp.getDriverName()); + DriverManager.setLoginTimeout(cpp.getTimeout()); + connection = DriverManager.getConnection(cpp.getUrl(), cpp.getUserName(), cpp.getPassword()); + connection.setAutoCommit(cpp.getAutoCommit()); + } catch (Exception e) { + throw new PoolException(e.getMessage()); + } + return connection; + } + + protected void releaseObject(Object resourceObject) { + validateObject(resourceObject); + Connection connection = (Connection) resourceObject; + try { + if (connection == null) + return; + if (connection.isClosed() == false) { + connection.close(); + } + connection = null; + } catch (Exception e) { + throw new PoolException(e.getMessage()); + } + } + + public void lendObject(Connection connection) { + super.lendObject(connection); + } + + protected void validateObject(Object resourceObject) { + super.validateObject(resourceObject); + if (!(resourceObject instanceof Connection)) { + throw new IllegalArgumentException("Only Connection class is acceptable."); + } + } +} diff --git a/server/user.jobengine.osgi.db/src/user/commons/pool/ConnectionPoolProperties.java b/server/user.jobengine.osgi.db/src/user/commons/pool/ConnectionPoolProperties.java new file mode 100644 index 00000000..969e8fc0 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/pool/ConnectionPoolProperties.java @@ -0,0 +1,79 @@ +package user.commons.pool; + +import user.commons.CommonsProperties; + +public class ConnectionPoolProperties extends CommonsProperties { + static public final String AUTOCOMMIT = "AutoCommit"; + static public final String DRIVERNAME = "DriverName"; + static public final String PASSWORD = "password"; + static public final String TIMEOUT = "Timeout"; + static public final String URL = "ConnectionUrl"; + static public final String USERNAME = "user"; + + static public final String TRACELEVEL = "traceLevel"; + static public final String TRACEFILE = "traceFile"; + static public final String TRACEFILEAPPEND = "traceFileAppend"; + + static public final String TRACELEVEL_FOR_TRACE_SQL_STATEMENT = Integer.toString(com.ibm.db2.jcc.DB2BaseDataSource.TRACE_CONNECTION_CALLS); + + public ConnectionPoolProperties(String driver, String url, String userName, String password, boolean autoCommit, int timeout) { + this(driver, url, userName, password, autoCommit, timeout, Integer.toString(com.ibm.db2.jcc.DB2BaseDataSource.TRACE_NONE), "/tmp/jobengine_sqlj_trace.log", "true"); + } + + public ConnectionPoolProperties(String driver, String url, String userName, String password, boolean autoCommit, int timeout, String traceLevel, String traceFile, String traceFileAppend) { + CommonsProperties.checkParameter(DRIVERNAME, driver); + CommonsProperties.checkParameter(URL, url); + CommonsProperties.checkParameter(USERNAME, userName); + CommonsProperties.checkParameter(PASSWORD, password); + CommonsProperties.checkParameter(AUTOCOMMIT, autoCommit); + CommonsProperties.checkParameter(TIMEOUT, timeout); + CommonsProperties.checkParameter(TRACELEVEL, traceLevel); + CommonsProperties.checkParameter(TRACEFILE, traceFile); + CommonsProperties.checkParameter(TRACEFILEAPPEND, traceFileAppend); + super.add(DRIVERNAME, driver); + super.add(URL, url); + super.add(USERNAME, userName); + super.add(PASSWORD, password); + super.add(AUTOCOMMIT, autoCommit); + super.add(TIMEOUT, timeout); + super.add(TRACELEVEL, traceLevel); + super.add(TRACEFILE, traceFile); + super.add(TRACEFILEAPPEND, traceFileAppend); + } + + public boolean getAutoCommit(){ + return getBool(AUTOCOMMIT); + } + + public String getDriverName(){ + return getString(DRIVERNAME); + } + + public String getPassword(){ + return getString(PASSWORD); + } + + public int getTimeout() { + return getInt(TIMEOUT); + } + + public String getUrl(){ + return getString(URL); + } + + public String getUserName(){ + return getString(USERNAME); + } + + public String getTraceLevel(){ + return getString(TRACELEVEL); + } + + public String getTraceFile(){ + return getString(TRACEFILE); + } + + public String getTraceFileAppend(){ + return getString(TRACEFILEAPPEND); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/commons/pool/ContextPool.java b/server/user.jobengine.osgi.db/src/user/commons/pool/ContextPool.java new file mode 100644 index 00000000..be22e325 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/pool/ContextPool.java @@ -0,0 +1,97 @@ +package user.commons.pool; + +import java.lang.reflect.InvocationTargetException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.util.Properties; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import sqlj.runtime.ref.DefaultContext; + +/** + * Adatbázis kontextus erőforrás kezelő. + * + */ +public class ContextPool extends ResourcePool { + private static final Logger logger = LogManager.getLogger(); + + public ContextPool(ConnectionPoolProperties properties) { + super(properties); + } + + @Override + public DefaultContext borrowObject() { + DefaultContext context = (DefaultContext) super.borrowObject(); + //DefaultContext.setDefaultContext(context); + return context; + } + + @Override + protected boolean checkObject(Object resourceObject) { + DefaultContext context = (DefaultContext) resourceObject; + return context.isClosed(); + } + + @Override + protected DefaultContext createObject() { + ConnectionPoolProperties cpp = (ConnectionPoolProperties) this.getProperties(); + Connection connection = null; + DefaultContext context = null; + try { + Class.forName(cpp.getDriverName()); + } catch (ClassNotFoundException e) { + throw new PoolException(e.getMessage()); + } + + try { + DriverManager.setLoginTimeout(cpp.getTimeout()); + Properties p = new Properties(); + p.setProperty(ConnectionPoolProperties.USERNAME, cpp.getUserName()); + p.setProperty(ConnectionPoolProperties.PASSWORD, cpp.getPassword()); + p.setProperty(ConnectionPoolProperties.TRACELEVEL, cpp.getTraceLevel()); + p.setProperty(ConnectionPoolProperties.TRACEFILE, cpp.getTraceFile()); + p.setProperty(ConnectionPoolProperties.TRACEFILEAPPEND, cpp.getTraceFileAppend()); + connection = DriverManager.getConnection(cpp.getUrl(), p); + connection.setAutoCommit(cpp.getAutoCommit()); + context = new DefaultContext(connection); + } catch (Throwable t) { + logger.error("System can't create JDBC connection. Reason: " + t.getMessage()); + Throwable cause = t.getCause(); + if (cause instanceof InvocationTargetException) { + Throwable targetException = ((InvocationTargetException) cause).getTargetException(); + logger.error(targetException.getMessage()); + } + } + return context; + } + + @Override + protected void releaseObject(Object value) { + validateObject(value); + DefaultContext context = (DefaultContext) value; + try { + if (context == null) + return; + if (context.isClosed() == false) { + context.close(); + } + context = null; + } catch (Exception e) { + throw new PoolException(e.getMessage()); + } + } + + public void lendObject(DefaultContext context) { + super.lendObject(context); + } + + @Override + protected void validateObject(Object resourceObject) { + super.validateObject(resourceObject); + if (!(resourceObject instanceof DefaultContext)) { + throw new IllegalArgumentException("Only DefaultContext class is acceptable."); + } + } +} diff --git a/server/user.jobengine.osgi.db/src/user/commons/pool/PoolException.java b/server/user.jobengine.osgi.db/src/user/commons/pool/PoolException.java new file mode 100644 index 00000000..c59bab0e --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/pool/PoolException.java @@ -0,0 +1,12 @@ +package user.commons.pool; + +/** + * Pool kivétel. + */ +public class PoolException extends RuntimeException { + private static final long serialVersionUID = 874798532700307318L; + + public PoolException(String message) { + super(message); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/commons/pool/ResourcePool.java b/server/user.jobengine.osgi.db/src/user/commons/pool/ResourcePool.java new file mode 100644 index 00000000..13b579d6 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/commons/pool/ResourcePool.java @@ -0,0 +1,166 @@ +package user.commons.pool; + +import java.util.LinkedList; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.CommonsProperties; + +/** + * Erőforrás kezelő. + *
+ * Az implementációban meghatározott típusú er�forr�s objektumb�l + * ig�ny szerint l�trehoz annyit, amennyi enged�lyezett. + *
+ * Az er�forr�s objektumok k�lcs�n�zhet�ek, visszaadhat�ak + * thread-safe m�don. + *
+ * Mind�g a legr�gebben haszn�lt objektumot k�lcs�nzi ki. + *
+ * Ha elfogy a k�lcs�n�zhet� objektum, v�rakoztat. + */ + +abstract public class ResourcePool { + private static final Logger logger = LogManager.getLogger(); + static public final String POOLSIZE = "PoolSize"; + protected LinkedList pool = null; + private CommonsProperties properties = null; + private int resourceCounter = 0; + + /** + * Konstruktor a pool l�trehoz�s�ra. + * @param properties + * Be�ll�t�sok. + */ + protected ResourcePool(CommonsProperties properties) { + if (properties == null) + throw new NullPointerException("Pool property map cannot be null."); + this.properties = properties; + resourceCounter = this.properties.getInt(POOLSIZE); + } + + /** + * Er�forr�s objektum k�lcs�nz�se. + * @return + * Kik�lcs�nz�tt er�forr�s objektum. + * Visszet�r�s el�tt a checkObject-el ellen�rzi, hogy haszn�lhat� e az objektum. + * Ha nem �jat, hoz l�tre. + */ + protected Object borrowObject() { + if (pool == null) + pool = new LinkedList(); + + Object resourceObject = null; + + for (;;) { + synchronized (this) { + resourceObject = pool.poll(); + } + if (resourceObject != null) + break; + if (resourceCounter > 0) { + synchronized (this) { + resourceObject = createObject(); + resourceCounter--; + } + break; + } + + logger.debug("Waiting for resource."); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + } + + if (resourceObject != null && checkObject(resourceObject) == true) { + synchronized (this) { + logger.debug("Resource not passed the check. Recreating."); + if (pool.contains(resourceObject)) + pool.remove(resourceObject); + resourceObject = createObject(); + } + } + logger.debug(String.format("Borrow, pool size: %1$d, counter: %2$d", pool.size(), resourceCounter)); + return resourceObject; + } + + /** + * Ellen�rzi, hogy haszn�lhat� e az objektum. + * Implement�ci� f�gg�! + * @param resourceObject + * Ellen�rizend� objektum. + * @return + * true ha m�r nem haszn�lhat� + */ + abstract protected boolean checkObject(Object resourceObject); + + /** + * Az �sszes nem kik�lcs�nz�tt er�forr�s objektumot, + * a releaseObject h�v�ssal felszabad�tja. + */ + public void close() { + if (pool == null) + return; + Object resourceObject = null; + synchronized (this) { + while ((resourceObject = pool.poll()) != null) { + releaseObject(resourceObject); + } + } + pool = null; + } + + /** + * L�trehozza az er�forr�s objektumot. + * Implement�ci� f�gg�! + * @return + * A l�trehozott er�forr�s objektum. + */ + abstract protected Object createObject(); + + /** + * Param�terek lek�rdez�se. + * @return + * CommonsProperties t�pus� param�ter objektum. + */ + protected CommonsProperties getProperties() { + return properties; + } + + /** + * K�lcs�nvett er�forr�s objektum visszaszolg�ltat�sa. + * T�pus �s null pointer elle�rz�s a validateObject seg�ts�g�vel. + * @param value + * Er�forr�s objektum. + */ + protected void lendObject(Object value) { + if (pool == null) { + throw new IllegalStateException("Pool never initialized, or closed. Did you missed something?"); + } + validateObject(value); + synchronized (this) { + pool.add(value); + } + logger.debug(String.format("Lend, pool size: %1$d, counter: %2$d", pool.size(), resourceCounter)); + } + + /** + * Er�forr�s objektum felszabad�t�sa (kapcsolat lez�r�s, + * haszn�lt er�forr�sok felszabad�t�sa). + * Implement�ci� f�gg�! + * @param resourceObject + * A sz�ban forg� objektum. + */ + abstract protected void releaseObject(Object resourceObject); + + /** + * Ellen�rzi, hogy az objektum t�pusa megfelel� e. + */ + protected void validateObject(Object value) { + if (value == null) { + throw new NullPointerException("Object is null."); + } + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/IChangeHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/IChangeHandler.java new file mode 100644 index 00000000..d88bc987 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/IChangeHandler.java @@ -0,0 +1,14 @@ +package user.jobengine.changehandler; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; + +public interface IChangeHandler { + + void createHandlers(); + IChangeHandler[] getHandlers(); + boolean isInterested(Object entity); + boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType); + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/ItemTypeChangeHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/ItemTypeChangeHandler.java new file mode 100644 index 00000000..7cbbe949 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/ItemTypeChangeHandler.java @@ -0,0 +1,24 @@ +package user.jobengine.changehandler; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; + +public class ItemTypeChangeHandler extends ItemTypeChangeHandlerFactory { + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(ItemType.class); + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + finalize(manager, (ItemType)entity, signalType); + return true; + } + + @Override + public void createHandlers() { + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/ItemTypeChangeHandlerFactory.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/ItemTypeChangeHandlerFactory.java new file mode 100644 index 00000000..109a881f --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/ItemTypeChangeHandlerFactory.java @@ -0,0 +1,60 @@ +package user.jobengine.changehandler; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemType; + +public class ItemTypeChangeHandlerFactory implements IChangeHandler { + protected IChangeHandler[] handlers; + + public ItemTypeChangeHandlerFactory() { + createHandlers(); + } + + @Override + public void createHandlers() { + handlers = new IChangeHandler[] { new ItemTypeChangeHandler(), new MetadataChangeHandler(), new MetadataElementChangeHandler(), + new MetadataTypeChangeHandler() }; + } + + void finalize(IItemManager manager, ItemType itemType, SignalType signalType) { + + if (signalType.equals(SignalType.DELETE)) + manager.removeCached(ItemType.class, itemType.getId()); + else { + manager.storeCached(itemType.getId(), itemType); + } + try { + manager.signal(itemType.getId(), signalType, StaticTables.ITEMTYPE); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + @Override + public IChangeHandler[] getHandlers() { + return handlers; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + boolean result = false; + IChangeHandler[] currentHandlers = getHandlers(); + if (currentHandlers != null) { + for (IChangeHandler handler : getHandlers()) { + if (handler.isInterested(entity) || handler.isInterested(signalType)) { + result = handler.handleChange(manager, entity, signalType); + break; + } + } + } + return result; + } + + @Override + public boolean isInterested(Object entity) { + return false; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataChangeHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataChangeHandler.java new file mode 100644 index 00000000..410f2cb2 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataChangeHandler.java @@ -0,0 +1,57 @@ +package user.jobengine.changehandler; + +import java.util.ArrayList; +import java.util.List; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; + +public class MetadataChangeHandler extends ItemTypeChangeHandlerFactory { + private IChangeHandler[] handlers; + + @Override + public void createHandlers() { + handlers = new IChangeHandler[] { + new MetadataCreateHandler(), + new MetadataDeleteHandler(), + new MetadataUpdateHandler() + }; + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(Metadata.class); + } + + @Override + public IChangeHandler[] getHandlers() { + return handlers; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + return super.handleChange(manager, entity, signalType); + } + + void updateItemType(IItemManager manager, ItemType itemType, List metadatas, Metadata metadata) { + } + + void visitItemTypes(IItemManager manager, Metadata metadata) { + ItemType itemType = null; + if (metadata != null) { + itemType = (ItemType) manager.retrieveCached(ItemType.class, metadata.getItemTypeId()); + if (itemType != null) { + List metadatas = itemType.getMetadatas(); + if (metadatas == null) { + metadatas = new ArrayList(); + itemType.setMetadatas(metadatas); + } + updateItemType(manager, itemType, metadatas, metadata); + } + } + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataCreateHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataCreateHandler.java new file mode 100644 index 00000000..3b95c0ca --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataCreateHandler.java @@ -0,0 +1,33 @@ +package user.jobengine.changehandler; + +import java.util.List; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; + +public class MetadataCreateHandler extends MetadataChangeHandler { + + @Override + public void createHandlers() { + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + visitItemTypes(manager, (Metadata) entity); + return true; + } + + void updateItemType(IItemManager manager, ItemType itemType, List metadatas, Metadata metadata) { + metadatas.add(metadata); + finalize(manager, itemType, SignalType.UPDATE); + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(SignalType.class) && ((SignalType)entity) == SignalType.CREATE; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataDeleteHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataDeleteHandler.java new file mode 100644 index 00000000..3696661e --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataDeleteHandler.java @@ -0,0 +1,42 @@ +package user.jobengine.changehandler; + +import java.util.List; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; + +public class MetadataDeleteHandler extends MetadataChangeHandler { + + @Override + public void createHandlers() { + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(SignalType.class) && ((SignalType)entity) == SignalType.DELETE; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + visitItemTypes(manager, (Metadata) entity); + return true; + } + + void updateItemType(IItemManager manager, ItemType itemType, List metadatas, Metadata metadata) { + int index = -1; + for (int i = 0; i < metadatas.size(); i++) { + if (metadatas.get(i).getId() == metadata.getId()) { + index = i; + break; + } + } + if (index > -1) { + metadatas.remove(index); + finalize(manager, itemType, SignalType.UPDATE); + } + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataElementChangeHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataElementChangeHandler.java new file mode 100644 index 00000000..bcd42f05 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataElementChangeHandler.java @@ -0,0 +1,58 @@ +package user.jobengine.changehandler; + +import java.util.List; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; +import user.jobengine.db.MetadataElement; + +public class MetadataElementChangeHandler extends ItemTypeChangeHandlerFactory { + private IChangeHandler[] handlers; + + @Override + public void createHandlers() { + handlers = new IChangeHandler[] { + new MetadataElementUpdateHandler() + }; + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(MetadataElement.class); + } + + @Override + public IChangeHandler[] getHandlers() { + return handlers; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + return super.handleChange(manager, entity, signalType); + } + + void updateItemType(IItemManager manager, ItemType itemType, Metadata metadata, MetadataElement metadataElement) { + } + + @SuppressWarnings("unchecked") + void visitItemTypes(IItemManager manager, MetadataElement metadataElement) { + if (metadataElement != null) { + List itemTypes = (List)(List) manager.getAllCached(ItemType.class); + if (itemTypes != null) { + for (ItemType itemType : itemTypes) { + List metadatas = itemType.getMetadatas(); + if (metadatas != null) { + for (Metadata metadata : metadatas) { + if (metadata.getMetadataElementId() == metadataElement.getId()) + updateItemType(manager, itemType, metadata, metadataElement); + } + } + } + } + } + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataElementUpdateHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataElementUpdateHandler.java new file mode 100644 index 00000000..88b7dc72 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataElementUpdateHandler.java @@ -0,0 +1,33 @@ +package user.jobengine.changehandler; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; +import user.jobengine.db.MetadataElement; + +public class MetadataElementUpdateHandler extends MetadataElementChangeHandler { + + @Override + public void createHandlers() { + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(SignalType.class) && ((SignalType)entity) == SignalType.UPDATE; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + visitItemTypes(manager, (MetadataElement) entity); + return true; + } + + @Override + void updateItemType(IItemManager manager, ItemType itemType, Metadata metadata, MetadataElement metadataElement) { + metadata.setMetadataElement(metadataElement); + finalize(manager, itemType, SignalType.UPDATE); + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataTypeChangeHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataTypeChangeHandler.java new file mode 100644 index 00000000..ac1c19fc --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataTypeChangeHandler.java @@ -0,0 +1,60 @@ +package user.jobengine.changehandler; + +import java.util.List; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; +import user.jobengine.db.MetadataElement; +import user.jobengine.db.MetadataType; + +public class MetadataTypeChangeHandler extends ItemTypeChangeHandlerFactory { + private IChangeHandler[] handlers; + + @Override + public void createHandlers() { + handlers = new IChangeHandler[] { + new MetadataTypeUpdateHandler() + }; + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(MetadataType.class); + } + + @Override + public IChangeHandler[] getHandlers() { + return handlers; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + return super.handleChange(manager, entity, signalType); + } + + void updateItemType(IItemManager manager, ItemType itemType, MetadataElement metadataElement, MetadataType metadataType) { + } + + @SuppressWarnings("unchecked") + void visitItemTypes(IItemManager manager, MetadataType metadataType) { + if (metadataType != null) { + List itemTypes = (List)(List) manager.getAllCached(ItemType.class); + if (itemTypes != null) { + for (ItemType itemType : itemTypes) { + List metadatas = itemType.getMetadatas(); + if (metadatas != null) { + for (Metadata metadata : metadatas) { + MetadataElement metadataElement = metadata.getMetadataElement(); + if (metadataElement.getMetadataTypeId() == metadataType.getId()) + updateItemType(manager, itemType, metadataElement, metadataType); + } + } + } + } + } + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataTypeUpdateHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataTypeUpdateHandler.java new file mode 100644 index 00000000..81b16557 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataTypeUpdateHandler.java @@ -0,0 +1,33 @@ +package user.jobengine.changehandler; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.MetadataElement; +import user.jobengine.db.MetadataType; + +public class MetadataTypeUpdateHandler extends MetadataTypeChangeHandler { + + @Override + public void createHandlers() { + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(SignalType.class) && ((SignalType)entity) == SignalType.UPDATE; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + visitItemTypes(manager, (MetadataType) entity); + return true; + } + + @Override + void updateItemType(IItemManager manager, ItemType itemType, MetadataElement metadataElement, MetadataType metadataType) { + metadataElement.setMetadataType(metadataType); + finalize(manager, itemType, SignalType.UPDATE); + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataUpdateHandler.java b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataUpdateHandler.java new file mode 100644 index 00000000..0a535b08 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/changehandler/MetadataUpdateHandler.java @@ -0,0 +1,43 @@ +package user.jobengine.changehandler; + +import java.util.List; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; + +public class MetadataUpdateHandler extends MetadataChangeHandler { + + @Override + public void createHandlers() { + } + + @Override + public boolean isInterested(Object entity) { + return entity != null && entity.getClass().equals(SignalType.class) && ((SignalType)entity) == SignalType.UPDATE; + } + + @Override + public boolean handleChange(IItemManager manager, IEntityBase entity, SignalType signalType) { + visitItemTypes(manager, (Metadata) entity); + return true; + } + + void updateItemType(IItemManager manager, ItemType itemType, List metadatas, Metadata metadata) { + int index = -1; + for (int i = 0; i < metadatas.size(); i++) { + if (metadatas.get(i).getId() == metadata.getId()) { + index = i; + break; + } + } + if (index > -1) { + metadatas.remove(index); + metadatas.add(index, metadata); + finalize(manager, itemType, SignalType.UPDATE); + } + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Break.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Break.java new file mode 100644 index 00000000..7232b316 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Break.java @@ -0,0 +1,76 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.sql.Timestamp; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import user.commons.EntityBase; +import user.commons.TimestampAdapter; +import user.jobengine.db.ItemManagerData.BreakType; + +@SuppressWarnings("serial") +public class Break extends EntityBase implements Serializable { + private Timestamp created = null; + private BreakType breakType = null; + private long inPoint = 0; + private Media media = null; + private long mediaId = 0; + private byte[] thumbnail = null; + + public BreakType getBreakType() { + return this.breakType; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return this.created; + } + + public long getInPoint() { + return this.inPoint; + } + + public Media getMedia() { + if (this.media == null && this.mediaId != 0) { + this.media = (Media) ItemManager.getInstance().getMedia( + this.mediaId); + } + return media; + } + + public long getMediaId() { + return this.mediaId; + } + + public byte[] getThumbnail() { + return this.thumbnail; + } + + public void setBreakType(BreakType breakType) { + this.breakType = breakType; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public void setInPoint(long inPoint) { + this.inPoint = inPoint; + } + + public void setMedia(Media media) { + checkParameter("Media", media); + this.media = media; + this.mediaId = media.getId(); + } + + public void setMediaId(long mediaId) { + checkParameter("MediaId", mediaId); + this.mediaId = mediaId; + } + + public void setThumbnail(byte[] thumbnail) { + this.thumbnail = thumbnail; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/BreakDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/BreakDAO.sqlj new file mode 100644 index 00000000..594607c7 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/BreakDAO.sqlj @@ -0,0 +1,94 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; +import java.util.ArrayList; + +#sql iterator BreakIter(long id, String breakType, long inPoint, long mediaId, Timestamp created, byte[] thumbnail); + +@SuppressWarnings("unused") +class BreakDAO extends EntityBaseDAO { + + public BreakDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + BreakIter iterator = (BreakIter) iter; + while (iterator.next()) { + Break entity = new Break(); + entity.setId(iterator.id()); + entity.setBreakType(ItemManagerData.toBreakType(iterator.breakType())); + entity.setInPoint(iterator.inPoint()); + entity.setMediaId(iterator.mediaId()); + entity.setCreated(iterator.created()); + entity.setThumbnail(iterator.thumbnail()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + BreakIter iter = null; + #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + BreakIter iter = null; + #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK WHERE MEDIAID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + BreakIter iter = null; + #sql [context] iter = { SELECT ID, BREAKTYPE, INPOINT, MEDIAID, CREATED, THUMBNAIL FROM BREAK }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM BREAK WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE BREAK DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Break obj = (Break) entity; + long id = obj.getId(); + String breakType = obj.getBreakType().toString(); + long inPoint = obj.getInPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + #sql [context] { UPDATE BREAK SET BREAKTYPE = :breakType, INPOINT = :inPoint, MEDIAID = :mediaId, THUMBNAIL = :thumbnail WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Break obj = (Break) entity; + String breakType = obj.getBreakType().toString(); + long inPoint = obj.getInPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + #sql [context] { INSERT INTO BREAK (BREAKTYPE, INPOINT, MEDIAID, THUMBNAIL) VALUES (:breakType, :inPoint, :mediaId, :thumbnail) }; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Color.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Color.java new file mode 100644 index 00000000..9884e70f --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Color.java @@ -0,0 +1,63 @@ +package user.jobengine.db; + +public class Color { + public static Color Error() { + return new Color(20, 255, 0, 0); + } + public static Color Finished() { + return new Color(0, 0, 0, 0); + } + public static Color Idle() { + return new Color(20, 246, 255, 42); + } + public static Color Running() { + return new Color(20, 0, 255, 0); + } + + private byte A; + + private byte R; + + private byte G; + + private byte B; + + public Color(int a, int r, int g, int b) { + setA((byte)a); + setR((byte)r); + setG((byte)g); + setB((byte)b); + } + + public byte getA() { + return A; + } + + public byte getB() { + return B; + } + + public byte getG() { + return G; + } + + public byte getR() { + return R; + } + + public void setA(byte a) { + A = a; + } + + public void setB(byte b) { + B = b; + } + + public void setG(byte g) { + G = g; + } + + public void setR(byte r) { + R = r; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Converter.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Converter.java new file mode 100644 index 00000000..2b098c8f --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Converter.java @@ -0,0 +1,91 @@ +package user.jobengine.db; + +import java.sql.Timestamp; +import java.util.Date; +import java.util.HashMap; + +import user.commons.BaseType; + +public class Converter { + private HashMap converters; + + public Converter() { + HashMap converters = new HashMap(); + converters.put(BaseType.BOOL, new BooleanConverter()); + // converters.put(BaseType.DATETIME, new DateTimeConverter()); + register(converters); + } + + public class BooleanConverter implements IValueConverter { + + @Override + public Object Convert(Object value) { + return value.toString().equalsIgnoreCase("Y"); + } + + @Override + public Object ConvertBack(Object value) { + return ((boolean) value) ? "Y" : "N"; + } + } + + public class DateTimeConverter implements IValueConverter { + + @Override + public Object Convert(Object value) { + // Object result = null; + // + // if (value != null) { + // Class clazz = value.getClass(); + // Timestamp date = null; + // if (clazz == Date.class) { + // date = new Timestamp(((Date) value).getTime()); + // } else + // date = (Timestamp) value; + // result = ItemManagerData.toDateString(date, 0, 0); + // } + + return value; + } + + @Override + public Object ConvertBack(Object value) { + Object result = null; + if (value != null) + result = new Timestamp(((Date) value).getTime()); + return result; + } + } + + public void register(HashMap parameter) { + if (converters == null) + converters = new HashMap(); + if (parameter != null) + converters.putAll(parameter); + } + + Object Convert(Object value, Metadata md) { + Object result = value; + BaseType bt = null; + try { + bt = md.getMetadataElement().getMetadataType().getBaseType(); + } catch (Exception e) { + } + if (value != null && bt != null && converters.containsKey(bt)) + result = converters.get(bt).Convert(value); + return result; + } + + Object ConvertBack(Object value, Metadata md) { + Object result = value; + BaseType bt = null; + try { + bt = md.getMetadataElement().getMetadataType().getBaseType(); + } catch (Exception e) { + } + if (value != null && bt != null && converters.containsKey(bt)) + result = converters.get(bt).ConvertBack(value); + return result; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Domain.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Domain.java new file mode 100644 index 00000000..c528e941 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Domain.java @@ -0,0 +1,56 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.EntityBase; + +/** + * Lista Pojo osztály. + * + * @author User + * + */ +@SuppressWarnings("serial") +public class Domain extends EntityBase implements Serializable { + private String display; + private long domainCategoryId; + private long value; + + public Domain() { + + } + + public Domain(String display) { + this.display = display; + } + + public Domain(String display, long value) { + this.display = display; + this.value = value; + } + + public String getDisplay() { + return display; + } + + public long getDomainCategoryId() { + return domainCategoryId; + } + + public long getValue() { + return value; + } + + public void setDisplay(String display) { + this.display = display; + } + + public void setDomainCategoryId(long domainCategoryId) { + this.domainCategoryId = domainCategoryId; + } + + public void setValue(long value) { + this.value = value; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainCategory.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainCategory.java new file mode 100644 index 00000000..9b164f9e --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainCategory.java @@ -0,0 +1,58 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import user.commons.EntityBase; + +/** + * Lista kategória Pojo osztály. + * + * @author User + * + */ +@SuppressWarnings("serial") +public class DomainCategory extends EntityBase implements Serializable { + private String name; + private List domains; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @SuppressWarnings("unchecked") + public List getDomains() { + if (domains == null) { + DomainDAO dao = (DomainDAO) ItemManager.getInstance().getBaseDAO( + Domain.class); + domains = (List) (List) dao.getAll(getId()); + } + return domains; + } + + public void setDomains(List domains) { + this.domains = domains; + } + + public void addDomain(Domain domain) { + if (getDomains() == null) + domains = new ArrayList(); + domains.add(domain); + } + + public void addDomain(String display) { + addDomain(display, 0); + } + + public void addDomain(String display, long value) { + Domain domain = new Domain(); + domain.setDisplay(display); + domain.setValue(value); + addDomain(domain); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainCategoryDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainCategoryDAO.sqlj new file mode 100644 index 00000000..05a1cfe5 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainCategoryDAO.sqlj @@ -0,0 +1,115 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +#sql iterator DomainCategoryIter(long id, String name); + +@SuppressWarnings("unused") +class DomainCategoryDAO extends EntityBaseDAO { + + public DomainCategoryDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + dao.addMissing(context, entity); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + dao.addMissing(context, entity); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + DomainCategoryIter iterator = (DomainCategoryIter) iter; + while (iterator.next()) { + DomainCategory entity = new DomainCategory(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + DomainCategoryIter iter = null; + #sql [context] iter = { SELECT ID, NAME FROM DOMAINCATEGORY WHERE ID = :id }; + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String name) throws SQLException{ + DomainCategoryIter iter = null; + #sql [context] iter = { SELECT ID, NAME FROM DOMAINCATEGORY WHERE NAME = :name }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + DomainCategoryIter iter = null; + #sql [context] iter = { SELECT ID, NAME FROM DOMAINCATEGORY ORDER BY NAME }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM DOMAINCATEGORY WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE DOMAINCATEGORY DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainCategory obj = (DomainCategory) entity; + long id = obj.getId(); + String name = obj.getName(); + + #sql [context] { UPDATE DOMAINCATEGORY SET NAME = :name WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainCategory obj = (DomainCategory) entity; + String name = obj.getName(); + + #sql [context] { INSERT INTO DOMAINCATEGORY (NAME) VALUES (:name) }; + } + + DomainCategory addMissing(String name) { + manager.traceIn(); + DomainCategory entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, name); + entity = (DomainCategory) getEntity(context, iter); + if (entity == null) { + entity = new DomainCategory(); + entity.setName(name); + add(context, entity); + } + + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainDAO.sqlj new file mode 100644 index 00000000..6b0efdfb --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainDAO.sqlj @@ -0,0 +1,152 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +#sql iterator DomainIter(long id, long domainCategoryId, String display, long value); + +@SuppressWarnings("unused") +class DomainDAO extends EntityBaseDAO { + + public DomainDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + DomainIter iterator = (DomainIter) iter; + while (iterator.next()) { + Domain entity = new Domain(); + entity.setId(iterator.id()); + entity.setDomainCategoryId(iterator.domainCategoryId()); + entity.setDisplay(iterator.display()); + entity.setValue(iterator.value()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException { + DomainIter iter = null; + #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException { + DomainIter iter = null; + #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE DOMAINCATEGORYID = :id }; + return iter; + } + + protected ResultSetIterImpl selectByRecordId(DefaultContext context, long recordId, long metadataId) throws SQLException { + DomainIter iter = null; + #sql [context] iter = { SELECT d.ID, d.DOMAINCATEGORYID, d.DISPLAY, d.VALUE FROM DOMAIN d, DOMAININDEX i WHERE d.ID = i.DOMAINID AND i.METADATAID = :metadataId AND i.RECORDID = :recordId }; + return iter; + } + + protected ResultSetIterImpl selectByDisplay(DefaultContext context, long id, String display) throws SQLException { + DomainIter iter = null; + #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE DOMAINCATEGORYID = :id AND DISPLAY = :display }; + return iter; + } + + protected ResultSetIterImpl selectByDisplayFilter(DefaultContext context, long id, String displayFilter) throws SQLException { + DomainIter iter = null; + #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN WHERE DOMAINCATEGORYID = :id AND (UPPER(DISPLAY) LIKE :displayFilter) }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException { + DomainIter iter = null; + #sql [context] iter = { SELECT ID, DOMAINCATEGORYID, DISPLAY, VALUE FROM DOMAIN ORDER BY DISPLAY }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM DOMAIN WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE DOMAIN DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Domain obj = (Domain) entity; + long id = obj.getId(); + long domainCategoryid = obj.getDomainCategoryId(); + String display = obj.getDisplay(); + long value = obj.getValue(); + #sql [context] { UPDATE DOMAIN SET DOMAINCATEGORYID = :domainCategoryid, DISPLAY = :display, VALUE = :value WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Domain obj = (Domain) entity; + long domainCategoryid = obj.getDomainCategoryId(); + String display = obj.getDisplay(); + long value = obj.getValue(); + + #sql [context] { INSERT INTO DOMAIN (DOMAINCATEGORYID, DISPLAY, VALUE) VALUES (:domainCategoryid, :display, :value) }; + } + + void addMissing(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + DomainCategory domainCategory = (DomainCategory) entity; + if (domainCategory != null) { + long domainCategoryId = domainCategory.getId(); + List domains = domainCategory.getDomains(); + if (domains != null) { + for (Domain d: domains) { + d.setDomainCategoryId(domainCategoryId); + ResultSetIterImpl iter = selectByDisplay(context, domainCategoryId, d.getDisplay()); + Domain existing = (Domain) getEntity(context, iter); + if (existing == null) + add(context, d); + else + d.setId(existing.getId()); + } + } + } + manager.traceOut(); + } + + List getAll(DefaultContext context, IEntityBase entity, IEntityBase metadata) throws SQLException { + manager.traceIn(); + ResultSetIterImpl iter = selectByRecordId(context, entity.getId(), metadata.getId()); + List result = getList(context, iter, false); + manager.traceOut(); + return result; + } + + List getByDisplayFilter(long domainCategoryId, String filter) { + manager.traceIn(); + List result = null; + DefaultContext context = manager.getDbContext(); + try { + String displayFilter = (filter + "%").toUpperCase(); + ResultSetIterImpl iter = selectByDisplayFilter(context, domainCategoryId, displayFilter); + result = getList(context, iter, false); + } catch (Exception e) { + logger.error(e.getMessage()); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainIndex.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainIndex.java new file mode 100644 index 00000000..db3bc283 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainIndex.java @@ -0,0 +1,48 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.EntityBase; + +@SuppressWarnings("serial") +public class DomainIndex extends EntityBase implements Serializable { + private long metadataId; + private long domainId; + private long recordId; + + public DomainIndex() { + + } + + public DomainIndex(long recordId, long metadataId, long domainId) { + this.recordId = recordId; + this.metadataId = metadataId; + this.domainId = domainId; + + } + + public long getDomainId() { + return domainId; + } + + public long getMetadataId() { + return metadataId; + } + + public long getRecordId() { + return recordId; + } + + public void setDomainId(long domainId) { + this.domainId = domainId; + } + + public void setMetadataId(long metadataId) { + this.metadataId = metadataId; + } + + public void setRecordId(long recordId) { + this.recordId = recordId; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainIndexDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainIndexDAO.sqlj new file mode 100644 index 00000000..d8864ba9 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/DomainIndexDAO.sqlj @@ -0,0 +1,112 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +#sql iterator DomainIndexIter(long id, long recordId, long metadataId, long domainId); + +@SuppressWarnings("unused") +class DomainIndexDAO extends EntityBaseDAO { + + public DomainIndexDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + DomainIndexIter iterator = (DomainIndexIter) iter; + while (iterator.next()) { + DomainIndex entity = new DomainIndex(); + entity.setId(iterator.id()); + entity.setRecordId(iterator.recordId()); + entity.setMetadataId(iterator.metadataId()); + entity.setDomainId(iterator.domainId()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + DomainIndexIter iter = null; + #sql [context] iter = { SELECT ID, RECORDID, METADATAID, DOMAINID FROM DOMAININDEX WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + DomainIndexIter iter = null; + #sql [context] iter = { SELECT ID, RECORDID, METADATAID, DOMAINID FROM DOMAININDEX WHERE RECORDID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + DomainIndexIter iter = null; + #sql [context] iter = { SELECT ID, RECORDID, METADATAID, DOMAINID FROM DOMAININDEX }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM DOMAININDEX WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE DOMAININDEX DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainIndex obj = (DomainIndex) entity; + long id = obj.getId(); + long recordId = obj.getRecordId(); + long metadataId = obj.getMetadataId(); + long domainId = obj.getDomainId(); + + #sql [context] { UPDATE DOMAININDEX SET RECORDID = :recordId, METADATAID = :metadataId, DOMAINID = :domainId WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + DomainIndex obj = (DomainIndex) entity; + long recordId = obj.getRecordId(); + long metadataId = obj.getMetadataId(); + long domainId = obj.getDomainId(); + + #sql [context] { INSERT INTO DomainIndex (RECORDID, METADATAID, DOMAINID) VALUES (:recordId, :metadataId, :domainId) }; + } + + void addAll(DefaultContext context, IEntityBase record, IEntityBase metadata, IEntityBase entity) throws SQLException { + manager.traceIn(); + DomainCategory domainCategory = (DomainCategory) entity; + if (domainCategory != null && metadata != null && record != null) { + List domains = domainCategory.getDomains(); + if (domains != null) { + for (Domain domain: domains) { + DomainIndex domainIndex = new DomainIndex(record.getId(), metadata.getId(), domain.getId()); + add(context, domainIndex); + } + } + } + manager.traceOut(); + } + + void removeAll(DefaultContext context, IEntityBase entity, IEntityBase metadata) throws SQLException { + manager.traceIn(); + long recordId = entity.getId(); + long metadataId = metadata.getId(); + #sql [context] { DELETE FROM DOMAININDEX WHERE RECORDID = :recordId AND METADATAID = :metadataId }; + manager.traceOut(); + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Domains.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Domains.java new file mode 100644 index 00000000..33159e17 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Domains.java @@ -0,0 +1,24 @@ +package user.jobengine.db; + +import java.util.List; + +public class Domains { + private List values; + + public Domains() { + } + + public Domains(List domains) { + setValues(domains); + } + + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/DynamicAttributes.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/DynamicAttributes.java new file mode 100644 index 00000000..57fd2ce5 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/DynamicAttributes.java @@ -0,0 +1,105 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** + * Seg�d oszt�ly a dinamikus metaadatok kezel�s�re. + */ +public class DynamicAttributes extends JSONBase implements Serializable { + private static final long serialVersionUID = 1L; + + @JsonIgnore + private Map attributes = null; + private ItemType itemType = null; + private long itemTypeId = 0; + private boolean loaded = false; + + public Metadata getMetadata(String name) { + return getItemType().getMetadata(name); + } + + public Object getAttribute(String name) { + ItemManager.getInstance().traceIn(); + Object result = null; + initalize(); + result = attributes.get(name); + ItemManager.getInstance().traceOut(); + return result; + } + + public Map getAttributes() { + initalize(); + return this.attributes; + } + + public ItemType getItemType() { + if (itemType == null && itemTypeId > 0) { + itemType = (ItemType) ItemManager.getInstance().get(ItemType.class, itemTypeId); + if (itemType == null) + throw new ItemManagerException("DynamicAttribute ItemType is null."); + } + return itemType; + } + + public long getItemTypeId() { + return this.itemTypeId; + } + + private void initalize() { + ItemManager.getInstance().traceIn(); + if (attributes == null) { + if (getItemType() != null) { + attributes = new HashMap(); + List metadatas = getItemType().getMetadatas(); + if (metadatas != null) { + for (Metadata metadata : metadatas) { + MetadataElement metadataElement = metadata.getMetadataElement(); + attributes.put(metadataElement.getName(), null); + } + } + if (getId() > 0 && !loaded) { + DynamicAttributesDAO daDAO = (DynamicAttributesDAO) ItemManager.getInstance() + .getBaseDAO(DynamicAttributes.class); + daDAO.get(this); + } + } + loaded = true; + } + ItemManager.getInstance().traceOut(); + } + + public void setAttribute(String name, Object value) { + setAttribute(name, value, false); + } + + protected void setAttribute(String name, Object value, boolean fromDb) { + ItemManager.getInstance().traceIn(); + initalize(); + Metadata metadata = getMetadata(name); + MetadataElement metadataElement = metadata.getMetadataElement(); + MetadataType metadataType = metadataElement.getMetadataType(); + if (ItemManagerData.checkObjectType(metadataElement.getName(), value, metadataType.getBaseType(), fromDb)) + attributes.put(metadataElement.getName(), value); + ItemManager.getInstance().traceOut(); + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public void setItemType(ItemType itemType) { + checkParameter("ItemType", itemType); + this.itemType = itemType; + this.itemTypeId = itemType.getId(); + } + + public void setItemTypeId(long itemTypeId) { + this.itemTypeId = itemTypeId; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/DynamicAttributesDAO.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/DynamicAttributesDAO.java new file mode 100644 index 00000000..9e76a5ed --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/DynamicAttributesDAO.java @@ -0,0 +1,294 @@ +package user.jobengine.db; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import sqlj.runtime.ref.DefaultContext; +import user.commons.BaseType; +import user.commons.IEntityBase; + +public class DynamicAttributesDAO extends EntityBaseDAO { + private Converter converter; + + public class BooleanConverter implements IValueConverter { + + @Override + public Object Convert(Object value) { + return value.toString().equalsIgnoreCase("Y"); + } + + @Override + public Object ConvertBack(Object value) { + return ((boolean) value) ? "Y" : "F"; + } + } + + public DynamicAttributesDAO(ItemManager manager) { + super(manager); + HashMap converters = new HashMap(); + converters.put(BaseType.BOOL, new BooleanConverter()); + converter = new Converter(); + converter.register(converters); + + } + + void addAsDomain(DefaultContext context, IEntityBase entity, Metadata metadata, List domains, boolean modify) throws SQLException { + DomainIndexDAO indexdao = (DomainIndexDAO) manager.getBaseDAO(DomainIndex.class); + + if (domains != null && domains.size() > 0) { + logger.debug("Adding domain attribute " + metadata.getMetadataElement().getName() + " , value count: " + domains.size()); + long domainCategoryId = metadata.getMetadataElement().getDomainCategoryId(); + DomainCategory dc = (DomainCategory) manager.get(DomainCategory.class, domainCategoryId); + dc.setDomains(domains); + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + dao.addMissing(context, dc); + if (modify) + indexdao.removeAll(context, entity, metadata); + indexdao.addAll(context, entity, metadata, dc); + } else { + if (modify) + indexdao.removeAll(context, entity, metadata); + } + } + + @Override + public void add(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + DynamicAttributes da = (DynamicAttributes) entity; + da.checkParameter("ID", da.getId(), false); + Map attributes = da.getAttributes(); + ItemType itemType = (ItemType) manager.get(ItemType.class, da.getItemTypeId()); + if (itemType != null) { + List metadatas = itemType.getMetadatas(); + if (metadatas != null) { + for (Metadata metadata : metadatas) { + if (metadata.getIsDbNullable() == false) { + String name = metadata.getMetadataElement().getName(); + Metadata attributesMetadata = da.getMetadata(name); + Object value = converter.ConvertBack(da.getAttribute(name), attributesMetadata); + if (attributesMetadata == null || value == null) { + throw new ItemManagerException(String.format("%1$s required field is blank or missing", metadata.getMetadataElement().getName())); + } + } + } + } + } + if (attributes != null) { + int attributesCount = attributes.size(); + if (attributesCount > 0) { + for (String name : attributes.keySet()) { + PreparedStatement st = null; + try { + Metadata metadata = da.getMetadata(name); + Object value = converter.ConvertBack(da.getAttribute(name), metadata); + + if (metadata.getIsDbNullable() == false && value == null) + throw new ItemManagerException(String.format("%1$s required field is blank or missing", name)); + + if (metadata.getIsDbNullable() && value == null) + continue; + + if (metadata.isDomain()) { + addAsDomain(context, entity, metadata, ((Domains) value).getValues(), false); + continue; + } + + String sql = String.format("INSERT INTO %1$s (ID, %2$s) VALUES (?, ?)", metadata.getTableName(), metadata.getColumnName()); + st = context.getConnection().prepareStatement(sql); + st.setLong(1, da.getId()); + st.setObject(2, value); + st.executeUpdate(); + } catch (SQLException e) { + manager.throwError(e); + } finally { + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + } + } + } + } + manager.traceOut(); + } + + @SuppressWarnings("unchecked") + Domains getAsDomain(DefaultContext context, IEntityBase entity, Metadata metadata) throws SQLException { + logger.debug("Reading domain attribute " + metadata.getMetadataElement().getName()); + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + List domains = (List) (List) dao.getAll(context, entity, metadata); + Domains result = null; + if (domains != null) + result = new Domains(domains); + return result; + } + + void get(IEntityBase entity) { + manager.traceIn(); + DynamicAttributes da = (DynamicAttributes) entity; + da.checkParameter("ID", da.getId(), false); + Map attributes = da.getAttributes(); + int attributesCount = attributes.size(); + if (attributesCount > 0) { + DefaultContext context = manager.getDbContext(); + PreparedStatement st = null; + ResultSet rs = null; + try { + Connection connection = context.getConnection(); + for (String name : attributes.keySet()) { + Metadata metadata = da.getMetadata(name); + + if (metadata.isDomain()) { + Domains domains = getAsDomain(context, entity, metadata); + da.setAttribute(name, domains, true); + continue; + } + + String columnName = metadata.getColumnName(); + String sql = String.format("SELECT %2$s FROM %1$s WHERE ID = ?", metadata.getTableName(), columnName); + st = connection.prepareStatement(sql); + st.setLong(1, da.getId()); + // manager.trace(st.toString()); + rs = st.executeQuery(); + if (rs.next()) { + Object value = converter.Convert(rs.getObject(columnName), metadata); + da.setAttribute(name, value, true); + } + rs.close(); + st.close(); + } + connection.commit(); + } catch (Exception e) { + try { + if (rs != null && !rs.isClosed()) + rs.close(); + } catch (Exception e1) { + } + try { + if (st != null && !st.isClosed()) + st.close(); + } catch (Exception e1) { + } + manager.throwError(e); + } finally { + manager.putDbContext(context); + } + + } + manager.traceOut(); + } + + @Override + public void modify(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + DynamicAttributes da = (DynamicAttributes) entity; + da.checkParameter("ID", da.getId(), false); + Map attributes = da.getAttributes(); + int attributesCount = attributes.size(); + + if (attributesCount > 0) { + for (String name : attributes.keySet()) { + PreparedStatement st = null; + try { + Metadata metadata = da.getMetadata(name); + Object value = converter.ConvertBack(da.getAttribute(name), metadata); + logger.debug("DynamicAttributes modify: Name " + name + " value " + value); + + if (metadata.getIsDbNullable() && value == null) { + if (metadata.isDomain()) { + removeAsDomain(context, entity, metadata); + continue; + } + String sql = String.format("DELETE FROM %1$s WHERE ID = ?", metadata.getTableName()); + st = context.getConnection().prepareStatement(sql); + st.setLong(1, da.getId()); + st.executeUpdate(); + } else { + if (metadata.isDomain()) { + addAsDomain(context, entity, metadata, ((Domains) value).getValues(), true); + continue; + } + + String sql = String.format("UPDATE %1$s SET %2$s = ? WHERE ID = ?", metadata.getTableName(), metadata.getColumnName()); + st = context.getConnection().prepareStatement(sql); + st.setLong(2, da.getId()); + st.setObject(1, value); + int rows = st.executeUpdate(); + + if (metadata.getIsDbNullable() && rows == 0) { + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + + sql = String.format("INSERT INTO %1$s (ID, %2$s) VALUES (?, ?)", metadata.getTableName(), metadata.getColumnName()); + st = context.getConnection().prepareStatement(sql); + st.setLong(1, da.getId()); + st.setObject(2, value); + st.executeUpdate(); + } + + } + } catch (SQLException e) { + manager.throwError(e); + } finally { + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + } + } + } + manager.traceOut(); + } + + void removeAsDomain(DefaultContext context, IEntityBase entity, Metadata metadata) throws SQLException { + logger.debug("Removing domain attribute " + metadata.getMetadataElement().getName()); + DomainIndexDAO indexdao = (DomainIndexDAO) manager.getBaseDAO(DomainIndex.class); + indexdao.removeAll(context, entity, metadata); + } + + @Override + public void remove(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + DynamicAttributes da = (DynamicAttributes) entity; + da.checkParameter("ID", da.getId(), false); + Map attributes = da.getAttributes(); + int attributesCount = attributes.size(); + if (attributesCount > 0) { + for (String name : attributes.keySet()) { + PreparedStatement st = null; + try { + Metadata metadata = da.getMetadata(name); + + if (metadata.isDomain()) { + removeAsDomain(context, entity, metadata); + continue; + } + + String sql = String.format("DELETE FROM %1$s WHERE ID = ?", metadata.getTableName(), metadata.getColumnName()); + st = context.getConnection().prepareStatement(sql); + st.setLong(1, da.getId()); + st.executeUpdate(); + } catch (SQLException e) { + manager.throwError(e); + } finally { + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + } + } + } + manager.traceOut(); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/EntityBaseDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/EntityBaseDAO.sqlj new file mode 100644 index 00000000..b9822450 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/EntityBaseDAO.sqlj @@ -0,0 +1,400 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import user.commons.logging.LogUtils; +import java.sql.SQLException; +import java.sql.ResultSet; +import java.util.List; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import sqlj.runtime.ref.DefaultContext; +import sqlj.runtime.ref.ResultSetIterImpl; +/** + * Az entit�sok alap DAO oszt�lya. + */ +@SuppressWarnings("unused") +public abstract class EntityBaseDAO implements IEntityBaseDAO { + protected ItemManager manager; + protected static final Logger logger = LogManager.getLogger(); + + public EntityBaseDAO(ItemManager manager) { + this.manager = manager; + } + + @SuppressWarnings("rawtypes") + protected void checkNull(Object obj, Class type) { + if (obj == null) + throw new IllegalArgumentException(type.getName() + " can not be null."); + } + + @Override + public void add(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + add(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + public void add(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + try { + checkNull(entity, IEntityBase.class); + beforeAdd(context, entity); + long id = entity.getId(); + + insert(context, entity); + if (id == 0) { + #sql [context] { SELECT IDENTITY_VAL_LOCAL() INTO :id FROM SYSIBM.SYSDUMMY1 }; + entity.setId(id); + } + afterAdd(context, entity); + #sql [context] { COMMIT }; + if (useMemoryCache()) + manager.storeCached(entity.getId(), entity); + + } catch (Exception e) { + try { + #sql [context] { ROLLBACK }; + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + @Override + public IEntityBase get(long id) { + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + entity = get(context, id); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return entity; + } + + public IEntityBase get(DefaultContext context, long id) { + manager.traceIn(); + IEntityBase entity = null; + try { + if (id == 0) + throw new IllegalArgumentException("Cannot get EntityBase with 0 ID."); + if (useMemoryCache()) + entity = manager.retrieveCached(getCacheType(), id); + if (entity == null) { + ResultSetIterImpl iter = selectByKey(context, id); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + if (useMemoryCache()) + manager.storeCached(id, entity); + } + afterGet(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return entity; + } + + @Override + public List getAll() { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + result = getAll(context); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return result; + } + + public List getAll(DefaultContext context) { + manager.traceIn(); + List result = null; + try { + ResultSetIterImpl iter = selectAll(context); + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, false, true); + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return result; + } + + @Override + public List getAll(long id) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + result = getAll(context, id); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return result; + } + + public List getAll(DefaultContext context, long id) { + manager.traceIn(); + List result = null; + try { + ResultSetIterImpl iter = selectByForeignKey(context, id); + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, false, true); + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return result; + } + + protected IEntityBase getEntity(DefaultContext context, ResultSetIterImpl iter) { + manager.traceIn(); + IEntityBase entity = null; + try { + List result = getList(context, iter, false, false); + if (result != null) { + if (result.size() != 1) + throw new IllegalStateException("Expected one, found " + result.size() + "."); + entity = result.get(0); + } + } catch (Exception e) { + throw new ItemManagerException(e); + } + manager.traceOut(); + return entity; + } + +// protected List getList(ResultSetIterImpl iter) { +// List result = null; +// DefaultContext context = manager.getDbContext(); +// try { +// result = getList(context, iter); +// } catch (Exception e) { +// throw new ItemManagerException(e); +// } finally { +// manager.putDbContext(context); +// } +// return result; +// } + + protected List getList(ResultSetIterImpl iter, boolean isChunked) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + result = getList(context, iter, isChunked, true); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + return result; + } + + protected List getList(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) { + return getList(context, iter, isChunked, true); + } + + protected List getList(DefaultContext context, ResultSetIterImpl iter, boolean isChunked, boolean enablecache) { + manager.traceIn(); + List result = null; + try { + if (useMemoryCache() && enablecache) + result = manager.getAllCached(getCacheType()); + + if (result == null) { + result = entities(context, iter, isChunked); + if (useMemoryCache() && enablecache) + manager.setAllCached(getCacheType(), result); + } + + #sql [context] { COMMIT }; + } catch (Exception e) { + try { + #sql [context] { ROLLBACK }; + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + return result; + } + + @Override + public void modify(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + modify(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + @Override + public void merge(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + if (entity.getId() == 0) + add(entity); + else + modify(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + public void modify(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + try { + checkNull(entity, IEntityBase.class); + long id = entity.getId(); + entity.checkParameter("ID", id, false); + update(context, entity); + afterModify(context, entity); + #sql [context] { COMMIT }; + if (useMemoryCache()) + manager.storeCached(entity.getId(), entity); + } catch (Exception e) { + try { + #sql [context] { ROLLBACK }; + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + @Override + public void remove(IEntityBase entity) { + DefaultContext context = manager.getDbContext(); + try { + remove(context, entity); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + public void remove(DefaultContext context, IEntityBase entity) { + manager.traceIn(); + try { + checkNull(entity, IEntityBase.class); + long id = entity.getId(); + entity.checkParameter("ID", id, false); + beforeDelete(context, entity); + delete(context, id); + afterDelete(context, entity); + #sql [context] { COMMIT }; + if (useMemoryCache()) + manager.removeCached(getCacheType(), entity.getId()); + } catch (Exception e) { + try { + #sql [context] { ROLLBACK }; + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + public void remove(List ids) { + DefaultContext context = manager.getDbContext(); + try { + remove(context, ids); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + + protected void remove(DefaultContext context, List ids) { + manager.traceIn(); + try { + for (long id : ids) + delete(context, id); + #sql [context] { COMMIT }; + if (useMemoryCache()) { + for (long id : ids) + manager.removeCached(getCacheType(), id); + } + } catch (Exception e) { + try { + #sql [context] { ROLLBACK }; + } catch(Exception e1) { + } + manager.throwError(e); + } + manager.traceOut(); + } + + @Override + public void truncate() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + truncateTable(context); + #sql [context] { COMMIT }; + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + + protected void afterGet(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void beforeAdd(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { } + protected void afterDelete(DefaultContext context, IEntityBase entity) throws SQLException { } + + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + return null; + } + + public List entities(DefaultContext context, ResultSet rs) throws SQLException { + return null; + } + + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException { + return null; + } + + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException { + return null; + } + + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException { + return null; + } + + protected void delete(DefaultContext context, long id) throws SQLException { } + + protected void truncateTable(DefaultContext context) throws SQLException { } + + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException { } + + protected void update(DefaultContext context, IEntityBase entity) throws SQLException { } + + protected boolean useMemoryCache() { return false; } + + protected Class getCacheType() { return null; } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/FileType.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/FileType.java new file mode 100644 index 00000000..2539837c --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/FileType.java @@ -0,0 +1,78 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.EntityBase; + +@SuppressWarnings("serial") +public class FileType extends EntityBase implements Serializable { + private String audioCodec = null; + private int audioTracks = 0; + private String description = null; + private float frameRate = 0; + private String name = null; + private String videoCodec = null; + private int videoTracks = 0; + + public String getAudioCodec() { + return this.audioCodec; + } + + public int getAudioTracks() { + return this.audioTracks; + } + + public String getDescription() { + return this.description; + } + + public float getFrameRate() { + return this.frameRate; + } + + public String getName() { + return this.name; + } + + public String getVideoCodec() { + return this.videoCodec; + } + + public int getVideoTracks() { + return this.videoTracks; + } + + public void setAudioCodec(String audioCodec) { + // checkParameter("AudioCodec", audioCodec); + this.audioCodec = audioCodec; + } + + public void setAudioTracks(int audioTracks) { + // checkParameter("AudioTracks", audioTracks); + this.audioTracks = audioTracks; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setFrameRate(float frameRate) { + // checkParameter("FrameRate", frameRate); + this.frameRate = frameRate; + } + + public void setName(String name) { + // checkParameter("Name", name); + this.name = name; + } + + public void setVideoCodec(String videoCodec) { + // checkParameter("VideoCodec", videoCodec); + this.videoCodec = videoCodec; + } + + public void setVideoTracks(int videoTracks) { + // checkParameter("VideoTracks", videoTracks); + this.videoTracks = videoTracks; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/FileTypeDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/FileTypeDAO.sqlj new file mode 100644 index 00000000..a851a505 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/FileTypeDAO.sqlj @@ -0,0 +1,118 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.util.List; +import java.util.ArrayList; +import java.sql.SQLException; + +#sql iterator FileTypeIter(long id, String name, String description, String videoCodec, String audioCodec, int videoTracks, int audioTracks, float frameRate); + +@SuppressWarnings("unused") +class FileTypeDAO extends EntityBaseDAO { + + public FileTypeDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + FileTypeIter iterator = (FileTypeIter) iter; + while (iterator.next()) { + FileType entity = new FileType(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setVideoCodec(iterator.videoCodec()); + entity.setAudioCodec(iterator.audioCodec()); + entity.setVideoTracks(iterator.videoTracks()); + entity.setAudioTracks(iterator.audioTracks()); + entity.setFrameRate(iterator.frameRate()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + FileTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE FROM FILETYPE WHERE ID = :id }; + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String name) throws SQLException{ + FileTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE FROM FILETYPE WHERE NAME = :name }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + FileTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE FROM FILETYPE }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM FILETYPE WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE FILETYPE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + FileType obj = (FileType) entity; + long id = entity.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + String audioCodec = obj.getAudioCodec(); + String videoCodec = obj.getVideoCodec(); + int videoTracks = obj.getVideoTracks(); + int audioTracks = obj.getAudioTracks(); + float frameRate = obj.getFrameRate(); + + #sql [context] { UPDATE INSERT FILETYPE SET NAME = :name, DESCRIPTION = :description, VIDEOCODEC = :videoCodec, AUDIOCODEC = :audioCodec, + VIDEOTRACKS = :videoTracks, AUDIOTRACKS = :audioTracks, FRAMERATE = :frameRate WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + FileType obj = (FileType) entity; + String name = obj.getName(); + String description = obj.getDescription(); + String audioCodec = obj.getAudioCodec(); + String videoCodec = obj.getVideoCodec(); + int videoTracks = obj.getVideoTracks(); + int audioTracks = obj.getAudioTracks(); + float frameRate = obj.getFrameRate(); + + #sql [context] { INSERT INTO FILETYPE (NAME, DESCRIPTION, VIDEOCODEC, AUDIOCODEC, VIDEOTRACKS, AUDIOTRACKS, FRAMERATE) + VALUES (:name, :description, :videoCodec, :audioCodec, :videoTracks, :audioTracks, :frameRate) }; + } + + public IEntityBase getByName(String name) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, name); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Folder.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Folder.java new file mode 100644 index 00000000..c719deb1 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Folder.java @@ -0,0 +1,62 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.EntityBase; + +/** + * Mappa Pojo osztály. + * + * @author User + * + */ +@SuppressWarnings("serial") +public class Folder extends EntityBase implements Serializable { + private long parentId = 0; + private long childId = 0; + private Item parent = null; + private Item child = null; + + public Item getChild() { + if (child == null && childId > 0) { + IEntityBaseDAO dao = ItemManager.getInstance().getBaseDAO( + Item.class); + child = (Item) dao.get(childId); + } + return child; + } + + public long getChildId() { + return childId; + } + + public Item getParent() { + if (parent == null && parentId > 0) { + IEntityBaseDAO dao = ItemManager.getInstance().getBaseDAO( + Item.class); + parent = (Item) dao.get(parentId); + } + return parent; + } + + public long getParentId() { + return parentId; + } + + public void setChild(Item child) { + this.child = child; + } + + public void setChildId(long childId) { + this.childId = childId; + } + + public void setParent(Item parent) { + this.parent = parent; + } + + public void setParentId(long parentId) { + this.parentId = parentId; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/FolderDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/FolderDAO.sqlj new file mode 100644 index 00000000..63ca96ad --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/FolderDAO.sqlj @@ -0,0 +1,74 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +#sql iterator FolderIter(long id, long parentId, long childId); + +@SuppressWarnings("unused") +public class FolderDAO extends EntityBaseDAO { + + public FolderDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + FolderIter iterator = (FolderIter) iter; + while (iterator.next()) { + Folder entity = new Folder(); + entity.setId(iterator.id()); + entity.setParentId(iterator.parentId()); + entity.setChildId(iterator.childId()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + FolderIter iter = null; + #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER WHERE ID = :id }; + return iter; + } + + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + FolderIter iter = null; + #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER WHERE CHILDID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + FolderIter iter = null; + #sql [context] iter = { SELECT ID, PARENTID, CHILDID FROM FOLDER }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM FOLDER WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE FOLDER DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Folder obj = (Folder) entity; + long parentId = obj.getParentId(); + long childId = obj.getChildId(); + + #sql [context] { INSERT INTO FOLDER (PARENTID, CHILDID) VALUES (:parentId, :childId) }; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/HelperDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/HelperDAO.sqlj new file mode 100644 index 00000000..b1be7a18 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/HelperDAO.sqlj @@ -0,0 +1,60 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import java.sql.SQLException; +import java.sql.ResultSet; +import java.util.List; + +import sqlj.runtime.ref.DefaultContext; + +@SuppressWarnings("unused") +public class HelperDAO { + static protected ItemManager manager; + + static { + manager = ItemManager.getInstance(); + } + + static void foreignKeysOn() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + #sql [context] { CALL SET_CONSTRAINTS('YES') }; + #sql [context] { COMMIT }; + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + + static void foreignKeysOff() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + #sql [context] { CALL SET_CONSTRAINTS('NO') }; + #sql [context] { COMMIT }; + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + + static void dropDynamicData() { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + try { + #sql [context] { CALL DROP_DYNAMIC_DATA() }; + #sql [context] { COMMIT }; + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/IEntityBaseDAO.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/IEntityBaseDAO.java new file mode 100644 index 00000000..85e8a613 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/IEntityBaseDAO.java @@ -0,0 +1,25 @@ +package user.jobengine.db; + +import java.util.List; + +import user.commons.IEntityBase; + +public interface IEntityBaseDAO { + void add(IEntityBase entity); + + IEntityBase get(long id); + + List getAll(); + + List getAll(long id); + + void modify(IEntityBase entity); + + void merge(IEntityBase entity); + + void remove(IEntityBase entity); + + void remove(List ids); + + void truncate(); +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java new file mode 100644 index 00000000..251a19f0 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java @@ -0,0 +1,420 @@ +package user.jobengine.db; + +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; + +import user.commons.BaseType; +import user.commons.IEntityBase; +import user.commons.IEntityPersister; +import user.commons.Job; +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.ItemManagerData.GuiType; +import user.jobengine.db.ItemManagerData.ListType; +import user.jobengine.db.ItemManagerData.MdType; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemManagerData.UserRight; + +/*** + * Adatbázis kezelő API. Az implementáció OSGI szolgáltatásként érhető el ezen + * az interfészen keresztül. Az API főbb szolgáltatásai: az adatmodell + * objektumainak létrehozása, módosítása, törlése az adatbázisban. + * + * @author comtrans + * + */ +public interface IItemManager extends IEntityPersister { + /** + * Létrehoz egy új adatbázis kapcsolatot. + */ + void connect(); + + /** + * A megfelelő bemeneti paramétrekekkel meghívja a connect() függvényt. + * + * @param dbUrl + * Adatbázis elérési útvonala + * @param dbUser + * Adatbázis felhasználói név + * @param dbPassword + * Adatbázis jelszó + */ + void connect(String dbUrl, String dbUser, String dbPassword); + + FileType createFileType(String name, String description, String videoCodec, String audioCodec, int videoTracks, + int audioTracks, float frameRate); + + Item createItem(String itemTypeName, String name, String description, String houseId); + + ItemType createItemType(String name, String description); + + Media createMedia(String itemTypeName, String name, String description, String houseId); + + MediaFile createMediaFile(String relativePath, FileType fileType, Store store, Media media); + + Metadata createMetadata(MetadataElement mde, GuiType guiType, MdType... flags); + + Metadata createMetadata(MetadataElement mde, ListType listType, GuiType guiType, MdType... flags); + + Metadata createMetadata(MetadataElement mde, ListType listType, GuiType guiType, String sqlField, + StaticTables staticTable, String pojoField, MdType... flags); + + Metadata createMetadata(MetadataElement mde, MdType... flags); + + MetadataElement createMetadataElement(String name, String description, MetadataType mdt); + + MetadataElement createMetadataElement(String name, String description, MetadataType mdt, boolean isDomain); + + MetadataType createMetadataType(String name, BaseType baseType, String javaType, String dataType); + + MetadataType createMetadataType(String name, BaseType baseType, String javaType, String dataType, int length); + + Scene createScene(String name); + + SceneContent createSceneContent(Shot shot, long sceneId, long position); + + Shot createShot(String description, long in, long out, long mediaId, byte[] thumbnail); + + Store createStore(String name, boolean isSystem, boolean isLowres); + + StoreUri createStoreUri(RemoteStoreProtocol protocol, String uri); + + StoreUri createStoreUri(RemoteStoreProtocol protocol, String uri, int portNumber, boolean isStream, + boolean isSource, boolean isTarget, String userName, String password, String rootPath); + + UserInfo createUser(String fullName, String userName, String password, UserRight[] rights); + + void disconnect(); + + /** + * A type paraméterből lekéri az entitás DAO objektumát, amin keresztül + * visszakapjuk az összes entitást. + * + * @param type + * @return + */ + List getAll(Class type); + + /** + * Entitás típus és azonosító alapján visszaad egy listát. + * + * @param type + * @param id + * @return + */ + List getAll(Class type, long id); + + /** + * Visszaadja egy átmeneti tárolóban tárolt entitás listáját. + * + * @param baseClass + * @return + */ + List getAllCached(Class baseClass); + + /** + * Visszaadja az entitásnak megfelelő DAO objektumot. + * + * @param classInfo + * @return + */ + IEntityBaseDAO getBaseDAO(Class classInfo); + + Break getBreak(long id); + + /** + * Elkéri a FileTypeDAO-tól a bemeneti paraméterként kapott névvel + * rendelekző FileType-ot. + * + * @param name + * @return + */ + FileType getFileType(String name); + + /** + * Visszaad egy szűrési feltételeknek megfelelő Domain listát. + * + * @param domainCategoryId + * @param filter + * @return + */ + List getFilteredDomainByDisplay(long domainCategoryId, String filter); + + /** + * Visszaad egy szűrési feltételeknek megfelelő QueryObject listát. + * + * @param filter + * @param isChunked + * @return + */ + List getFilteredQueryObject(String filter, boolean isChunked); + + /** + * Visszaad egy szűrési feltételeknek megfelelő Vágólista listát. + * + * @param name + * @param isChunked + * @return + */ + List getFilteredScene(String name, boolean isChunked); + + /** + * A bemenő paraméterként kapott azonosító alaján lekéri a megfelelő Mappa + * objektumokat. + * + * @param id + * @return + */ + List getFolders(long id); + + /** + * A bemenő paraméterként kapott azonosító alaján lekéri a megfelelő Szkript + * objektumokat. + * + * @param id + * @return + */ + List getShots(long id); + + /** + * Elkéri az összes anyag típust. + * + * @return + */ + List getItemTypes(); + + /** + * Elkéri az összes dinamikus anyag típust. + * + * @return + */ + List getDynamicItemTypes(); + + /** + * Elkéri az fix anyag típust. + * + * @return + */ + ItemType getStaticItemType(); + + /** + * Azonosító alapján elkér egy Verzió objektumot. + * + * @param id + * @return + */ + Media getMedia(long id); + + /** + * Azonosító alapján elkér egy Metaadat elem objektumot. + * + * @param id + * @return + */ + MetadataElement getMetadataElement(long id); + + /** + * Visszaadja az adatbázisban tárolt összes Metaadat elem listáját. + * + * @return + */ + List getMetadataElements(); + + /** + * Azonosító alapján elkér egy Metadatat típus objektumot. + * + * @param id + * @return + */ + MetadataType getMetadataType(long id); + + /** + * Azonosító alapján elkér egy Vágólista objektumot. + * + * @param id + * @return + */ + Scene getScene(long id); + + /** + * Név és időpont alapján elkéri a megfelelő Vágólista objektumokat. + * + * @param name + * @param created + * @return + */ + List getScenes(String name, Timestamp created); + + /** + * Azonosító alapján elkér egy Szkript objektumot. + * + * @param id + * @return + */ + Shot getShot(long id); + + /** + * Azonosító alapján elkér egy Tároló objektumot. + * + * @param id + * @return + */ + Store getStore(long id); + + /** + * Név alapján elkér egy Szkript objektumot. + * + * @param name + * @return + */ + Store getStore(String name); + + /** + * Elkér a StoreDAO-tól, egy olyan Rendszer tárolót, amely a lowres + * paraméterben kapott érték alapján vagy kisfelbontású videók tárolója, + * vagy nem. + * + * @param lowres + * @return + */ + Store getSystemStore(boolean lowres); + + /** + * Ha a bemeneti paraméter alapján létezik ilyen felhasználó, akkor true-val + * tér vissza. + * + * @param userName + * @param password + * @return + */ + boolean getUser(String userName, String password); + + /** + * A bemeneti paraméterként megadott felhasználónév/jelszó páros alapján + * visszaad egy UserInfo objektumot. + * + * @param userName + * @param password + * @return + */ + UserInfo getUserInfo(String userName, String password); + + /** + * A bemeneti paraméterként kapott típus és azonosító lista alapján + * eltávolítja a megfelelő adatbázis bejegyzéseket. + * + * @param type + * @param ids + */ + void remove(Class type, List ids); + + /** + * A bemeneti paraméterként kapott típus és azonosító alapján az objektumot + * eltávolítja az átmeneti tárolóból. + * + * @param baseClass + * @param key + */ + void removeCached(Class baseClass, Object key); + + /** + * A bemeneti paraméterként kapott típus és kulcs alapján elkéri a megfelelő + * objektumot az átmeneti tárolóból. + * + * @param baseClass + * @param key + * @return + */ + IEntityBase retrieveCached(Class baseClass, Object key); + + /** + * A bemeneti paraméterként kapott keresési feltételeknek megfelelő + * Anyagokat lekéri az adatbázisból és SearchResult objektumba csomagolva + * visszatér. + * + * @param parameter + * @return + */ + List searchItem(QueryObject parameter); + + /** + * A bemeneti paraméterként kapott keresési feltételeknek megfelelő + * Munkafolyamatokat lekéri az adaatbázisból. + * + * @param parameter + * @return + */ + List searchJob(QueryObject parameter); + + /** + * A kapott három paraméter alapján létrehoz egy Signal objektumot, + * átkonvertálja bájt tömbbé és beteszi a Signalserver üzenetküldő sorába. + * + * @param id + * @param signalType + * @param staticTable + */ + void signal(long id, SignalType signalType, StaticTables staticTable); + + /** + * Egy azonosítót és entitást elhelyez az átmeneti tárolóban. + * + * @param key + * @param entity + * @return + */ + boolean storeCached(Object key, IEntityBase entity); + + /** + * Kivétel dobása esetén a kivétel üzenetét és a keletkezés helyét + * becsomagolja egy string-be, majd átadja a logger-nek. + * + * @param e + */ + void throwError(Exception e); + + /** + * Kiloggolja az kapott művelethez tartozó objektum típusát és a metódus + * nevét. + */ + void traceIn(); + + /** + * Kiloggolja az kapott művelet végén az objektum típusát és a metódus + * nevét. + */ + void traceOut(); + + /** + * Törli a felsorolt típusok bejegyzéseit. + */ + void truncate(); + + /** + * Törli a bemeneti paraméterként kapott entitás adatbázis bejegyzéseit. + * + * @param classInfo + */ + void truncate(Class classInfo); + + Item createItem(String name, String description, String houseId); + + SearchResult searchItem(String criteria, int fromResult, int toResult); + + Item getItemByHouseID(String houseID); + + List getRunningJobs(String template); + + ItemType getItemType(String itemTypeName); + + WorkflowAction createWorkflowAction(Timestamp touched, Timestamp started, Timestamp finished, boolean successful, + String houseId, String description, String source, String destination, String tag, long size); + + List getWorkflowActions(Date date); + + void mergeItemStructure(Item item); + + void merge(IEntityBase entity); +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/IValueConverter.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/IValueConverter.java new file mode 100644 index 00000000..91d83fc0 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/IValueConverter.java @@ -0,0 +1,6 @@ +package user.jobengine.db; + +public interface IValueConverter { + public Object Convert(Object value); + public Object ConvertBack(Object value); +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Item.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Item.java new file mode 100644 index 00000000..520b701d --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Item.java @@ -0,0 +1,108 @@ +package user.jobengine.db; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import user.commons.TimestampAdapter; + +/** + * Anyag Pojo osztály. + * + * @author User + * + */ +public class Item extends DynamicAttributes { + private static final long serialVersionUID = 1L; + private Timestamp created = null; + private Timestamp modified = null; + private String description = null; + private String houseId = null; + private List medias = null; + private String title = null; + private boolean isFolder = false;; + private Long folderId = null; + + public void appendMedia(Media media) { + checkParameter("Media", media, true); + if (getMedias() == null) + setMedias(new ArrayList()); + getMedias().add(media); + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return created; + } + + public String getDescription() { + return description; + } + + public Long getFolderId() { + return folderId; + } + + public String getHouseId() { + return houseId; + } + + public boolean getIsFolder() { + return isFolder; + } + + @SuppressWarnings("unchecked") + public List getMedias() { + if (medias == null) { + MediaDAO dao = (MediaDAO) ItemManager.getInstance().getBaseDAO( + Media.class); + medias = (List) (List) dao.getAll(getId()); + } + return medias; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getModified() { + return modified; + } + + public String getTitle() { + return title; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public void setDescription(String description) { + // checkParameter("Description", description); + this.description = description; + } + + public void setFolderId(Long folderId) { + this.folderId = folderId; + } + + public void setHouseId(String houseId) { + this.houseId = houseId; + } + + public void setIsFolder(boolean isFolder) { + this.isFolder = isFolder; + } + + public void setMedias(List medias) { + this.medias = medias; + } + + public void setModified(Timestamp modified) { + this.modified = modified; + } + + public void setTitle(String title) { + // checkParameter("Title", title); + this.title = title; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemDAO.sqlj new file mode 100644 index 00000000..9673bb4a --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemDAO.sqlj @@ -0,0 +1,201 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.List; + +@SuppressWarnings("unused") +public class ItemDAO extends EntityBaseDAO { + + public ItemDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void beforeAdd(DefaultContext context, IEntityBase entity) throws SQLException { + long id = manager.getMasterId(context); + entity.setId(id); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.add(context, entity); + MediaDAO daoMedia = (MediaDAO) manager.getBaseDAO(Media.class); + daoMedia.addAll(context, entity); + readAutoGeneratedValues(context, (Item) entity); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.modify(context, entity); + readAutoGeneratedValues(context, (Item) entity); + } + + private void readAutoGeneratedValues(DefaultContext context, Item item) { + Item newItem = (Item) get(context, item.getId()); + if (newItem != null) { + item.setCreated(newItem.getCreated()); + item.setModified(newItem.getModified()); + } + } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.remove(context, entity); + MediaDAO daoMedia = (MediaDAO) manager.getBaseDAO(Media.class); + daoMedia.removeAll(context, entity); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ItemIter iterator = (ItemIter) iter; + while (iterator.next()) { + Item entity = toEntity(iterator); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + public List entities(DefaultContext context, ResultSetIterImpl iter, int maxRecords) throws SQLException { + List result = null; + ItemIter iterator = (ItemIter) iter; + while (iterator.next() && maxRecords > 0) { + Item entity = toEntity(iterator); + if (result == null) + result = new ArrayList(); + result.add(entity); + maxRecords--; + } + iterator.close(); + return result; + } + + private Item toEntity(ItemIter iterator) throws SQLException { + Item entity = new Item(); + entity.setId(iterator.id()); + entity.setTitle(iterator.title()); + entity.setDescription(iterator.description()); + entity.setItemTypeId(iterator.itemTypeId()); + entity.setHouseId(iterator.houseId()); + entity.setCreated(iterator.created()); + entity.setIsFolder(iterator.isFolder().equals("Y") ? true : false); + return entity; + } + + @Override + public List entities(DefaultContext context, ResultSet rs) throws SQLException { + ItemIter iter = null; + #sql [context] iter = { CAST :rs }; + return entities(context, iter, false) ; + } + + public List entities(DefaultContext context, ResultSet rs, int maxRecords) throws SQLException { + ItemIter iter = null; + #sql [context] iter = { CAST :rs }; + return entities(context, iter, maxRecords) ; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + ItemIter iter = null; + #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + ItemIter iter = null; + #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM ITEM WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE ITEM DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Item obj = (Item) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + String isFolder = obj.getIsFolder() == true ? "Y" : "N"; + + #sql [context] { UPDATE ITEM SET TITLE = :title, DESCRIPTION = :description, ITEMTYPEID = :itemTypeId, HOUSEID = :houseId, ISFOLDER = :isFolder WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Item obj = (Item) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + String isFolder = obj.getIsFolder() == true ? "Y" : "N"; + + #sql [context] { INSERT INTO ITEM (ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, ISFOLDER) VALUES (:id, :title, :description, :itemTypeId, :houseId, :isFolder) }; + } + + protected ResultSetIterImpl selectFolders(DefaultContext context, long id) throws SQLException{ + ItemIter iter = null; + if (id == 0) { + #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ID IN ( + SELECT DISTINCT(f.PARENTID) FROM FOLDER f LEFT JOIN FOLDER p ON (f.PARENTID = p.CHILDID) WHERE P.PARENTID IS NULL + ) ORDER BY TITLE }; + } else { + #sql [context] iter = { + SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ISFOLDER = 'Y' AND ID IN ( + SELECT CHILDID FROM FOLDER WHERE PARENTID = :id + ) ORDER BY TITLE + }; + } + return iter; + } + +// protected ResultSetIterImpl selectFolderContents(DefaultContext context, long id) throws SQLException{ +// ItemIter iter = null; +// #sql [context] iter = { +// SELECT ID, TITLE, DESCRIPTION, ITEMTYPEID, HOUSEID, CREATED, ISFOLDER FROM ITEM WHERE ID IN ( +// SELECT CHILDID FROM FOLDER WHERE PARENTID = :id +// ) ORDER BY ISFOLDER DESC, TITLE +// }; +// return iter; +// } + + public List getFolders(long id) { + manager.traceIn(); + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectFolders(context, id); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemDAOEx.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemDAOEx.java new file mode 100644 index 00000000..a9414c6e --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemDAOEx.java @@ -0,0 +1,276 @@ +package user.jobengine.db; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.Formatter; +import java.util.List; +import java.util.Locale; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import sqlj.runtime.ref.DefaultContext; + +public class ItemDAOEx { + private static final Logger logger = LogManager.getLogger(); + private ItemManager manager = null; + + public ItemDAOEx(ItemManager manager) { + this.manager = manager; + } + + public SearchResult search(String criteria, int fromResult, int toResult) { + SearchResult result = new SearchResult(); + + ResultSet rs = null; + PreparedStatement st = null; + DefaultContext context = manager.getDbContext(); + Connection connection = context.getConnection(); + + try { + StringBuffer sql = new StringBuffer(); + sql.append("select * from (("); + sql.append( + "select distinct i.id,i.itemtypeid,i.houseid,i.title,i.description,i.isfolder,i.created,i.modified from item i, media m, mediafile mf"); + sql.append( + " where ((CONTAINS(i.title, ?) >= 1) OR (CONTAINS(i.description, ?) >= 1)) and m.itemid = i.id and mf.MEDIAID = m.id"); + sql.append(")UNION("); + sql.append( + "select distinct i2.id,i2.itemtypeid,i2.houseid,i2.title,i2.description,i2.isfolder,i2.created,i2.modified from item i2, media m2, mediafile mf2"); + sql.append( + " where ((CONTAINS(m2.title, ?) >= 1) OR (CONTAINS(m2.description, ?) >= 1)) and m2.itemid = i2.id and mf2.MEDIAID = m2.id"); + sql.append(")UNION("); + sql.append( + "select distinct i3.id,i3.itemtypeid,i3.houseid,i3.title,i3.description,i3.isfolder,i3.created,i3.modified from item i3, media m3, mediafile mf3"); + sql.append(" where (CONTAINS(mf3.relativepath, ?) >= 1) and m3.itemid = i3.id and mf3.MEDIAID = m3.id"); + sql.append(")) order by title"); + String query = sql.toString(); + /* + query = "SELECT i.* from item i, media m, mediafile mf WHERE m.ITEMID = i.id AND mf.MEDIAID = m.ID" + + " AND (" + "(CONTAINS(i.TITLE, '" + criteria + "') >= 1) OR (CONTAINS(i.DESCRIPTION, '" + criteria + + "') >= 1)" + " OR (CONTAINS(m.TITLE, '" + criteria + "') >= 1) OR (CONTAINS(m.DESCRIPTION, '" + + criteria + "') >= 1)" + " OR (CONTAINS(mf.RELATIVEPATH, '" + criteria + + "') >= 1)) ORDER BY i.title"; + */ + // query = "SELECT * FROM ITEM ORDER BY title"; + + st = connection.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); + for (int s = 1; s <= 5; s++) { + st.setString(s, criteria); + } + rs = st.executeQuery(); + rs.last(); + result.setItemCount(rs.getRow()); + + // set begining position + if (fromResult > -1) { + if (fromResult <= result.getItemCount()) { + if (fromResult > 1) { + rs.absolute(fromResult - 1); + } else { + rs.beforeFirst(); + } + } else { + if (result.getItemCount() > 0) { + throw new Exception("Invalid searchResult 'from' position: " + fromResult + " total records: " + + result.getItemCount() + " " + query); + } + } + } else { + rs.beforeFirst(); + } + + int maxRecords = toResult - fromResult; + + ItemDAO dao = (ItemDAO) manager.getBaseDAO(Item.class); + result.setItems((List) (List) dao.entities(context, rs, maxRecords)); + + connection.commit(); + } catch (Exception e) { + try { + connection.rollback(); + } catch (Exception e1) { + e1.printStackTrace(); + } + manager.throwError(e); + } finally { + try { + if (rs != null) + rs.close(); + } catch (Exception e1) { + } + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + manager.putDbContext(context); + } + manager.traceOut(); + + return result; + } + + @SuppressWarnings("unchecked") + public List search(QueryObject queryObject) { + manager.traceIn(); + if (queryObject == null || queryObject.getFilters() == null || queryObject.getFilters().size() == 0) + throw new IllegalArgumentException("QueryObject not specified."); + + List results = new ArrayList(); + + ResultSet rs = null; + PreparedStatement st = null; + DefaultContext context = manager.getDbContext(); + Connection connection = context.getConnection(); + + try { + String innerQuery = buildQueryCore(queryObject); + + if (queryObject.getActiveItemTypeId() == 0) { + // keres�s az �sszes t�pusban + // Ha nincs RenderParameter, akkor az eredm�ny egy + // SearchResult-ba ker�l, egy�bk�nt + // ItemType-onk�nt t�bbe + results = getResultHeaders(connection, queryObject, innerQuery); + } else { + SearchResult sr = new SearchResult(); + ItemType itemType = (ItemType) manager.get(ItemType.class, queryObject.getActiveItemTypeId()); + sr.setItemType(itemType); + // TODO + // sr.setItemCount(rs.getLong(2)); + sr.setParameters(queryObject.getParameters()); + results.add(sr); + } + + if (results.size() != 0) { + SearchResult csr = results.get(0); + String resultQuery = buildResultQuery(queryObject, innerQuery, csr); + st = connection.prepareStatement(resultQuery); + + // int rpp = (int)parameter.getParameters().getRowPerPage(); + // st.setFetchSize(rpp); + // st.setMaxRows(rpp); + + rs = st.executeQuery(); + List items = new ArrayList(); + ItemDAO dao = (ItemDAO) manager.getBaseDAO(Item.class); + items = (List) (List) dao.entities(context, rs); + csr.setItems(items); + rs.close(); + } + + connection.commit(); + } catch (Exception e) { + try { + connection.rollback(); + } catch (Exception e1) { + e1.printStackTrace(); + } + manager.throwError(e); + } finally { + try { + if (rs != null) + rs.close(); + } catch (Exception e1) { + } + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + manager.putDbContext(context); + } + manager.traceOut(); + return results; + } + + private String buildResultQuery(QueryObject queryObject, String innerQuery, SearchResult csr) { + StringBuilder resultQuery = new StringBuilder(); + Formatter qf = new Formatter(resultQuery, Locale.getDefault()); + RenderParameter rp = queryObject.getParameters(); + if (rp != null) { + long bottom = rp.getPage() * rp.getRowPerPage() + 1; + long top = bottom + rp.getRowPerPage() - 1; + resultQuery.append("WITH NUMBEREDITEM AS ("); + Metadata orderMetadata = rp.getOrderBy(); + if (queryObject.hasOrderInfo()) + qf.format("SELECT ROWNUMBER() OVER (ORDER BY %1$s %2$s) AS RN, ", orderMetadata.getOrderName("i", "md"), + rp.getOrderDirection().name()); + else + resultQuery.append("SELECT ROWNUMBER() OVER () AS RN, "); + resultQuery.append( + "i.ID, i.TITLE, i.DESCRIPTION, i.ITEMTYPEID, i.HOUSEID, i.CREATED, i.ISFOLDER FROM ITEM i "); + String orderTableName = orderMetadata.getTableName(); + if (orderTableName != null) + qf.format("LEFT OUTER JOIN %1$s md ON (md.ID = i.ID) ", orderTableName); + resultQuery.append("WHERE i.ID IN "); + qf.format("(SELECT ii.ID %1$s AND ii.ITEMTYPEID = %2$d))", innerQuery, csr.getItemType().getId()); + qf.format(" SELECT * FROM NUMBEREDITEM WHERE RN BETWEEN %1$d AND %2$d", bottom, top); + } else { + resultQuery.append( + "SELECT i.ID, i.TITLE, i.DESCRIPTION, i.ITEMTYPEID, i.HOUSEID, i.CREATED, i.ISFOLDER FROM ITEM i "); + resultQuery.append("WHERE i.ID IN "); + qf.format("(SELECT ii.ID %1$s) ORDER BY i.TITLE", innerQuery); + } + + logger.info(resultQuery.toString()); + return resultQuery.toString(); + } + + private String buildQueryCore(QueryObject parameter) { + QueryBuilder queryBuilder = new QueryBuilder(); + queryBuilder.getParameters(parameter.getFilters()); + return queryBuilder.getQuery(); + } + + private List getResultHeaders(Connection connection, QueryObject queryObject, String innerQuery) { + List results = new ArrayList(); + String typeQuery; + if (queryObject.getParameters() == null) + typeQuery = String.format("SELECT CAST(COUNT(DISTINCT(ii.ID)) AS BIGINT) %s", innerQuery); + else + typeQuery = String.format( + "SELECT ii.ITEMTYPEID, CAST(COUNT(DISTINCT(ii.ID)) AS BIGINT) %s GROUP BY ii.ITEMTYPEID", + innerQuery); + + logger.info(typeQuery.toString()); + PreparedStatement st = null; + ResultSet rs = null; + try { + st = connection.prepareStatement(typeQuery); + rs = st.executeQuery(); + while (rs.next()) { + SearchResult sr = new SearchResult(); + if (queryObject.getParameters() == null) { + sr.setItemCount(rs.getLong(1)); + } else { + ItemType itemType = (ItemType) manager.get(ItemType.class, rs.getLong(1)); + sr.setItemType(itemType); + sr.setItemCount(rs.getLong(2)); + } + + sr.setParameters(queryObject.getParameters()); + results.add(sr); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (rs != null) + rs.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + try { + if (st != null) + st.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + } + return results; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemIter.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemIter.sqlj new file mode 100644 index 00000000..0b9f21e8 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemIter.sqlj @@ -0,0 +1,5 @@ +package user.jobengine.db; + +import java.sql.Timestamp; + +#sql public iterator ItemIter(long id, String title, String description, long itemTypeId, String houseId, Timestamp created, String isFolder); diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java new file mode 100644 index 00000000..49c32fb1 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java @@ -0,0 +1,919 @@ +package user.jobengine.db; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import sqlj.runtime.ref.DefaultContext; +import user.commons.BaseType; +import user.commons.CalendarUtils; +import user.commons.IEntityBase; +import user.commons.Job; +import user.commons.StoreUri; +import user.commons.pool.ConnectionPoolProperties; +import user.commons.pool.ContextPool; +import user.commons.pool.ResourcePool; +import user.commons.remotestore.RemoteStore; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.server.tcp.SignalServer; +import user.jobengine.changehandler.IChangeHandler; +import user.jobengine.changehandler.ItemTypeChangeHandlerFactory; +import user.jobengine.db.ItemManagerData.FilterValueLogic; +import user.jobengine.db.ItemManagerData.GuiType; +import user.jobengine.db.ItemManagerData.ListType; +import user.jobengine.db.ItemManagerData.MdType; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemManagerData.UserRight; + +/** + * JobEngine adatbázis modell kezelő API. + */ +public class ItemManager extends MemoryCache implements IItemManager { + private static final Logger logger = LogManager.getLogger(); + public static String DBURL = "jobengine.db.url"; + public static String DBUSERNAME = "jobengine.db.user"; + public static String DBPASSWORD = "jobengine.db.password"; + + private Map, IEntityBaseDAO> baseDAOs = new Hashtable, IEntityBaseDAO>(); + private IChangeHandler itemTypeChangeFactory; + private int connectionPoolSize = 5; + private ContextPool contextPool = null; + String dbDriver = "com.ibm.db2.jcc.DB2Driver"; + + String dbUrl = null; + String dbUser = null; + String dbPassword = null; + + static ItemManager currentInstance = null; + private SignalServer signalServer; + + static public ItemManager getInstance() { + return currentInstance; + } + + public ItemManager() { + initializeItemManager(signalServer); + connect(); + // logger.info("ItemManager hasn't SignalServer reference."); + } + + // public ItemManager(SignalServer signalServer) { + // initializeItemManager(signalServer); + // } + + private void initializeItemManager(SignalServer signalServer) { + this.signalServer = signalServer; + initialize(); + dbUrl = System.getProperty(DBURL); + dbUser = System.getProperty(DBUSERNAME); + dbPassword = System.getProperty(DBPASSWORD); + } + + public void activate() { + //logger.info("ItemManager activated."); + } + + public void deactivate() { + //logger.info("ItemManager deactivated."); + } + + public synchronized void bindSignalServerService(SignalServer service) { + try { + initializeItemManager(service); + logger.info("ItemManager service started."); + } catch (Exception e) { + logger.error(e); + } + } + + public synchronized void unbindSignalServerService(SignalServer service) { + try { + disconnect(); + logger.info("ItemManager service stopped."); + } catch (Exception exc) { + logger.error(exc); + } + } + + @Override + public void add(IEntityBase entity) { + traceIn(); + IEntityBaseDAO dbmanager = getBaseDAO(entity.getClass()); + dbmanager.add(entity); + traceOut(); + } + + @Override + public void connect() { + traceIn(); + ConnectionPoolProperties properties = new ConnectionPoolProperties(dbDriver, dbUrl, dbUser, dbPassword, false, + 1000); + properties.add(ResourcePool.POOLSIZE, connectionPoolSize); + contextPool = new ContextPool(properties); + + getItemTypes(); + + traceOut(); + } + + @Override + public void connect(String dbUrl, String dbUser, String dbPassword) { + this.dbUrl = dbUrl; + this.dbUser = dbUser; + this.dbPassword = dbPassword; + connect(); + } + + @Override + public FileType createFileType(String name, String description, String videoCodec, String audioCodec, + int videoTracks, int audioTracks, float frameRate) { + traceIn(); + FileType entity = new FileType(); + entity.setPersister(this); + entity.setName(name); + entity.setDescription(description); + entity.setVideoCodec(videoCodec); + entity.setAudioCodec(audioCodec); + entity.setVideoTracks(videoTracks); + entity.setAudioTracks(audioTracks); + entity.setFrameRate(frameRate); + traceOut(); + return entity; + } + + @Override + public WorkflowAction createWorkflowAction(Timestamp touched, Timestamp started, Timestamp finished, + boolean successful, String houseId, String description, String source, String destination, String tag, + long size) { + traceIn(); + + WorkflowAction entity = new WorkflowAction(); + entity.setPersister(this); + entity.setTouched(touched); + entity.setStarted(started); + entity.setFinished(finished); + entity.setSuccessful(successful); + entity.setHouseId(houseId); + entity.setDescription(description); + entity.setSource(source); + entity.setDestination(destination); + entity.setTag(tag); + entity.setSize(size); + traceOut(); + return entity; + } + + @Override + public Item createItem(String itemTypeName, String name, String description, String houseId) { + traceIn(); + Item entity = new Item(); + entity.setPersister(this); + if (itemTypeName != null) + entity.setItemType(getItemType(itemTypeName)); + entity.setTitle(name); + entity.setDescription(description); + entity.setHouseId(houseId); + traceOut(); + return entity; + } + + @Override + public Item createItem(String name, String description, String houseId) { + return createItem(null, name, description, houseId); + } + + @Override + public ItemType createItemType(String name, String description) { + traceIn(); + ItemType entity = new ItemType(); + entity.setPersister(this); + entity.setName(name); + entity.setDescription(description); + traceOut(); + return entity; + } + + @Override + public Media createMedia(String itemTypeName, String name, String description, String houseId) { + traceIn(); + ItemTypeDAO dbmanager = (ItemTypeDAO) getBaseDAO(ItemType.class); + ItemType itemType = dbmanager.get(itemTypeName); + Media entity = new Media(); + entity.setPersister(this); + entity.setItemType(itemType); + entity.setTitle(name); + entity.setDescription(description); + entity.setHouseId(houseId); + entity.setLength(0); + traceOut(); + return entity; + } + + @Override + public MediaFile createMediaFile(String relativePath, FileType fileType, Store store, Media media) { + traceIn(); + MediaFile entity = new MediaFile(); + entity.setPersister(this); + entity.setRelativePath(relativePath); + entity.setFileStructInfo(""); + entity.setMedia(media); + entity.setStore(store); + entity.setFileType(fileType); + traceOut(); + return entity; + } + + @Override + public Metadata createMetadata(MetadataElement mde, MdType... flags) { + return createMetadata(mde, ListType.LABEL, GuiType.TEXTBOX, null, null, null, flags); + } + + @Override + public Metadata createMetadata(MetadataElement mde, GuiType guiType, MdType... flags) { + return createMetadata(mde, ListType.LABEL, guiType, null, null, null, flags); + } + + @Override + public Metadata createMetadata(MetadataElement mde, ListType listType, GuiType guiType, MdType... flags) { + return createMetadata(mde, listType, guiType, null, null, null, flags); + } + + @Override + public Metadata createMetadata(MetadataElement mde, ListType listType, GuiType guiType, String sqlField, + StaticTables staticTable, String pojoField, MdType... flags) { + traceIn(); + Metadata entity = new Metadata(); + int values = MdType.getValues(flags); + entity.setPersister(this); + entity.setIsDbIndex(MdType.is(values, MdType.INDEX)); + entity.setIsDbUnique(MdType.is(values, MdType.UNIQUE)); + entity.setIsDbNullable(MdType.is(values, MdType.NULL)); + entity.setIsEditable(MdType.is(values, MdType.EDIT)); + entity.setIsListable(MdType.is(values, MdType.LIST)); + entity.setIsGenerated(MdType.is(values, MdType.GENERATE)); + entity.setIsSearchable(MdType.is(values, MdType.SEARCH)); + entity.setGuiType(guiType); + entity.setListType(listType); + entity.setSqlField(sqlField); + entity.setStaticTable(staticTable); + entity.setPojoField(pojoField); + entity.setMetadataElement(mde); + traceOut(); + return entity; + } + + @Override + public MetadataElement createMetadataElement(String name, String description, MetadataType mdt) { + return createMetadataElement(name, description, mdt, false); + } + + @Override + public MetadataElement createMetadataElement(String name, String description, MetadataType mdt, boolean isDomain) { + traceIn(); + MetadataElement entity = new MetadataElement(); + entity.setPersister(this); + entity.setMetadataType(mdt); + entity.setName(name); + entity.setDescription(description); + if (isDomain) { + DomainCategoryDAO dao = (DomainCategoryDAO) getBaseDAO(DomainCategory.class); + DomainCategory dc = dao.addMissing(name); + entity.setDomainCategoryId(dc.getId()); + } + traceOut(); + return entity; + } + + @Override + public MetadataType createMetadataType(String name, BaseType baseType, String javaType, String dataType) { + return createMetadataType(name, baseType, javaType, dataType, 0); + } + + @Override + public MetadataType createMetadataType(String name, BaseType baseType, String javaType, String dataType, + int length) { + traceIn(); + MetadataType entity = new MetadataType(); + entity.setPersister(this); + entity.setName(name); + entity.setType(baseType, length); + entity.setDataType(dataType); + entity.setJavaType(javaType); + traceOut(); + return entity; + } + + @Override + public Scene createScene(String name) { + traceIn(); + Scene entity = new Scene(); + entity.setPersister(this); + entity.setName(name); + traceOut(); + return entity; + } + + @Override + public SceneContent createSceneContent(Shot shot, long sceneId, long position) { + traceIn(); + SceneContent entity = new SceneContent(); + entity.setPersister(this); + entity.setSceneId(sceneId); + entity.setShot(shot); + entity.setPosition(position); + traceOut(); + return entity; + } + + @Override + public Shot createShot(String description, long in, long out, long mediaId, byte[] thumbnail) { + traceIn(); + Shot entity = new Shot(); + entity.setPersister(this); + entity.setInPoint(in); + entity.setOutPoint(out); + entity.setDescription(description); + entity.setMediaId(mediaId); + entity.setThumbnail(thumbnail); + traceOut(); + return entity; + } + + @Override + public Store createStore(String name, boolean isSystem, boolean isLowres) { + traceIn(); + Store entity = new Store(); + entity.setPersister(this); + entity.setName(name); + entity.setSystem(isSystem); + entity.setLowres(isLowres); + traceOut(); + return entity; + } + + @Override + public StoreUri createStoreUri(RemoteStoreProtocol protocol, String uri) { + return createStoreUri(protocol, uri, 0, false, false, false, null, null, null); + } + + @Override + public StoreUri createStoreUri(RemoteStoreProtocol protocol, String uri, int portNumber, boolean isStream, + boolean isSource, boolean isTarget, String userName, String password, String rootPath) { + traceIn(); + StoreUri entity = new StoreUri(); + entity.setPersister(this); + entity.setUri(uri); + entity.setStream(isStream); + entity.setTarget(isTarget); + entity.setSource(isSource); + entity.setProtocol(protocol); + if (portNumber != 0) + entity.setPortNumber(portNumber); + traceOut(); + return entity; + } + + @Override + public UserInfo createUser(String fullName, String userName, String password, UserRight[] rights) { + traceIn(); + UserInfo entity = new UserInfo(); + entity.setPersister(this); + entity.setFullName(fullName); + entity.setUserName(userName); + entity.setPassword(password); + if (rights != null) + for (UserRight right : rights) + entity.addRight(right); + traceOut(); + return entity; + } + + /** + * Lez�rja a kapcsolatot az Adatb�zis kontextus er�forr�s kezel�. + */ + @Override + public void disconnect() { + traceIn(); + if (contextPool != null) + contextPool.close(); + // if (policyServer != null) + // policyServer.shutdown(); + // if (signalServer != null) + // signalServer.shutdown(); + traceOut(); + } + + @Override + public IEntityBase get(Class classInfo, long id) { + traceIn(); + IEntityBase entity = null; + IEntityBaseDAO dao = getBaseDAO(classInfo); + entity = dao.get(id); + traceOut(); + return entity; + } + + @Override + public List getAll(Class type) { + List result = null; + EntityBaseDAO dao = (EntityBaseDAO) getBaseDAO(type); + if (dao != null) + result = dao.getAll(); + return result; + } + + @Override + public List getAll(Class type, long id) { + List result = null; + EntityBaseDAO dao = (EntityBaseDAO) getBaseDAO(type); + if (dao != null) + result = dao.getAll(id); + return result; + } + + @Override + public IEntityBaseDAO getBaseDAO(Class classInfo) { + IEntityBaseDAO entityBaseDb = null; + entityBaseDb = baseDAOs.get(classInfo); + if (entityBaseDb == null) + throw new ItemManagerException("IEntityBaseDb not registered for " + classInfo); + return entityBaseDb; + } + + @Override + public Break getBreak(long id) { + return (Break) get(Break.class, id); + } + + DefaultContext getDbContext() { + DefaultContext context = null; + context = contextPool.borrowObject(); + return context; + } + + @Override + public FileType getFileType(String name) { + FileTypeDAO dao = (FileTypeDAO) getBaseDAO(FileType.class); + FileType result = (FileType) dao.getByName(name); + if (result == null) { + result = createFileType(name, "", "", "", 0, 0, 25); + result.add(); + } + return result; + } + + @Override + @SuppressWarnings("unchecked") + public List getFilteredDomainByDisplay(long domainCategoryId, String filter) { + DomainDAO dao = (DomainDAO) getBaseDAO(Domain.class); + return (List) (List) dao.getByDisplayFilter(domainCategoryId, filter); + } + + @Override + public List getFilteredQueryObject(String filter, boolean isChunked) { + List result = null; + SearchDefinitionDAO dao = (SearchDefinitionDAO) getBaseDAO(SearchDefinition.class); + if (dao != null) + result = dao.getFilteredEntities(filter, isChunked); + return result; + } + + @Override + public List getFilteredScene(String name, boolean isChunked) { + List result = null; + SceneDAO dao = (SceneDAO) getBaseDAO(Scene.class); + if (dao != null) + result = dao.getFilteredEntities(name, isChunked); + return result; + } + + @Override + public List getFolders(long id) { + List result = null; + ItemDAO dao = (ItemDAO) getBaseDAO(Item.class); + if (dao != null) + result = dao.getFolders(id); + return result; + } + + @Override + public List getShots(long id) { + List result = null; + ShotDAO dao = (ShotDAO) getBaseDAO(Shot.class); + if (dao != null) + result = dao.getShots(id); + return result; + } + + @Override + @SuppressWarnings("unchecked") + public List getItemTypes() { + traceIn(); + List result = null; + ItemTypeDAO dao = (ItemTypeDAO) getBaseDAO(ItemType.class); + List itemTypes = dao.getAll(); + result = (List) (List) itemTypes; + traceOut(); + return result; + } + + long getLastId(Statement st) throws SQLException { + traceIn(); + long id = 0; + ResultSet rs = st.getGeneratedKeys(); + if (rs.next()) { + id = rs.getLong(1); + rs.close(); + if (id == 0) { + throw new ItemManagerException("ID is 0 after insert, getGeneratedKeys() is empty."); + } + } + traceOut(); + return id; + } + + long getMasterId(DefaultContext context) throws SQLException { + traceIn(); + MasterIdDAO dao = (MasterIdDAO) getBaseDAO(MasterId.class); + MasterId masterId = new MasterId(); + dao.add(masterId); + traceOut(); + return masterId.getId(); + } + + @Override + public Media getMedia(long id) { + return (Media) get(Media.class, id); + } + + @Override + public MetadataElement getMetadataElement(long id) { + return (MetadataElement) get(MetadataElement.class, id); + } + + @Override + @SuppressWarnings("unchecked") + public List getMetadataElements() { + MetadataElementDAO dao = (MetadataElementDAO) getBaseDAO(MetadataElement.class); + return (List) (List) dao.getAll(); + } + + @Override + public MetadataType getMetadataType(long id) { + return (MetadataType) get(MetadataType.class, id); + } + + @Override + public Scene getScene(long id) { + return (Scene) get(Scene.class, id); + } + + @Override + public List getScenes(String name, Timestamp created) { + traceIn(); + SceneDAO dao = (SceneDAO) getBaseDAO(Scene.class); + List result = dao.search(created, name); + traceOut(); + return result; + } + + @Override + public Shot getShot(long id) { + return (Shot) get(Shot.class, id); + } + + @Override + public Store getStore(long id) { + return (Store) get(Store.class, id); + } + + @Override + public Store getStore(String name) { + StoreDAO dao = (StoreDAO) getBaseDAO(Store.class); + return (Store) dao.getByName(name); + } + + @Override + public Store getSystemStore(boolean lowres) { + Store result = null; + StoreDAO dao = (StoreDAO) getBaseDAO(Store.class); + if (dao != null) + result = (Store) dao.getSystemStore(lowres); + return result; + } + + @Override + public boolean getUser(String userName, String password) { + IEntityBase entity = getUserInfo(userName, password); + return entity != null; + } + + @Override + public UserInfo getUserInfo(String userName, String password) { + UserInfo result = null; + UserInfoDAO dao = (UserInfoDAO) getBaseDAO(UserInfo.class); + if (dao != null) { + IEntityBase entity = dao.get(userName, password); + result = (UserInfo) entity; + } + return result; + } + + void initialize() { + currentInstance = this; + super.setItemManager(this); + + baseDAOs.put(MetadataType.class, new MetadataTypeDAO(this)); + baseDAOs.put(MetadataElement.class, new MetadataElementDAO(this)); + baseDAOs.put(MediaFile.class, new MediaFileDAO(this)); + baseDAOs.put(Metadata.class, new MetadataDAO(this)); + baseDAOs.put(Media.class, new MediaDAO(this)); + baseDAOs.put(Scene.class, new SceneDAO(this)); + baseDAOs.put(SceneContent.class, new SceneContentDAO(this)); + baseDAOs.put(ItemType.class, new ItemTypeDAO(this)); + baseDAOs.put(DynamicAttributes.class, new DynamicAttributesDAO(this)); + baseDAOs.put(Item.class, new ItemDAO(this)); + baseDAOs.put(Folder.class, new FolderDAO(this)); + baseDAOs.put(RemoteStore.class, new RemoteStoreDAO(this)); + baseDAOs.put(Break.class, new BreakDAO(this)); + baseDAOs.put(FileType.class, new FileTypeDAO(this)); + baseDAOs.put(StoreUri.class, new StoreUriDAO(this)); + baseDAOs.put(Store.class, new StoreDAO(this)); + baseDAOs.put(Shot.class, new ShotDAO(this)); + baseDAOs.put(MasterId.class, new MasterIdDAO(this)); + baseDAOs.put(SearchDefinition.class, new SearchDefinitionDAO(this)); + baseDAOs.put(DomainCategory.class, new DomainCategoryDAO(this)); + baseDAOs.put(Domain.class, new DomainDAO(this)); + baseDAOs.put(DomainIndex.class, new DomainIndexDAO(this)); + baseDAOs.put(UserInfo.class, new UserInfoDAO(this)); + baseDAOs.put(Job.class, new JobDAO(this)); + baseDAOs.put(JobParameters.class, new JobParametersDAO(this)); + baseDAOs.put(WorkflowAction.class, new WorkflowActionDAO(this)); + + itemTypeChangeFactory = new ItemTypeChangeHandlerFactory(); + logger.info("ItemManager initialized"); + } + + @Override + public void modify(IEntityBase entity) { + traceIn(); + IEntityBaseDAO dbmanager = getBaseDAO(entity.getClass()); + dbmanager.modify(entity); + traceOut(); + } + + public void notifyItemTypeChange(IEntityBase entity, SignalType signalType) { + itemTypeChangeFactory.handleChange(this, entity, signalType); + } + + void putDbContext(DefaultContext context) { + contextPool.lendObject(context); + } + + @Override + public void remove(Class type, List ids) { + traceIn(); + IEntityBaseDAO dao = getBaseDAO(type); + if (dao != null) + dao.remove(ids); + traceOut(); + } + + @Override + public void remove(IEntityBase entity) { + traceIn(); + IEntityBaseDAO dbmanager = getBaseDAO(entity.getClass()); + dbmanager.remove(entity); + traceOut(); + } + + @Override + public List searchItem(QueryObject parameter) { + traceIn(); + List result = null; + ItemDAOEx itemDb = new ItemDAOEx(this); + result = itemDb.search(parameter); + traceOut(); + return result; + } + + @Override + public Item getItemByHouseID(String houseID) { + traceIn(); + Item result = null; + SearchFilter filter = new SearchFilter(); + filter.setMetadata(getStaticItemType().getMetadata("Anyag house ID")); + filter.setValueLogic(FilterValueLogic.EQUALS); + filter.setValues(Arrays.asList((Object) houseID)); + QueryObject qo = new QueryObject(); + qo.setFilters(Arrays.asList(filter)); + + // Exercise + List searchResult = searchItem(qo); + + if (searchResult != null && searchResult.size() > 0 && searchResult.get(0).getItemCount() == 1) + result = searchResult.get(0).getItems().get(0); + traceOut(); + return result; + } + + @Override + public SearchResult searchItem(String criteria, int fromResult, int toResult) { + traceIn(); + SearchResult result = null; + ItemDAOEx itemDb = new ItemDAOEx(this); + result = itemDb.search(criteria, fromResult, toResult); + traceOut(); + return result; + } + + @Override + public List searchJob(QueryObject parameter) { + traceIn(); + List result = null; + JobDAOEx jobDb = new JobDAOEx(this); + result = jobDb.search(parameter); + traceOut(); + return result; + } + + @Override + public void signal(long id, SignalType signalType, StaticTables staticTable) { + if (signalServer != null) { + Signal signal = new Signal(id, signalType, staticTable); + byte[] bytes = signal.toByteArray(); + if (bytes != null) + signalServer.queueMessage(bytes); + } + } + + @Override + public void throwError(Exception e) { + if (e != null) { + String message = e.getMessage(); + if (message == null || message.length() == 0) + message = e.getClass().getName(); + StackTraceElement element = Thread.currentThread().getStackTrace()[2]; + message += String.format(", source: %1$s.%2$s", element.getClassName(), element.getMethodName()); + if (logger != null) + logger.error(message, e); + throw new ItemManagerException(message); + } + } + + @Override + public void traceIn() { + // StackTraceElement element = + // Thread.currentThread().getStackTrace()[2]; + // logger.trace(String.format("<%1$s.%2$s", element.getClassName(), + // element.getMethodName())); + } + + @Override + public void traceOut() { + // StackTraceElement element = + // Thread.currentThread().getStackTrace()[2]; + // logger.trace(String.format("%1$s.%2$s>", element.getClassName(), + // element.getMethodName())); + } + + @Override + public void truncate() { + traceIn(); + HelperDAO.foreignKeysOff(); + HelperDAO.dropDynamicData(); + + truncate(SearchDefinition.class); + truncate(MediaFile.class); + truncate(SceneContent.class); + truncate(StoreUri.class); + truncate(Metadata.class); + truncate(MetadataElement.class); + truncate(MetadataType.class); + truncate(Store.class); + truncate(Scene.class); + truncate(Shot.class); + truncate(Break.class); + truncate(Media.class); + truncate(FileType.class); + truncate(Folder.class); + truncate(Item.class); + truncate(ItemType.class); + truncate(MasterId.class); + truncate(DomainIndex.class); + truncate(Domain.class); + truncate(DomainCategory.class); + // truncate(UserInfo.class); + HelperDAO.foreignKeysOn(); + + traceOut(); + } + + @Override + public void truncate(Class classInfo) { + traceIn(); + IEntityBaseDAO dbmanager = getBaseDAO(classInfo); + dbmanager.truncate(); + traceOut(); + } + + @Override + public ItemType getStaticItemType() { + ItemType result = null; + List itemTypes = getItemTypes(); + if (itemTypes != null) { + for (ItemType it : itemTypes) { + if (it.getIsStatic()) { + result = it; + break; + } + } + } + return result; + } + + @Override + public List getDynamicItemTypes() { + List result = new ArrayList(); + List itemTypes = getItemTypes(); + if (itemTypes != null) { + for (ItemType it : itemTypes) { + if (!it.getIsStatic()) + result.add(it); + } + } + return result; + } + + @Override + public ItemType getItemType(String itemTypeName) { + ItemTypeDAO dbmanager = (ItemTypeDAO) getBaseDAO(ItemType.class); + return dbmanager.get(itemTypeName); + } + + @SuppressWarnings("unchecked") + @Override + public List getRunningJobs(String template) { + JobDAO dbmanager = (JobDAO) getBaseDAO(Job.class); + return (List) (List) dbmanager.getAllIncomplete(template); + } + + @SuppressWarnings("unchecked") + @Override + public List getWorkflowActions(Date date) { + Calendar begin = CalendarUtils.createZeroCalendar(date); + Calendar end = CalendarUtils.createZeroCalendar(date); + end.add(Calendar.DAY_OF_YEAR, 1); + WorkflowActionDAO dao = (WorkflowActionDAO) getBaseDAO(WorkflowAction.class); + return (List) (List) dao.getWorkflowActions(new Timestamp(begin.getTimeInMillis()), + new Timestamp(end.getTimeInMillis())); + } + + @Override + public void mergeItemStructure(Item item) { + if (item.getId() == 0) { + add(item); + return; + } + List mS = item.getMedias(); + if (mS == null) + return; + for (Media m : mS) { + if (m.getId() == 0) { + m.setItemId(item.getId()); + add(m); + continue; + } + List fS = m.getMediaFiles(); + if (fS == null) + continue; + for (MediaFile f : fS) { + if (f.getId() == 0) { + f.setMediaId(m.getId()); + add(f); + continue; + } + } + } + } + + @Override + public void merge(IEntityBase entity) { + traceIn(); + IEntityBaseDAO dbmanager = getBaseDAO(entity.getClass()); + dbmanager.merge(entity); + traceOut(); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManagerData.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManagerData.java new file mode 100644 index 00000000..bd83a7b3 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManagerData.java @@ -0,0 +1,250 @@ +package user.jobengine.db; + +import java.sql.Timestamp; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Hashtable; +import java.util.Locale; +import java.util.Map; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.BaseType; +import user.commons.EntityBase; +import user.commons.remotestore.DeliveryMethod; +import user.commons.remotestore.RemoteStoreProtocol; + +/** + * Adattípusok, enumerátorok. + */ +public class ItemManagerData { + private static final Logger logger = LogManager.getLogger(); + + public enum SignalType { + CREATE(0), UPDATE(1), DELETE(2); + + private final long value; + + SignalType(long value) { + this.value = value; + } + + public long getValue() { + return value; + } + } + + public enum UserRight { + READONLY(1), READWRITE(3), ADMINISTRATOR(63); + + private final int value; + + UserRight(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + + static public boolean is(int flags, UserRight type) { + return ((flags & type.getValue()) == type.getValue()); + } + } + + // public enum LogLevel { + // TRACE, DEBUG, INFO, WARNING, ERROR, FATAL + // } + + public enum OrderDirection { + ASC, DESC + } + + public enum FilterLogic { + AND, OR + } + + public enum FilterValueLogic { + CONTAINS, STARTSWITH, ENDSWITH, EQUALS, LESS, MORE, BEETWEN, ONEWEEK, TWOWEEKS, THREEWEEKS, ONEMONTH, TWOMONTHS, THREEMONTHS, SIXMONTHS, ONEYEAR + } + + public enum StaticTables { + ITEM(0), ITEMTYPE(1), MEDIA(2), MEDIAFILE(3), METADATA(4), METADATELEMENT(5), METADATATYPE(6), FOLDER(7), SHOT( + 8), BREAK(9), STORE(10), STOREURI(11), MEDIAINFO(12), REMOTESTORE(13), REMOTEFILE(14), SEARCHDEFINITION( + 15), DOMAIN(16), DOMAINCATEGORY(17), JOB(18), USERINFO(19), FILETYPE(20), SCENE( + 21), SCENECONTENT(22), TEMPLATE(23), TEMPLATESTEP(24), TEMPLATEDECLARATION( + 25), INPUTPARAM(26), OUTPUTPARAM(27), LOGEVENT(28), JOBSTART(29); + private final long value; + + StaticTables(long value) { + this.value = value; + } + + public long getValue() { + return value; + } + + } + + public enum SqlIndexType { + NONE, INDEX, UNIQUE + } + + public enum MdType { + INDEX(0x0001), UNIQUE(0x0002), NULL(0x0004), EDIT(0x0008), LIST(0x0010), GENERATE(0x0020), SEARCH(0x0040); + + private final int value; + + MdType(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + + static public boolean is(int flags, MdType type) { + return ((flags & type.getValue()) == type.getValue()); + } + + static public int getValues(MdType... flags) { + int result = 0; + if (flags != null) { + for (MdType mdtype : flags) + result += mdtype.getValue(); + } + return result; + } + } + + // public enum StaticField { + // NONE, + // ITEM_NAME, + // ITEM_DESCRIPTION, + // ITEM_HOUSEID, + // MEDIA_NAME, + // MEDIA_DESCRIPTION, + // MEDIA_HOUSEID + // } + + public enum GuiType { + LABEL, TEXTBOX, DATAGRID, DATEPICKER, DATETIMEPICKER, DOMAINCOMBO, DOMAINLOOKUP, MULTIDOMAINLOOKUP, CHECKBOX, COMBOBOX, MULTILINETEXTBOX, TIMECODE, NUMBER, WHOLENUMBER, METADATAELEMENT, METADATTYPE, FILETYPE, STORE, IMAGE + } + + public enum ListType { + LABEL, CHECKBOX, DOMAINLABEL, FOLDERICON, ICON, FILESIZE, WRAPPEDLABEL, TIMECODE, PROGRESS, THUMBNAIL, EDITABLETEXTBOX + } + + public enum BreakType { + IN, OUT, SEGMENT + } + + private static Map typeDefinitions = null; + + static { + typeDefinitions = new Hashtable(); + typeDefinitions.put(BaseType.BIGINT, new TypeDefinition("java.lang.Long", "java.lang.Long", "BIGINT")); + typeDefinitions.put(BaseType.BINARY, new TypeDefinition("byte[]", "byte[]", "BLOB")); + typeDefinitions.put(BaseType.BOOL, + new TypeDefinition("java.lang.Boolean", "java.lang.Boolean", "CHARACTER(1)")); + typeDefinitions.put(BaseType.CHAR, new TypeDefinition("java.sql.String", "java.sql.String", "CHARACTER")); + typeDefinitions.put(BaseType.DATETIME, + new TypeDefinition("java.sql.Timestamp", "com.ibm.db2.jcc.DBTimestamp", "TIMESTAMP")); + typeDefinitions.put(BaseType.DOMAIN, + new TypeDefinition("user.jobengine.db.Domains", "user.jobengine.db.Domains", "")); + typeDefinitions.put(BaseType.DOUBLE, new TypeDefinition("java.lang.Double", "java.lang.Double", "DOUBLE")); + typeDefinitions.put(BaseType.DECIMAL, + new TypeDefinition("java.math.BigDecimal", "java.math.BigDecimal", "DECIMAL")); + typeDefinitions.put(BaseType.INT, new TypeDefinition("java.lang.Integer", "java.lang.Integer", "INT")); + typeDefinitions.put(BaseType.REAL, new TypeDefinition("java.lang.Float", "java.lang.Float", "REAL")); + typeDefinitions.put(BaseType.TEXT, new TypeDefinition("java.lang.String", "java.lang.String", "CLOB")); + typeDefinitions.put(BaseType.TIME, new TypeDefinition("java.sql.Time", "java.sql.Time", "TIME")); + typeDefinitions.put(BaseType.VARCHAR, new TypeDefinition("java.lang.String", "java.lang.String", "VARCHAR")); + } + + public static BaseType toBaseType(String typeName) { + return BaseType.valueOf(typeName); + } + + public static GuiType toGuiType(String typeName) { + return GuiType.valueOf(typeName); + } + + public static BreakType toBreakType(String typeName) { + return BreakType.valueOf(typeName); + } + + public static ListType toListType(String typeName) { + return ListType.valueOf(typeName); + } + + public static StaticTables toStaticTable(String name) { + return name == null ? null : StaticTables.valueOf(name); + } + + public static RemoteStoreProtocol toRemoteStoreProtocol(String name) { + return name == null ? null : RemoteStoreProtocol.valueOf(name); + } + + public static DeliveryMethod toDeliveryMethod(String name) { + return name == null ? null : DeliveryMethod.valueOf(name); + } + + public static boolean checkObjectType(String name, Object value, BaseType baseType, boolean fromDb) { + boolean result = true; + if (value != null) { + String valueType = value.getClass().getName(); + TypeDefinition def = typeDefinitions.get(baseType); + if (def != null) { + String expectedType = fromDb ? def.getSqlJavaType() : def.getBaseJavaType(); + result = valueType.equals(expectedType); + if (!result) { + if (expectedType == null) + expectedType = "UNDEFINED"; + String msg = String.format( + "Value type is not acceptable for column: %1$s. Expected: %2$s, found: %3$s", name, + expectedType, value.getClass().getName()); + logger.error(msg); + } + } + } + return result; + } + + public static String toDateString(String fullDate, int addday, int field) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH); + Date date = null; + try { + date = formatter.parse(fullDate); + } catch (ParseException e) { + e.printStackTrace(); + } + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.add(field, addday); + return formatter.format(cal.getTime()); + } + + public static String toDateString(Timestamp fullDate, int addday, int field) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", Locale.ENGLISH); + Calendar cal = Calendar.getInstance(); + cal.setTime(fullDate); + cal.add(field, addday); + return formatter.format(cal.getTime()); + } + + @SuppressWarnings("unchecked") + public static Class getEntityClass(String type) { + Class result = null; + try { + result = (Class) Class.forName("user.jobengine.db." + type); + } catch (ClassNotFoundException e) { + logger.error(e.getMessage()); + } + return result; + + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManagerException.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManagerException.java new file mode 100644 index 00000000..2b7f3338 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManagerException.java @@ -0,0 +1,25 @@ +package user.jobengine.db; + +/** + * ItemManager API kivétel. Az ilyen kivételek automatikusan naplózódnak level=ERROR. + */ +public class ItemManagerException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + public ItemManagerException(String message) { + super(message); +// ItemManager.getInstance().getLogger().error(message); + } + + public ItemManagerException(Exception e) { + super(e); +// ItemManager.getInstance().getLogger().error(message); + } + +// public ItemManagerException(String message, boolean log) { +// super(message); +// if (log) +// ItemManager.getInstance().getLogger().error(message); +// } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemType.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemType.java new file mode 100644 index 00000000..5266da77 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemType.java @@ -0,0 +1,150 @@ +package user.jobengine.db; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import user.commons.EntityBase; + +/** + * Anyag típus Pojo osztály. + * + * @author User + * + */ +public class ItemType extends EntityBase implements Serializable { + private static final long serialVersionUID = 1L; + private String description; + private String name; + protected List metadatas = null; + private final String tablePrefix = "METADATA_"; + private boolean isStatic; + + public void appendMetadata(Metadata md) { + checkParameter("Metadata", md, true); + if (this.metadatas == null) + this.metadatas = new ArrayList(); + for (Metadata m : this.metadatas) { + String oldName = m.getMetadataElement().getName(); + String newName = md.getMetadataElement().getName(); + if (oldName.equals(newName)) + throw new ItemManagerException( + "Metadata with this name already added: " + oldName); + } + this.metadatas.add(md); + } + + public String getDescription() { + return this.description; + } + + @SuppressWarnings("unchecked") + public List getMetadatas() { + if (metadatas == null && getId() != 0) { + ItemManager manager = ItemManager.getInstance(); + if (manager != null) { + IEntityBaseDAO dao = manager.getBaseDAO(Metadata.class); + if (dao != null) + this.metadatas = (List) (List) dao + .getAll(getId()); + } + } + return this.metadatas; + } + + public String getName() { + return this.name; + } + + String getTableName() { + return tablePrefix + getTableId(); + } + + String getTableId() { + return String.format("%04d", getId()); + } + + public void setDescription(String description) { + checkParameter("Description", description); + this.description = description; + } + + public void setMetadatas(List metadatas) { + this.metadatas = metadatas; + } + + public void setName(String name) { + checkParameter("Name", name); + this.name = name; + } + + String getFieldList(String prefix) { + String ret = ""; + for (int i = 0; i < getMetadatas().size(); i++) { + Metadata md = getMetadatas().get(i); + ret += String.format("%s.\"%s\"", prefix, md.getMetadataElement() + .getName()); + if (i < getMetadatas().size() - 1) + ret += ", "; + } + return ret; + } + + /** + * Serializációs technikával másolatot készít egy ItemType objektumról. + * + * @deprecated Az ItemType objektum másolási technikára nincs szükség. Az + * objektum kliens oldalon bõvítendõ a megjelenítéshez szükséges + * statikus Metadata objektumokkal. + * @return ItemType objektum másolata. + */ + ItemType copy() { + Object obj = null; + try { + // Write the object out to a byte array + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(bos); + out.writeObject(this); + out.flush(); + out.close(); + + // Make an input stream from the byte array and read + // a copy of the object back in. + ObjectInputStream in = new ObjectInputStream( + new ByteArrayInputStream(bos.toByteArray())); + obj = in.readObject(); + } catch (Exception e) { + throw new ItemManagerException(e.getMessage()); + } + return (ItemType) obj; + } + + public void setIsStatic(boolean isStatic) { + this.isStatic = isStatic; + } + + public boolean getIsStatic() { + return isStatic; + } + + public Metadata getMetadata(String name) { + Metadata result = null; + if (getMetadatas() != null) { + for (Metadata metadata : metadatas) { + MetadataElement metadataElement = metadata.getMetadataElement(); + if (metadataElement != null + && metadataElement.getName().equals(name)) { + result = metadata; + break; + } + } + } + if (result == null) + throw new ItemManagerException("Metadata name not exists: " + name); + return result; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemTypeDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemTypeDAO.sqlj new file mode 100644 index 00000000..05cbf90c --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemTypeDAO.sqlj @@ -0,0 +1,140 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.jobengine.db.ItemManagerData.SignalType; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +#sql iterator ItemTypeIter(long id, String name, String description, String isStatic); + +@SuppressWarnings("unused") +class ItemTypeDAO extends EntityBaseDAO { + + public ItemTypeDAO(ItemManager manager) { + super(manager); + } + + @Override + protected boolean useMemoryCache() { return true; } + + @Override + protected Class getCacheType() { return ItemType.class; } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + MetadataDAO dao = (MetadataDAO) manager.getBaseDAO(Metadata.class); + dao.removeAll(context, entity.getId()); + } + + @Override + protected void afterDelete(DefaultContext context, IEntityBase entity) throws SQLException { + manager.notifyItemTypeChange(entity, SignalType.DELETE); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + ItemType obj = (ItemType) entity; + MetadataDAO dao = (MetadataDAO) manager.getBaseDAO(Metadata.class); + dao.addAll(context, obj); + manager.notifyItemTypeChange(entity, SignalType.CREATE); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + manager.notifyItemTypeChange(entity, SignalType.UPDATE); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ItemTypeIter iterator = (ItemTypeIter) iter; + while (iterator.next()) { + ItemType entity = new ItemType(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setIsStatic(iterator.isStatic() == null || iterator.isStatic().equals("N") ? false : true); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + ItemTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, ISSTATIC FROM ITEMTYPE WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + ItemTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, ISSTATIC FROM ITEMTYPE }; + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String filterName) throws SQLException{ + ItemTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, ISSTATIC FROM ITEMTYPE WHERE NAME = :filterName }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM ITEMTYPE WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE ITEMTYPE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + ItemType obj = (ItemType) entity; + long id = obj.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + String isStatic = obj.getIsStatic() ? "Y" : "N"; + + #sql [context] { UPDATE ITEMTYPE SET NAME = :name, DESCRIPTION = :description, ISSTATIC = :isStatic WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + ItemType obj = (ItemType) entity; + String name = obj.getName(); + String description = obj.getDescription(); + String isStatic = obj.getIsStatic() ? "Y" : "N"; + + #sql [context] { INSERT INTO ITEMTYPE (NAME, DESCRIPTION, ISSTATIC) VALUES (:name, :description, :isStatic) }; + } + + public ItemType get(String filterName) { + manager.traceIn(); + ItemType result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, filterName); + result = (ItemType) getEntity(context, iter); + } catch (Exception e) { + logger.error(e.getMessage()); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/JSONBase.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/JSONBase.java new file mode 100644 index 00000000..811d6ed4 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/JSONBase.java @@ -0,0 +1,13 @@ +package user.jobengine.db; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +import user.commons.EntityBase; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "$type") +@JsonSubTypes({ @Type(WorkflowAction.class) }) +public class JSONBase extends EntityBase { + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/JobDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobDAO.sqlj new file mode 100644 index 00000000..39f8925b --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobDAO.sqlj @@ -0,0 +1,138 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.Job; +import user.commons.JobStatus; +import java.sql.Timestamp; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.ResultSet; +import java.util.List; +import java.util.ArrayList; +import java.io.ByteArrayOutputStream; +import java.io.ObjectOutputStream; + + +@SuppressWarnings("unused") +class JobDAO extends EntityBaseDAO { + private ItemManager manager; + + public JobDAO(ItemManager manager) { + super(manager); + this.manager = manager; + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + JobIter iterator = (JobIter) iter; + while (iterator.next()) { + Job entity = new Job(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setOwner(iterator.owner()); + entity.setPriority(iterator.priority()); + entity.setProgress(iterator.progress()); + entity.setStatus(JobStatus.valueOf(iterator.status())); + entity.setDescription(iterator.description()); + entity.setSubmitted(iterator.submitted()); + entity.setFinished(iterator.finished()); + entity.setTemplate(iterator.template()); + entity.setScheduledTime(iterator.scheduledTime()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + public List entities(DefaultContext context, ResultSet rs) throws SQLException { + JobIter iter = null; + #sql [context] iter = { CAST :rs }; + return entities(context, iter, false); + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + JobIter iter = null; + #sql [context] iter = { SELECT ID, NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME FROM JOB WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + JobIter iter = null; + #sql [context] iter = { SELECT ID, NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME FROM JOB }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM JOB WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE JOB DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Job obj = (Job) entity; + long id = obj.getId(); + String name = obj.getName(); + String owner = obj.getOwner(); + int priority = obj.getPriority(); + int progress = obj.getProgress(); + String status = obj.getStatus().toString(); + String description = obj.getDescription(); + Timestamp submitted = obj.getSubmitted(); + Timestamp finished = obj.getFinished(); + String template = obj.getTemplate(); + Timestamp scheduledTime = obj.getScheduledTime(); + + #sql [context] { UPDATE JOB SET NAME = :name, OWNER = :owner, PRIORITY = :priority, PROGRESS = :progress, STATUS = :status, DESCRIPTION = :description, SUBMITTED = :submitted, FINISHED = :finished, TEMPLATE = :template, SCHEDULEDTIME = :scheduledTime WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Job obj = (Job) entity; + String name = obj.getName(); + String owner = obj.getOwner(); + int priority = obj.getPriority(); + int progress = obj.getProgress(); + String status = obj.getStatus().toString(); + String description = obj.getDescription(); + Timestamp submitted = obj.getSubmitted(); + Timestamp finished = obj.getFinished(); + String template = obj.getTemplate(); + Timestamp scheduledTime = obj.getScheduledTime(); + + #sql [context] { INSERT INTO JOB (NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME) + VALUES (:name, :owner, :priority, :progress, :status, :description, :submitted, :finished, :template, :scheduledTime) }; + } + + public List getAllIncomplete(String template) { + manager.traceIn(); + List result = null; + DefaultContext context = manager.getDbContext(); + try { + JobIter iter = null; + //ResultSetIterImpl iter = null; + #sql [context] iter = { SELECT ID, NAME, OWNER, PRIORITY, PROGRESS, STATUS, DESCRIPTION, SUBMITTED, FINISHED, TEMPLATE, SCHEDULEDTIME + FROM JOB WHERE TEMPLATE = :template + AND STATUS IN ('EXECUTING', 'WAIT_EXECUTOR', 'WAIT_SUSPEND', 'SUSPENDED', 'RUNABLE')}; + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/JobDAOEx.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobDAOEx.java new file mode 100644 index 00000000..568ae8cf --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobDAOEx.java @@ -0,0 +1,99 @@ +package user.jobengine.db; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Date; +import java.util.Formatter; +import java.util.List; +import java.util.Locale; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import sqlj.runtime.ref.DefaultContext; +import user.commons.Job; + +public class JobDAOEx { + private ItemManager manager = null; + private static final Logger logger = LogManager.getLogger(); + + public JobDAOEx(ItemManager manager) { + this.manager = manager; + } + + @SuppressWarnings("unchecked") + public List search(QueryObject parameter) { + manager.traceIn(); + if (parameter == null || parameter.getFilters() == null || parameter.getFilters().size() == 0) + throw new IllegalArgumentException("QueryObject not specified."); + + List results = new ArrayList(); + + ResultSet rs = null; + PreparedStatement st = null; + DefaultContext context = ItemManager.getInstance().getDbContext(); + Connection connection = context.getConnection(); + + try { + String resultQuery = buildResultQuery(parameter); + st = connection.prepareStatement(resultQuery); + st.setFetchSize(50); + st.setMaxRows(50); + rs = st.executeQuery(); + JobDAO dao = (JobDAO) manager.getBaseDAO(Job.class); + results = (List) (List) dao.entities(context, rs); + rs.close(); + + connection.commit(); + } catch (Exception e) { + try { + connection.rollback(); + } catch (Exception e1) { + e1.printStackTrace(); + } + manager.throwError(e); + } finally { + try { + if (rs != null) + rs.close(); + } catch (Exception e1) { + } + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + manager.putDbContext(context); + } + manager.traceOut(); + return results; + } + + private String buildResultQuery(QueryObject parameter) { + StringBuilder resultQuery = new StringBuilder(); + Formatter qf = new Formatter(resultQuery, Locale.getDefault()); + List filters = parameter.getFilters(); + if (filters != null && filters.size() > 0) { + String whereCondition = ""; + List where = new ArrayList(); + for (SearchFilter filter : filters) { + Timestamp date = new Timestamp(((Date) filter.getValues().get(0)).getTime()); + Object filterValue = ItemManagerData.toDateString(date, 0, 0); + if (filter.getLogic() != null) + where.add(String.format(" %1$s ", filter.getLogic().toString())); + where.add(String.format("j.%1$s LIKE '%2$s%3$s'", filter.getMetadata().getPojoField().toUpperCase(), + filterValue, "%")); + } + for (String element : where) { + whereCondition += element; + } + qf.format("SELECT * FROM JOB j WHERE (%1$s) ORDER BY submitted DESC", whereCondition); + logger.info(resultQuery.toString()); + } + qf.close(); + return resultQuery.toString(); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/JobIter.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobIter.sqlj new file mode 100644 index 00000000..bee2d520 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobIter.sqlj @@ -0,0 +1,5 @@ +package user.jobengine.db; + +import java.sql.Timestamp; + +#sql public iterator JobIter(long id, String name, String owner, int priority, int progress, String status, String description, Timestamp submitted, Timestamp finished, String template, Timestamp scheduledTime); diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/JobParameters.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobParameters.java new file mode 100644 index 00000000..e18b3a3d --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobParameters.java @@ -0,0 +1,15 @@ +package user.jobengine.db; + +import user.commons.EntityBase; + +public class JobParameters extends EntityBase { + private byte[] data; + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/JobParametersDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobParametersDAO.sqlj new file mode 100644 index 00000000..2ef6f819 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/JobParametersDAO.sqlj @@ -0,0 +1,81 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.Job; +import user.commons.JobStatus; +import java.sql.Timestamp; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.sql.ResultSet; +import java.util.List; +import java.util.ArrayList; + +#sql iterator JobParametersIter(long id, byte[] data); + +@SuppressWarnings("unused") +class JobParametersDAO extends EntityBaseDAO { + + public JobParametersDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + JobParametersIter iterator = (JobParametersIter) iter; + while (iterator.next()) { + JobParameters entity = new JobParameters(); + entity.setId(iterator.id()); + entity.setData(iterator.data()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + JobParametersIter iter = null; + #sql [context] iter = { SELECT ID, DATA FROM JOBPARAMETERS WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + JobParametersIter iter = null; + #sql [context] iter = { SELECT ID, DATA FROM JOBPARAMETERS }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM JOBPARAMETERS WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE JOBPARAMETERS DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + JobParameters obj = (JobParameters) entity; + long id = obj.getId(); + byte[] data = obj.getData(); + + #sql [context] { UPDATE JOBPARAMETERS DATA = :data WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + JobParameters obj = (JobParameters) entity; + long id = obj.getId(); + byte[] data = obj.getData(); + + #sql [context] { INSERT INTO JOBPARAMETERS (ID, DATA) VALUES (:id, :data) }; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MasterId.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/MasterId.java new file mode 100644 index 00000000..37270990 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MasterId.java @@ -0,0 +1,17 @@ +package user.jobengine.db; + +import java.sql.Timestamp; + +import user.commons.EntityBase; + +public class MasterId extends EntityBase { + private Timestamp created = null; + + public Timestamp getCreated() { + return this.created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MasterIdDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/MasterIdDAO.sqlj new file mode 100644 index 00000000..0c2ced1a --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MasterIdDAO.sqlj @@ -0,0 +1,51 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.Date; +import java.util.List; +import java.util.ArrayList; + +#sql iterator MasterIdIter(long id, Timestamp created); + +@SuppressWarnings("unused") +class MasterIdDAO extends EntityBaseDAO { + + public MasterIdDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ShotIter iterator = (ShotIter) iter; + while (iterator.next()) { + MasterId entity = new MasterId(); + entity.setId(iterator.id()); + entity.setCreated(iterator.created()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MasterId obj = (MasterId) entity; + obj.setCreated(new Timestamp(new Date().getTime())); + Timestamp created = obj.getCreated(); + + #sql [context] { INSERT INTO MASTERID (CREATED) VALUES (:created) }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE MASTERID DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Media.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Media.java new file mode 100644 index 00000000..1d8ecd86 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Media.java @@ -0,0 +1,125 @@ +package user.jobengine.db; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import user.commons.TimestampAdapter; + +/** + * Verzió Pojo osztály. + * + * @author User + * + */ +public class Media extends DynamicAttributes { + private static final long serialVersionUID = 1L; + private Timestamp archived = null; + private Timestamp created = null; + private String description = null; + private String houseId = null; + private long itemId = 0; + private long length = 0; + private List mediaFiles = null; + private String title = null; + private boolean isPartialEnabled; + private byte[] poster = null; + + public void appendMediaFile(MediaFile mediaFile) { + checkParameter("MediaFile", mediaFile, true); + if (this.getMediaFiles() == null) + this.setMediaFiles(new ArrayList()); + this.getMediaFiles().add(mediaFile); + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getArchived() { + return this.archived; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return created; + } + + public String getDescription() { + return description; + } + + public String getHouseId() { + return this.houseId; + } + + public long getItemId() { + return this.itemId; + } + + public long getLength() { + return this.length; + } + + @SuppressWarnings("unchecked") + public List getMediaFiles() { + if (mediaFiles == null) + mediaFiles = (List) (List) ItemManager.getInstance() + .getAll(MediaFile.class, getId()); + return mediaFiles; + } + + public String getTitle() { + return title; + } + + public void setArchived(Timestamp archived) { + this.archived = archived; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public void setDescription(String description) { + checkParameter("Description", description); + this.description = description; + } + + public void setHouseId(String id) { + houseId = id; + } + + public void setItemId(long itemId) { + // checkParameter("ItemId", itemId); + this.itemId = itemId; + } + + public void setLength(long length) { + this.length = length; + } + + public void setTitle(String title) { + checkParameter("Title", title); + this.title = title; + } + + public void setMediaFiles(List mediaFiles) { + this.mediaFiles = mediaFiles; + } + + public boolean getIsPartialEnabled() { + return isPartialEnabled; + } + + public void setIsPartialEnabled(boolean isPartialEnabled) { + this.isPartialEnabled = isPartialEnabled; + } + + public byte[] getPoster() { + return poster; + } + + public void setPoster(byte[] poster) { + this.poster = poster; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaDAO.sqlj new file mode 100644 index 00000000..eadadce9 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaDAO.sqlj @@ -0,0 +1,170 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.Timestamp; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +#sql iterator MediaIter(long id, String title, String description, long itemId, long itemTypeId, String houseId, long length, Timestamp created, Timestamp archived, byte[] poster); + +@SuppressWarnings("unused") +class MediaDAO extends EntityBaseDAO { + + public MediaDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void beforeAdd(DefaultContext context, IEntityBase entity) throws SQLException { + long id = manager.getMasterId(context); + entity.setId(id); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + Media media = (Media) entity; + if (!media.getIsPartialEnabled()) { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.add(context, entity); + } + MediaFileDAO daoMf = (MediaFileDAO) manager.getBaseDAO(MediaFile.class); + daoMf.addAll(context, entity); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.modify(context, entity); + } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + DynamicAttributesDAO dao = (DynamicAttributesDAO) manager.getBaseDAO(DynamicAttributes.class); + dao.remove(context, entity); + MediaFileDAO daoMf = (MediaFileDAO) manager.getBaseDAO(MediaFile.class); + daoMf.removeAll(context, entity.getId()); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MediaIter iterator = (MediaIter) iter; + while (iterator.next()) { + Media entity = new Media(); + entity.setId(iterator.id()); + entity.setTitle(iterator.title()); + entity.setDescription(iterator.description()); + entity.setItemId(iterator.itemId()); + entity.setItemTypeId(iterator.itemTypeId()); + entity.setHouseId(iterator.houseId()); + entity.setLength(iterator.length()); + entity.setCreated(iterator.created()); + entity.setArchived(iterator.archived()); + entity.setPoster(iterator.poster()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MediaIter iter = null; + #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, CREATED, ARCHIVED, POSTER FROM MEDIA WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + MediaIter iter = null; + #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, CREATED, ARCHIVED, POSTER FROM MEDIA WHERE ITEMID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MediaIter iter = null; + #sql [context] iter = { SELECT ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, CREATED, ARCHIVED, POSTER FROM MEDIA }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM MEDIA WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE MEDIA DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Media obj = (Media) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemId = obj.getItemId(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + long length = obj.getLength(); + byte[] poster = obj.getPoster(); + Timestamp archived = obj.getArchived(); + + #sql [context] { UPDATE MEDIA SET TITLE = :title, DESCRIPTION = :description, ITEMID = :itemId, ITEMTYPEID = :itemTypeId, HOUSEID = :houseId, LENGTH = :length, POSTER = :poster, ARCHIVED = :archived WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Media obj = (Media) entity; + long id = obj.getId(); + String title = obj.getTitle(); + String description = obj.getDescription(); + long itemId = obj.getItemId(); + long itemTypeId = obj.getItemTypeId(); + String houseId = obj.getHouseId(); + long length = obj.getLength(); + byte[] poster = obj.getPoster(); + Timestamp archived = obj.getArchived(); + + #sql [context] { INSERT INTO MEDIA (ID, TITLE, DESCRIPTION, ITEMID, ITEMTYPEID, HOUSEID, LENGTH, POSTER, ARCHIVED) VALUES (:id, :title, :description, :itemId, :itemTypeId, :houseId, :length, :poster, :archived) }; + } + + /** + * Beszúrja az Item objektumhoz kapcsolódó statikus/dinamikus Media adatokat. + */ + void addAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Item item = (Item) entity; + if (item != null) { + long itemId = item.getId(); + List medias = item.getMedias(); + if (medias != null) { + for (Media m: medias) { + m.setItemId(itemId); + add(context, m); + } + } + } + manager.traceOut(); + } + + void removeAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Item item = (Item) entity; + if (item != null) { + List medias = item.getMedias(); + if (medias != null) { + for (Media media: medias) + remove(context, media); + } + } + manager.traceOut(); + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaFile.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaFile.java new file mode 100644 index 00000000..810bc27f --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaFile.java @@ -0,0 +1,101 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.EntityBase; + +public class MediaFile extends EntityBase implements Serializable { + //TODO change back to BLOB or BINARY (everywhere) + private static final long serialVersionUID = 1L; + private String fileStructInfo = null; + private FileType fileType = null; + private long fileTypeId = 0; + private Media media = null; + private long mediaId = 0; + private String relativePath = null; + private Store store = null; + private long storeId = 0; + + public String getFileStructInfo() { + return this.fileStructInfo; + } + + public FileType getFileType() { + if (this.fileType == null && this.fileTypeId != 0) + this.fileType = (FileType) ItemManager.getInstance().get(FileType.class, fileTypeId); + return this.fileType; + } + + public long getFileTypeId() { + return this.fileTypeId; + } + + public Media getMedia() { + if (this.media == null && this.mediaId != 0) { + this.media = (Media)ItemManager.getInstance().getMedia(this.mediaId); + } + return this.media; + } + + public long getMediaId() { + return this.mediaId; + } + + public String getRelativePath() { + return this.relativePath; + } + + public Store getStore() { + if (this.store == null && this.storeId != 0) { + logger.debug("MediaFile.getStore Store entity cache"); + this.store = ItemManager.getInstance().getStore(this.storeId); + } + return this.store; + } + + public long getStoreId() { + return this.storeId; + } + + public void setFileStructInfo(String fileStructInfo) { + this.fileStructInfo = fileStructInfo; + } + + public void setFileType(FileType fileType) { + //checkParameter("FileType", fileType); + this.fileType = fileType; + this.fileTypeId = fileType.getId(); + } + + public void setFileTypeId(long fileTypeId) { + //checkParameter("FileTypeId", fileTypeId); + this.fileTypeId = fileTypeId; + } + + public void setMedia(Media media) { + //checkParameter("Media", media); + this.media = media; + this.mediaId = media.getId(); + } + + public void setMediaId(long mediaId) { + //checkParameter("MediaId", mediaId); + this.mediaId = mediaId; + } + + public void setRelativePath(String relativePath) { + //checkParameter("RelativePath", relativePath); + this.relativePath = relativePath; + } + + public void setStore(Store store) { + //checkParameter("Store", store); + this.store = store; + this.storeId = store.getId(); + } + + public void setStoreId(long id) { + //checkParameter("StoreId", id); + this.storeId = id; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaFileDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaFileDAO.sqlj new file mode 100644 index 00000000..4171300f --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MediaFileDAO.sqlj @@ -0,0 +1,116 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +#sql iterator MediaFileIter(long id, long mediaId, long storeId, long fileTypeId, String relativePath, String fileStructInfo); + +@SuppressWarnings("unused") +public class MediaFileDAO extends EntityBaseDAO { + + public MediaFileDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MediaFileIter iterator = (MediaFileIter) iter; + while (iterator.next()) { + MediaFile entity = new MediaFile(); + entity.setId(iterator.id()); + entity.setMediaId(iterator.mediaId()); + entity.setStoreId(iterator.storeId()); + entity.setFileTypeId(iterator.fileTypeId()); + entity.setRelativePath(iterator.relativePath()); + entity.setFileStructInfo(iterator.fileStructInfo()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MediaFileIter iter = null; + #sql [context] iter = { SELECT ID, MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO FROM MEDIAFILE WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + MediaFileIter iter = null; + #sql [context] iter = { SELECT ID, MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO FROM MEDIAFILE WHERE MEDIAID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MediaFileIter iter = null; + #sql [context] iter = { SELECT ID, MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO FROM MEDIAFILE }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM MEDIAFILE WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE MEDIAFILE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + MediaFile obj = (MediaFile) entity; + long id = obj.getId(); + long mediaId = obj.getMediaId(); + long storeId = obj.getStoreId(); + long fileTypeId = obj.getFileTypeId(); + String relativePath = obj.getRelativePath(); + String fileStructInfo = obj.getFileStructInfo(); + + #sql [context] { UPDATE MEDIAFILE SET MEDIAID = :mediaId, STOREID = :storeId, FILETYPEID = :fileTypeId, RELATIVEPATH = :relativePath, FILESTRUCTINFO = :fileStructInfo WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MediaFile obj = (MediaFile) entity; + long mediaId = obj.getMediaId(); + long storeId = obj.getStoreId(); + long fileTypeId = obj.getFileTypeId(); + String relativePath = obj.getRelativePath(); + String fileStructInfo = obj.getFileStructInfo(); + + #sql [context] { INSERT INTO MEDIAFILE (MEDIAID, STOREID, FILETYPEID, RELATIVEPATH, FILESTRUCTINFO) VALUES (:mediaId, :storeId, :fileTypeId, :relativePath, :fileStructInfo) }; + } + + void addAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Media media = (Media) entity; + if (media != null) { + List mediaFiles = media.getMediaFiles(); + if (mediaFiles != null) { + for (MediaFile mf: mediaFiles) { + long mediaId = media.getId(); + mf.setMediaId(mediaId); + add(context, mf); + } + } + } + manager.traceOut(); + } + + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + #sql [context] { DELETE FROM MEDIAFILE WHERE MEDIAID = :filterId }; + manager.traceOut(); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MemoryCache.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/MemoryCache.java new file mode 100644 index 00000000..d76952e4 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MemoryCache.java @@ -0,0 +1,185 @@ +package user.jobengine.db; + +import java.lang.ref.SoftReference; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.IEntityBase; + +class MemoryCache { + boolean enabled; + Map, Map>> cacheMap = new ConcurrentHashMap, Map>>(); + Object lock = new Object(); + private IItemManager manager; + private static final Logger logger = LogManager.getLogger(); + + public void setItemManager(IItemManager manager) { + this.manager = manager; + enableCache(); + } + + void clearCached(Class baseClass) { + manager.traceIn(); + Map> cache = getCache(baseClass); + if (cache != null) + cache.clear(); + manager.traceOut(); + } + + void clearAllCached() { + manager.traceIn(); + for (Class baseClass : cacheMap.keySet()) + clearCached(baseClass); + manager.traceOut(); + } + + public void disableCache() { + enabled = false; + clearAllCached(); + logger.info("Cache is disabled"); + } + + public void enableCache() { + enabled = true; + logger.info("Cache is enabled"); + } + + Map> getCache(Class baseClass) { + Map> cache = null; + if (enabled) { + if (cacheMap.containsKey(baseClass)) { + cache = cacheMap.get(baseClass); + } else { + cache = new ConcurrentHashMap>(); + cacheMap.put(baseClass, cache); + } + } + return cache; + } + + boolean setAllCached(Class baseClass, List entities) { + manager.traceIn(); + boolean result = true; + if (entities != null) { + logger.debug(String.format("Setting all %s, count %d", baseClass, entities.size())); + for (IEntityBase entity : entities) { + result = storeCached(entity.getId(), entity); + if (!result) + break; + } + } + manager.traceOut(); + return result; + } + + public List getAllCached(Class baseClass) { + manager.traceIn(); + List result = null; + Map> cache = getCache(baseClass); + if (cache != null) { + try { + for (Object key : cache.keySet()) { + SoftReference reference = cache.get(key); + if (reference != null) { + IEntityBase obj = reference.get(); + if (obj == null) { + clearCached(baseClass); + cache = null; + break; + } + } + } + if (cache == null || cache.size() == 0) + logger.debug(String.format("Getting all for %s returns empty result", baseClass)); + } catch (Exception ex) { + logger.error(ex.getMessage()); + } + } + manager.traceOut(); + return result; + } + + public boolean storeCached(Object key, IEntityBase entity) { + manager.traceIn(); + if (entity == null) + manager.throwError(new Exception("Can not store null value into cache")); + Map> cache = getCache(entity.getClass()); + boolean result = false; + if (cache != null) { + try { + cache.put(key, new SoftReference(entity)); + logger.debug("Store " + entity.getClass() + ", key: " + key); + result = true; + } catch (Exception ex) { + logger.error(ex.getMessage()); + } + } + manager.traceOut(); + return result; + } + + public void removeCached(Class baseClass, Object key) { + manager.traceIn(); + Map> cache = getCache(baseClass); + if (cache != null) { + try { + if (cache.containsKey(key)) { + cache.remove(key); + logger.debug("Remove " + baseClass + ", key: " + key); + } + } catch (Exception ex) { + logger.error(ex.getMessage()); + } + } + manager.traceOut(); + } + + public IEntityBase retrieveCached(Class baseClass, Object key) { + manager.traceIn(); + Map> cache = getCache(baseClass); + IEntityBase result = null; + if (cache != null) { + try { + if (cache.containsKey(key)) { + SoftReference r = cache.get(key); + if (r != null) { + result = r.get(); + if (result == null) { + logger.info(baseClass + " is garbaged by system, removing key " + key); + cache.remove(key); + } else { + logger.debug("Retrive " + baseClass + ", key: " + key); + } + } + } + + } catch (Exception ex) { + logger.error(ex.getMessage()); + } + } + manager.traceOut(); + return result; + } + + void garbageCached(Class baseClass, Object key) { + manager.traceIn(); + Map> cache = getCache(baseClass); + if (cache != null) { + try { + if (cache.containsKey(key)) { + SoftReference r = cache.get(key); + if (r != null) + r.clear(); + } + + } catch (Exception ex) { + logger.error(ex.getMessage()); + } + } + manager.traceOut(); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Metadata.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Metadata.java new file mode 100644 index 00000000..67b1b1d4 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Metadata.java @@ -0,0 +1,323 @@ +package user.jobengine.db; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; + +import user.commons.BaseType; +import user.commons.EntityBase; +import user.jobengine.db.ItemManagerData.GuiType; +import user.jobengine.db.ItemManagerData.ListType; +import user.jobengine.db.ItemManagerData.StaticTables; + +public class Metadata extends EntityBase implements Serializable { + private static final long serialVersionUID = 1L; + protected long itemTypeId = 0; + private boolean isDbIndex = false; + private boolean isDbNullable = false; + private boolean isDbUnique = false; + private boolean isEditable = false; + private boolean isListable = false; + private boolean isGenerated = false; + private boolean isSearchable = false; + private GuiType guiType = null; + private ListType listType = null; + private MetadataElement metadataElement = null; + private long metadataElementId = 0; + // private Object value = null; + private StaticTables staticTable = null; + private String pojoField = null; + private String sqlField = null; + private String parameter = null; + + /** + * Serializációs technikával másolatot készít egy Metadata objektumról. A + * DynamicAttributes osztály használja. + * + * @return Metadata objektum másolata. + */ + Metadata copy() { + Metadata result = null; + try { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(bos); + out.writeObject(this); + out.flush(); + out.close(); + + ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); + result = (Metadata) in.readObject(); + } catch (Exception e) { + throw new ItemManagerException(e.getMessage()); + } + // TODO why? + result.setId(getId()); + return result; + } + + public String getColumnName() { + return "C" + getId(); + } + + public String getCreateSQL() { + StringBuilder sb = new StringBuilder(); + MetadataType mdt = getMetadataElement().getMetadataType(); + sb.append(getColumnName() + " " + mdt.getDataType()); + if (mdt.getLength() > 0) + sb.append(" (" + mdt.getLength() + ")"); + if (!getIsDbNullable()) + sb.append(" NOT NULL DEFAULT " + getDefaultValue()); + return sb.toString(); + } + + public String getDefaultValue() { + String result = null; + MetadataElement element = getMetadataElement(); + if (element != null) { + MetadataType mdt = element.getMetadataType(); + switch (mdt.getBaseType()) { + case BOOL: + result = "'N'"; + break; + case DATETIME: + result = "'1900-01-01'"; + break; + case BIGINT: + case DECIMAL: + case DOUBLE: + case INT: + case REAL: + result = "'0'"; + break; + } + } + return result; + } + + public GuiType getGuiType() { + return guiType; + } + + public String getIndexSQL() { + String result = null; + String tableName = getTableName(); + String columnName = getColumnName(); + if (getIsDbUnique()) + result = String.format("CREATE UNIQUE INDEX UDX_%1$s_%2$s ON %1$s (%2$s)", tableName, columnName); + if (getIsDbIndex()) + result = String.format("CREATE INDEX IDX_%1$s_%2$s ON %1$s (%2$s)", tableName, columnName); + return result; + } + + public boolean getIsDbIndex() { + return this.isDbIndex; + } + + public boolean getIsDbNullable() { + return this.isDbNullable; + } + + public boolean getIsDbUnique() { + return this.isDbUnique; + } + + public boolean getIsEditable() { + return this.isEditable; + } + + public boolean getIsGenerated() { + return isGenerated; + } + + public boolean getIsListable() { + return isListable; + } + + public boolean getIsSearchable() { + return isSearchable; + } + + public long getItemTypeId() { + return this.itemTypeId; + } + + public ListType getListType() { + return listType; + } + + public MetadataElement getMetadataElement() { + if (this.metadataElement == null && this.metadataElementId != 0) { + this.metadataElement = ItemManager.getInstance().getMetadataElement(this.metadataElementId); + } + return this.metadataElement; + } + + public long getMetadataElementId() { + return this.metadataElementId; + } + + public String getOrderName(String staticPrefix, String dynamicPrefix) { + String result = null; + if (getStaticTable() == null) { + result = String.format("%s.%s", dynamicPrefix, getColumnName()); + } else { + result = String.format("%s.\"%s\"", staticPrefix, getSqlField()); + } + return result; + } + + public String getParameter() { + return parameter; + } + + public String getPojoField() { + return pojoField; + } + + public String getRemoveSQL() { + ItemType itemType = (ItemType) ItemManager.getInstance().retrieveCached(ItemType.class, getItemTypeId()); + String tableName = itemType.getTableName(); + String result = "ALTER TABLE " + tableName + " DROP COLUMN " + getColumnName(); + return result; + } + + public String getSqlField() { + return sqlField; + } + + public StaticTables getStaticTable() { + return this.staticTable; + } + + public String getTableName() { + return getStaticTable() != null ? null : "METADATA_" + getId(); + } + + public String getPrefix() { + String result = null; + if (staticTable == StaticTables.MEDIA) + result = String.format("mm."); + if (staticTable == StaticTables.ITEM) + result = String.format("ii."); + if (staticTable == StaticTables.FOLDER) + result = String.format("f."); + return result; + } + + public String getFieldName() { + String fieldName = null; + if (staticTable != null) + fieldName = String.format(getPrefix() + getSqlField()); + else + fieldName = String.format("%1$s.%2$s", getTableName(), getColumnName()); + return fieldName; + } + + // public Object getValue() { + // return value; + // } + + public boolean isDomain() { + boolean result = false; + MetadataElement mde = getMetadataElement(); + if (mde != null) { + MetadataType mdt = mde.getMetadataType(); + if (mdt != null && mdt.getBaseType() == BaseType.DOMAIN) + result = true; + } + return result; + } + + public boolean requireDataTable() { + return getStaticTable() == null && !isDomain(); + } + + public void setColumnName(String columName) { + // nothing to do: xml serialize miatt kell! + } + + public void setGuiType(GuiType guiType) { + this.guiType = guiType; + } + + public void setIsDbIndex(boolean isDbIndex) { + this.isDbIndex = isDbIndex; + } + + public void setIsDbNullable(boolean isDbNullable) { + this.isDbNullable = isDbNullable; + } + + public void setIsDbUnique(boolean isDbUnique) { + this.isDbUnique = isDbUnique; + } + + public void setIsEditable(boolean isEditable) { + this.isEditable = isEditable; + } + + public void setIsGenerated(boolean isGenerated) { + this.isGenerated = isGenerated; + } + + public void setIsListable(boolean isListable) { + this.isListable = isListable; + } + + public void setIsSearchable(boolean isSearchable) { + this.isSearchable = isSearchable; + } + + public void setItemTypeId(long id) { + checkParameter("ItemTypeId", id); + this.itemTypeId = id; + } + + public void setListType(ListType listType) { + this.listType = listType; + } + + public void setMetadataElement(MetadataElement metadataElement) { + if (metadataElement != null) { + this.metadataElement = metadataElement; + setMetadataElementId(metadataElement.getId()); + } + } + + public void setMetadataElementId(long metadataElementId) { + if (metadataElementId > 0) + this.metadataElementId = metadataElementId; + } + + public void setParameter(String parameter) { + this.parameter = parameter; + } + + public void setPojoField(String pojoField) { + this.pojoField = pojoField; + } + + public void setSqlField(String sqlField) { + this.sqlField = sqlField; + } + + public void setStaticTable(StaticTables tableName) { + this.staticTable = tableName; + } + + // public void setValue(Object value) { + // setValue(value, false); + // } + // + // public void setValue(Object value, boolean fromDb) { + // ItemManager.getInstance().traceIn(); + // MetadataElement mde = getMetadataElement(); + // MetadataType mdt = mde.getMetadataType(); + // if (ItemManagerData.checkObjectType(mde.getName(), value, + // mdt.getBaseType(), fromDb)) + // this.value = value; + // ItemManager.getInstance().traceOut(); + // } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataDAO.sqlj new file mode 100644 index 00000000..b02b1308 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataDAO.sqlj @@ -0,0 +1,398 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.jobengine.db.ItemManagerData.SignalType; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.List; +import java.util.ArrayList; + +#sql iterator MetadataIter(long id, String isDbIndex, String isDbUnique, String isDbNullable, String isEditable, String isListable, String isGenerated, String isSearchable, String guiType, String listType, String pojoField, String sqlField, String staticTable, String parameter, long itemTypeId, long metadataElementId); + +@SuppressWarnings("unused") +class MetadataDAO extends EntityBaseDAO { + + public MetadataDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) + createTable(context.getConnection(), entity); + manager.notifyItemTypeChange(entity, SignalType.CREATE); + } + + @Override + protected void afterModify(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) { + dropTable(context.getConnection(), entity); + createTable(context.getConnection(), entity); + } + manager.notifyItemTypeChange(entity, SignalType.UPDATE); + } + + @Override + protected void afterDelete(DefaultContext context, IEntityBase entity) throws SQLException { + Metadata metadata = (Metadata) entity; + if (metadata.requireDataTable()) + dropTable(context.getConnection(), entity); + manager.notifyItemTypeChange(entity, SignalType.DELETE); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MetadataIter iterator = (MetadataIter) iter; + while (iterator.next()) { + Metadata entity = new Metadata(); + entity.setId(iterator.id()); + entity.setIsDbIndex(iterator.isDbIndex().equals("Y") ? true : false); + entity.setIsDbUnique(iterator.isDbUnique().equals("Y") ? true : false); + entity.setIsDbNullable(iterator.isDbNullable().equals("Y") ? true : false); + entity.setIsEditable(iterator.isEditable().equals("Y") ? true : false); + entity.setIsListable(iterator.isListable().equals("Y") ? true : false); + entity.setIsGenerated(iterator.isGenerated().equals("Y") ? true : false); + entity.setIsSearchable(iterator.isSearchable().equals("Y") ? true : false); + entity.setGuiType(ItemManagerData.toGuiType(iterator.guiType())); + entity.setListType(ItemManagerData.toListType(iterator.listType())); + entity.setPojoField(iterator.pojoField()); + entity.setSqlField(iterator.sqlField()); + entity.setStaticTable(ItemManagerData.toStaticTable(iterator.staticTable())); + entity.setParameter(iterator.parameter()); + entity.setItemTypeId(iterator.itemTypeId()); + entity.setMetadataElementId(iterator.metadataElementId()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MetadataIter iter = null; + #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + MetadataIter iter = null; + #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE,GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE ITEMTYPEID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MetadataIter iter = null; + #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM METADATA WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE METADATA DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Metadata obj = (Metadata) entity; + long id = obj.getId(); + String isDbIndex = obj.getIsDbIndex() == true ? "Y" : "N"; + String isDbUnique = obj.getIsDbUnique() == true ? "Y" : "N"; + String isDbNullable = obj.getIsDbNullable() == true ? "Y" : "N"; + String isEditable = obj.getIsEditable() == true ? "Y" : "N"; + String isListable = obj.getIsListable() == true ? "Y" : "N"; + String isGenerated = obj.getIsGenerated() == true ? "Y" : "N"; + String isSearchable = obj.getIsSearchable() == true ? "Y" : "N"; + String guiType = obj.getGuiType().toString(); + String listType = obj.getListType().toString(); + String pojoField = obj.getPojoField(); + String sqlField = obj.getSqlField(); + String staticTable = obj.getStaticTable() == null ? null : obj.getStaticTable().toString(); + String parameter = obj.getParameter(); + long itemTypeId = obj.getItemTypeId(); + long metadataElementId = obj.getMetadataElementId(); + + #sql [context] { UPDATE METADATA SET ISDBINDEX = :isDbIndex, ISDBUNIQUE = :isDbUnique, ISDBNULLABLE = :isDbNullable, ISEDITABLE = :isEditable, ISLISTABLE = :isListable, ISGENERATED = :isGenerated, ISSEARCHABLE = :isSearchable, GUITYPE = :guiType, LISTTYPE = :listType, POJOFIELD = :pojoField, SQLFIELD = :sqlField, STATICTABLE = :staticTable, PARAMETER = :parameter, ITEMTYPEID = :itemTypeId, METADATAELEMENTID = :metadataElementId WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Metadata obj = (Metadata) entity; + String isDbIndex = obj.getIsDbIndex() == true ? "Y" : "N"; + String isDbUnique = obj.getIsDbUnique() == true ? "Y" : "N"; + String isDbNullable = obj.getIsDbNullable() == true ? "Y" : "N"; + String isEditable = obj.getIsEditable() == true ? "Y" : "N"; + String isListable = obj.getIsListable() == true ? "Y" : "N"; + String isGenerated = obj.getIsGenerated() == true ? "Y" : "N"; + String isSearchable = obj.getIsSearchable() == true ? "Y" : "N"; + String guiType = obj.getGuiType().toString(); + String listType = obj.getListType().toString(); + String pojoField = obj.getPojoField(); + String sqlField = obj.getSqlField(); + String staticTable = obj.getStaticTable() == null ? null : obj.getStaticTable().toString(); + String parameter = obj.getParameter(); + long itemTypeId = obj.getItemTypeId(); + long metadataElementId = obj.getMetadataElementId(); + + #sql [context] { INSERT INTO METADATA (ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID) + VALUES (:isDbIndex, :isDbUnique, :isDbNullable, :isEditable, :isListable, :isGenerated, :isSearchable, :guiType, :listType, :pojoField, :sqlField, :staticTable, :parameter, :itemTypeId, :metadataElementId) }; + } + + public IEntityBase get(String name) { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + IEntityBase entity = null; + try { + MetadataIter iter = null; + #sql [context] iter = { SELECT ID, ISDBINDEX, ISDBUNIQUE, ISDBNULLABLE, ISEDITABLE, ISLISTABLE, ISGENERATED, ISSEARCHABLE, GUITYPE, LISTTYPE, POJOFIELD, SQLFIELD, STATICTABLE, PARAMETER, ITEMTYPEID, METADATAELEMENTID FROM METADATA WHERE NAME = :name }; + List result = entities(context, iter, false); + if (result != null && result.size() == 1) + entity = result.get(0); + #sql [context] { COMMIT }; + } catch (Exception e) { + logger.error(e.getMessage()); + try { + #sql [context] { ROLLBACK }; + } catch(Exception e1) { + } + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + + /** + * Beszúrja az ItemType objektumhoz kapcsolódó Metadata adatokat. + */ + void addAll(DefaultContext context, ItemType itemType) throws SQLException { + List metadatas = itemType.getMetadatas(); + if (metadatas != null) { + for (Metadata metadata: metadatas) { + metadata.setItemTypeId(itemType.getId()); + add(context, metadata); + } + } + } + + /** + * Törli a paraméterként kapott ItemType azonosítóhoz tartozó Metadata bejegyzéseket. + */ + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + #sql [context] { DELETE FROM METADATA WHERE ITEMTYPEID = :filterId }; + manager.traceOut(); + } + +// void addColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String create = metadata.getCreateSQL(); +// List commands = new ArrayList(); +// if (create != null) { +// commands.add("ALTER TABLE " + tableName + " ADD COLUMN " + create); +// String index = metadata.getIndexSQL(); +// if (index != null) +// commands.add(index); +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// } +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } +// +// void modifyColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String columnName = metadata.getColumnName(); +// List commands = new ArrayList(); +// commands.add("ALTER TABLE " + tableName + " DROP COLUMN " + columnName); +// String create = metadata.getCreateSQL(); +// if (create != null) { +// commands.add("ALTER TABLE " + tableName + " ADD COLUMN " + create); +// String index = metadata.getIndexSQL(); +// if (index != null) { +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// commands.add(index); +// } +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// } +// st = connection.createStatement(); +// for (String sql: commands) { +// System.out.println(sql); +// st.execute(sql); +// } +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } +// +// void removeColumn(Connection connection, Metadata metadata) throws SQLException { +// Statement st = null; +// try { +// ItemType itemType = ItemManager.getInstance().getItemType(metadata.getItemTypeId()); +// String tableName = itemType.getTableName(); +// String columnName = metadata.getColumnName(); +// List commands = new ArrayList(); +// commands.add("ALTER TABLE " + tableName + " DROP COLUMN " + columnName); +// commands.add("call SYSPROC.ADMIN_CMD ('REORG TABLE " + tableName + "')"); +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// } + +// void dropMetadataTable(Connection connection, ItemType itemType) throws SQLException { +// manager.traceIn(); +// String tableName = itemType.getTableName().toString(); +// Statement st = null; +// try { +// st = connection.createStatement(); +// st.execute("DROP TABLE " + tableName); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// manager.traceOut(); +// } +// +// void createMetadataTable(Connection connection, ItemType itemType) throws SQLException { +// manager.traceIn(); +// List commands = new ArrayList(); +// List indexes = new ArrayList(); +// String tableName = itemType.getTableName().toString(); +// StringBuilder sb = new StringBuilder(); +// sb.append("CREATE TABLE " + tableName + "("); +// sb.append("ID BIGINT NOT NULL PRIMARY KEY,"); +// sb.append("CONSTRAINT FK_" + tableName + "_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID)"); +// +// List metadatas = itemType.getMetadatas(); +// if (metadatas != null) { +// for (Metadata md : metadatas) { +// String create = md.getCreateSQL(); +// if (create != null) { +// sb.append(", "); +// sb.append(create); +// } +// String index = md.getIndexSQL(); +// if (index != null) +// indexes.add(index); +// } +// } +// sb.append(")"); +// commands.add(sb.toString()); +// commands.addAll(indexes); +// +// Statement st = null; +// try { +// st = connection.createStatement(); +// for (String sql: commands) +// st.execute(sql); +// } +// catch (SQLException e) { +// throw new SQLException(e); +// } finally { +// try{ +// if (st != null) +// st.close(); +// } catch (Exception e1) { } +// } +// manager.traceOut(); +// } + + void createTable(Connection connection, IEntityBase entity) throws SQLException { + manager.traceIn(); + Statement st = null; + Metadata metadata = (Metadata) entity; + try { + String tableName = metadata.getTableName(); + String columnSql = metadata.getCreateSQL(); + String sql = String.format("CREATE TABLE %1$s (ID BIGINT NOT NULL PRIMARY KEY, %2$s, CONSTRAINT FK_%1$s_ID FOREIGN KEY (ID) REFERENCES MASTERID (ID))", tableName, columnSql); + st = connection.createStatement(); + logger.debug(sql); + st.execute(sql); + String index = metadata.getIndexSQL(); + if (index != null) { + logger.debug(index); + st.execute(index); + } + } + catch (SQLException e) { + throw new SQLException(e); + } finally { + try{ + if (st != null) + st.close(); + } catch (Exception e1) { } + } + manager.traceOut(); + } + + void dropTable(Connection connection, IEntityBase entity) throws SQLException { + manager.traceIn(); + Metadata metadata = (Metadata) entity; + String tableName = metadata.getTableName(); + Statement st = null; + try { + st = connection.createStatement(); + String sql = "DROP TABLE " + tableName; + logger.debug(sql); + st.execute(sql); + } + catch (SQLException e) { + throw new SQLException(e); + } finally { + try{ + if (st != null) + st.close(); + } catch (Exception e1) { } + } + manager.traceOut(); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataElement.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataElement.java new file mode 100644 index 00000000..f81a98e8 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataElement.java @@ -0,0 +1,63 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.EntityBase; + + +public class MetadataElement extends EntityBase implements Serializable { + private static final long serialVersionUID = 1L; + private String description = null; + private MetadataType metadataType = null; + private long metadataTypeId = 0; + private String name = null; + private Long domainCategoryId = null; + + public String getDescription() { + return this.description; + } + + public Long getDomainCategoryId() { + return domainCategoryId; + } + + public MetadataType getMetadataType() { + if (this.metadataType == null && this.metadataTypeId != 0) + this.metadataType = ItemManager.getInstance().getMetadataType(this.metadataTypeId); + return this.metadataType; + } + + public long getMetadataTypeId() { + return this.metadataTypeId; + } + + public String getName() { + return this.name; + } + + public void setDescription(String description) { + //checkParameter("Description", description); + this.description = description; + } + + public void setDomainCategoryId(Long domainCategoryId) { + this.domainCategoryId = domainCategoryId; + } + + public void setMetadataType(MetadataType metadataType) { + if (metadataType != null) { + this.metadataType = metadataType; + setMetadataTypeId(metadataType.getId()); + } + } + + public void setMetadataTypeId(long metadataTypeId) { + if (metadataTypeId > 0) + this.metadataTypeId = metadataTypeId; + } + + public void setName(String name) { + checkParameter("Name", name); + this.name = name; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataElementDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataElementDAO.sqlj new file mode 100644 index 00000000..7856d641 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataElementDAO.sqlj @@ -0,0 +1,91 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +#sql iterator MetadataElementIter(long id, String name, String description, long metadataTypeId, Long domainCategoryId); + +@SuppressWarnings("unused") +class MetadataElementDAO extends EntityBaseDAO { + + public MetadataElementDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MetadataElementIter iterator = (MetadataElementIter) iter; + while (iterator.next()) { + + MetadataElement entity = new MetadataElement(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setMetadataTypeId(iterator.metadataTypeId()); + entity.setDomainCategoryId(iterator.domainCategoryId()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MetadataElementIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, METADATATYPEID, DOMAINCATEGORYID FROM METADATAELEMENT WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MetadataElementIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, METADATATYPEID, DOMAINCATEGORYID FROM METADATAELEMENT }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM METADATAELEMENT WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE METADATAELEMENT DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataElement obj = (MetadataElement) entity; + long id = obj.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + long metadataTypeId = obj.getMetadataTypeId(); + Long DomainCategoryId = obj.getDomainCategoryId(); + + #sql [context] { UPDATE METADATAELEMENT SET NAME = :name, DESCRIPTION = :description, METADATATYPEID = :metadataTypeId, DOMAINCATEGORYID = :DomainCategoryId WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataElement obj = (MetadataElement) entity; + String name = obj.getName(); + String description = obj.getDescription(); + long metadataTypeId = obj.getMetadataTypeId(); + Long DomainCategoryId = obj.getDomainCategoryId(); + + #sql [context] { INSERT INTO METADATAELEMENT (NAME, DESCRIPTION, METADATATYPEID, DOMAINCATEGORYID) VALUES (:name, :description, :metadataTypeId, :DomainCategoryId) }; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataType.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataType.java new file mode 100644 index 00000000..3584d2be --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataType.java @@ -0,0 +1,77 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.BaseType; +import user.commons.EntityBase; + +public class MetadataType extends EntityBase implements Serializable { + private static final long serialVersionUID = 1L; + private String dataType = null; + private BaseType baseType = null; + private String javaType = null; + private int length = 0; + private String name = null; + + public BaseType getBaseType() { + return baseType; + } + + public String getDataType() { + return dataType; + } + + public String getJavaType() { + return javaType; + } + + public int getLength() { + return this.length; + } + + public String getName() { + return this.name; + } + + public void setBaseType(BaseType baseType) { + this.baseType = baseType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public void setJavaType(String javaType) { + this.javaType = javaType; + } + + public void setLength(int length) { + this.length = length; + } + + public void setName(String name) { + checkParameter("Name", name); + this.name = name; + } + + public void setType(BaseType baseType, int length) { + checkParameter("BaseType", baseType); + switch (baseType) { + case CHAR: + case BOOL: + case VARCHAR: { + if (length == 0) { + throw new ItemManagerException("Length definition required."); + } + break; + } + default: + if (length != 0) { + throw new ItemManagerException("Length definition not allowed."); + } + } + this.setBaseType(baseType); + this.length = length; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataTypeDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataTypeDAO.sqlj new file mode 100644 index 00000000..a62bea50 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/MetadataTypeDAO.sqlj @@ -0,0 +1,93 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; + +#sql iterator MetadataTypeIter(long id, String name, String dataType, String javaType, String baseType, int length); + +@SuppressWarnings("unused") +class MetadataTypeDAO extends EntityBaseDAO { + + public MetadataTypeDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + MetadataTypeIter iterator = (MetadataTypeIter) iter; + while (iterator.next()) { + + MetadataType entity = new MetadataType(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDataType(iterator.dataType()); + entity.setJavaType(iterator.javaType()); + entity.setType(ItemManagerData.toBaseType(iterator.baseType()), iterator.length()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + MetadataTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DATATYPE, BASETYPE, JAVATYPE, LENGTH FROM METADATATYPE WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + MetadataTypeIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DATATYPE, BASETYPE, JAVATYPE, LENGTH FROM METADATATYPE }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM METADATATYPE WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE METADATATYPE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataType obj = (MetadataType) entity; + long id = obj.getId(); + String name = obj.getName(); + String dataType = obj.getDataType(); + String javaType = obj.getJavaType(); + String baseType = obj.getBaseType().toString(); + int length = obj.getLength(); + + #sql [context] { UPDATE METADATATYPE SET NAME = :name, DATATYPE = :dataType, BASETYPE = :baseType, JAVATYPE = :javaType, LENGTH = :length WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + MetadataType obj = (MetadataType) entity; + String name = obj.getName(); + String dataType = obj.getDataType(); + String javaType = obj.getJavaType(); + String baseType = obj.getBaseType().toString(); + int length = obj.getLength(); + + #sql [context] { INSERT INTO METADATATYPE (NAME, DATATYPE, BASETYPE, JAVATYPE, LENGTH) VALUES (:name, :dataType, :baseType, :javaType, :length) }; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/QueryBuilder.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/QueryBuilder.java new file mode 100644 index 00000000..426b1062 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/QueryBuilder.java @@ -0,0 +1,152 @@ +package user.jobengine.db; + +import java.util.ArrayList; +import java.util.Formatter; +import java.util.Hashtable; +import java.util.List; +import java.util.Locale; + +import user.jobengine.db.ItemManagerData.StaticTables; + +public class QueryBuilder { + private List tables; + private boolean isMedia = false; + private boolean isDomain = false; + private boolean isFolder = false; + private Hashtable whereCondition; + private int counter = 1; + private List domainIDs; + private Converter converter; + + public QueryBuilder() { + converter = new Converter(); + } + + public String getQuery() { + StringBuilder innerQuery = new StringBuilder(); + Formatter formatter = new Formatter(innerQuery, Locale.getDefault()); + innerQuery.append("FROM ITEM ii "); + if (tables != null || isMedia) { + innerQuery.append("LEFT OUTER JOIN MEDIA mm ON (mm.ITEMID = ii.ID) "); + if (tables != null) { + for (String tableName : tables) { + formatter.format("LEFT OUTER JOIN %1$s i_%1$s ON (i_%1$s.ID = ii.ID) ", tableName); + formatter.format("LEFT OUTER JOIN %1$s m_%1$s ON (m_%1$s.ID = mm.ID) ", tableName); + } + } + } + if (isDomain && !domainIDs.isEmpty()) { + for (Integer i : domainIDs) { + formatter.format("LEFT OUTER JOIN DOMAININDEX di_%1$s ON (di_%1$s.RECORDID = ii.ID) ", i); + } + } + if (isFolder) { + formatter.format("RIGHT OUTER JOIN FOLDER f ON (f.CHILDID = ii.ID) "); + } + int size = whereCondition.size(); + if (size > 0) { + innerQuery.append("WHERE "); + for (int i = 0; i < size; i++) { + formatter.format("%1$s", whereCondition.get(i)); + } + } + return innerQuery.toString(); + } + + public void getParameters(List filters) { + whereCondition = new Hashtable(); + for (SearchFilter filter : filters) { + Metadata metadata = filter.getMetadata(); + if (whereCondition.size() > 0 && filter.getLogic() != null) { + whereCondition.put(counter++, String.format(" %1$s ", filter.getLogic())); + } + if ((filter.getFilters() == null || filter.getFilters().size() == 0) && metadata != null) { + isDomain = metadata.isDomain(); + String fieldName = metadata.getFieldName(); + + // BooleanConverter hívás + List convertedValues = new ArrayList(); + for (Object value : filter.getValues()) { + Object convertedValue = converter.ConvertBack(value, metadata); + convertedValues.add(convertedValue); + filter.setValues(convertedValues); + } + + if (metadata.getStaticTable() != null && fieldName != null) { + whereCondition.put(counter++, filter.getLogic(fieldName)); + if (metadata.getStaticTable() == StaticTables.MEDIA) + isMedia = true; + if (metadata.getStaticTable() == StaticTables.FOLDER) + isFolder = true; + } else { + if (isDomain) { + if (domainIDs == null) + domainIDs = new ArrayList(); + domainIDs.addAll(getDomainId(filter.getValues().get(0))); + int idsCounter = 1; + for (Integer i : domainIDs) { + whereCondition.put(counter++, String.format("(di_%1$s.DOMAINID = %1$s) ", i)); + if (idsCounter < domainIDs.size()) { + whereCondition.put(counter++, String.format("AND ")); + idsCounter++; + } + } + } else { + String tableName = metadata.getTableName(); + if (tableName != null && !getTables().contains(tableName)) + getTables().add(tableName); + String fieldName1 = String.format("i_" + fieldName); + String fieldName2 = String.format("m_" + fieldName); + whereCondition.put(counter++, String.format("(%1$s OR %2$s) ", filter.getLogic(fieldName1), filter.getLogic(fieldName2))); + setIsMedia(true); + } + } + + } else { + getParameters(filter.getFilters()); + } + + // BooleanConverter visszakonvertálás + List convertedBackValues = new ArrayList(); + for (Object value : filter.getValues()) { + Object convertedBackValue = converter.Convert(value, metadata); + convertedBackValues.add(convertedBackValue); + filter.setValues(convertedBackValues); + } + } + if (whereCondition.size() > 0) { + if (!whereCondition.containsKey(0)) { + whereCondition.put(0, "("); + whereCondition.put(counter++, ")"); + } + } + } + + public List getTables() { + if (tables == null) + tables = new ArrayList(); + return tables; + } + + public void setIsMedia(boolean isMedia) { + this.isMedia = isMedia; + } + + public void setIsDomain(boolean isDomain) { + this.isDomain = isDomain; + } + + private List getDomainId(Object value) { + List result = new ArrayList(); + Domains domains = (Domains) value; + if (domains != null) { + List domainList = domains.getValues(); + if (domainList != null) { + for (Domain domain : domainList) { + result.add((int) domain.getId()); + } + } + } + return result; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/QueryObject.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/QueryObject.java new file mode 100644 index 00000000..6b747933 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/QueryObject.java @@ -0,0 +1,38 @@ +package user.jobengine.db; + +import java.util.List; + +public class QueryObject { + private long activeItemTypeId; + private RenderParameter parameters; + private List filters; + + public long getActiveItemTypeId() { + return this.activeItemTypeId; + } + + public List getFilters() { + return this.filters; + } + + public RenderParameter getParameters() { + return this.parameters; + } + + public boolean hasOrderInfo() { + return (parameters != null) && (parameters.getOrderBy() != null) && (parameters.getOrderDirection() != null); + } + + public void setActiveItemTypeId(long activeItemTypeId) { + this.activeItemTypeId = activeItemTypeId; + } + + public void setFilters(List filters) { + this.filters = filters; + } + + public void setParameters(RenderParameter parameters) { + this.parameters = parameters; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/RemoteStoreDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/RemoteStoreDAO.sqlj new file mode 100644 index 00000000..dee21ca3 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/RemoteStoreDAO.sqlj @@ -0,0 +1,92 @@ +package user.jobengine.db; + +import user.commons.remotestore.RemoteStore; +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +#sql iterator RemoteStoreIter(long id, String name, String description, String uri, String userName, String password, String rootPath); + +@SuppressWarnings("unused") +public class RemoteStoreDAO extends EntityBaseDAO { + + public RemoteStoreDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + RemoteStoreIter iterator = (RemoteStoreIter) iter; + while (iterator.next()) { + RemoteStore entity = new RemoteStore(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setDescription(iterator.description()); + entity.setUri(iterator.uri()); + entity.setUserName(iterator.userName()); + entity.setPassword(iterator.password()); + entity.setRootPath(iterator.rootPath()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + RemoteStoreIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, URI, USERNAME, PASSWORD, ROOTPATH FROM REMOTESTORE WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + RemoteStoreIter iter = null; + #sql [context] iter = { SELECT ID, NAME, DESCRIPTION, URI, USERNAME, PASSWORD, ROOTPATH FROM REMOTESTORE }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM REMOTESTORE WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE REMOTESTORE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + RemoteStore obj = (RemoteStore) entity; + long id = obj.getId(); + String name = obj.getName(); + String description = obj.getDescription(); + String uri = obj.getUri(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + + #sql [context] { UPDATE REMOTESTORE SET NAME = :name, DESCRIPTION = :description, URI = :uri, USERNAME = :userName, PASSWORD = :password, ROOTPATH = :rootPath WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + RemoteStore obj = (RemoteStore) entity; + String name = obj.getName(); + String description = obj.getDescription(); + String uri = obj.getUri(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + + #sql [context] { INSERT INTO REMOTESTORE (NAME, DESCRIPTION, URI, USERNAME, PASSWORD, ROOTPATH) VALUES (:name, :description, :uri, :userName, :password, :rootPath) }; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/RenderParameter.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/RenderParameter.java new file mode 100644 index 00000000..19654a33 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/RenderParameter.java @@ -0,0 +1,42 @@ +package user.jobengine.db; + +import user.jobengine.db.ItemManagerData.OrderDirection; + +public class RenderParameter { + private long page; + private long rowPerPage; + private Metadata orderBy; + private OrderDirection orderDirection; + + public Metadata getOrderBy() { + return this.orderBy; + } + + public OrderDirection getOrderDirection() { + return this.orderDirection; + } + + public long getPage() { + return this.page; + } + + public long getRowPerPage() { + return this.rowPerPage; + } + + public void setOrderBy(Metadata metadata) { + this.orderBy = metadata; + } + + public void setOrderDirection(OrderDirection orderDirection) { + this.orderDirection = orderDirection; + } + + public void setPage(long page) { + this.page = page; + } + + public void setRowPerPage(long rowPerPage) { + this.rowPerPage = rowPerPage; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Scene.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Scene.java new file mode 100644 index 00000000..9035efbd --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Scene.java @@ -0,0 +1,80 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import user.commons.EntityBase; +import user.commons.TimestampAdapter; + +@SuppressWarnings("serial") +public class Scene extends EntityBase implements Serializable { + private Timestamp created = null; + private Timestamp modified = null; + private String name = null; + private List sceneContents = null; + private boolean isChunked = false; + + public void appendSceneContent(SceneContent sc) { + // ? checkParameter("SceneContent", sc, true); + checkParameter("SceneContent", sc, false); + if (this.sceneContents == null) + this.sceneContents = new ArrayList(); + this.sceneContents.add(sc); + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return this.created; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getModified() { + return this.modified; + } + + public String getName() { + return this.name; + } + + @SuppressWarnings("unchecked") + public List getSceneContents() { + if (!this.isChunked && this.sceneContents == null) { + logger.debug("Scene.getSceneContents SceneContents entity array cache"); + SceneContentDAO dao = (SceneContentDAO) ItemManager.getInstance() + .getBaseDAO(SceneContent.class); + this.sceneContents = (List) (List) dao + .getSceneContents(getId()); + } + return this.sceneContents; + } + + public boolean isChunked() { + return this.isChunked; + } + + public void setChunked(boolean isChunked) { + this.isChunked = isChunked; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public void setModified(Timestamp modified) { + this.modified = modified; + } + + public void setName(String name) { + checkParameter("Name", name); + this.name = name; + } + + public void setSceneContents(List sceneContents) { + this.sceneContents = sceneContents; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneContent.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneContent.java new file mode 100644 index 00000000..f035dfd1 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneContent.java @@ -0,0 +1,67 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.EntityBase; + +@SuppressWarnings("serial") +public class SceneContent extends EntityBase implements Serializable { + private Scene scene = null; + private long sceneId = 0; + private Shot shot = null; + private long shotId = 0; + private long position = 0; + + public long getPosition() { + return this.position; + } + + public Scene getScene() { + if (this.scene == null && this.sceneId != 0) { + logger.debug("SceneContent.getScene Scene entity cache"); + this.scene = ItemManager.getInstance().getScene(this.sceneId); + } + return this.scene; + } + + public long getSceneId() { + return this.sceneId; + } + + public Shot getShot() { + if (this.shot == null && this.shotId != 0) { + logger.debug("SceneContent.getShot Shot entity cache"); + this.shot = ItemManager.getInstance().getShot(this.shotId); + } + return this.shot; + } + + public long getShotId() { + return this.shotId; + } + + public void setPosition(long position) { + this.position = position; + } + + public void setScene(Scene scene) { + checkParameter("Scene", scene); + this.scene = scene; + this.sceneId = scene.getId(); + } + + public void setSceneId(long sceneId) { + this.sceneId = sceneId; + } + + public void setShot(Shot shot) { + checkParameter("Shot", shot); + this.shot = shot; + this.shotId = shot.getId(); + } + + public void setShotId(long shotId) { + checkParameter("ShotId", shotId); + this.shotId = shotId; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneContentDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneContentDAO.sqlj new file mode 100644 index 00000000..e70ad977 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneContentDAO.sqlj @@ -0,0 +1,125 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +#sql iterator SceneContentIter(long id, long sceneId, long shotId, long position); + +@SuppressWarnings("unused") +public class SceneContentDAO extends EntityBaseDAO { + + public SceneContentDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + SceneContentIter iterator = (SceneContentIter) iter; + while (iterator.next()) { + SceneContent entity = new SceneContent(); + entity.setId(iterator.id()); + entity.setSceneId(iterator.sceneId()); + entity.setShotId(iterator.shotId()); + entity.setPosition(iterator.position()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + //TODO + void addAll(DefaultContext context, Scene scene) throws SQLException { + manager.traceIn(); + if (scene != null) + { + for (SceneContent sc: scene.getSceneContents()) { + sc.setSceneId(scene.getId()); + long sceneId = sc.getSceneId(); + long shotId = sc.getShotId(); + long position = sc.getPosition(); + long id = 0; + + #sql [context] { INSERT INTO SCENECONTENT (SCENEID, SHOTID, POSITION) VALUES (:sceneId, :shotId, :position) }; + #sql [context] { SELECT IDENTITY_VAL_LOCAL() INTO :id FROM SYSIBM.SYSDUMMY1 }; + + sc.setId(id); + } + } + manager.traceOut(); + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + SceneContentIter iter = null; + #sql [context] iter = { SELECT ID, SCENEID, SHOTID, POSITION FROM SCENECONTENT WHERE ID = :id}; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + SceneContentIter iter = null; + #sql [context] iter = { SELECT ID, SCENEID, SHOTID, POSITION FROM SCENECONTENT WHERE SCENEID = :id ORDER BY POSITION}; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + SceneContentIter iter = null; + #sql [context] iter = { SELECT ID, SCENEID, SHOTID, POSITION FROM SCENECONTENT}; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM SCENECONTENT WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE SCENECONTENT DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + SceneContent obj = (SceneContent) entity; + long id = obj.getId(); + long sceneId = obj.getSceneId(); + long shotId = obj.getShotId(); + long position = obj.getPosition(); + + #sql [context] { UPDATE SCENECONTENT SET SCENEID = :sceneId, SHOTID = :shotId, POSITION = :position WHERE ID = :id }; + + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + SceneContent obj = (SceneContent) entity; + long sceneId = obj.getSceneId(); + long shotId = obj.getShotId(); + long position = obj.getPosition(); + + #sql [context] { INSERT INTO SCENECONTENT (SCENEID, SHOTID, POSITION) VALUES (:sceneId, :shotId, :position) }; + } + + public List getSceneContents(long id) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByForeignKey(context, id); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneDAO.sqlj new file mode 100644 index 00000000..8bb00a62 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SceneDAO.sqlj @@ -0,0 +1,193 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +#sql iterator SceneIter(long id, String name, Timestamp created); + +@SuppressWarnings("unused") +public class SceneDAO extends EntityBaseDAO { + + public SceneDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + SceneIter iterator = (SceneIter) iter; + while (iterator.next()) { + Scene entity = new Scene(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); +// entity.setModified(iterator.modified()); + entity.setCreated(iterator.created()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String nameFilter) throws SQLException{ + SceneIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE WHERE (UPPER(NAME) LIKE :nameFilter) ORDER BY CREATED DESC}; + return iter; + } + + protected ResultSetIterImpl selectByModified(DefaultContext context) throws SQLException{ + SceneIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE ORDER BY CREATED DESC FETCH FIRST 5 ROWS ONLY}; + return iter; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + SceneIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + return null; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + SceneIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED FROM SCENE }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM SCENE WHERE ID = :id }; + #sql [context] { DELETE FROM SCENECONTENT WHERE SCENEID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE SCENE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Scene obj = (Scene) entity; + long id = obj.getId(); + String name = obj.getName(); + + #sql [context] { UPDATE SCENE SET NAME = :name WHERE ID = :id }; + + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Scene obj = (Scene) entity; + String name = obj.getName(); + + #sql [context] { INSERT INTO SCENE (NAME) VALUES (:name) }; + } + + //TODO + public List search(Timestamp dateFilter, String nameFilter) { + manager.traceIn(); + List result = new ArrayList(); + ResultSet rs = null; + PreparedStatement st = null; + DefaultContext context = manager.getDbContext(); + Connection connection = context.getConnection(); + try { + StringBuilder sb = new StringBuilder(); + + sb.append("SELECT ID, NAME, CREATED FROM SCENE "); + + String filter = ""; + if (dateFilter != null) { +// filter = String.format(" (CREATED > '%1$s' AND CREATED < '%2$s') ", +// ItemManagerData.toDateString(new Date(dateFilter.getTime()), 0, Calendar.DAY_OF_MONTH), +// ItemManagerData.toDateString(new Date(dateFilter.getTime()), 1, Calendar.DAY_OF_MONTH)); + } + if (nameFilter != null && nameFilter.length() > 2) { + if (filter.length() > 0) { + filter += "AND"; + } + filter += String.format(" (UPPER(NAME) LIKE UPPER('%1$s')) ", nameFilter + "%"); + } + if (filter.length() > 0) { + sb.append("WHERE"); + sb.append(filter); + } + + sb.append("ORDER BY NAME"); + st = connection.prepareStatement(sb.toString()); + + rs = st.executeQuery(); + while (rs.next()) { + Scene s = new Scene(); + s.setId(rs.getLong("ID")); + s.setName(rs.getString("NAME")); + s.setCreated(rs.getTimestamp("CREATED")); + s.setChunked(true); + result.add(s); + } + connection.commit(); + } catch (Exception e) { + try { + connection.rollback(); + } catch(Exception e1) { + } + throw new ItemManagerException(e.getMessage()); + } finally { + try{ + if (rs != null) + rs.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + try{ + if (st != null) + st.close(); + } catch (Exception e1) { + e1.printStackTrace(); + } + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } + + public List getFilteredEntities(String nameFilter, boolean isChunked){ + manager.traceIn(); + List result = new ArrayList(); + if (isChunked == true) { + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = null; + if (nameFilter != null) { + String filter = ("%" + nameFilter + "%").toUpperCase(); + iter = selectByName(context, filter); + } else { + iter = selectByModified(context); + } + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, isChunked); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + manager.traceOut(); + return result; + } +} + diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinition.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinition.java new file mode 100644 index 00000000..57fae433 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinition.java @@ -0,0 +1,60 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.sql.Timestamp; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import user.commons.EntityBase; +import user.commons.TimestampAdapter; + +@SuppressWarnings("serial") +public class SearchDefinition extends EntityBase implements Serializable { + private long id; + private String name = null; + private Timestamp created = null; + private Timestamp modified = null; + private byte[] data; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return created; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getModified() { + return modified; + } + + public void setModified(Timestamp modified) { + this.modified = modified; + } + + public byte[] getData() { + return data; + } + + public void setData(byte[] data) { + this.data = data; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinitionDAO.java.tmp b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinitionDAO.java.tmp new file mode 100644 index 00000000..da742aa1 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinitionDAO.java.tmp @@ -0,0 +1,440 @@ +/*@lineinfo:filename=SearchDefinitionDAO*//*@lineinfo:user-code*//*@lineinfo:1^1*/package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +/*@lineinfo:generated-code*//*@lineinfo:10^2*/ + +// ************************************************************ +// SQLJ iterator declaration: +// ************************************************************ + +class SearchDefinitionIter +extends sqlj.runtime.ref.ResultSetIterImpl +implements sqlj.runtime.NamedIterator +{ + private int dataNdx; + private int modifiedNdx; + private int createdNdx; + private int nameNdx; + private int idNdx; + public SearchDefinitionIter(sqlj.runtime.profile.RTResultSet resultSet) + throws java.sql.SQLException + { + super(resultSet); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + createdNdx = findColumn("created"); + modifiedNdx = findColumn("modified"); + dataNdx = findColumn("data"); + } + public SearchDefinitionIter(sqlj.runtime.profile.RTResultSet resultSet, int fetchSize, int maxRows) + throws java.sql.SQLException + { + super(resultSet, fetchSize, maxRows); + idNdx = findColumn("id"); + nameNdx = findColumn("name"); + createdNdx = findColumn("created"); + modifiedNdx = findColumn("modified"); + dataNdx = findColumn("data"); + } + public long id() + throws java.sql.SQLException + { + return resultSet.getLongNoNull(idNdx); + } + public String name() + throws java.sql.SQLException + { + return resultSet.getString(nameNdx); + } + public Timestamp created() + throws java.sql.SQLException + { + return resultSet.getTimestamp(createdNdx); + } + public Timestamp modified() + throws java.sql.SQLException + { + return resultSet.getTimestamp(modifiedNdx); + } + public byte[] data() + throws java.sql.SQLException + { + return resultSet.getBytes(dataNdx); + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:10^107*/ + +@SuppressWarnings("unused") +public class SearchDefinitionDAO extends EntityBaseDAO { + + public SearchDefinitionDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + SearchDefinitionIter iterator = (SearchDefinitionIter) iter; + while (iterator.next()) { + SearchDefinition entity = new SearchDefinition(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setCreated(iterator.created()); + entity.setModified(iterator.modified()); + if(isChunked == false){ + entity.setData(iterator.data()); + } + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String nameFilter) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:43^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION WHERE (UPPER(NAME) LIKE :nameFilter) ORDER BY CREATED DESC }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 0); + try + { + __sJT_stmt.setString(1, nameFilter); + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:43^147*/ + return iter; + } + + protected ResultSetIterImpl selectByModified(DefaultContext context) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:49^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION ORDER BY CREATED DESC FETCH FIRST 5 ROWS ONLY }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 1); + try + { + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:49^134*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:56^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 2); + try + { + __sJT_stmt.setLong(1, id); + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:56^104*/ + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + SearchDefinitionIter iter = null; + /*@lineinfo:generated-code*//*@lineinfo:63^2*/ + +// ************************************************************ +// #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 3); + try + { + iter = new SearchDefinitionIter(__sJT_execCtx.executeQuery(), __sJT_execCtx.getFetchSize(), __sJT_execCtx.getMaxRows()); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:63^88*/ + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:69^2*/ + +// ************************************************************ +// #sql [context] { DELETE FROM SEARCHDEFINITION WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 4); + try + { + __sJT_stmt.setLong(1, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:69^63*/ + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + /*@lineinfo:generated-code*//*@lineinfo:74^2*/ + +// ************************************************************ +// #sql [context] { TRUNCATE TABLE SEARCHDEFINITION DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 5); + try + { + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:74^97*/ + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + SearchDefinition obj = (SearchDefinition) entity; + long id = obj.getId(); + String name = obj.getName(); + Timestamp created = obj.getCreated(); + Timestamp modified = obj.getModified(); + byte[] data = obj.getData(); + + /*@lineinfo:generated-code*//*@lineinfo:86^2*/ + +// ************************************************************ +// #sql [context] { UPDATE SEARCHDEFINITION SET NAME = :name, CREATED = :created, MODIFIED = :modified, DATA = :data WHERE ID = :id }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 6); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setTimestamp(2, created); + __sJT_stmt.setTimestamp(3, modified); + __sJT_stmt.setBytes(4, data); + __sJT_stmt.setLong(5, id); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:86^131*/ + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + SearchDefinition obj = (SearchDefinition) entity; + String name = obj.getName(); + Timestamp created = obj.getCreated(); + Timestamp modified = obj.getModified(); + byte[] data = obj.getData(); + + /*@lineinfo:generated-code*//*@lineinfo:97^2*/ + +// ************************************************************ +// #sql [context] { INSERT INTO SEARCHDEFINITION (NAME, CREATED, MODIFIED, DATA) VALUES (:name, :created, :modified, :data) }; +// ************************************************************ + +{ + sqlj.runtime.ConnectionContext __sJT_connCtx = context; + if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_DEFAULT_CONN_CTX(); + sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext(); + if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX(); + synchronized (__sJT_execCtx) { + sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, SearchDefinitionDAO_SJProfileKeys.getKey(0), 7); + try + { + __sJT_stmt.setString(1, name); + __sJT_stmt.setTimestamp(2, created); + __sJT_stmt.setTimestamp(3, modified); + __sJT_stmt.setBytes(4, data); + __sJT_execCtx.executeUpdate(); + } + finally + { + __sJT_execCtx.releaseStatement(); + } + } +} + + +// ************************************************************ + +/*@lineinfo:user-code*//*@lineinfo:97^123*/ + } + + public List getFilteredEntities(String nameFilter, boolean isChunked){ + manager.traceIn(); + List result = new ArrayList(); + if (isChunked == true) { + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = null; + if (nameFilter != null) { + String filter = ("%" + nameFilter + "%").toUpperCase(); + iter = selectByName(context, filter); + } else { + iter = selectByModified(context); + } + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, isChunked); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + manager.traceOut(); + return result; + } + +}/*@lineinfo:generated-code*/class SearchDefinitionDAO_SJProfileKeys +{ + private java.lang.Object[] keys; + private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass()); + private static SearchDefinitionDAO_SJProfileKeys inst = null; + public static java.lang.Object getKey(int keyNum) + throws java.sql.SQLException + { + synchronized(user.jobengine.db.SearchDefinitionDAO_SJProfileKeys.class) { + if (inst == null) + { + inst = new SearchDefinitionDAO_SJProfileKeys(); + } + } + return inst.keys[keyNum]; + } + private SearchDefinitionDAO_SJProfileKeys() + throws java.sql.SQLException + { + keys = new java.lang.Object[1]; + keys[0] = DefaultContext.getProfileKey(loader, "user.jobengine.db.SearchDefinitionDAO_SJProfile0"); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinitionDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinitionDAO.sqlj new file mode 100644 index 00000000..9240759a --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchDefinitionDAO.sqlj @@ -0,0 +1,125 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +#sql iterator SearchDefinitionIter(long id, String name, Timestamp created, Timestamp modified, byte[] data); + +@SuppressWarnings("unused") +public class SearchDefinitionDAO extends EntityBaseDAO { + + public SearchDefinitionDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + SearchDefinitionIter iterator = (SearchDefinitionIter) iter; + while (iterator.next()) { + SearchDefinition entity = new SearchDefinition(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setCreated(iterator.created()); + entity.setModified(iterator.modified()); + if(isChunked == false){ + entity.setData(iterator.data()); + } + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String nameFilter) throws SQLException{ + SearchDefinitionIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION WHERE (UPPER(NAME) LIKE :nameFilter) ORDER BY CREATED DESC}; + return iter; + } + + protected ResultSetIterImpl selectByModified(DefaultContext context) throws SQLException{ + SearchDefinitionIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION ORDER BY CREATED DESC FETCH FIRST 5 ROWS ONLY}; + return iter; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + SearchDefinitionIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + SearchDefinitionIter iter = null; + #sql [context] iter = { SELECT ID, NAME, CREATED, MODIFIED, DATA FROM SEARCHDEFINITION}; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM SEARCHDEFINITION WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE SEARCHDEFINITION DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + SearchDefinition obj = (SearchDefinition) entity; + long id = obj.getId(); + String name = obj.getName(); + Timestamp created = obj.getCreated(); + Timestamp modified = obj.getModified(); + byte[] data = obj.getData(); + + #sql [context] { UPDATE SEARCHDEFINITION SET NAME = :name, CREATED = :created, MODIFIED = :modified, DATA = :data WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + SearchDefinition obj = (SearchDefinition) entity; + String name = obj.getName(); + Timestamp created = obj.getCreated(); + Timestamp modified = obj.getModified(); + byte[] data = obj.getData(); + + #sql [context] { INSERT INTO SEARCHDEFINITION (NAME, CREATED, MODIFIED, DATA) VALUES (:name, :created, :modified, :data) }; + } + + public List getFilteredEntities(String nameFilter, boolean isChunked){ + manager.traceIn(); + List result = new ArrayList(); + if (isChunked == true) { + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = null; + if (nameFilter != null) { + String filter = ("%" + nameFilter + "%").toUpperCase(); + iter = selectByName(context, filter); + } else { + iter = selectByModified(context); + } + checkNull(iter, ResultSetIterImpl.class); + result = getList(context, iter, isChunked); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + } + manager.traceOut(); + return result; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchFilter.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchFilter.java new file mode 100644 index 00000000..7812a5a6 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchFilter.java @@ -0,0 +1,216 @@ +package user.jobengine.db; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import user.commons.BaseType; +import user.jobengine.db.ItemManagerData.FilterLogic; +import user.jobengine.db.ItemManagerData.FilterValueLogic; + +public class SearchFilter { + private FilterLogic logic; + private long itemTypeId; + private Metadata metadata; + private FilterValueLogic valueLogic; + private List values; + private List filters; + + public List getFilters() { + return this.filters; + } + + public long getItemTypeId() { + return this.itemTypeId; + } + + public FilterLogic getLogic() { + return this.logic; + } + + private boolean hasBaseType() { + boolean result = false; + MetadataElement metadataElement = metadata.getMetadataElement(); + if (metadataElement != null) { + MetadataType metadataType = metadataElement.getMetadataType(); + if (metadataType != null) { + BaseType baseType = metadataType.getBaseType(); + result = baseType != null; + } + + } + + return result; + } + + public String getLogic(String fieldName) { + String ret = null; + List values = getValues(); + + if (!hasBaseType()) + throw new ItemManagerException("SearchFilter getLogic can't identify BaseType."); + + BaseType baseType = metadata.getMetadataElement().getMetadataType().getBaseType(); + + // adat normalizáció + Timestamp currentDate = new Timestamp(new Date().getTime()); + + switch (baseType) { + case DATETIME: { + switch (getValueLogic()) { + case EQUALS: { + setValueLogic(FilterValueLogic.BEETWEN); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString((Timestamp) values.get(0), 0, Calendar.DAY_OF_MONTH); + vals.add(v1); + String v2 = ItemManagerData.toDateString((Timestamp) values.get(0), 1, Calendar.DAY_OF_MONTH); + vals.add(v2); + setValues(vals); + break; + } + case ONEWEEK: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -7, Calendar.DAY_OF_MONTH); + vals.add(v1); + setValues(vals); + break; + } + case TWOWEEKS: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -14, Calendar.DAY_OF_MONTH); + vals.add(v1); + setValues(vals); + break; + } + case THREEWEEKS: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -21, Calendar.DAY_OF_MONTH); + vals.add(v1); + setValues(vals); + break; + } + case ONEMONTH: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -1, Calendar.MONTH); + vals.add(v1); + setValues(vals); + break; + } + case TWOMONTHS: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -2, Calendar.MONTH); + vals.add(v1); + setValues(vals); + break; + } + case THREEMONTHS: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -3, Calendar.MONTH); + vals.add(v1); + setValues(vals); + break; + } + case SIXMONTHS: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -6, Calendar.MONTH); + vals.add(v1); + setValues(vals); + break; + } + case ONEYEAR: { + setValueLogic(FilterValueLogic.MORE); + List vals = new ArrayList(); + String v1 = ItemManagerData.toDateString(currentDate, -1, Calendar.YEAR); + vals.add(v1); + setValues(vals); + break; + } + default: { + if (getValues().size() > 0) { + String v1 = ItemManagerData.toDateString((Timestamp) values.get(0), 0, Calendar.DAY_OF_MONTH); + values.set(0, v1); + } + if (getValues().size() > 1) { + String v2 = ItemManagerData.toDateString((Timestamp) values.get(1), 0, Calendar.DAY_OF_MONTH); + values.set(1, v2); + } + break; + } + + } + break; + } + } + values = getValues(); + switch (getValueLogic()) { + case BEETWEN: + ret = String.format("(%1$s BETWEEN '%2$s' AND '%3$s')", fieldName, values.get(0), values.get(1)); + break; + case CONTAINS: + ret = String.format("(%1$s LIKE '%%%2$s%%')", fieldName, values.get(0)); + break; + case ENDSWITH: + ret = String.format("(%1$s LIKE '%%%2$s')", fieldName, values.get(0)); + break; + case EQUALS: + ret = String.format("(%1$s = '%2$s')", fieldName, values.get(0)); + break; + case LESS: + ret = String.format("(%1$s < '%2$s')", fieldName, values.get(0)); + break; + case MORE: + ret = String.format("(%1$s > '%2$s')", fieldName, values.get(0)); + break; + case STARTSWITH: + ret = String.format("(%1$s LIKE '%2$s%%')", fieldName, values.get(0)); + break; + } + + return ret; + } + + public Metadata getMetadata() { + return this.metadata; + } + + public FilterValueLogic getValueLogic() { + return this.valueLogic; + } + + public List getValues() { + return this.values; + } + + public void setFilters(List filters) { + this.filters = filters; + } + + public void setItemTypeId(long itemTypeId) { + this.itemTypeId = itemTypeId; + } + + public void setLogic(FilterLogic logic) { + this.logic = logic; + } + + public void setMetadata(Metadata metadata) { + this.metadata = metadata; + } + + public void setValueLogic(FilterValueLogic valueLogic) { + this.valueLogic = valueLogic; + } + + public void setValues(List values) { + this.values = values; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchResult.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchResult.java new file mode 100644 index 00000000..2d0ccb2d --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/SearchResult.java @@ -0,0 +1,52 @@ +package user.jobengine.db; + +import java.util.List; + +public class SearchResult { + + private long itemCount; + private ItemType itemType; + private List items; + private List folders; + private RenderParameter parameters; + + public List getFolders() { + return this.folders; + } + + public long getItemCount() { + return this.itemCount; + } + + public List getItems() { + return this.items; + } + + public ItemType getItemType() { + return this.itemType; + } + + public RenderParameter getParameters() { + return this.parameters; + } + + public void setFolders(List folders) { + this.folders = folders; + } + + public void setItemCount(long itemCount) { + this.itemCount = itemCount; + } + + public void setItems(List items) { + this.items = items; + } + + public void setItemType(ItemType itemType) { + this.itemType = itemType; + } + + public void setParameters(RenderParameter parameters) { + this.parameters = parameters; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Shot.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Shot.java new file mode 100644 index 00000000..e398cf6d --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Shot.java @@ -0,0 +1,87 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.sql.Timestamp; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import user.commons.EntityBase; +import user.commons.TimestampAdapter; + +public class Shot extends EntityBase implements Serializable { + /** + * + */ + private static final long serialVersionUID = 1L; + private Timestamp created = null; + private String description = null; + private long inPoint = 0; + private Media media = null; + private long mediaId = 0; + private long outPoint = 0; + private byte[] thumbnail = null; + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return this.created; + } + + public String getDescription() { + return this.description; + } + + public long getInPoint() { + return this.inPoint; + } + + public Media getMedia() { + if (this.media == null && this.mediaId != 0) { + this.media = (Media) ItemManager.getInstance().getMedia( + this.mediaId); + } + return this.media; + } + + public long getMediaId() { + return this.mediaId; + } + + public long getOutPoint() { + return this.outPoint; + } + + public byte[] getThumbnail() { + return this.thumbnail; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setInPoint(long inPoint) { + this.inPoint = inPoint; + } + + public void setMedia(Media media) { + checkParameter("Media", media); + this.media = media; + this.mediaId = media.getId(); + } + + public void setMediaId(long mediaId) { + checkParameter("MediaId", mediaId); + this.mediaId = mediaId; + } + + public void setOutPoint(long outPoint) { + this.outPoint = outPoint; + } + + public void setThumbnail(byte[] thumbnail) { + this.thumbnail = thumbnail; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ShotDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/ShotDAO.sqlj new file mode 100644 index 00000000..e1acff8e --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ShotDAO.sqlj @@ -0,0 +1,111 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; +import java.util.ArrayList; + +#sql iterator ShotIter(long id, String description, long inPoint, long outPoint, long mediaId, Timestamp created, byte[] thumbnail); + +@SuppressWarnings("unused") +class ShotDAO extends EntityBaseDAO { + + public ShotDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + ShotIter iterator = (ShotIter) iter; + while (iterator.next()) { + Shot entity = new Shot(); + entity.setId(iterator.id()); + entity.setDescription(iterator.description()); + entity.setInPoint(iterator.inPoint()); + entity.setOutPoint(iterator.outPoint()); + entity.setMediaId(iterator.mediaId()); + entity.setCreated(iterator.created()); + entity.setThumbnail(iterator.thumbnail()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + ShotIter iter = null; + #sql [context] iter = { SELECT ID, DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, CREATED, THUMBNAIL FROM SHOT WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + ShotIter iter = null; + #sql [context] iter = { SELECT ID, DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, CREATED, THUMBNAIL FROM SHOT WHERE MEDIAID = :id ORDER BY INPOINT }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + ShotIter iter = null; + #sql [context] iter = { SELECT ID, DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, CREATED, THUMBNAIL FROM SHOT }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM SHOT WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE SHOT DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Shot obj = (Shot) entity; + long id = obj.getId(); + String description = obj.getDescription(); + long inPoint = obj.getInPoint(); + long outPoint = obj.getOutPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + #sql [context] { UPDATE SHOT SET DESCRIPTION = :description, INPOINT = :inPoint, OUTPOINT = :outPoint, MEDIAID = :mediaId, THUMBNAIL = :thumbnail WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Shot obj = (Shot) entity; + String description = obj.getDescription(); + long inPoint = obj.getInPoint(); + long outPoint = obj.getOutPoint(); + long mediaId = obj.getMediaId(); + byte[] thumbnail = obj.getThumbnail(); + + #sql [context] { INSERT INTO SHOT (DESCRIPTION, INPOINT, OUTPOINT, MEDIAID, THUMBNAIL) VALUES (:description, :inPoint, :outPoint, :mediaId, :thumbnail) }; + } + + public List getShots(long id) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByForeignKey(context, id); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Signal.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Signal.java new file mode 100644 index 00000000..4a94a569 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Signal.java @@ -0,0 +1,50 @@ +package user.jobengine.db; + +import java.io.Serializable; + +import user.commons.Bytes; +import user.commons.EntityBase; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; + +@SuppressWarnings("serial") +public class Signal extends EntityBase implements Serializable { + + private SignalType signalType; + private StaticTables staticTable; + + public Signal() { + } + + public Signal(long id, SignalType signalType, StaticTables staticTable) { + setSignalType(signalType); + setStaticTable(staticTable); + setId(id); + } + + public SignalType getSignalType() { + return signalType; + } + + public void setSignalType(SignalType signalType) { + this.signalType = signalType; + } + + public StaticTables getStaticTable() { + return staticTable; + } + + public void setStaticTable(StaticTables staticTable) { + this.staticTable = staticTable; + } + + public byte[] toByteArray() { + byte[] result = null; + byte[] idBytes = Bytes.toByteArray(getId()); + byte[] signalTypeBytes = Bytes.toByteArray(getSignalType().getValue()); + byte[] staticTableBytes = Bytes + .toByteArray(getStaticTable().getValue()); + result = Bytes.concatAll(idBytes, signalTypeBytes, staticTableBytes); + return result; + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Store.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Store.java new file mode 100644 index 00000000..fe13a14e --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Store.java @@ -0,0 +1,89 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import user.commons.EntityBase; +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; + +@SuppressWarnings("serial") +public class Store extends EntityBase implements Serializable { + private String name; + private List storeUris; + private boolean isSystem; + private boolean isLowres; + + public void appendStoreUri(StoreUri storeUri) { + checkParameter("StoreUri", storeUri, true); + if (this.storeUris == null) + this.storeUris = new ArrayList(); + this.storeUris.add(storeUri); + } + + public String getName() { + return this.name; + } + + @SuppressWarnings("unchecked") + public List getStoreUris() { + if (this.storeUris == null) { + StoreUriDAO dao = (StoreUriDAO) ItemManager.getInstance().getBaseDAO(StoreUri.class); + this.storeUris = (List) (List) dao.getAll(getId()); + } + return this.storeUris; + } + + public StoreUri getSourceStoreUri(RemoteStoreProtocol protocol) { + StoreUri result = null; + List uris = getStoreUris(); + for (StoreUri uri : uris) { + if (uri.getProtocol() == protocol) { + if (uri.isSource()) { + result = uri; + break; + } + } + } + return result; + } + + public StoreUri getTargetStoreUri(RemoteStoreProtocol protocol) { + StoreUri result = null; + List uris = getStoreUris(); + for (StoreUri uri : uris) { + if (uri.getProtocol() == protocol) { + if (uri.isTarget()) { + result = uri; + break; + } + } + } + return result; + } + + public boolean isLowres() { + return isLowres; + } + + public boolean isSystem() { + return isSystem; + } + + public void setLowres(boolean isLowres) { + this.isLowres = isLowres; + } + + public void setName(String name) { + this.name = name; + } + + public void setStoreUris(List storeUris) { + this.storeUris = storeUris; + } + + public void setSystem(boolean isSystem) { + this.isSystem = isSystem; + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/StoreDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/StoreDAO.sqlj new file mode 100644 index 00000000..8465c4cc --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/StoreDAO.sqlj @@ -0,0 +1,142 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.StoreUri; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +#sql iterator StoreIter(long id, String name, String isSystem, String isLowres); + +@SuppressWarnings("unused") +class StoreDAO extends EntityBaseDAO { + + public StoreDAO(ItemManager manager) { + super(manager); + } + + @Override + protected void afterAdd(DefaultContext context, IEntityBase entity) throws SQLException { + StoreUriDAO dao = (StoreUriDAO) manager.getBaseDAO(StoreUri.class); + dao.addAll(context, entity); + } + + @Override + protected void beforeDelete(DefaultContext context, IEntityBase entity) throws SQLException { + StoreUriDAO dao = (StoreUriDAO) manager.getBaseDAO(StoreUri.class); + dao.removeAll(context, entity.getId()); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + StoreIter iterator = (StoreIter) iter; + while (iterator.next()) { + Store entity = new Store(); + entity.setId(iterator.id()); + entity.setName(iterator.name()); + entity.setSystem(iterator.isSystem().equals("Y") ? true : false); + entity.setLowres(iterator.isLowres().equals("Y") ? true : false); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + StoreIter iter = null; + #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + StoreIter iter = null; + #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE }; + return iter; + } + + protected ResultSetIterImpl selectByName(DefaultContext context, String name) throws SQLException{ + StoreIter iter = null; + #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE NAME = :name }; + return iter; + } + + protected ResultSetIterImpl selectBySystem(DefaultContext context, String lowres) throws SQLException{ + StoreIter iter = null; + #sql [context] iter = { SELECT ID, NAME, ISSYSTEM, ISLOWRES FROM STORE WHERE ISSYSTEM = 'Y' AND ISLOWRES = :lowres }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM STORE WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE STORE DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + Store obj = (Store) entity; + long id = obj.getId(); + String name = obj.getName(); + String isSystem = obj.isSystem() == true ? "Y" : "N"; + String isLowres = obj.isLowres() == true ? "Y" : "N"; + + #sql [context] { UPDATE STORE SET NAME = :name, ISSYSTEM = :isSystem, ISLOWRES = :isLowres WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + Store obj = (Store) entity; + String name = obj.getName(); + String isSystem = obj.isSystem() == true ? "Y" : "N"; + String isLowres = obj.isLowres() == true ? "Y" : "N"; + + #sql [context] { INSERT INTO STORE (NAME, ISSYSTEM, ISLOWRES) VALUES (:name, :isSystem, :isLowres) }; + } + + public IEntityBase getByName(String name) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByName(context, name); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + + + public IEntityBase getSystemStore(boolean lowres) { + manager.traceIn(); + IEntityBase entity = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectBySystem(context, lowres ? "Y" : "N"); + checkNull(iter, ResultSetIterImpl.class); + entity = getEntity(context, iter); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/StoreUriDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/StoreUriDAO.sqlj new file mode 100644 index 00000000..0021aacc --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/StoreUriDAO.sqlj @@ -0,0 +1,138 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import user.commons.StoreUri; +import java.sql.SQLException; +import java.util.List; +import java.util.ArrayList; +import user.commons.remotestore.RemoteStoreProtocol; +import user.commons.remotestore.DeliveryMethod; + +#sql iterator StoreUriIter(long id, long storeId, String uri, String isStream, String isSource, String isTarget, String userName, String password, String rootPath, Integer portNumber, String delivery, String protocol); + +@SuppressWarnings("unused") + +class StoreUriDAO extends EntityBaseDAO { + + public StoreUriDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + StoreUriIter iterator = (StoreUriIter) iter; + while (iterator.next()) { + StoreUri entity = new StoreUri(); + entity.setId(iterator.id()); + entity.setStoreId(iterator.storeId()); + entity.setUri(iterator.uri()); + entity.setStream(iterator.isStream().equals("Y") ? true : false); + entity.setSource(iterator.isSource().equals("Y") ? true : false); + entity.setTarget(iterator.isTarget().equals("Y") ? true : false); + entity.setUserName(iterator.userName()); + entity.setPassword(iterator.password()); + entity.setRootPath(iterator.rootPath()); + entity.setPortNumber(iterator.portNumber()); + entity.setDelivery(ItemManagerData.toDeliveryMethod(iterator.delivery())); + entity.setProtocol(ItemManagerData.toRemoteStoreProtocol(iterator.protocol())); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + StoreUriIter iter = null; + #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectByForeignKey(DefaultContext context, long id) throws SQLException{ + StoreUriIter iter = null; + #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI WHERE STOREID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + StoreUriIter iter = null; + #sql [context] iter = { SELECT ID, STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL FROM STOREURI }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM STOREURI WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE STOREURI DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + StoreUri obj = (StoreUri) entity; + long id = obj.getId(); + long storeId = obj.getStoreId(); + String uri = obj.getUri(); + String isStream = obj.isStream() == true ? "Y" : "N"; + String isSource = obj.isSource() == true ? "Y" : "N"; + String isTarget = obj.isTarget() == true ? "Y" : "N"; + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + Integer portNumber = obj.getPortNumber(); + String delivery = obj.getDelivery() == null ? null : obj.getDelivery().toString(); + String protocol = obj.getProtocol() == null ? null : obj.getProtocol().toString(); + + #sql [context] { UPDATE STOREURI SET STOREID = :storeId, URI = :uri, ISSTREAM = :isStream, ISSOURCE = :isSource, ISTARGET = :isTarget, USERNAME = :userName, PASSWORD = :password, ROOTPATH = :rootPath, PORTNUMBER = :portNumber, DELIVERY = :delivery, PROTOCOL = :protocol WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + StoreUri obj = (StoreUri) entity; + long storeId = obj.getStoreId(); + String uri = obj.getUri(); + String isStream = obj.isStream() == true ? "Y" : "N"; + String isSource = obj.isSource() == true ? "Y" : "N"; + String isTarget = obj.isTarget() == true ? "Y" : "N"; + String userName = obj.getUserName(); + String password = obj.getPassword(); + String rootPath = obj.getRootPath(); + Integer portNumber = obj.getPortNumber(); + String delivery = obj.getDelivery() == null ? null : obj.getDelivery().toString(); + String protocol = obj.getProtocol() == null ? null : obj.getProtocol().toString(); + + #sql [context] { INSERT INTO STOREURI (STOREID, URI, ISSTREAM, ISSOURCE, ISTARGET, USERNAME, PASSWORD, ROOTPATH, PORTNUMBER, DELIVERY, PROTOCOL) VALUES (:storeId, :uri, :isStream, :isSource, :isTarget, :userName, :password, :rootPath, :portNumber, :delivery, :protocol) }; + } + + void addAll(DefaultContext context, IEntityBase entity) throws SQLException { + manager.traceIn(); + Store store = (Store) entity; + if (store != null && store.getStoreUris() != null) { + for (StoreUri su: store.getStoreUris()) { + su.setStoreId(store.getId()); + add(context, su); + } + } + manager.traceOut(); + } + + /** + * Törli a paraméterként kapott Store azonosítóhoz tartozó StoreUri bejegyzéseket. + */ + void removeAll(DefaultContext context, long filterId) throws SQLException { + manager.traceIn(); + #sql [context] { DELETE FROM STOREURI WHERE STOREID = :filterId }; + manager.traceOut(); + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/TypeDefinition.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/TypeDefinition.java new file mode 100644 index 00000000..c1a8324e --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/TypeDefinition.java @@ -0,0 +1,26 @@ +package user.jobengine.db; + +public class TypeDefinition { + private String baseJavaType; + private String sqlJavaType; + private String sqlType; + + TypeDefinition(String baseJavaType, String sqlJavaType, String sqlType) { + this.baseJavaType = baseJavaType; + this.sqlJavaType = sqlJavaType; + this.sqlType = sqlType; + } + + public String getBaseJavaType() { + return baseJavaType; + } + + public String getSqlJavaType() { + return sqlJavaType; + } + + public String getSqlType() { + return sqlType; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/UserInfo.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/UserInfo.java new file mode 100644 index 00000000..6c16b7c4 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/UserInfo.java @@ -0,0 +1,88 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.sql.Timestamp; + +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import user.commons.EntityBase; +import user.commons.TimestampAdapter; +import user.jobengine.db.ItemManagerData.UserRight; + +@SuppressWarnings("serial") +public class UserInfo extends EntityBase implements Serializable { + private String fullName; + private String userName; + private String password; + private Timestamp created; + private Timestamp lastLogin; + private int rights; + private String token; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public void addRight(UserRight right) { + // iend() + this.rights |= right.getValue(); + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getCreated() { + return created; + } + + public String getFullName() { + return fullName; + } + + @XmlJavaTypeAdapter(TimestampAdapter.class) + public Timestamp getLastLogin() { + return lastLogin; + } + + public String getPassword() { + return password; + } + + public int getRights() { + return rights; + } + + public String getUserName() { + return userName; + } + + public void setCreated(Timestamp created) { + this.created = created; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public void setLastLogin(Timestamp lastLogin) { + this.lastLogin = lastLogin; + } + + public void setPassword(String password) { + this.password = password; + } + + public void setRights(int rights) { + this.rights = rights; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public boolean hasRight(UserRight right) { + return UserRight.is(getRights(), right); + } +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/UserInfoDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/UserInfoDAO.sqlj new file mode 100644 index 00000000..6603d790 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/UserInfoDAO.sqlj @@ -0,0 +1,117 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +#sql iterator UserInfoIter(long id, String fullName, String userName, String password, int rights, Timestamp created, Timestamp lastLogin); + +@SuppressWarnings("unused") +public class UserInfoDAO extends EntityBaseDAO { + private String generalPassword = "xwXbgTer"; + + public UserInfoDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + UserInfoIter iterator = (UserInfoIter) iter; + while (iterator.next()) { + UserInfo entity = new UserInfo(); + entity.setId(iterator.id()); + entity.setFullName(iterator.fullName()); + entity.setUserName(iterator.userName()); + if (!isChunked) + entity.setPassword(iterator.password()); + entity.setRights(iterator.rights()); + entity.setCreated(iterator.created()); + entity.setLastLogin(iterator.lastLogin()); + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + UserInfoIter iter = null; + #sql [context] iter = { SELECT ID, FULLNAME, USERNAME, PASSWORD, RIGHTS, CREATED, LASTLOGIN FROM USERINFO WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + UserInfoIter iter = null; + #sql [context] iter = { SELECT ID, FULLNAME, USERNAME, PASSWORD, RIGHTS, CREATED, LASTLOGIN FROM USERINFO ORDER BY FULLNAME }; + return iter; + } + + protected ResultSetIterImpl selectByUserPassword(DefaultContext context, String user, String password) throws SQLException{ + UserInfoIter iter = null; + #sql [context] iter = { SELECT ID, FULLNAME, USERNAME, PASSWORD, RIGHTS, CREATED, LASTLOGIN FROM USERINFO WHERE PASSWORD = :password AND USERNAME = :user }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM USERINFO WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE USERINFO DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + UserInfo obj = (UserInfo) entity; + long id = obj.getId(); + String fullName = obj.getFullName(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + int rights = obj.getRights(); + Timestamp lastLogin = obj.getLastLogin(); + #sql [context] { UPDATE USERINFO SET FULLNAME = :fullName, USERNAME = :userName, PASSWORD = :password, RIGHTS = :rights, LASTLOGIN = :lastLogin WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + UserInfo obj = (UserInfo) entity; + String fullName = obj.getFullName(); + String userName = obj.getUserName(); + String password = obj.getPassword(); + int rights = obj.getRights(); + #sql [context] { INSERT INTO USERINFO (FULLNAME, USERNAME, PASSWORD, RIGHTS) VALUES (:fullName, :userName, :password, :rights) }; + } + + public IEntityBase get(String user, String password) { + manager.traceIn(); + DefaultContext context = manager.getDbContext(); + IEntityBase entity = null; + try { + ResultSetIterImpl iter = selectByUserPassword(context, user, password); + List result = entities(context, iter, true); + if (result != null && result.size() == 1) + entity = result.get(0); + #sql [context] { COMMIT }; + } catch (Exception e) { + logger.error(e.getMessage()); + try { + #sql [context] { ROLLBACK }; + } catch(Exception e1) { + } + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return entity; + } + +} diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/WorkflowAction.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/WorkflowAction.java new file mode 100644 index 00000000..0edde20d --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/WorkflowAction.java @@ -0,0 +1,99 @@ +package user.jobengine.db; + +import java.io.Serializable; +import java.sql.Timestamp; + +@SuppressWarnings("serial") +public class WorkflowAction extends JSONBase implements Serializable { + private Timestamp touched; + private Timestamp started; + private Timestamp finished; + private boolean successful; + private String houseId; + private String description; + private String source; + private String destination; + private String tag; + private long size; + + public Timestamp getTouched() { + return touched; + } + + public void setTouched(Timestamp touched) { + this.touched = touched; + } + + public Timestamp getStarted() { + return started; + } + + public void setStarted(Timestamp started) { + this.started = started; + } + + public Timestamp getFinished() { + return finished; + } + + public void setFinished(Timestamp finished) { + this.finished = finished; + } + + public String getHouseId() { + return houseId; + } + + public void setHouseId(String houseId) { + this.houseId = houseId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getDestination() { + return destination; + } + + public void setDestination(String destination) { + this.destination = destination; + } + + public String getTag() { + return tag; + } + + public void setTag(String tag) { + this.tag = tag; + } + + public boolean isSuccessful() { + return successful; + } + + public void setSuccessful(boolean successful) { + this.successful = successful; + } + + public long getSize() { + return size; + } + + public void setSize(long size) { + this.size = size; + } + +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/WorkflowActionDAO.sqlj b/server/user.jobengine.osgi.db/src/user/jobengine/db/WorkflowActionDAO.sqlj new file mode 100644 index 00000000..d5350677 --- /dev/null +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/WorkflowActionDAO.sqlj @@ -0,0 +1,128 @@ +package user.jobengine.db; + +import user.commons.IEntityBase; +import sqlj.runtime.ref.*; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.List; +import java.util.ArrayList; + + +#sql iterator WorkflowActionIter(long id, Timestamp touched, Timestamp started, Timestamp finished, String successful, String houseId, String description, String source, String destination, String tag, long size); + +@SuppressWarnings("unused") +class WorkflowActionDAO extends EntityBaseDAO { + + public WorkflowActionDAO(ItemManager manager) { + super(manager); + } + + @Override + protected List entities(DefaultContext context, ResultSetIterImpl iter, boolean isChunked) throws SQLException { + List result = null; + WorkflowActionIter iterator = (WorkflowActionIter) iter; + while (iterator.next()) { + WorkflowAction entity = new WorkflowAction(); + entity.setId(iterator.id()); + entity.setTouched(iterator.touched()); + entity.setStarted(iterator.started()); + entity.setFinished(iterator.finished()); + entity.setSuccessful(iterator.successful().equals("Y") ? true : false); + entity.setHouseId(iterator.houseId()); + entity.setDescription(iterator.description()); + entity.setSource(iterator.source()); + entity.setDestination(iterator.destination()); + entity.setTag(iterator.tag()); + entity.setSize(iterator.size()); + + if (result == null) + result = new ArrayList(); + result.add(entity); + } + iterator.close(); + return result; + } + + @Override + protected ResultSetIterImpl selectByKey(DefaultContext context, long id) throws SQLException{ + WorkflowActionIter iter = null; + #sql [context] iter = { SELECT ID, TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE FROM WORKFLOWACTION WHERE ID = :id }; + return iter; + } + + @Override + protected ResultSetIterImpl selectAll(DefaultContext context) throws SQLException{ + WorkflowActionIter iter = null; + #sql [context] iter = { SELECT ID, TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE FROM WORKFLOWACTION }; + return iter; + } + + private ResultSetIterImpl selectByFinished(DefaultContext context, Timestamp begin, Timestamp end) throws SQLException{ + WorkflowActionIter iter = null; + #sql [context] iter = { SELECT ID, TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE FROM WORKFLOWACTION WHERE FINISHED BETWEEN :begin AND :end ORDER BY HOUSEID }; + return iter; + } + + @Override + protected void delete(DefaultContext context, long id) throws SQLException{ + #sql [context] { DELETE FROM WORKFLOWACTION WHERE ID = :id }; + } + + @Override + protected void truncateTable(DefaultContext context) throws SQLException{ + #sql [context] { TRUNCATE TABLE WORKFLOWACTION DROP STORAGE IGNORE DELETE TRIGGERS IMMEDIATE }; + } + + @Override + protected void update(DefaultContext context, IEntityBase entity) throws SQLException{ + WorkflowAction obj = (WorkflowAction) entity; + + long id = obj.getId(); + Timestamp touched = obj.getTouched(); + Timestamp started = obj.getStarted(); + Timestamp finished = obj.getFinished(); + String successful = obj.isSuccessful() ? "Y" : "N"; + String houseId = obj.getHouseId(); + String description = obj.getDescription(); + String source = obj.getSource(); + String destination = obj.getDestination(); + String tag = obj.getTag(); + long size = obj.getSize(); + + #sql [context] { UPDATE WORKFLOWACTION SET TOUCHED = :touched, STARTED = :started, FINISHED = :finished, SUCCESSFUL = :successful, HOUSEID = :houseId, DESCRIPTION = :description, SOURCE = :source, DESTINATION = :destination, TAG = :tag, SIZE = :size WHERE ID = :id }; + } + + @Override + protected void insert(DefaultContext context, IEntityBase entity) throws SQLException{ + WorkflowAction obj = (WorkflowAction) entity; + + long id = obj.getId(); + Timestamp touched = obj.getTouched(); + Timestamp started = obj.getStarted(); + Timestamp finished = obj.getFinished(); + String successful = obj.isSuccessful() ? "Y" : "N"; + String houseId = obj.getHouseId(); + String description = obj.getDescription(); + String source = obj.getSource(); + String destination = obj.getDestination(); + String tag = obj.getTag(); + long size = obj.getSize(); + + #sql [context] { INSERT INTO WORKFLOWACTION (TOUCHED, STARTED, FINISHED, SUCCESSFUL, HOUSEID, DESCRIPTION, SOURCE, DESTINATION, TAG, SIZE) VALUES (:touched, :started, :finished, :successful, :houseId, :description, :source, :destination, :tag, :size) }; + } + + public List getWorkflowActions(Timestamp begin, Timestamp end) { + List result = null; + DefaultContext context = manager.getDbContext(); + try { + ResultSetIterImpl iter = selectByFinished(context, begin, end); + result = getList(context, iter, false); + } catch (Exception e) { + throw new ItemManagerException(e); + } finally { + manager.putDbContext(context); + } + manager.traceOut(); + return result; + } +} diff --git a/server/user.jobengine.osgi.db/test/user/commons/TestProperties.java b/server/user.jobengine.osgi.db/test/user/commons/TestProperties.java new file mode 100644 index 00000000..ccf2291f --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/commons/TestProperties.java @@ -0,0 +1,69 @@ +package user.commons; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; + +public class TestProperties { + + @Test + public void testCreate(){ + CommonsProperties properties = new CommonsProperties(); + assertNotNull(properties); + } + + @Test(expected=NullPointerException.class) + public void testNullKey(){ + CommonsProperties properties = new CommonsProperties(); + properties.add(null, "TestString"); + } + + @Test(expected=NullPointerException.class) + public void testNullValue(){ + CommonsProperties properties = new CommonsProperties(); + properties.add("Test", null); + } + + @Test(expected=CommonsException.class) + public void testWrongValueType(){ + CommonsProperties properties = new CommonsProperties(); + properties.add("Test", 100); + properties.getString("Test"); + } + + @Test(expected=CommonsException.class) + public void testNonExistingProperty(){ + CommonsProperties properties = new CommonsProperties(); + properties.add("Test", 100); + properties.getString("Test1"); + } + + @Test + public void testString(){ + CommonsProperties properties = new CommonsProperties(); + properties.add("Test", "TestString"); + assertEquals("TestString", properties.get("Test")); + } + + @Test + public void testBoolean(){ + CommonsProperties properties = new CommonsProperties(); + properties.add("Test", true); + assertEquals(true, properties.get("Test")); + } + + @Test + public void testInt(){ + CommonsProperties properties = new CommonsProperties(); + properties.add("Test", 100); + assertEquals(100, properties.get("Test")); + } + + @Test + public void testLong(){ + CommonsProperties properties = new CommonsProperties(); + properties.add("Test", 100L); + assertEquals(100L, properties.get("Test")); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/commons/pool/TestConnectionPool.java b/server/user.jobengine.osgi.db/test/user/commons/pool/TestConnectionPool.java new file mode 100644 index 00000000..c84df3ec --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/commons/pool/TestConnectionPool.java @@ -0,0 +1,43 @@ +package user.commons.pool; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TestConnectionPool { + private static ConnectionPool pool = null; + + @BeforeClass + public static void beforeTest() { + ConnectionPoolProperties properties = new ConnectionPoolProperties("com.ibm.db2.jcc.DB2Driver", + "jdbc:db2://localhost:50000/MF", "Balazs Dombovari", "balage1", false, 1000); + properties.add(ResourcePool.POOLSIZE, 2); + pool = new ConnectionPool(properties); + } + + @AfterClass + public static void afterTest() { + pool.close(); + } + + @Test + public void testConcurrentBorrow(){ + //3 szál próbál kölcsönözni, de csak 2 erõforrás van. + //A harmadik várakozik, míg fel nem szabadul egy erõforrás. + TestingThread thread1 = new TestingThread("Thread1", pool); + TestingThread thread2 = new TestingThread("Thread2", pool); + TestingThread thread3 = new TestingThread("Thread3", pool); + + thread1.start(); + thread2.start(); + thread3.start(); + + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + } + + thread1.interrupt(); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/commons/pool/TestingThread.java b/server/user.jobengine.osgi.db/test/user/commons/pool/TestingThread.java new file mode 100644 index 00000000..9b065f59 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/commons/pool/TestingThread.java @@ -0,0 +1,31 @@ +package user.commons.pool; + +import java.sql.Connection; + +/** + * Teszt thread, kölcsönöz majd egy idõ múlva visszaad egy Connection erõforrást. + */ +public class TestingThread extends Thread { + private ConnectionPool pool = null; + private String name = null; + + TestingThread(String name, ConnectionPool pool) { + this.pool = pool; + this.name = name; + } + + public void run() { + try { + Connection connection = pool.borrowObject(); + System.out.println(name + " borrowed a connection."); + Thread.sleep(3000); + pool.lendObject(connection); + System.out.println(name + " lend a connection."); + } catch (PoolException e) { + System.out.println(e.getMessage()); + } catch (InterruptedException e1) { + System.out.println(name + " finished."); + } + + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestItemTypeChangeHandler.java b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestItemTypeChangeHandler.java new file mode 100644 index 00000000..d367abbf --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestItemTypeChangeHandler.java @@ -0,0 +1,101 @@ +package user.jobengine.changehandler; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.jmock.Expectations; +import org.jmock.Mockery; +import org.jmock.integration.junit4.JMock; +import org.jmock.integration.junit4.JUnit4Mockery; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemType; + +@RunWith(JMock.class) +public class TestItemTypeChangeHandler { + static public Mockery context = null; + static private IChangeHandler sut = null; + static private IItemManager manager = null; + + @BeforeClass + static public void startup() { + context = new JUnit4Mockery(); + sut = new ItemTypeChangeHandler(); + manager = context.mock(IItemManager.class); + } + + @Test + public void testIsInterestred() { + // Fixture + ItemType itemType = new ItemType(); + + // Exercise + boolean result = sut.isInterested(itemType); + + // Verify + assertTrue(result); + } + + @Test + public void testIsInterestredNull() { + // Exercise + boolean result = sut.isInterested(null); + + // Verify + assertFalse(result); + } + + @Test + public void testHandleChangeCreate() { + // Fixture + final SignalType signalType = SignalType.CREATE; + final IEntityBase entity = new ItemType(); + entity.setId(1); + + context.checking(new Expectations() {{ + one (manager).storeCached(entity.getId(), entity); + one (manager).signal(entity.getId(), signalType, StaticTables.ITEMTYPE); + }}); + + // Exercise, Verify + sut.handleChange(manager, entity, signalType); + } + + @Test + public void testHandleChangeDelete() { + // Fixture + final SignalType signalType = SignalType.DELETE; + final IEntityBase entity = new ItemType(); + entity.setId(1); + + context.checking(new Expectations() {{ + one (manager).removeCached(ItemType.class, entity.getId()); + one (manager).signal(entity.getId(), signalType, StaticTables.ITEMTYPE); + }}); + + // Exercise, Verify + sut.handleChange(manager, entity, signalType); + } + + @Test + public void testHandleChangeUpdate() { + // Fixture + final SignalType signalType = SignalType.UPDATE; + final IEntityBase entity = new ItemType(); + entity.setId(1); + + context.checking(new Expectations() {{ + one (manager).storeCached(entity.getId(), entity); + one (manager).signal(entity.getId(), signalType, StaticTables.ITEMTYPE); + }}); + + // Exercise, Verify + sut.handleChange(manager, entity, signalType); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestItemTypeChangeHandlerFactory.java b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestItemTypeChangeHandlerFactory.java new file mode 100644 index 00000000..95642e06 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestItemTypeChangeHandlerFactory.java @@ -0,0 +1,73 @@ +package user.jobengine.changehandler; + +import org.jmock.Expectations; +import org.jmock.Mockery; +import org.jmock.integration.junit4.JMock; +import org.jmock.integration.junit4.JUnit4Mockery; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManager; +import user.jobengine.db.ItemManagerData.SignalType; + +@RunWith(JMock.class) +public class TestItemTypeChangeHandlerFactory { + static public Mockery context = null; + static private IChangeHandler sut = null; + static private IChangeHandler mockedHandler = null; + static private IItemManager manager = null; + static private IEntityBase entity = null; + + @BeforeClass + static public void startup() { + manager = new ItemManager(); + } + + @Before + public void initialize() { + context = new JUnit4Mockery(); + mockedHandler = context.mock(IChangeHandler.class); + entity = context.mock(IEntityBase.class); + sut = new ItemTypeChangeHandlerFactory(){ + @Override + public void createHandlers() { + handlers = new IChangeHandler[] { + mockedHandler + }; + } + }; + } + + @Test + public void testHandleChangeIsInterested() { + // Fixture + final SignalType signalType = SignalType.CREATE; + + context.checking(new Expectations() {{ + one (mockedHandler).isInterested(entity); will(returnValue(true)); + one (mockedHandler).handleChange(manager, entity, signalType); + }}); + + // Exercise, Verify + sut.handleChange(manager, entity, signalType); + } + + @Test + public void testHandleChangeIsNotInterested() { + // Fixture + final SignalType signalType = SignalType.CREATE; + + context.checking(new Expectations() {{ + one (mockedHandler).isInterested(entity); will(returnValue(false)); + one (mockedHandler).isInterested(signalType); will(returnValue(false)); + }}); + + // Exercise, Verify + sut.handleChange(manager, entity, signalType); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataChangeHandler.java b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataChangeHandler.java new file mode 100644 index 00000000..c475b650 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataChangeHandler.java @@ -0,0 +1,126 @@ +package user.jobengine.changehandler; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.jmock.Expectations; +import org.jmock.Mockery; +import org.jmock.integration.junit4.JMock; +import org.jmock.integration.junit4.JUnit4Mockery; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; +import user.jobengine.db.MetadataElement; + +@RunWith(JMock.class) +public class TestMetadataChangeHandler { + static public Mockery context = null; + static private IChangeHandler sut = null; + static private IItemManager manager = null; + + @BeforeClass + static public void startup() { + context = new JUnit4Mockery(); + sut = new MetadataChangeHandler(); + manager = context.mock(IItemManager.class); + } + + @Test + public void testHandleChangeCreate() { + // Fixture + final SignalType signalType = SignalType.CREATE; + + final ItemType itemType = new ItemType(); + itemType.setId(1); + final Metadata metadata = new Metadata(); + metadata.setItemTypeId(itemType.getId()); + + context.checking(new Expectations() {{ + one (manager).retrieveCached(ItemType.class, metadata.getItemTypeId()); will(returnValue(itemType)); + one (manager).storeCached(itemType.getId(), itemType); + one (manager).signal(itemType.getId(), SignalType.UPDATE, StaticTables.ITEMTYPE); + }}); + + // Exercise, Verify + sut.handleChange(manager, metadata, signalType); + } + + @Test + public void testHandleChangeDelete() { + // Fixture + final SignalType signalType = SignalType.DELETE; + + final ItemType itemType = new ItemType(); + itemType.setId(1); + MetadataElement metadataElement = new MetadataElement(); + metadataElement.setName("Metadata"); + final Metadata metadata = new Metadata(); + metadata.setItemTypeId(itemType.getId()); + metadata.setMetadataElement(metadataElement); + itemType.appendMetadata(metadata); + + context.checking(new Expectations() {{ + one (manager).retrieveCached(ItemType.class, metadata.getItemTypeId()); will(returnValue(itemType)); + one (manager).storeCached(itemType.getId(), itemType); + one (manager).signal(itemType.getId(), SignalType.UPDATE, StaticTables.ITEMTYPE); + }}); + + + // Exercise, Verify + sut.handleChange(manager, metadata, signalType); + } + + @Test + public void testHandleChangeUpdate() { + // Fixture + final SignalType signalType = SignalType.UPDATE; + + final ItemType itemType = new ItemType(); + itemType.setId(1); + MetadataElement metadataElement = new MetadataElement(); + metadataElement.setName("Metadata"); + final Metadata metadata = new Metadata(); + metadata.setItemTypeId(itemType.getId()); + metadata.setMetadataElement(metadataElement); + itemType.appendMetadata(metadata); + + context.checking(new Expectations() {{ + one (manager).retrieveCached(ItemType.class, metadata.getItemTypeId()); will(returnValue(itemType)); + one (manager).storeCached(itemType.getId(), itemType); + one (manager).signal(itemType.getId(), SignalType.UPDATE, StaticTables.ITEMTYPE); + }}); + + + // Exercise, Verify + sut.handleChange(manager, metadata, signalType); + } + + @Test + public void testIsInterestred() { + // Fixture + IEntityBase entity = new Metadata(); + + // Exercise + boolean result = sut.isInterested(entity); + + // Verify + assertTrue(result); + } + + @Test + public void testIsInterestredNull() { + // Exercise + boolean result = sut.isInterested(null); + + // Verify + assertFalse(result); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataElementChangeHandler.java b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataElementChangeHandler.java new file mode 100644 index 00000000..746b9242 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataElementChangeHandler.java @@ -0,0 +1,88 @@ +package user.jobengine.changehandler; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.jmock.Expectations; +import org.jmock.Mockery; +import org.jmock.integration.junit4.JMock; +import org.jmock.integration.junit4.JUnit4Mockery; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; +import user.jobengine.db.MetadataElement; + +@RunWith(JMock.class) +public class TestMetadataElementChangeHandler { + static public Mockery context = null; + static private IChangeHandler sut = null; + static private IItemManager manager = null; + + @BeforeClass + static public void startup() { + context = new JUnit4Mockery(); + sut = new MetadataElementChangeHandler(); + manager = context.mock(IItemManager.class); + } + + + @Test + public void testHandleChangeUpdate() { + // Fixture + final SignalType signalType = SignalType.UPDATE; + + final ItemType itemType = new ItemType(); + itemType.setId(1); + MetadataElement metadataElement = new MetadataElement(); + metadataElement.setName("Metadata"); + metadataElement.setId(2); + final Metadata metadata = new Metadata(); + metadata.setItemTypeId(itemType.getId()); + metadata.setMetadataElement(metadataElement); + itemType.appendMetadata(metadata); + final List itemTypes = new ArrayList(); + itemTypes.add(itemType); + + context.checking(new Expectations() {{ + one (manager).getAllCached(ItemType.class); will(returnValue(itemTypes)); + one (manager).storeCached(itemType.getId(), itemType); + one (manager).signal(itemType.getId(), SignalType.UPDATE, StaticTables.ITEMTYPE); + }}); + + + // Exercise, Verify + sut.handleChange(manager, metadataElement, signalType); + } + + @Test + public void testIsInterestred() { + // Fixture + IEntityBase entity = new MetadataElement(); + + // Exercise + boolean result = sut.isInterested(entity); + + // Verify + assertTrue(result); + } + + @Test + public void testIsInterestredNull() { + // Exercise + boolean result = sut.isInterested(null); + + // Verify + assertFalse(result); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataTypeChangeHandler.java b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataTypeChangeHandler.java new file mode 100644 index 00000000..199777ff --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/changehandler/TestMetadataTypeChangeHandler.java @@ -0,0 +1,96 @@ +package user.jobengine.changehandler; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.jmock.Expectations; +import org.jmock.Mockery; +import org.jmock.integration.junit4.JMock; +import org.jmock.integration.junit4.JUnit4Mockery; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + +import user.commons.IEntityBase; +import user.jobengine.db.IItemManager; +import user.jobengine.db.ItemManagerData.SignalType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemType; +import user.jobengine.db.Metadata; +import user.jobengine.db.MetadataElement; +import user.jobengine.db.MetadataType; + +@RunWith(JMock.class) +public class TestMetadataTypeChangeHandler { + static public Mockery context = null; + static private IChangeHandler sut = null; + static private IItemManager manager = null; + + @BeforeClass + static public void startup() { + context = new JUnit4Mockery(); + sut = new MetadataTypeChangeHandler(); + manager = context.mock(IItemManager.class); + } + + + @Test + public void testHandleChangeUpdate() { + // Fixture + final SignalType signalType = SignalType.UPDATE; + final ItemType itemType = new ItemType(); + final Metadata metadata = new Metadata(); + final MetadataElement metadataElement = new MetadataElement(); + final MetadataType metadataType = new MetadataType(); + final List itemTypes = new ArrayList(); + + itemType.setId(1); + + metadataType.setId(3); + + metadataElement.setName("Metadata"); + metadataElement.setId(2); + metadataElement.setMetadataType(metadataType); + + metadata.setItemTypeId(itemType.getId()); + metadata.setMetadataElement(metadataElement); + + itemType.appendMetadata(metadata); + itemTypes.add(itemType); + + context.checking(new Expectations() {{ + one (manager).getAllCached(ItemType.class); will(returnValue(itemTypes)); + one (manager).storeCached(itemType.getId(), itemType); + one (manager).signal(itemType.getId(), SignalType.UPDATE, StaticTables.ITEMTYPE); + }}); + + + // Exercise, Verify + sut.handleChange(manager, metadataType, signalType); + } + + @Test + public void testIsInterestred() { + // Fixture + IEntityBase entity = new MetadataType(); + + // Exercise + boolean result = sut.isInterested(entity); + + // Verify + assertTrue(result); + } + + @Test + public void testIsInterestredNull() { + // Exercise + boolean result = sut.isInterested(null); + + // Verify + assertFalse(result); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestBase.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestBase.java new file mode 100644 index 00000000..b9c67494 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestBase.java @@ -0,0 +1,57 @@ +package user.jobengine.db; + +import org.junit.AfterClass; +import org.junit.BeforeClass; + +import user.commons.logging.LogUtils; + +public class TestBase { + protected static IItemManager manager = null; + + @BeforeClass + static public void setUpConnection() { + // System.setProperty(ItemManager.DBURL, + // "jdbc:db2://localhost:50000/je:retrieveMessagesFromServerOnGetMessage=true;"); + // System.setProperty(ItemManager.DBUSERNAME, "db2admin"); + // System.setProperty(ItemManager.DBPASSWORD, "Danken74"); + // System.setProperty(LogUtils.LOGLEVEL, "DEBUG"); + // + // System.setProperty(ItemManager.DBURL, + // "jdbc:db2://localhost:50000/MF:retrieveMessagesFromServerOnGetMessage=true;"); + // System.setProperty(ItemManager.DBUSERNAME, "jobengine"); + // System.setProperty(ItemManager.DBPASSWORD, "DaGus201"); + // System.setProperty(LogUtils.LOGLEVEL, "DEBUG"); + + // System.setProperty(ItemManager.DBURL, + // "jdbc:db2://jobengine.useribm.hu:50000/MF:retrieveMessagesFromServerOnGetMessage=true;"); + // System.setProperty(ItemManager.DBUSERNAME, "db2admin"); + // System.setProperty(ItemManager.DBPASSWORD, "D0urdenDrizzt"); + // System.setProperty(LogUtils.LOGLEVEL, "TRACE"); + + // System.setProperty(ItemManager.DBURL, + // "jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;"); + // System.setProperty(ItemManager.DBUSERNAME, "db2admin"); + // System.setProperty(ItemManager.DBPASSWORD, "password"); + // System.setProperty(LogUtils.LOGLEVEL, "INFO"); + + System.setProperty(ItemManager.DBURL, + "jdbc:db2://10.10.1.26:50000/mc:retrieveMessagesFromServerOnGetMessage=true;"); + System.setProperty(ItemManager.DBUSERNAME, "db2admin"); + System.setProperty(ItemManager.DBPASSWORD, "password"); + System.setProperty(LogUtils.LOGLEVEL, "INFO"); + // System.setProperty(ItemManager.DBURL, + // "jdbc:db2://localhost:50000/je:retrieveMessagesFromServerOnGetMessage=true;"); + // System.setProperty(ItemManager.DBUSERNAME, "jobengine"); + // System.setProperty(ItemManager.DBPASSWORD, "DaGus201"); + // System.setProperty(LogUtils.LOGLEVEL, "DEBUG"); + + manager = new ItemManager(); + manager.connect(); + } + + @AfterClass + static public void tearDownConnection() { + manager.disconnect(); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestDomainCategory.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestDomainCategory.java new file mode 100644 index 00000000..af29f0be --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestDomainCategory.java @@ -0,0 +1,121 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import org.junit.Before; +import org.junit.Test; + +public class TestDomainCategory extends TestBase { + + @Before + public void cleanup() { + manager.truncate(); +// HelperDAO.foreignKeysOff(); +// manager.truncate(Domain.class); +// manager.truncate(DomainCategory.class); +// HelperDAO.foreignKeysOn(); + } + + @Test + public void testCreate() { + // Fixture + DomainCategory sut = new DomainCategory(); + sut.setName("DomainCategory1"); + + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + } + + @Test + public void testRead() { + // Fixture + DomainCategory sut = new DomainCategory(); + sut.setName("DomainCategory1"); + sut.add(); + + // Exercise + DomainCategory actual = (DomainCategory) manager.get(DomainCategory.class, sut.getId()); + + // Verify + assertEquals(actual.getId(), sut.getId()); + assertEquals(actual.getName(), sut.getName()); + } + + @Test + public void testUpdate() { + // Fixture + DomainCategory sut = new DomainCategory(); + sut.setName("DomainCategory1"); + sut.add(); + sut.setName("DomainCategory2"); + + // Exercise + sut.modify(); + DomainCategory actual = (DomainCategory) manager.get(DomainCategory.class, sut.getId()); + + // Verify + assertEquals(actual.getName(), sut.getName()); + } + + @Test + public void testDelete() { + // Fixture + DomainCategory sut = new DomainCategory(); + sut.setName("DomainCategory1"); + sut.add(); + long id = sut.getId(); + + // Exercise + sut.remove(); + + // Verify + DomainCategory result = (DomainCategory) manager.get(DomainCategory.class, id); + assertNull(result); + } + + @Test + public void testAddMissingDomainCategory() { + // Fixture + DomainCategoryDAO dao = (DomainCategoryDAO) manager.getBaseDAO(DomainCategory.class); + + // Exercise + DomainCategory sut = dao.addMissing("DomainCategory1"); + + // Verify + DomainCategory actual = dao.addMissing("DomainCategory1"); + assertEquals(sut.getId(), actual.getId()); + } + + + @Test + public void testAddDomain() { + // Fixture + DomainCategory sut = new DomainCategory(); + sut.setName("DomainCategory1"); + String expectedDisplay = "Domain1"; + long expectedValue = 1; + sut.addDomain(expectedDisplay, expectedValue); + + // Exercise + sut.add(); + + // Verify + DomainCategory actual = (DomainCategory) manager.get(DomainCategory.class, sut.getId()); + List domains = actual.getDomains(); + + assertNotNull(domains); + assertEquals(1, domains.size()); + + Domain domain = domains.get(0); + assertEquals(expectedDisplay, domain.getDisplay()); + assertEquals(expectedValue, domain.getValue()); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestFileType.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestFileType.java new file mode 100644 index 00000000..5b6b33fe --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestFileType.java @@ -0,0 +1,60 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TestFileType { + private static IItemManager itemManager = new ItemManager(); + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + @Test + public void testCreate() { + //Létrehozás, paraméter ellenõrzés. + FileType filetypeLowres = itemManager.createFileType("Lowres", "Streamable low-res video, 512Kbps", "WMVA", "WMA", 1, 1, 25); + assertEquals("Lowres", filetypeLowres.getName()); + assertEquals("Streamable low-res video, 512Kbps", filetypeLowres.getDescription()); + assertEquals("WMVA", filetypeLowres.getVideoCodec()); + assertEquals("WMA", filetypeLowres.getAudioCodec()); + assertEquals(1, filetypeLowres.getVideoTracks()); + assertEquals(1, filetypeLowres.getAudioTracks()); + assertEquals(25, filetypeLowres.getFrameRate(), 0); + filetypeLowres.add(); + } + + @Test(expected=NullPointerException.class) + public void testCreateNullName() { + //Null paraméter. + itemManager.createFileType(null, "Streamable low-res video, 512Kbps", "WMVA", "WMA", 1, 1, 25); + } + + @Test(expected=NullPointerException.class) + public void testCreateNullVideocodec() { + //Null paraméter. + itemManager.createFileType("Lowres", "Streamable low-res video, 512Kbps", null, "WMA", 1, 1, 25); + } + + @Test(expected=NullPointerException.class) + public void testCreateNullAudiocodec() { + //Null paraméter. + itemManager.createFileType("Lowres", "Streamable low-res video, 512Kbps", "WMVA", null, 1, 1, 25); + } + + @Test(expected=IllegalArgumentException.class) + public void testCreateZeroFrameRate() { + //0 paraméter. + itemManager.createFileType("Lowres", "Streamable low-res video, 512Kbps", "WMVA", "WMA", 1, 1, 0); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestFolder.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestFolder.java new file mode 100644 index 00000000..c0af16fe --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestFolder.java @@ -0,0 +1,45 @@ +package user.jobengine.db; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TestFolder { + private static IItemManager itemManager = new ItemManager(); + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + //Test + public void testCreate() { + Item item = itemManager.createItem("Film", "Sorozatok", "Sorozatok tároló mappája", null); + item.setIsFolder(true); + item.add(); + + Item i = (Item) itemManager.get(Item.class, 1165861); + i.setFolderId(item.getId()); + i.modify(); + } + + //@Test + public void testCreateSub() { + Item i = (Item) itemManager.get(Item.class, 1165861); + Item item = itemManager.createItem("Film", "Stargate Atlantis", "A Stargate CSK-1 utódsorozata.", null); + item.setIsFolder(true); + item.setFolderId(i.getId()); + item.add(); + + } + + @Test + public void testGetFolders() { + //List folders = itemManager.getFolders(); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItem.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItem.java new file mode 100644 index 00000000..f858e915 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItem.java @@ -0,0 +1,412 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.sql.Timestamp; +import java.util.Arrays; +import java.util.Calendar; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.Test; + +import sqlj.runtime.ref.DefaultContext; +import user.commons.CalendarUtils; +import user.commons.IEntityBase; +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.data.TestDB; + +public class TestItem extends TestBase { + + @BeforeClass + public static void initialize() { + // TestDB.createStructure(); + // TestDB.createItemTypes(); + if (manager.getStaticItemType() == null) + TestDB.createStaticItemTypes(); + if (manager.getItemType("Generic") == null) + manager.createItemType("Generic", "Generic").add(); + + if (manager.getStore("TSM") == null) { + Store tsmStore = manager.createStore("TSM", true, false); + StoreUri tsmStoreUri = manager.createStoreUri(RemoteStoreProtocol.TSM, "MEDIACUBE"); + tsmStoreUri.setSource(true); + tsmStoreUri.setTarget(true); + tsmStoreUri.setUserName("mediacube"); + tsmStoreUri.setPassword("password"); + tsmStore.appendStoreUri(tsmStoreUri); + tsmStore.add(); + } + if (manager.getFileType("High-res") == null) { + FileType fileType = manager.createFileType("High-res", "High resolution material", "MPEG Video", "PCM", 1, + 8, 25); + fileType.add(); + } + if (manager.getFileType("Low-res") == null) { + FileType fileType = manager.createFileType("Low-res", "Low resolution material", "MPEG-4", "AAC", 1, 4, 25); + fileType.add(); + } + + // if (manager.getStore("Local video") == null) { + // Store store = manager.createStore("Local video", false, false); + // StoreUri storeUri = manager.createStoreUri(RemoteStoreProtocol.HTTP, "localhost/lowres/"); + // store.appendStoreUri(storeUri); + // store.add(); + // } + // if (manager.getFileType("Lowres") == null) { + // FileType fileType = manager.createFileType("Lowres", "Streamable low-res video, 512Kbps", "WMVA", "WMA", 1, + // 1, 25); + // fileType.add(); + // } + + } + + @Test + public void testMergeItemStructure_NewItem() { + Item item = manager.createItem("Generic", "Ötödik elem", "Scifi", ""); + Media media = manager.createMedia("Generic", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + MediaFile mf = manager.createMediaFile("low.wmv", manager.getFileType("Low-res"), manager.getStore("TSM"), + media); + media.appendMediaFile(mf); + // Exercise + manager.mergeItemStructure(item); + assertTrue(item.getId() > 0); + assertTrue(item.getMedias().get(0).getId() > 0); + assertTrue(item.getMedias().get(0).getMediaFiles().get(0).getId() > 0); + } + + @Test + public void testMergeItemStructure_NewMedia() { + Item item = manager.createItem("Generic", "Ötödik elem", "Scifi", ""); + item.add(); + + Media media = manager.createMedia("Generic", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + MediaFile mf = manager.createMediaFile("low.wmv", manager.getFileType("Low-res"), manager.getStore("TSM"), + media); + media.appendMediaFile(mf); + // Exercise + manager.mergeItemStructure(item); + assertTrue(item.getId() > 0); + assertTrue(item.getMedias().get(0).getId() > 0); + assertTrue(item.getMedias().get(0).getMediaFiles().get(0).getId() > 0); + } + + @Test + public void testMergeItemStructure_NewMediaFile() { + Item item = manager.createItem("Generic", "Ötödik elem", "Scifi", ""); + + Media media = manager.createMedia("Generic", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + + MediaFile mf = manager.createMediaFile("low.wmv", manager.getFileType("Low-res"), manager.getStore("TSM"), + media); + media.appendMediaFile(mf); + // Exercise + manager.mergeItemStructure(item); + assertTrue(item.getId() > 0); + assertTrue(item.getMedias().get(0).getId() > 0); + assertTrue(item.getMedias().get(0).getMediaFiles().get(0).getId() > 0); + } + + @Test + public void testCreateWorkflowActions_and_search() { + // manager.truncate(WorkflowAction.class); + // String[] tags = { "INGEST", "ARCHIVE", "TRANSCODE" }; + // for (int i = 0; i < 1000; i++) { + // Calendar touched = Calendar.getInstance(); + // Calendar started = Calendar.getInstance(); + // Calendar finished = Calendar.getInstance(); + // finished.add(Calendar.HOUR_OF_DAY, 1); + // String houseId = "house" + i % 10; + // WorkflowAction item = manager.createWorkflowAction(new Timestamp(touched.getTimeInMillis()), + // new Timestamp(started.getTimeInMillis()), new Timestamp(finished.getTimeInMillis()), true, houseId, + // houseId, houseId, houseId, tags[i % 3], 1000); + // item.add(); + // System.out.println("Created " + i + " id: " + item.getId()); + // } + // + WorkflowActionDAO dao = (WorkflowActionDAO) manager.getBaseDAO(WorkflowAction.class); + + Calendar begin = CalendarUtils.createZeroCalendar(); + Calendar end = CalendarUtils.createZeroCalendar(); + end.add(Calendar.DAY_OF_YEAR, 1); + List workflowActions = dao.getWorkflowActions(new Timestamp(begin.getTimeInMillis()), + new Timestamp(end.getTimeInMillis())); + assertEquals(1000, workflowActions.size()); + } + + @Test + public void testCreateManyFull() { + // manager.truncate(); + + for (int i = 0; i < 1000; i++) { + Item item = manager.createItem("Generic", "Ötödik elem " + i, "Scifi", i + ""); + item.add(); + + Media media = manager.createMedia("Generic", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + + MediaFile mf = manager.createMediaFile("low.wmv", manager.getFileType("Lowres"), + manager.getStore("Local video"), media); + mf.add(); + + System.out.println("Item created: " + i); + } + } + + @Test + public void testCreateFull() { + // manager.truncate(); + Item item = manager.createItem("Generic", "Ötödik elem", "Scifi", ""); + item.add(); + + Media media = manager.createMedia("Generic", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + + MediaFile mf = manager.createMediaFile("low.wmv", manager.getFileType("Lowres"), + manager.getStore("Local video"), media); + mf.add(); + } + + @Test + public void testCreateManyAndSearch() { + + if (manager.getStaticItemType() == null) + TestDB.createStaticItemTypes(); + + for (int i = 0; i < 1000; i++) { + Item sut = manager.createItem("Default", "Hatodik elem" + i, "Scifi", i + ""); + sut.add(); + assertTrue(sut.getId() > 0); + System.out.println("Item created: " + i); + } + + SearchResult search = manager.searchItem("elem", 0, 9); + assertEquals(10, search.getItemCount()); + + for (Item item : search.getItems()) { + System.out.println(item.getTitle()); + } + } + + @Test + public void testSearch() { + SearchResult search = manager.searchItem("elem", 10, 20); + assertEquals(1000, search.getItemCount()); + assertEquals(10, search.getItems().size()); + + for (Item item : search.getItems()) { + System.out.println(item.getTitle()); + } + } + + @Test + public void testCreate() { + // Fixture + Item sut = manager.createItem("Adásanyag light", "Ötödik elem", "Scifi", null); + + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + } + + @Test + public void testRemove() { + // Fixture + Item sut = null; + sut = manager.createItem("Film", "Nyolcadik kör ami törölhető", "Scifi", null); + sut.setAttribute("Főszereplő", "Kovocs Géza"); + sut.setAttribute("Gyártás éve", 2001); + sut.setAttribute("Szinkron", "Hajda Ákos"); + sut.add(); + + // Exercise + sut.remove(); + + // Verify + Item actual = (Item) manager.get(Item.class, sut.getId()); + assertNull(actual); + } + + @Test + public void testSetAttribute() { + // Fixture + Item sut = manager.createItem("Film", "Ötödik elem", "Scifi", null); + + // Exercise + sut.setAttribute("Főszereplő", "Kalapács Miklós"); + + // Verify + assertEquals("Kalapács Miklós", sut.getAttribute("Főszereplő")); + } + + @Test + public void testSetAttributeWithWrongType() { + // L�tez� dinamikus attrib�tum rossz adatttal val� felt�lt�se. + // Fixture + Item item = manager.createItem("Film", "Ötödik elem", "Scifi", null); + + // Exercise + item.setAttribute("F�szerepl�", 10); + + // Verify + assertNull(item.getAttribute("F�szerepl�")); + } + + @Test + public void testCreateWithAttribute() { + // L�trehoz�s, dinamikus attrib�tummal. + // Fixture + Item sut = manager.createItem("Film", "Hatodik érzék", "Scifi", null); + String value1 = "Kalapács Miklós"; + String value2 = "Hagyó Zsuzsanna"; + int value3 = 2000; + + sut.setAttribute("Főszereplő", value1); + sut.setAttribute("Szinkron", value2); + sut.setAttribute("Gyártás éve", value3); + + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + + Item actual = (Item) manager.get(Item.class, sut.getId()); + assertEquals(value1, actual.getAttribute("Főpszereplő")); + assertEquals(value2, actual.getAttribute("Szinkron")); + assertEquals(value3, actual.getAttribute("Gyártás éve")); + } + + @Test(expected = ItemManagerException.class) + public void testCreateWithUniqueAttribute() { + // L�trehoz�s, unique dinamikus attrib�tummal. + // Az els� besz�r�s sikeres, a m�sodik nem, mert a mez� UNIQUE + // Fixture + Item sut = null; + sut = manager.createItem("Adásanyag", "Nyolcadik kör", "Scifi", null); + sut.setAttribute("Kameraállás", "bal"); + sut.setAttribute("Csatorna", 3); + sut.add(); + + sut = manager.createItem("Adásanyag", "Kilencedik ház", "Scifi", null); + sut.setAttribute("Kameraállás", "bal"); + sut.setAttribute("Csatorna", 3); + + // Exercise, Verify + sut.add(); + } + + @Test + @SuppressWarnings("unchecked") + public void testCreateWithDomainAttribute() { + // Fixture + Item sut = null; + sut = manager.createItem("Domain", "Domain teszt record", "Scifi", null); + sut.setAttribute("Szereplők", + Arrays.asList(new Domain("Kovács Gizi"), new Domain("Szekér Ivett"), new Domain("Hanka Barbara"))); + + // Exercise + sut.add(); + + // Verify + List domains = (List) sut.getAttribute("Szereplők"); + + assertNotNull(domains); + assertEquals(3, domains.size()); + for (Domain d : domains) { + assertTrue(d.getId() > 0); + assertTrue(d.getDomainCategoryId() > 0); + } + } + + @Test + @SuppressWarnings("unchecked") + public void testReadWithDomainAttribute() { + // Fixture + Item item = null; + item = manager.createItem("Domain", "Domain teszt record", "Scifi", null); + item.setAttribute("Szereplők", + Arrays.asList(new Domain("Kovács Gizi"), new Domain("Szekér Ivett"), new Domain("Hanka Barbara"))); + item.add(); + + // Exercise + Item sut = (Item) manager.get(Item.class, item.getId()); + + // Verify + assertNotNull(sut); + List domains = (List) item.getAttribute("Szereplők"); + assertNotNull(domains); + assertEquals(3, domains.size()); + } + + @Test + public void testRemoveWithDomainAttribute() throws Exception { + // Fixture + Item sut = null; + sut = manager.createItem("Domain", "Domain teszt record", "Scifi", null); + sut.setAttribute("Szereplők", + Arrays.asList(new Domain("Kovács Gizi"), new Domain("Szekér Ivett"), new Domain("Hanka Barbara"))); + sut.add(); + + // Exercise + sut.remove(); + + // Verify + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + DefaultContext context = null; + List expected = null; + + // context = manager.getDbContext(); + // expected = dao.getAll(context, sut); + // manager.putDbContext(context); + assertNull(expected); + } + + @Test + public void testUpdateWithDomainAttribute() throws Exception { + // Fixture + Item sut = null; + sut = manager.createItem("Domain", "Domain teszt record", "Scifi", null); + sut.setAttribute("Szereplők", + Arrays.asList(new Domain("Kovács Gizi"), new Domain("Szekér Ivett"), new Domain("Hanka Barbara"))); + sut.add(); + + // Exercise + sut.setAttribute("Szerepl�k", null); + sut.modify(); + + // Verify + DomainDAO dao = (DomainDAO) manager.getBaseDAO(Domain.class); + DefaultContext context = null; + List expected = null; + // context = manager.getDbContext(); + // expected = dao.getAll(context, sut); + // manager.putDbContext(context); + assertNull(expected); + } + + @Test + public void testSearchItem_byHouseID() { + + //TestDB.createStaticItemTypes(); + // Fixture + // Exercise + Item result = manager.getItemByHouseID("11111"); + + // Verify + assertNotNull(result); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItemManager.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItemManager.java new file mode 100644 index 00000000..5a688073 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItemManager.java @@ -0,0 +1,109 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.Arrays; +import java.util.List; + +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.BaseType; +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.ItemManagerData.FilterValueLogic; +import user.jobengine.db.ItemManagerData.GuiType; +import user.jobengine.db.ItemManagerData.ListType; +import user.jobengine.db.ItemManagerData.MdType; +import user.jobengine.db.ItemManagerData.OrderDirection; +import user.jobengine.db.ItemManagerData.StaticTables; + +public class TestItemManager extends TestBase { + + @BeforeClass + public static void initializie() { + // manager.truncate(); + } + + @Test + public void testCreateStore() { + // Fixture + // Exercise + String name = "Store1"; + Store store = manager.createStore(name, true, true); + + // Verify + assertEquals(name, store.getName()); + assertEquals(true, store.isSystem()); + assertEquals(true, store.isLowres()); + } + + @Test + public void testGetSystemStore() { + // Fixture + Store expected = manager.createStore("Store1", true, false); + StoreUri uri = manager.createStoreUri(RemoteStoreProtocol.LOCAL, + "c:/temp", 0, false, true, false, null, null, null); + expected.appendStoreUri(uri); + expected.add(); + + // Exercise + Store store = manager.getSystemStore(false); + + // Verify + assertEquals(expected.getId(), store.getId()); + } + + @Test + public void testGetSystemStore_Lowres() { + // Fixture + Store expected = manager.createStore("Store1", true, true); + StoreUri uri = manager.createStoreUri(RemoteStoreProtocol.LOCAL, + "c:/temp", 0, false, true, false, null, null, null); + expected.appendStoreUri(uri); + expected.add(); + + // Exercise + Store store = manager.getSystemStore(true); + + // Verify + assertEquals(expected.getId(), store.getId()); + } + + @Test + public void testSearchItem_Folders() { + // Fixture + ItemType itemType = manager.getStaticItemType(); + Metadata orderMetadata = itemType.getMetadata("Anyag cím"); + + RenderParameter parameters = new RenderParameter(); + parameters.setOrderBy(orderMetadata); + parameters.setRowPerPage(100); + parameters.setOrderDirection(OrderDirection.ASC); + + MetadataType mdt = manager.createMetadataType("big integer", + BaseType.BIGINT, "java.lang.Long", "BIGINT"); + MetadataElement mde = manager.createMetadataElement("Folder ID", + "Mappa azonosító", mdt); + Metadata metadata = manager.createMetadata(mde, ListType.LABEL, + GuiType.LABEL, "PARENTID", StaticTables.FOLDER, "parentId", + MdType.SEARCH); + + SearchFilter filter = new SearchFilter(); + filter.setMetadata(metadata); + filter.setValueLogic(FilterValueLogic.EQUALS); + filter.setValues(Arrays.asList((Object) 441)); + + QueryObject qo = new QueryObject(); + qo.setParameters(parameters); + qo.setFilters(Arrays.asList(filter)); + + // Exercise + List result = manager.searchItem(qo); + + // Verify + assertNotNull(result); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItemType.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItemType.java new file mode 100644 index 00000000..8f27e2c4 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestItemType.java @@ -0,0 +1,84 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import user.commons.BaseType; + +public class TestItemType { + private static IItemManager itemManager = new ItemManager(); + private static MetadataType mdt = null; + private static MetadataElement mde1 = null; + private static MetadataElement mde2 = null; + private static Metadata md1 = null; + private static Metadata md2 = null; + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + mdt = itemManager.createMetadataType("string100", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 100); + mdt.add(); + mde1 = itemManager.createMetadataElement("Ország", "A gyártó ország", mdt); + mde1.add(); + mde2 = itemManager.createMetadataElement("Város", "?", mdt); + mde2.add(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + @Test + public void testCreate() { + //Létrehozás, paraméter ellenõrzés. + md1 = itemManager.createMetadata(mde1); + ItemType it = itemManager.createItemType("Itemtype1", "Itemtype1 description"); + assertEquals("Itemtype1", it.getName()); + assertEquals("Itemtype1 description", it.getDescription()); + it.appendMetadata(md1); + it.add(); + + ItemType it1 = (ItemType) ItemManager.getInstance().retrieveCached(ItemType.class, it.getId()); + + assertNotNull(it1); + assertEquals(it1.getId(), it.getId()); + assertEquals(it1.getName(), it.getName()); + assertEquals(it1.getDescription(), it.getDescription()); + } + + @Test(expected = IllegalStateException.class) + public void testCreateWithNoMetadata() { + //Létrehozás kapcsolódó tartalom nélkül. + ItemType itemType = itemManager.createItemType("Itemtype1", "Itemtype1 description"); + itemType.add(); + } + + @Test(expected = NullPointerException.class) + public void testCreateWithNullName() { + //Null paraméter. + itemManager.createItemType(null, "Itemtype1 description"); + } + + @Test(expected = NullPointerException.class) + public void testCreateWithNullDescription() { + //Null paraméter. + itemManager.createItemType("Itemtype1", null); + } + + @Test + public void testRemove() { + //Törlés. + md1 = itemManager.createMetadata(mde1); + md2 = itemManager.createMetadata(mde2); + ItemType itemType = itemManager.createItemType("Itemtype4", "Itemtype4 description"); + itemType.appendMetadata(md1); + itemType.appendMetadata(md2); + itemType.add(); + itemType.remove(); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestJob.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestJob.java new file mode 100644 index 00000000..6a3b8d8e --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestJob.java @@ -0,0 +1,129 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.sql.Timestamp; +import java.util.Date; + +import org.junit.Before; +import org.junit.Test; + +import user.commons.Job; +import user.commons.JobStatus; + +public class TestJob extends TestBase { + Job sut; + String name; + String template; + String description; + String owner; + int priority; + int progress; + JobStatus status; + Timestamp submitted; + Timestamp finished; + + + @Before + public void initialize() { + manager.truncate(Job.class); + + name = "Name"; + template = "Template"; + priority = 2; + progress = 50; + description = "Description"; + owner = "Owner"; + status = JobStatus.RUNABLE; + finished = new Timestamp((new Date()).getTime()); + submitted = new Timestamp((new Date()).getTime()); + + sut = new Job(); + sut.setPersister(manager); + set(sut); + } + + private void set(Job entity) { + sut.setName(name); + sut.setTemplate(template); + sut.setDescription(description); + sut.setOwner(owner); + sut.setPriority(priority); + sut.setProgress(progress); + sut.setStatus(status); + sut.setFinished(finished); + sut.setSubmitted(submitted); + } + + private void check(Job entity) { + assertNotNull(entity); + assertEquals(name, entity.getName()); + assertEquals(template, entity.getTemplate()); + assertEquals(owner, entity.getOwner()); + assertEquals(priority, entity.getPriority()); + assertEquals(progress, entity.getProgress()); + assertEquals(description, entity.getDescription()); + assertEquals(status, entity.getStatus()); + assertEquals(finished, entity.getFinished()); + assertEquals(submitted, entity.getSubmitted()); + } + + @Test + public void testCreate() { + // Fixture + // Exercise + // Verify + check(sut); + } + + @Test + public void testAdd() { + // Fixture + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + check(sut); + } + + @Test + public void testGet() { + // Fixture + sut.add(); + // Exercise + Job entity = (Job) manager.get(Job.class, sut.getId()); + // Verify + check(entity); + } + + @Test + public void testModify() { + // Fixture + sut.add(); + + name = "Name1"; + template = "Template1"; + priority = 3; + progress = 51; + description = "Description1"; + owner = "Owner1"; + status = JobStatus.EXECUTING; + finished = new Timestamp((new Date()).getTime()); + submitted = new Timestamp((new Date()).getTime()); + + set(sut); + + // Exercise + sut.modify(); + + Job entity = (Job) manager.get(Job.class, sut.getId()); + + // Verify + assertTrue(sut.getId() > 0); + check(entity); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestJobParameters.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestJobParameters.java new file mode 100644 index 00000000..605058c1 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestJobParameters.java @@ -0,0 +1,62 @@ +package user.jobengine.db; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.LinkedHashMap; +import java.util.Map; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class TestJobParameters extends TestBase { + private static final Logger logger = LogManager.getLogger(); + JobParameters sut; + byte[] data; + + @Before + public void initialize() { + sut = new JobParameters(); + sut.setPersister(manager); + } + + @SuppressWarnings("unchecked") + @Test + public void testCreate() { + // Fixture + Map result = null; + LinkedHashMap map = new LinkedHashMap(); + map.put("teszt", 1000); + ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); + ObjectOutputStream out; + try { + out = new ObjectOutputStream(byteOut); + out.writeObject(map); + byte[] convertedData = byteOut.toByteArray(); + sut.setId(1); + sut.setData(convertedData); + manager.add(sut); + } catch (Exception e) { + logger.info(e.getMessage()); + } + JobParameters jobParameters = (JobParameters) manager.get(JobParameters.class, sut.getId()); + ByteArrayInputStream byteIn = new ByteArrayInputStream(jobParameters.getData()); + ObjectInputStream in; + try { + in = new ObjectInputStream(byteIn); + result = (Map) in.readObject(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + // Exercise + // Verify + Assert.assertNotNull(result); + Assert.assertEquals(map, result); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMedia.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMedia.java new file mode 100644 index 00000000..f6c13628 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMedia.java @@ -0,0 +1,87 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.jobengine.db.data.TestDB; + +public class TestMedia { + private static IItemManager itemManager = new ItemManager(); + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + TestDB.createStructure(); + TestDB.createItemTypes(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + @Test + public void testCreate() { + // Létrehozás, paraméter ellenõrzés. + Item item = itemManager.createItem("Film", "Ötödik elem", "Scifi", null); + Media media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + assertEquals(1, item.getMedias().size()); + } + + @Test + public void testsetAttribute() { + // Dinamikus attribútum ellenõrzés. + Media media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + media.setAttribute("Kameraállás", "Kamera1"); + assertEquals("Kamera1", media.getAttribute("Kameraállás")); + } + + @Test(expected = IllegalArgumentException.class) + public void testSetNonExistingAttribute() { + // Nem létezõ dinamikus attribútum beállítása. + Media media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + media.setAttribute("Rendezõ", "Kalapács Miklós"); + } + + @Test(expected = ItemManagerException.class) + public void testsetAttributeWithWrongType() { + // Létezõ dinamikus attribútum rossz adatttal való feltöltése. + Media media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + media.setAttribute("Kameraállás", 10); + } + + @Test + public void testCreateWithAttribute() { + // Létrehozás, dinamikus attribútummal. + Item item = itemManager.createItem("Film", "Ötödik elem", "Scifi", null); + Media media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + media.setAttribute("Kameraállás", "bal"); + media.setAttribute("Csatorna", 10); + item.appendMedia(media); + item.add(); + } + + @Test(expected = ItemManagerException.class) + public void testCreateWithUniqueAttribute() { + // Létrehozás, unique dinamikus attribútummal. + // Az elsõ beszúrás sikeres, a második nem, mert a Szinkron mezõ UNIQUE + Item item = null; + item = itemManager.createItem("Film", "Nyolcadik kör", "Scifi", null); + Media media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + media.setAttribute("Kameraállás", "jobb"); + media.setAttribute("Csatorna", 10); + item.appendMedia(media); + media = itemManager.createMedia("Adásanyag", "Média2", "Nagyon frankó kis mozi.", null); + media.setAttribute("Kameraállás", "jobb"); + media.setAttribute("Csatorna", 10); + item.appendMedia(media); + item.add(); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMediaFile.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMediaFile.java new file mode 100644 index 00000000..d98473f3 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMediaFile.java @@ -0,0 +1,76 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.data.TestDB; + +public class TestMediaFile { + private static IItemManager itemManager = new ItemManager(); + + static private Store store = null; + static private FileType fileTypeLowres = null; + static private FileType fileTypeHighres = null; + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + TestDB.createStructure(); + TestDB.createItemTypes(); + + store = itemManager.createStore("Local video", false, false); + StoreUri storeUri = null; + storeUri = itemManager.createStoreUri(RemoteStoreProtocol.HTTP, "elgekko-pc/lowres/"); + storeUri = itemManager.createStoreUri(RemoteStoreProtocol.LOCAL, "elgekko-pc/c$/_movie/lowres/"); + store.appendStoreUri(storeUri); + store.add(); + + fileTypeLowres = itemManager.createFileType("Lowres", "Streamable low-res video, 512Kbps", "WMVA", "WMA", 1, 1, 25); + fileTypeLowres.add(); + fileTypeHighres = itemManager.createFileType("Highres", "Broadcast high-res video, 50Mbps", "MXF", "MXF", 1, 1, 25); + fileTypeHighres.add(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + @Test + public void testCreate() { + // Létrehozás, paraméter ellenõrzés. + Item item = itemManager.createItem("Film", "Hastánc oktató 1", "Ez egy full rekord teszt.", null); + Media media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + + MediaFile mf = itemManager.createMediaFile("low.wmv", fileTypeLowres, store, media); + assertEquals("low.wmv", mf.getRelativePath()); + assertEquals(store, mf.getStore()); + assertEquals(media, mf.getMedia()); + mf.add(); + } + + @Test + public void testModify() { + // Módosítás. + Item item = itemManager.createItem("Film", "Hastánc oktató 2", "Ez egy full rekord teszt.", null); + Media media = itemManager.createMedia("Adásanyag", "Média2", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + + MediaFile mf = itemManager.createMediaFile("low.wmv", fileTypeLowres, store, media); + assertEquals("low.wmv", mf.getRelativePath()); + assertEquals(store, mf.getStore()); + assertEquals(media, mf.getMedia()); + mf.add(); + mf.setRelativePath("valami/valami.wmv"); + mf.modify(); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMemoryCache.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMemoryCache.java new file mode 100644 index 00000000..1ed7e12d --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMemoryCache.java @@ -0,0 +1,177 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.lang.ref.SoftReference; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.junit.Before; +import org.junit.Test; + +import user.commons.EntityBase; +import user.commons.IEntityBase; + +public class TestMemoryCache extends TestBase { + private MemoryCache sut = null; + + @Before + public void initialize() { + sut = new MemoryCache(); + sut.setItemManager(manager); + } + + @Test + public void testStore() { + // Fixture + IEntityBase entity = new EntityBase(); + long id = 1; + entity.setId(id); + + // Exercise + boolean success = sut.storeCached(id, entity); + + // Verify + assertTrue(success); + Map> cache = sut.getCache(EntityBase.class); + assertNotNull(cache); + assertEquals(1, cache.size()); + assertEquals(entity, cache.get(id).get()); + } + + @Test + public void testRetrieve() { + // Fixture + IEntityBase expected = new EntityBase(); + long id = 1; + expected.setId(id); + sut.storeCached(id, expected); + + // Exercise + IEntityBase entity = sut.retrieveCached(EntityBase.class, id); + + // Verify + assertEquals(expected, entity); + } + + @Test + public void testRetrieveGarbaged() { + // Fixture + manager.truncate(); + IEntityBase itemType = manager.createItemType("ItemType1", "ItemType2"); + itemType.add(); + long id = itemType.getId(); + sut.storeCached(id, itemType); + sut.garbageCached(itemType.getClass(), id); + + // Exercise + IEntityBase entity = sut.retrieveCached(itemType.getClass(), id); + + // Verify + assertEquals(id, entity.getId()); + } + + @Test + public void testRemove() { + // Fixture + IEntityBase expected = new EntityBase(); + long id = 1; + expected.setId(id); + sut.storeCached(id, expected); + + // Exercise + sut.removeCached(expected.getClass(), id); + + // Verify + IEntityBase entity = sut.retrieveCached(EntityBase.class, id); + assertNull(entity); + } + + @Test + public void testClear() { + // Fixture + IEntityBase expected = new EntityBase(); + long id = 1; + expected.setId(id); + sut.storeCached(id, expected); + + // Exercise + sut.clearCached(EntityBase.class); + + // Verify + IEntityBase entity = sut.retrieveCached(EntityBase.class, id); + assertNull(entity); + } + + @Test + public void testClearAll() { + // Fixture + IEntityBase expected = new EntityBase(); + long id = 1; + expected.setId(id); + sut.storeCached(id, expected); + + // Exercise + sut.clearAllCached(); + + // Verify + IEntityBase entity = sut.retrieveCached(EntityBase.class, id); + assertNull(entity); + } + + @Test + public void testDisable() { + // Fixture + IEntityBase expected = new EntityBase(); + long id = 1; + expected.setId(id); + sut.storeCached(id, expected); + + // Exercise + sut.disableCache(); + + // Verify + IEntityBase entity = sut.retrieveCached(EntityBase.class, id); + assertNull(entity); + } + + @Test + public void testSet() { + // Fixture + IEntityBase expected = new EntityBase(); + long id = 1; + expected.setId(id); + List list = new ArrayList(); + list.add(expected); + + // Exercise + boolean success = sut.setAllCached(EntityBase.class, list); + + // Verify + assertTrue(success); + IEntityBase entity = sut.retrieveCached(EntityBase.class, id); + assertEquals(expected, entity); + } + + @Test + public void testGetAll() { + // Fixture + IEntityBase expected = new EntityBase(); + long id = 1; + expected.setId(id); + List list = new ArrayList(); + list.add(expected); + sut.setAllCached(EntityBase.class, list); + + // Exercise + List result = sut.getAllCached(EntityBase.class); + + // Verify + assertNotNull(result); + assertEquals(1, result.size()); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadata.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadata.java new file mode 100644 index 00000000..3a91301c --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadata.java @@ -0,0 +1,40 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.BaseType; + +public class TestMetadata extends TestBase { + private static MetadataType mdt = null; + private static MetadataElement mde = null; + + @Before + public void cleanup() { + HelperDAO.foreignKeysOff(); + manager.truncate(Metadata.class); + manager.truncate(MetadataElement.class); + manager.truncate(MetadataType.class); + HelperDAO.foreignKeysOn(); + } + + @BeforeClass + public static void initializie() { + mdt = manager.createMetadataType("string100", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 100); + mdt.add(); + mde = manager.createMetadataElement("Vágó", "A mûsor vágója", mdt); + mde.add(); + } + + @Test + public void testCreate() { + //Létrehozás, paraméter ellenõrzés. + Metadata metadata = manager.createMetadata(mde); + assertEquals(false, metadata.getIsDbIndex()); + assertEquals(false, metadata.getIsDbUnique()); + assertEquals(false, metadata.getIsDbNullable()); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadataElement.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadataElement.java new file mode 100644 index 00000000..e3a766f9 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadataElement.java @@ -0,0 +1,76 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.BaseType; + +public class TestMetadataElement { + private static IItemManager itemManager = new ItemManager(); + private static MetadataType mdt = null; + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + mdt = itemManager.createMetadataType("string100", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 100); + mdt.add(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + @Test + public void testCreate() { + //Létrehozás, paraméter ellenõrzés. + MetadataElement mde = itemManager.createMetadataElement("Ország", "A gyártó ország", mdt); + assertEquals("Ország", mde.getName()); + assertEquals("A gyártó ország", mde.getDescription()); + assertEquals(mdt.getId(), mde.getMetadataTypeId()); + mde.add(); + } + + @Test + public void testModify() { + //Módosítás. + MetadataElement mde = itemManager.createMetadataElement("Ország2", "A gyártó ország2", mdt); + mde.add(); + + mdt = itemManager.createMetadataType("string101", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 101); + mdt.add(); + mde.setName("Város"); + mde.setDescription("Comment"); + mde.setMetadataType(mdt); + mde.modify(); + + MetadataElement mde1 = itemManager.getMetadataElement(mde.getId()); + assertEquals("Város", mde1.getName()); + assertEquals("Comment", mde1.getDescription()); + assertEquals(mdt.getId(), mde1.getMetadataTypeId()); + } + + @Test(expected = NullPointerException.class) + public void testCreateWithNullMetadataType() { + //Null paraméter. + itemManager.createMetadataElement("Ország", "A gyártó ország", null); + } + + @Test(expected = NullPointerException.class) + public void testCreateWithNullName() { + //Null paraméter. + itemManager.createMetadataElement(null, "A gyártó ország", mdt); + } + + @Test + public void testRemove() { + //Törlés. + MetadataElement mde = itemManager.createMetadataElement("Ország1", "A gyártó ország1", mdt); + mde.add(); + mde.remove(); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadataType.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadataType.java new file mode 100644 index 00000000..edcdd6de --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestMetadataType.java @@ -0,0 +1,89 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.BaseType; + +public class TestMetadataType { + private static IItemManager itemManager = new ItemManager(); + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + + @Test + public void testCreate() { + //Létrehozás, paraméter elenõrzés. + MetadataType mdt = itemManager.createMetadataType("string100", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 100); + assertEquals("string100", mdt.getName()); + assertEquals(BaseType.VARCHAR, mdt.getDataType()); + assertEquals(100, mdt.getLength()); + mdt.add(); + } + + @Test + public void testCreate_Existing() { + MetadataType mdt1 = itemManager.createMetadataType("teszt", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 100); + mdt1.add(); + MetadataType mdt2 = itemManager.createMetadataType("teszt", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 100); + mdt2.add(); + + assertEquals(mdt1.getId(), mdt2.getId()); + } + + @Test + public void testModify() { + //Módosítás. + MetadataType mdt = itemManager.createMetadataType("string101", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 101); + mdt.add(); + + mdt.setName("bigint"); + mdt.setType(BaseType.BIGINT, 0); + mdt.modify(); + + MetadataType mdt1 = itemManager.getMetadataType(mdt.getId()); + assertNotNull(mdt1); + assertEquals("bigint", mdt1.getName()); + assertEquals(BaseType.BIGINT, mdt1.getDataType()); + assertEquals(0, mdt1.getLength()); + } + + @Test(expected = ItemManagerException.class) + public void testCreateWithInvalidConstructor1() { + //Hibás konstruktor: a hossz nincs megadva. + itemManager.createMetadataType("string100", BaseType.VARCHAR, "java.lang.String", "VARCHAR"); + } + + @Test(expected = ItemManagerException.class) + public void testCreateWithInvalidConstructor2() { + //Hibás konstruktor: a hossz meg van adva, pedig nem kell. + itemManager.createMetadataType("bigint", BaseType.BIGINT, "java.lang.Long", "BIGINT", 1); + } + + @Test(expected = NullPointerException.class) + public void testCreateWithNullName() { + //Null paraméter. + itemManager.createMetadataType(null, BaseType.VARCHAR, null, null, 100); + } + + @Test + public void testRemove() { + //Törlés. + MetadataType mdt = itemManager.createMetadataType("string90", BaseType.VARCHAR, "java.lang.String", "VARCHAR", 90); + mdt.add(); + mdt.remove(); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestScene.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestScene.java new file mode 100644 index 00000000..7ce73ed0 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestScene.java @@ -0,0 +1,103 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TestScene extends TestBase { +// private static Item item = null; +// private static Media media = null; +// private static Shot shot1 = null; +// private static Shot shot2 = null; + private static String name; + private Scene sut; + +// @BeforeClass +// public static void setUpConnection() { +// itemManager.connect(); +// itemManager.truncate(); +// TestDB.createStructure(); +// TestDB.createItemTypes(); +// item = itemManager.createItem("Film", "Ötödik elem", "Scifi", null); +// media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); +// item.appendMedia(media); +// item.add(); +// shot1 = itemManager.createShot("Leírás1", 1000L, 1001L, media); +// shot1.add(); +// shot2 = itemManager.createShot("Leírás2", 1003L, 1004L, media); +// shot2.add(); +// } + + @BeforeClass + public static void initialize() { + name = "Scene"; + } + + @Before + public void cleanup() { + HelperDAO.foreignKeysOff(); + manager.truncate(Scene.class); + HelperDAO.foreignKeysOn(); + sut = manager.createScene(name); + } + + @Test + public void testAdd() { + // Fixture + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + assertEquals(name, sut.getName()); + } + +// @Test +// public void testCreate() { +// //Létrehozása, paraméter ellenõrzés. +// Scene scene = manager.createScene("Vágólista"); +// assertEquals("Vágólista", scene.getName()); +// SceneContent sceneContent = manager.createSceneContent(shot1); +// scene.appendSceneContent(sceneContent); +// scene.add(); +// } + +// @Test(expected=NullPointerException.class) +// public void testCreateWithNullName() { +// //Null paraméter. +// manager.createScene(null); +// } +// +// @Test(expected=IllegalStateException.class) +// public void testCreateWithoutContent() { +// //Tartalom nélkül. +// Scene scene = manager.createScene("Vágólista"); +// scene.add(); +// } + +// @Test +// public void testRemove() { +// //Törlése a kapcsolódó tartalommal együtt. +// Scene scene = manager.createScene("Vágólista1"); +// SceneContent sceneContent = manager.createSceneContent(shot2); +// scene.appendSceneContent(sceneContent); +// scene.add(); +// scene.remove(); +// } + + @Test + public void testRemove() { + // Fixture + sut.add(); + + // Exercise + sut.remove(); + + // Verify + Scene store = (Scene) manager.get(Scene.class, sut.getId()); + assertEquals(null, store); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestSceneContent.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestSceneContent.java new file mode 100644 index 00000000..47a6ca14 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestSceneContent.java @@ -0,0 +1,50 @@ +package user.jobengine.db; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.jobengine.db.data.TestDB; + +public class TestSceneContent { + private static IItemManager itemManager = new ItemManager(); + private static Item item = null; + private static Media media = null; + private static Shot shot = null; + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + TestDB.createStructure(); + TestDB.createItemTypes(); + + item = itemManager.createItem("Film", "Ötödik elem", "Scifi", null); + media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + shot = itemManager.createShot("Leírás1", 1000L, 1001L, 1, null); + shot.add(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + @Test(expected=NullPointerException.class) + public void testCreateWithNullShot() { + //Null paraméter. + itemManager.createSceneContent(null, 0, 0); + } + + @Test(expected=ItemManagerException.class) + public void testRemove() { + //Törlés. Direktben nem hívható. + Scene scene = itemManager.createScene("Vágólista1"); + SceneContent sceneContent = itemManager.createSceneContent(shot, 1, 1); + scene.appendSceneContent(sceneContent); + scene.add(); + sceneContent.remove(); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestShot.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestShot.java new file mode 100644 index 00000000..dedf38c3 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestShot.java @@ -0,0 +1,66 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.jobengine.db.data.TestDB; + +public class TestShot { + private static IItemManager itemManager = new ItemManager(); + private static Item item = null; + private static Media media = null; + + @BeforeClass + public static void setUpConnection() { + itemManager.connect(); + itemManager.truncate(); + TestDB.createStructure(); + TestDB.createItemTypes(); + item = itemManager.createItem("Film", "Ötödik elem", "Scifi", null); + media = itemManager.createMedia("Adásanyag", "Média1", "Nagyon frankó kis mozi.", null); + item.appendMedia(media); + item.add(); + } + + @AfterClass + public static void tearDownConnection() { + itemManager.disconnect(); + } + + @Test + public void testCreate() { + //Létrehozása, paraméter ellenõrzés. + Shot shot = itemManager.createShot("Leírás", 1000L, 1001L, 1, new byte[1]); + assertEquals("Leírás", shot.getDescription()); + assertEquals(1000L, shot.getInPoint()); + assertEquals(1001L, shot.getOutPoint()); + shot.add(); + } + + @Test(expected=NullPointerException.class) + public void testCreateWithNullDescription() { + //Null paraméter. + itemManager.createShot(null, 1000L, 1001L, 1, new byte[1]); + } + + @Test(expected=NullPointerException.class) + public void testCreateWithNullMedia() { + //Null paraméter. + itemManager.createShot("Leírás", 1000L, 1001L, 1, new byte[1]); + } + + @Test(expected=IllegalArgumentException.class) + public void testCreateWithZeroOut() { + //0 paraméter. + itemManager.createShot("Leírás", 1000L, 0, 1, new byte[1]); + } + + @Test(expected=ItemManagerException.class) + public void testCreateWithWrongInOut() { + //Inkonzisztens paraméter. + itemManager.createShot("Leírás", 1001L, 1000L, 1, new byte[1]); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestStore.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestStore.java new file mode 100644 index 00000000..16c65dd1 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestStore.java @@ -0,0 +1,127 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; + +public class TestStore extends TestBase { + private Store sut; + private StoreUri storeUri1; + private StoreUri storeUri2; + private static boolean isSystem; + private static boolean isLowres; + private static String name; + private static String uri1; + private static String uri2; + + @BeforeClass + public static void initializie() { + name = "Store1"; + uri1 = "elgekko-pc/lowres/"; + uri2 = "elgekko-pc/lowres/"; + isSystem = true; + isLowres = true; + } + + @Before + public void cleanup() { + HelperDAO.foreignKeysOff(); + manager.truncate(StoreUri.class); + manager.truncate(Store.class); + HelperDAO.foreignKeysOn(); + sut = manager.createStore(name, isSystem, isLowres); + storeUri1 = manager.createStoreUri(RemoteStoreProtocol.HTTP, uri1); + storeUri2 = manager.createStoreUri(RemoteStoreProtocol.FTP, uri2); + } + + @Test + public void testAdd() { + // Fixture + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + assertEquals(name, sut.getName()); + assertEquals(isSystem, sut.isSystem()); + assertEquals(isLowres, sut.isLowres()); + } + + @Test + public void testAdd_WithUri() { + // Fixture + sut.appendStoreUri(storeUri1); + sut.appendStoreUri(storeUri2); + + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + assertEquals(2, sut.getStoreUris().size()); + } + + @Test + public void testGet() { + // Fixture + sut.add(); + + // Exercise + Store store = (Store) manager.get(Store.class, sut.getId()); + + // Verify + assertEquals(store.getId(), sut.getId()); + assertEquals(store.getName(), sut.getName()); + assertEquals(isSystem, sut.isSystem()); + assertEquals(isLowres, sut.isLowres()); + } + + @Test + public void testGet_WithUri() { + // Fixture + sut.appendStoreUri(storeUri1); + sut.appendStoreUri(storeUri2); + sut.add(); + + // Exercise + Store store = (Store) manager.get(Store.class, sut.getId()); + + // Verify + assertEquals(2, store.getStoreUris().size()); + } + + @Test + public void testRemove() { + // Fixture + sut.add(); + + // Exercise + sut.remove(); + + // Verify + Store store = (Store) manager.get(Store.class, sut.getId()); + assertEquals(null, store); + } + + @Test + public void testRemove_WithUri() { + // Fixture + sut.appendStoreUri(storeUri1); + sut.appendStoreUri(storeUri2); + sut.add(); + + // Exercise + sut.remove(); + + // Verify + Store store = (Store) manager.get(Store.class, sut.getId()); + assertEquals(null, store); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestStoreUri.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestStoreUri.java new file mode 100644 index 00000000..d1b312e4 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestStoreUri.java @@ -0,0 +1,36 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; + +public class TestStoreUri { + private static IItemManager itemManager = new ItemManager(); + + @BeforeClass + public static void setUpConnection() { + } + + @AfterClass + public static void tearDownConnection() { + } + + @Test + public void testCreate() { + // Paraméter ellenõrzés. + StoreUri storeUri = itemManager.createStoreUri(RemoteStoreProtocol.HTTP, "elgekko-pc/lowres/"); + assertEquals("http://elgekko-pc/lowres/", storeUri.toString()); + assertEquals(true, storeUri.isStream()); + } + + @Test(expected = NullPointerException.class) + public void testCreateWithNullUri() { + // Null paraméter. + itemManager.createStoreUri(null, null); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestUpdate.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestUpdate.java new file mode 100644 index 00000000..4ff2dd89 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestUpdate.java @@ -0,0 +1,28 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; + +import java.sql.Timestamp; +import java.util.Date; + +import org.junit.Test; + +public class TestUpdate extends TestBase { + + @Test + public void testUpdate() { + // Fixture + Media media = manager.getMedia(6); + media.setPersister(manager); + + Timestamp expected = new Timestamp(new Date().getTime()); + media.setArchived(expected); + + // Exercise + media.modify(); + + // Verify + Media current = manager.getMedia(6); + assertEquals(expected, current.getArchived()); + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/TestUserInfo.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestUserInfo.java new file mode 100644 index 00000000..2657aaba --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/TestUserInfo.java @@ -0,0 +1,101 @@ +package user.jobengine.db; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import org.junit.Before; +import org.junit.Test; + +import user.jobengine.db.ItemManagerData.UserRight; + +public class TestUserInfo extends TestBase { + UserInfo sut; + String fullName; + String userName; + String password; + UserRight[] rights; + String fullName1; + String userName1; + String password1; + UserRight[] rights1; + + @Before + public void initialize() { + manager.truncate(UserInfo.class); + + fullName = "Gipsz Jakab"; + userName = "admin"; + password = "pwd"; + rights = new UserRight[]{ UserRight.ADMINISTRATOR }; + + fullName1 = "Gipsz Jakab1"; + userName1 = "admin1"; + password1 = "pwd1"; + rights1 = new UserRight[]{ UserRight.READWRITE }; + + // Exercise + sut = manager.createUser(fullName, userName, password, rights); + } + + private void check(UserInfo sut) { + assertNotNull(sut); + assertEquals(fullName, sut.getFullName()); + assertEquals(userName, sut.getUserName()); + assertEquals(password, sut.getPassword()); + assertEquals(true, sut.hasRight(rights[0])); + } + + @Test + public void testCreate() { + // Fixture + // Exercise + // Verify + check(sut); + } + + @Test + public void testAdd() { + // Fixture + // Exercise + sut.add(); + + // Verify + assertTrue(sut.getId() > 0); + check(sut); + } + + @Test + public void testGet() { + // Fixture + sut.add(); + // Exercise + UserInfo user = (UserInfo) manager.get(UserInfo.class, sut.getId()); + // Verify + check(user); + } + + @Test + public void testModify() { + // Fixture + sut.add(); + sut.setFullName(fullName1); + sut.setUserName(userName1); + sut.setPassword(password1); + sut.setRights(rights1[0].getValue()); + + // Exercise + sut.modify(); + + UserInfo user = (UserInfo) manager.get(UserInfo.class, sut.getId()); + + // Verify + assertNotNull(user); + assertTrue(user.getId() > 0); + assertEquals(fullName1, user.getFullName()); + assertEquals(userName1, user.getUserName()); + assertEquals(password1, user.getPassword()); + assertEquals(true, user.hasRight(rights1[0])); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/data/GenericList.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/data/GenericList.java new file mode 100644 index 00000000..b332f96d --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/data/GenericList.java @@ -0,0 +1,14 @@ +package user.jobengine.db.data; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class GenericList { + + static public List asList(T... items) { + List result = new ArrayList(Arrays.asList(items)); + return result; + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/data/TestDB.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/data/TestDB.java new file mode 100644 index 00000000..8d8ccaf6 --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/data/TestDB.java @@ -0,0 +1,495 @@ +package user.jobengine.db.data; + +import java.sql.Timestamp; +import java.util.List; +import java.util.Random; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.BaseType; +import user.commons.StoreUri; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.Domain; +import user.jobengine.db.Domains; +import user.jobengine.db.FileType; +import user.jobengine.db.IItemManager; +import user.jobengine.db.Item; +import user.jobengine.db.ItemManager; +import user.jobengine.db.ItemManagerData.GuiType; +import user.jobengine.db.ItemManagerData.ListType; +import user.jobengine.db.ItemManagerData.MdType; +import user.jobengine.db.ItemManagerData.StaticTables; +import user.jobengine.db.ItemManagerException; +import user.jobengine.db.ItemType; +import user.jobengine.db.Media; +import user.jobengine.db.MediaFile; +import user.jobengine.db.Metadata; +import user.jobengine.db.MetadataElement; +import user.jobengine.db.MetadataType; +import user.jobengine.db.Store; + +/** + * Test segédfüggvények + */ +public class TestDB { + private static IItemManager itemManager = ItemManager.getInstance(); + private static MetadataElement element1 = null; + private static MetadataElement element2 = null; + private static MetadataElement element3 = null; + private static MetadataElement element4 = null; + private static MetadataElement element5 = null; + private static MetadataElement element6 = null; + private static MetadataElement element7 = null; + private static MetadataElement element8 = null; + private static MetadataElement element9 = null; + private static MetadataElement element10 = null; + private static MetadataElement element11 = null; + private static MetadataElement element12 = null; + + private static final Logger logger = LogManager.getLogger(); + + public static void createStructure() throws ItemManagerException { + // Alap stuktúra elemek létrehozása. + MetadataType metadataType1 = itemManager.createMetadataType("string100", BaseType.VARCHAR, "java.lang.String", + "VARCHAR", 100); + MetadataType metadataType2 = itemManager.createMetadataType("string20", BaseType.VARCHAR, "java.lang.String", + "VARCHAR", 20); + MetadataType metadataType3 = itemManager.createMetadataType("integer", BaseType.INT, "java.lang.Integer", + "INT"); + MetadataType metadataType4 = itemManager.createMetadataType("datetime", BaseType.DATETIME, "java.sql.Timestamp", + "TIMESTAMP"); + MetadataType metadataType5 = itemManager.createMetadataType("big integer", BaseType.BIGINT, "java.lang.Long", + "BIGINT"); + MetadataType metadataType6 = itemManager.createMetadataType("boolean", BaseType.BOOL, "java.lang.String", + "CHARACTER", 1); + MetadataType metadataType7 = itemManager.createMetadataType("domainlist", BaseType.DOMAIN, + "user.jobengine.db.Domains", ""); + MetadataType metadataType8 = itemManager.createMetadataType("double", BaseType.DOUBLE, "java.util.Double", + "DOUBLE"); + + metadataType1.add(); + metadataType2.add(); + metadataType3.add(); + metadataType4.add(); + metadataType5.add(); + metadataType6.add(); + metadataType7.add(); + metadataType8.add(); + + element1 = itemManager.createMetadataElement("Főszereplő", "A film főszereplője", metadataType1); + element2 = itemManager.createMetadataElement("Szinkron", "A főszereplő magyar hangja", metadataType1); + element3 = itemManager.createMetadataElement("Gyártó ország", "A film készítője", metadataType2); + element4 = itemManager.createMetadataElement("Gyártás éve", "A gyártás éve", metadataType3); + element5 = itemManager.createMetadataElement("Készítés dátuma", "A készítés dátuma", metadataType4); + element6 = itemManager.createMetadataElement("Bevétel", "A vetítések nyeresége", metadataType8); + element7 = itemManager.createMetadataElement("Kameraállás", "A kamera azonosítója", metadataType2); + element8 = itemManager.createMetadataElement("Csatorna", "A kijátszandó csatorna", metadataType3); + element9 = itemManager.createMetadataElement("Kész", "Az anyag újravágása kész", metadataType6); + element10 = itemManager.createMetadataElement("Szereplők", "A műsor szereplői", metadataType7, true); + element11 = itemManager.createMetadataElement("Alkotók", "A műsor alkotói", metadataType7, true); + element12 = itemManager.createMetadataElement("Országok", "Országok", metadataType7, true); + element1.add(); + element2.add(); + element3.add(); + element4.add(); + element5.add(); + element6.add(); + element7.add(); + element8.add(); + element9.add(); + element10.add(); + element11.add(); + element12.add(); + } + + public static void createStaticItemTypes() { + ItemType itemType = itemManager.createItemType("Default", "Statikus mezők leírója"); + itemType.setIsStatic(true); + + MetadataType mdString255 = itemManager.createMetadataType("string255", BaseType.VARCHAR, "java.lang.String", + "VARCHAR", 255); + MetadataType mdString80 = itemManager.createMetadataType("string80", BaseType.VARCHAR, "java.lang.String", + "VARCHAR", 80); + MetadataType mdString40 = itemManager.createMetadataType("string40", BaseType.VARCHAR, "java.lang.String", + "VARCHAR", 40); + MetadataType mdBoolean = itemManager.createMetadataType("boolean1", BaseType.BOOL, "java.lang.Boolean", + "VARCHAR", 1); + MetadataType mdBigInt = itemManager.createMetadataType("biginteger", BaseType.BIGINT, "java.lang.Long", + "BIGINT"); + MetadataType mdDateTime = itemManager.createMetadataType("datetime1", BaseType.DATETIME, "java.sql.Timestamp", + "TIMESTAMP"); + mdString255.add(); + mdString80.add(); + mdString40.add(); + mdBoolean.add(); + mdBigInt.add(); + mdDateTime.add(); + + MetadataElement mdeItemFolder = itemManager.createMetadataElement("Mappa", "Mappa", mdBoolean); + MetadataElement mdeItemID = itemManager.createMetadataElement("Anyag ID", "Anyag azonosító", mdBigInt); + MetadataElement mdeItemTitle = itemManager.createMetadataElement("Anyag cím", "Anyag cím", mdString80); + MetadataElement mdeItemDescription = itemManager.createMetadataElement("Anyag leírás", "Anyag leírás", + mdString255); + MetadataElement mdeItemCreated = itemManager.createMetadataElement("Anyag létrehozva", "Anyag létrehozás ideje", + mdDateTime); + MetadataElement mdeItemHouseID = itemManager.createMetadataElement("Anyag house ID", "Anyag belső azonosító", + mdString40); + MetadataElement mdeMediaID = itemManager.createMetadataElement("Verzió ID", "Verzió azonosító", mdBigInt); + MetadataElement mdeMediaItemID = itemManager.createMetadataElement("Verzió anyag ID", "Verzió anyag azonosító", + mdBigInt); + MetadataElement mdeMediaTitle = itemManager.createMetadataElement("Verzió cím", "Verzió cím", mdString80); + MetadataElement mdeMediaDescription = itemManager.createMetadataElement("Verzió leírás", "Verzió leírás", + mdString255); + MetadataElement mdeMediaCreated = itemManager.createMetadataElement("Verzió létrehozva", + "Verzió létrehozás ideje", mdDateTime); + MetadataElement mdeMediaHouseID = itemManager.createMetadataElement("Verzió house ID", "Verzió belső azonosító", + mdString40); + MetadataElement mdeMediaLength = itemManager.createMetadataElement("Verzió hossz", "Verzió hossz", mdBigInt); + MetadataElement mdeMediaArchived = itemManager.createMetadataElement("Verzió archiválva", + "Verzió archiválás ideje", mdDateTime); + MetadataElement mdeParentFolder = itemManager.createMetadataElement("Szülő mappa", "Szülő mappa", mdBigInt); + + mdeItemFolder.add(); + mdeItemID.add(); + mdeItemTitle.add(); + mdeItemDescription.add(); + mdeItemCreated.add(); + mdeItemHouseID.add(); + mdeMediaID.add(); + mdeMediaItemID.add(); + mdeMediaTitle.add(); + mdeMediaDescription.add(); + mdeMediaCreated.add(); + mdeMediaHouseID.add(); + mdeMediaLength.add(); + mdeMediaArchived.add(); + mdeParentFolder.add(); + + Metadata mdItemFolder = itemManager.createMetadata(mdeItemFolder, ListType.FOLDERICON, GuiType.CHECKBOX, + "ISFOLDER", StaticTables.ITEM, "isFolder", MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.GENERATE, + MdType.SEARCH); + Metadata mdItemID = itemManager.createMetadata(mdeItemID, ListType.LABEL, GuiType.WHOLENUMBER, "ID", + StaticTables.ITEM, "id", MdType.UNIQUE, MdType.LIST, MdType.EDIT, MdType.GENERATE, MdType.SEARCH); + Metadata mdItemTitle = itemManager.createMetadata(mdeItemTitle, ListType.LABEL, GuiType.TEXTBOX, "TITLE", + StaticTables.ITEM, "title", MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.SEARCH); + Metadata mdItemDescription = itemManager.createMetadata(mdeItemDescription, ListType.WRAPPEDLABEL, + GuiType.MULTILINETEXTBOX, "DESCRIPTION", StaticTables.ITEM, "description", MdType.INDEX, MdType.LIST, + MdType.EDIT, MdType.SEARCH); + Metadata mdItemCreated = itemManager.createMetadata(mdeItemCreated, ListType.LABEL, GuiType.DATETIMEPICKER, + "CREATED", StaticTables.ITEM, "created", MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.GENERATE, + MdType.SEARCH); + Metadata mdItemHouseID = itemManager.createMetadata(mdeItemHouseID, ListType.LABEL, GuiType.TEXTBOX, "HOUSEID", + StaticTables.ITEM, "houseId", MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.SEARCH); + Metadata mdMediaID = itemManager.createMetadata(mdeMediaID, ListType.LABEL, GuiType.WHOLENUMBER, "ID", + StaticTables.MEDIA, "id", MdType.UNIQUE, MdType.LIST, MdType.EDIT, MdType.SEARCH); + Metadata mdMediaItemID = itemManager.createMetadata(mdeMediaItemID, ListType.LABEL, GuiType.LABEL, "ITEMID", + StaticTables.MEDIA, "itemId", MdType.INDEX, MdType.LIST, MdType.EDIT); + Metadata mdMediaTitle = itemManager.createMetadata(mdeMediaTitle, ListType.LABEL, GuiType.TEXTBOX, "TITLE", + StaticTables.MEDIA, "title", MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.SEARCH); + Metadata mdMediaDescription = itemManager.createMetadata(mdeMediaDescription, ListType.WRAPPEDLABEL, + GuiType.MULTILINETEXTBOX, "DESCRIPTION", StaticTables.MEDIA, "description", MdType.INDEX, MdType.LIST, + MdType.EDIT, MdType.SEARCH); + Metadata mdMediaCreated = itemManager.createMetadata(mdeMediaCreated, ListType.LABEL, GuiType.DATETIMEPICKER, + "CREATED", StaticTables.MEDIA, "created", MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.GENERATE, + MdType.SEARCH); + Metadata mdMediaHouseID = itemManager.createMetadata(mdeMediaHouseID, ListType.LABEL, GuiType.TEXTBOX, + "HOUSEID", StaticTables.MEDIA, "houseId", MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.SEARCH); + Metadata mdMediaLength = itemManager.createMetadata(mdeMediaLength, ListType.TIMECODE, GuiType.TIMECODE, + "LENGTH", StaticTables.MEDIA, "length", MdType.INDEX, MdType.LIST, MdType.EDIT); + Metadata mdMediaArchived = itemManager.createMetadata(mdeMediaArchived, ListType.LABEL, GuiType.LABEL, + "ARCHIVED", StaticTables.MEDIA, "archived", MdType.INDEX, MdType.LIST, MdType.NULL, MdType.SEARCH); + Metadata mdParentFolder = itemManager.createMetadata(mdeParentFolder, ListType.LABEL, GuiType.LABEL, "PARENTID", + StaticTables.FOLDER, "parentId", MdType.INDEX, MdType.LIST, MdType.EDIT); + + itemType.appendMetadata(mdItemFolder); + itemType.appendMetadata(mdItemID); + itemType.appendMetadata(mdItemTitle); + itemType.appendMetadata(mdItemDescription); + itemType.appendMetadata(mdItemCreated); + itemType.appendMetadata(mdItemHouseID); + itemType.appendMetadata(mdMediaID); + itemType.appendMetadata(mdMediaItemID); + itemType.appendMetadata(mdMediaTitle); + itemType.appendMetadata(mdMediaDescription); + itemType.appendMetadata(mdMediaCreated); + itemType.appendMetadata(mdMediaHouseID); + itemType.appendMetadata(mdMediaLength); + itemType.appendMetadata(mdMediaArchived); + itemType.appendMetadata(mdParentFolder); + + itemType.add(); + } + + public static void createItemTypes() { + // Alap struktúra elemekből ItemType létrehozása. + Metadata metadata = null; + ItemType itemType = null; + + // SqlIndexType indexType, boolean isDBNullable, boolean isEditable, + // GuiType guiType + + itemType = itemManager.createItemType("Film", "Film description"); + + metadata = itemManager.createMetadata(element1, MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element2, MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element3, MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.NULL, + MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element4, GuiType.WHOLENUMBER, MdType.INDEX, MdType.LIST, MdType.EDIT, + MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element5, GuiType.DATETIMEPICKER, MdType.INDEX, MdType.LIST, MdType.EDIT, + MdType.NULL, MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element6, GuiType.NUMBER, MdType.INDEX, MdType.LIST, MdType.EDIT, + MdType.NULL, MdType.SEARCH); + itemType.appendMetadata(metadata); + itemType.add(); + + itemType = itemManager.createItemType("Sorozat", "Sorozat description"); + metadata = itemManager.createMetadata(element1, MdType.INDEX, MdType.LIST, MdType.EDIT, MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element4, GuiType.WHOLENUMBER, MdType.INDEX, MdType.LIST, MdType.EDIT, + MdType.SEARCH); + itemType.appendMetadata(metadata); + itemType.add(); + + itemType = itemManager.createItemType("Adásanyag", "Közvetlenül adásba tehető anyag"); + metadata = itemManager.createMetadata(element7, MdType.UNIQUE, MdType.LIST, MdType.EDIT, MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element8, GuiType.WHOLENUMBER, MdType.INDEX, MdType.LIST, MdType.EDIT, + MdType.SEARCH); + itemType.appendMetadata(metadata); + itemType.add(); + + itemType = itemManager.createItemType("Adásanyag light", "Korhatáros sávokban adásba tehető változat."); + metadata = itemManager.createMetadata(element9, ListType.CHECKBOX, GuiType.CHECKBOX, MdType.NULL, MdType.LIST, + MdType.EDIT); + itemType.appendMetadata(metadata); + itemType.add(); + + itemType = itemManager.createItemType("Domain", "Domain"); + metadata = itemManager.createMetadata(element10, ListType.DOMAINLABEL, GuiType.DOMAINCOMBO, MdType.INDEX, + MdType.LIST, MdType.EDIT, MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element11, ListType.DOMAINLABEL, GuiType.DOMAINLOOKUP, MdType.INDEX, + MdType.LIST, MdType.EDIT, MdType.SEARCH); + itemType.appendMetadata(metadata); + metadata = itemManager.createMetadata(element12, ListType.DOMAINLABEL, GuiType.MULTIDOMAINLOOKUP, MdType.INDEX, + MdType.LIST, MdType.EDIT, MdType.SEARCH); + itemType.appendMetadata(metadata); + itemType.add(); + + } + + public static void createItems(IItemManager manager) { + // Fix darabszámú Item létrehozása a Media-val. + Item item = null; + Media media = null; + + item = itemManager.createItem("Film", "Ötödik elem", "Scifi", null); + item.setAttribute("Főszereplő", "Bruce Willis"); + item.setAttribute("Szinkron", "Ökrös József"); + item.setAttribute("Gyártó ország", "USA"); + item.setAttribute("Gyártás éve", 1989); + item.setAttribute("Készítés dátuma", Timestamp.valueOf("2000-01-02 16:30:00")); + item.setAttribute("Bevétel", 1567891L); + + media = itemManager.createMedia("Adásanyag", "Ötödik elem mester", "Mester anyag a gyártótól", null); + media.setAttribute("Kameraállás", "full közép"); + media.setAttribute("Csatorna", 1); + item.appendMedia(media); + + item.add(); + + item = itemManager.createItem("Film", "Ötödik sugárút", "Szocidráma", null); + item.setAttribute("Főszereplő", "John Wayne"); + item.setAttribute("Szinkron", "Szinkron Aisza1"); + item.setAttribute("Gyártás éve", 1971); + item.add(); + + item = itemManager.createItem("Film", "Ötödik Lenin", "Szocidráma", null); + item.setAttribute("Főszereplő", "Vlagyimir Iljics Lenin"); + item.setAttribute("Szinkron", "Szinkron Aisza2"); + item.setAttribute("Gyártás éve", 1960); + item.add(); + + item = itemManager.createItem("Film", "Tarzan", "Kalandmozi", null); + item.setAttribute("Főszereplő", "John Weismüller"); + item.setAttribute("Szinkron", "Szinkron Aisza3"); + item.setAttribute("Gyártás éve", 1960); + item.add(); + + item = itemManager.createItem("Film", "Hatodik érzék", "Scifi", null); + item.setAttribute("Főszereplő", "Bruce Willis"); + item.setAttribute("Szinkron", "Szinkron Aisza4"); + item.setAttribute("Gyártás éve", 1999); + item.add(); + + item = itemManager.createItem("Film", "Firefly", "Sorozat", null); + item.setAttribute("Főszereplő", "Frank Frank"); + item.setAttribute("Szinkron", "Szinkron Aisza5"); + item.setAttribute("Gyártás éve", 2002); + item.add(); + + item = itemManager.createItem("Film", "Hetedik szoba", "Scifi", null); + item.setAttribute("Főszereplő", "Mel Gibson"); + item.setAttribute("Szinkron", "Szinkron Aisza6"); + item.setAttribute("Gyártás éve", 2008); + item.add(); + + item = itemManager.createItem("Film", "Nyolcadik kör", "Scifi", null); + item.setAttribute("Főszereplő", "Mel Gibson"); + item.setAttribute("Szinkron", "Szinkron Aisza7"); + item.setAttribute("Gyártás éve", 2008); + item.add(); + + item = itemManager.createItem("Sorozat", "Ötödik elem x", "Scifi", null); + item.setAttribute("Főszereplő", "Bruce Willis"); + item.setAttribute("Gyártás éve", 1989); + item.add(); + + item = itemManager.createItem("Sorozat", "Ötödik sugárút x", "Szocidráma", null); + item.setAttribute("Főszereplő", "Mel Willis"); + item.setAttribute("Gyártás éve", 1971); + + media = itemManager.createMedia("Adásanyag", "Forgatott1", "Forgatott anyag leíró", null); + media.setAttribute("Kameraállás", "Bal közép"); + media.setAttribute("Csatorna", 1); + item.appendMedia(media); + + media = itemManager.createMedia("Adásanyag", "Forgatott2", "Forgatott anyag leíró", null); + media.setAttribute("Kameraállás", "Jobb közép"); + media.setAttribute("Csatorna", 2); + item.appendMedia(media); + + media = itemManager.createMedia("Adásanyag", "Forgatott3", "Forgatott anyag leíró", null); + media.setAttribute("Kameraállás", "Hátsó"); + media.setAttribute("Csatorna", 3); + item.appendMedia(media); + + item.add(); + } + + public static void createItems(int count) { + // Tetszőleges darabszámú Item létrehozása a kapcsolódó tartalmakkal. + Item item = null; + Media media1 = null; + Media media2 = null; + MediaFile fileLowres = null; + MediaFile fileHires = null; + + Store storeLow = itemManager.createStore("System (LOWRES)", true, true); + StoreUri storeUri = null; + storeUri = itemManager.createStoreUri(RemoteStoreProtocol.HTTP, "192.168.42.238", 8080, true, false, false, + null, null, null); + storeLow.appendStoreUri(storeUri); + storeUri = itemManager.createStoreUri(RemoteStoreProtocol.LOCAL, "\\jobengine.useribm.hu\\storage\\lowres\\", 0, + false, true, true, null, null, null); + storeLow.appendStoreUri(storeUri); + storeLow.add(); + + Store storeHigh = itemManager.createStore("System (HIRES)", true, false); + storeUri = itemManager.createStoreUri(RemoteStoreProtocol.LOCAL, "/db2data/apache-ftpserver-1.0.5/res/home", 0, + false, true, true, null, null, null); + storeHigh.appendStoreUri(storeUri); + storeHigh.add(); + + Store storeOmneon = itemManager.createStore("Omneon", false, false); + storeUri = itemManager.createStoreUri(RemoteStoreProtocol.FTP, "jobengine.useribm.hu", 21, false, true, false, + "anonymous", "password", null); + storeOmneon.appendStoreUri(storeUri); + storeOmneon.add(); + + FileType filetypeLowres = itemManager.createFileType("Lowres", "Streamable low-res video, 512Kbps", "WMVA", + "WMA", 1, 1, 25); + filetypeLowres.add(); + FileType filetypeHighres = itemManager.createFileType("Highres", "Broadcast high-res video, 50Mbps", "MXF", + "MXF", 1, 1, 25); + filetypeHighres.add(); + + List actors = GenericList.asList(new Domain("Kovács Gizi"), new Domain("Szekér Ivett"), + new Domain("Hanka Barbara")); + List creators = GenericList.asList(new Domain("Nyakas Gizi"), new Domain("Xenób Ivett"), + new Domain("Lukács I. Barbara"), new Domain("Tahitót Miklós"), new Domain("Gerely Imre"), + new Domain("Szekeres Albert"), new Domain("Szomszéd János"), new Domain("Néhai Elemér"), + new Domain("Kedves Rozália"), new Domain("Cserepes Virág"), new Domain("Harsány Ilona"), + new Domain("Halmaz Elmélet")); + List countries = GenericList.asList(new Domain("Magyarország"), new Domain("Lengyelország"), + new Domain("Németország"), new Domain("Hollandia"), new Domain("Irak"), new Domain("Irán"), + new Domain("Anglia"), new Domain("Üzbegisztán"), new Domain("Oroszország"), new Domain("Peru"), + new Domain("Mexikó"), new Domain("Ausztria"), new Domain("Dánia"), new Domain("Norvégia"), + new Domain("Szlovénia"), new Domain("Szlovákia")); + Random random = new Random(); + for (int i = 1; i < count + 1; i++) { + item = itemManager.createItem("Domain", "Domain teszt record " + i, "Scifi", "House" + i); + + item.setAttribute("Szereplők", + new Domains(GenericList.asList(actors.get(random.nextInt(actors.size() - 1))))); + item.setAttribute("Alkotók", + new Domains(GenericList.asList(creators.get(random.nextInt(creators.size() - 1))))); + item.setAttribute("Országok", + new Domains(GenericList.asList(countries.get(random.nextInt(countries.size() - 1)), + countries.get(random.nextInt(countries.size() - 1)), + countries.get(random.nextInt(countries.size() - 1)), + countries.get(random.nextInt(countries.size() - 1))))); + item.add(); + + item = itemManager.createItem("Film", "Film test item " + i, "Film test item description " + i, + "House" + i); + item.setAttribute("Főszereplő", "Szereplő " + i); + item.setAttribute("Szinkron", "Szinkron " + i); + item.setAttribute("Gyártás éve", i); + + media1 = itemManager.createMedia("Adásanyag", "Média cím" + i, "Forgatott anyag leíró", "House" + i + 100); + media1.setAttribute("Kameraállás", "Kamera" + i); + media1.setAttribute("Csatorna", i); + item.appendMedia(media1); + // item.add(); + + media2 = itemManager.createMedia("Adásanyag light", "Light Média cím" + i, "Újravágott anyag leíró", + "House" + i + 100); + media2.setAttribute("Kész", true); + item.appendMedia(media2); + item.add(); + + fileLowres = itemManager.createMediaFile("low" + (i % 9) + ".wmv", filetypeLowres, storeLow, media1); + fileLowres.add(); + fileHires = itemManager.createMediaFile("hires/high.mxf", filetypeHighres, storeHigh, media1); + fileHires.add(); + + fileLowres = itemManager.createMediaFile("low" + (8 - (i % 9)) + ".wmv", filetypeLowres, storeLow, media2); + fileLowres.add(); + fileHires = itemManager.createMediaFile("hires/high" + i + ".mxf", filetypeHighres, storeHigh, media2); + fileHires.add(); + + item = itemManager.createItem("Sorozat", "Sorozat test item " + i, "Sorozat test item description " + i, + "House" + i); + item.setAttribute("Főszereplő", "Sorozat Szereplő " + i); + item.setAttribute("Gyártás éve", 1000 + i); + + media1 = itemManager.createMedia("Adásanyag", "Média cím" + i, "Forgatott anyag leíró", "House" + i + 100); + media1.setAttribute("Kameraállás", "Sorozat kamera" + i); + media1.setAttribute("Csatorna", i); + item.appendMedia(media1); + item.add(); + + fileLowres = itemManager.createMediaFile("low.wmv", filetypeLowres, storeLow, media1); + fileLowres.add(); + fileHires = itemManager.createMediaFile("hires/high.mxf", filetypeHighres, storeHigh, media1); + fileHires.add(); + + fileLowres = null; + fileHires = null; + item = null; + media1 = null; + media2 = null; + + logger.info("Item " + i + " created"); + + } + } +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/db/data/TestItemDbData.java b/server/user.jobengine.osgi.db/test/user/jobengine/db/data/TestItemDbData.java new file mode 100644 index 00000000..316aa3dd --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/db/data/TestItemDbData.java @@ -0,0 +1,19 @@ +package user.jobengine.db.data; + +import org.junit.Test; + +import user.jobengine.db.TestBase; + + +public class TestItemDbData extends TestBase { + + @Test + public void testCreateSample() { + manager.truncate(); + TestDB.createStructure(); + TestDB.createItemTypes(); + TestDB.createStaticItemTypes(); + TestDB.createItems(1000); + } + +} diff --git a/server/user.jobengine.osgi.db/test/user/jobengine/nosql/TestConnectionPool.java b/server/user.jobengine.osgi.db/test/user/jobengine/nosql/TestConnectionPool.java new file mode 100644 index 00000000..cd50310b --- /dev/null +++ b/server/user.jobengine.osgi.db/test/user/jobengine/nosql/TestConnectionPool.java @@ -0,0 +1,161 @@ +package user.jobengine.nosql; + +import java.sql.Timestamp; +import java.util.Date; +import java.util.Set; + +import javax.lang.model.element.Element; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import com.ibm.nosql.json.api.BasicDBList; +import com.ibm.nosql.json.api.BasicDBObject; +import com.ibm.nosql.json.api.BasicDBObjectBuilder; +import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; +import com.ibm.nosql.json.api.DBCursor; +import com.ibm.nosql.json.api.DBObject; +import com.ibm.nosql.json.api.NoSQLClient; + +public class TestConnectionPool { + private static DB db; + + @BeforeClass + public static void beforeTest() { + db = NoSQLClient.getDB("jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;", + "db2admin", "password", "test"); + } + + @AfterClass + public static void afterTest() { + } + + @Test + public void testConcurrentBorrow() { + + DBCollection collection = db.getCollection("test2"); + + BasicDBObject dbObj = new BasicDBObject(); + dbObj.append("field1", "value1"); + BasicDBList dbList = new BasicDBList(new BasicDBObject("item1", "v1"), new BasicDBObject("item2", "v2")); + dbObj.append("field2", dbList); + + System.out.println(dbObj.size()); + Timestamp timestamp = new Timestamp(System.currentTimeMillis()); + BasicDBObject timeObject = new BasicDBObject(); + timeObject.append("insterTimeStamp", timestamp); + System.out.println(timeObject.toString()); + collection.insert(timeObject); + DBCursor find = collection.find(); + + while (find.hasNext()) { + try { + DBObject next = find.next(); + System.out.println(next); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + + find.close(); + } + + /*@Test + public void findTimeStampTest() { + DBCollection collection = db.getCollection("test2"); + DBCursor find = collection.find(); + + while (find.hasNext()) { + try { + BasicDBObject next = (BasicDBObject) find.next(); + Set keys= next.keySet(); + for (String string : keys) { + if(string.equals("")) + + } + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + }*/ + + @Test + public void findTest() { + DBCollection collection = db.getCollection("test2"); + BasicDBObject object = new BasicDBObject(); + BasicDBObject field2 = new BasicDBObject(); + field2.append("item2", "v2"); + BasicDBObject elemMatch = new BasicDBObject(); + elemMatch.append("$elemMatch", field2); + object.append("field2", elemMatch); + + BasicDBObject object2 = new BasicDBObject(); + BasicDBObject insertTimeStamp = new BasicDBObject(); + insertTimeStamp.append("$date", "2017-07-27T11:15:28.162Z"); + BasicDBObject elemMatch2 = new BasicDBObject(); + elemMatch2.append("$elemMatch", insertTimeStamp); + object2.append("insertTimeStamp", insertTimeStamp); + + BasicDBObject object3 = new BasicDBObject(); + object3.append("insertTimeStamp", insertTimeStamp); + + DBCursor find = collection.find(object2); + + + + while (find.hasNext()) { + try { + DBObject next = find.next(); + System.out.println(next); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + + find.close(); + } + + @Test + public void delete() { + DBCollection collection = db.getCollection("test2"); + DBCursor find = collection.find(); + + while (find.hasNext()) { + try { + DBObject next = find.next(); + collection.remove(next); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + + find.close(); + } + + @Test + public void queryWithPlaceHolder() { + final String placeHolderId = "18e649db-77de-4777-b552-6ad3807400a4"; + DBCollection collection = db.getCollection("test2"); + BasicDBObject object = new BasicDBObject(); + BasicDBObject story = new BasicDBObject(); + story.append("scriptXml", placeHolderId); + BasicDBList list = new BasicDBList(story); + // object.append("id", 44622396); + + object.append("Stories", list); + DBCursor find = collection.find(object); + + while (find.hasNext()) { + try { + DBObject next = find.next(); + System.out.println(next); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + } + + find.close(); + } +} diff --git a/server/user.jobengine.osgi.server/.classpath b/server/user.jobengine.osgi.server/.classpath new file mode 100644 index 00000000..21dfa925 --- /dev/null +++ b/server/user.jobengine.osgi.server/.classpath @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.server/.project b/server/user.jobengine.osgi.server/.project new file mode 100644 index 00000000..a4237ea6 --- /dev/null +++ b/server/user.jobengine.osgi.server/.project @@ -0,0 +1,33 @@ + + + user.jobengine.osgi.server + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.ds.core.builder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/server/user.jobengine.osgi.server/.settings/org.eclipse.core.resources.prefs b/server/user.jobengine.osgi.server/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..f05a3733 --- /dev/null +++ b/server/user.jobengine.osgi.server/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//pages/menu.zul=ISO-8859-2 +encoding//src/user/jobengine/server/JobRuntime.java=UTF-8 diff --git a/server/user.jobengine.osgi.server/.settings/org.eclipse.jdt.core.prefs b/server/user.jobengine.osgi.server/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..e13cc4eb --- /dev/null +++ b/server/user.jobengine.osgi.server/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate diff --git a/server/user.jobengine.osgi.server/.settings/org.eclipse.pde.core.prefs b/server/user.jobengine.osgi.server/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 00000000..1443b689 --- /dev/null +++ b/server/user.jobengine.osgi.server/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,5 @@ +#Wed Oct 19 11:23:42 CEST 2011 +eclipse.preferences.version=1 +pluginProject.equinox=false +pluginProject.extensions=false +resolve.requirebundle=false diff --git a/server/user.jobengine.osgi.server/.tpignore b/server/user.jobengine.osgi.server/.tpignore new file mode 100644 index 00000000..24d64373 --- /dev/null +++ b/server/user.jobengine.osgi.server/.tpignore @@ -0,0 +1 @@ +/target/ diff --git a/server/user.jobengine.osgi.server/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.server/META-INF/MANIFEST.MF new file mode 100644 index 00000000..659645ff --- /dev/null +++ b/server/user.jobengine.osgi.server/META-INF/MANIFEST.MF @@ -0,0 +1,84 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Server +Bundle-SymbolicName: user.jobengine.osgi.server;singleton:=true +Bundle-Version: 1.0.0 +Service-Component: OSGI-INF/component.xml +Import-Package: javax.servlet;version="3.1.0", + javax.servlet.http;version="3.1.0", + org.apache.logging.log4j.core;version="2.8.2", + org.apache.logging.log4j.core.appender;version="2.8.2", + org.apache.logging.log4j.core.config;version="2.8.2", + org.apache.logging.log4j.core.config.plugins;version="2.8.2", + org.apache.logging.log4j.core.config.plugins.validation.constraints;version="2.8.2", + org.apache.logging.log4j.core.filter;version="2.8.2", + org.apache.logging.log4j.core.layout;version="2.8.2", + org.apache.logging.log4j.core.net;version="2.8.2", + org.apache.logging.log4j.core.util;version="2.8.2", + org.osgi.framework;version="1.5.0", + org.osgi.util.tracker;version="1.4.0", + org.slf4j;version="1.6.3" +Require-Bundle: user.jobengine.osgi.db;bundle-version="1.0.0", + user.jobengine.osgi.commons;bundle-version="1.0.0", + user.tsm.client;bundle-version="1.2.0", + org.apache.commons.lang;bundle-version="2.4.0";visibility:=reexport, + org.junit;bundle-version="4.12.0", + org.jmock;bundle-version="2.6.0", + org.jmock.junit4;bundle-version="2.6.0", + org.apache.servicemix.bundles.quartz;bundle-version="2.2.2", + org.apache.logging.log4j.api;bundle-version="2.8.2" +Export-Package: user.jobengine.osgi.server, + user.jobengine.server, + user.jobengine.server.ast, + user.jobengine.server.messagequeue, + user.jobengine.server.messages, + user.jobengine.server.steps +DynamicImport-Package: * +Bundle-ClassPath: ., + WEB-INF/classes/, + WEB-INF/lib/commons-codec-1.10.jar, + WEB-INF/lib/commons-fileupload-1.2.1.jar, + WEB-INF/lib/commons-io-1.4.jar, + WEB-INF/lib/commons-logging-1.1.1.jar, + WEB-INF/lib/zcommon.jar, + WEB-INF/lib/zel.jar, + WEB-INF/lib/zhtml.jar, + WEB-INF/lib/zk_bsh.jar, + WEB-INF/lib/zk_commons-collections.jar, + WEB-INF/lib/zk_elinez.jar, + WEB-INF/lib/zk_eplotz.jar, + WEB-INF/lib/zk_Filters.jar, + WEB-INF/lib/zk_flashchart.jar, + WEB-INF/lib/zk_gmapsz.jar, + WEB-INF/lib/zk_jackson-annotations.jar, + WEB-INF/lib/zk_jackson-core.jar, + WEB-INF/lib/zk_jackson-databind.jar, + WEB-INF/lib/zk_jasperreports.jar, + WEB-INF/lib/zk_javassist.jar, + WEB-INF/lib/zk_jcommon.jar, + WEB-INF/lib/zk_jfreechart.jar, + WEB-INF/lib/zk_jsp.jar, + WEB-INF/lib/zk_monitor.jar, + WEB-INF/lib/zk_psz.jar, + WEB-INF/lib/zk_sapphire.jar, + WEB-INF/lib/zk_shchart.jar, + WEB-INF/lib/zk_silvertail.jar, + WEB-INF/lib/zk_timelinez.jar, + WEB-INF/lib/zk_timeplotz.jar, + WEB-INF/lib/zk_zuljsp.jar, + WEB-INF/lib/zk.jar, + WEB-INF/lib/zkbind.jar, + WEB-INF/lib/zkex_r.jar, + WEB-INF/lib/zkmax.jar, + WEB-INF/lib/zkplus.jar, + WEB-INF/lib/zml.jar, + WEB-INF/lib/zsoup.jar, + WEB-INF/lib/zul.jar, + WEB-INF/lib/zuti.jar, + WEB-INF/lib/zweb.jar, + src/, + WEB-INF/lib/zkcharts.jar +Bundle-ActivationPolicy: lazy +Web-ContextPath: / +Bundle-Activator: user.jobengine.osgi.server.Activator + diff --git a/server/user.jobengine.osgi.server/OSGI-INF/component.xml b/server/user.jobengine.osgi.server/OSGI-INF/component.xml new file mode 100644 index 00000000..d78073c9 --- /dev/null +++ b/server/user.jobengine.osgi.server/OSGI-INF/component.xml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/server/user.jobengine.osgi.server/WEB-INF/classes/jes.properties b/server/user.jobengine.osgi.server/WEB-INF/classes/jes.properties new file mode 100644 index 00000000..e69de29b diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/commons-codec-1.10.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-codec-1.10.jar new file mode 100644 index 00000000..1d7417c4 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-codec-1.10.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/commons-fileupload-1.2.1.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-fileupload-1.2.1.jar new file mode 100644 index 00000000..aa209b38 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-fileupload-1.2.1.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/commons-io-1.4.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-io-1.4.jar new file mode 100644 index 00000000..133dc6cb Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-io-1.4.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/commons-logging-1.1.1.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-logging-1.1.1.jar new file mode 100644 index 00000000..8758a96b Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/commons-logging-1.1.1.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zcommon.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zcommon.jar new file mode 100644 index 00000000..e6c7ec04 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zcommon.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zel.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zel.jar new file mode 100644 index 00000000..addeffe0 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zel.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zhtml.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zhtml.jar new file mode 100644 index 00000000..8cb11dc7 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zhtml.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk.jar new file mode 100644 index 00000000..3ddb6d84 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_Filters.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_Filters.jar new file mode 100644 index 00000000..4517ec82 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_Filters.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_bsh.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_bsh.jar new file mode 100644 index 00000000..29d71a9d Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_bsh.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_commons-collections.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_commons-collections.jar new file mode 100644 index 00000000..c35fa1fe Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_commons-collections.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_elinez.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_elinez.jar new file mode 100644 index 00000000..71cf782f Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_elinez.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_eplotz.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_eplotz.jar new file mode 100644 index 00000000..cec342bb Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_eplotz.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_flashchart.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_flashchart.jar new file mode 100644 index 00000000..f9a7030a Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_flashchart.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_gmapsz.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_gmapsz.jar new file mode 100644 index 00000000..262a710e Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_gmapsz.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-annotations.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-annotations.jar new file mode 100644 index 00000000..62521310 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-annotations.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-core.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-core.jar new file mode 100644 index 00000000..8c9c4e0e Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-core.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-databind.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-databind.jar new file mode 100644 index 00000000..9b82e3fa Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jackson-databind.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jasperreports.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jasperreports.jar new file mode 100644 index 00000000..9ced8dee Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jasperreports.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_javassist.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_javassist.jar new file mode 100644 index 00000000..c8761c8e Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_javassist.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jcommon.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jcommon.jar new file mode 100644 index 00000000..ee633d53 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jcommon.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jfreechart.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jfreechart.jar new file mode 100644 index 00000000..0e4d020a Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jfreechart.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jsp.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jsp.jar new file mode 100644 index 00000000..79b09870 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_jsp.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_monitor.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_monitor.jar new file mode 100644 index 00000000..6b1fa87c Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_monitor.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_psz.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_psz.jar new file mode 100644 index 00000000..262a710e Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_psz.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_sapphire.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_sapphire.jar new file mode 100644 index 00000000..4ecc4da8 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_sapphire.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_shchart.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_shchart.jar new file mode 100644 index 00000000..f9a7030a Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_shchart.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_silvertail.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_silvertail.jar new file mode 100644 index 00000000..16d7125f Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_silvertail.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_timelinez.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_timelinez.jar new file mode 100644 index 00000000..71cf782f Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_timelinez.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_timeplotz.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_timeplotz.jar new file mode 100644 index 00000000..cec342bb Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_timeplotz.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zk_zuljsp.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_zuljsp.jar new file mode 100644 index 00000000..79b09870 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zk_zuljsp.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zkbind.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zkbind.jar new file mode 100644 index 00000000..695ed3c0 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zkbind.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zkcharts.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zkcharts.jar new file mode 100644 index 00000000..9edc1d00 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zkcharts.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zkex_r.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zkex_r.jar new file mode 100644 index 00000000..7b04ad0f Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zkex_r.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zkmax.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zkmax.jar new file mode 100644 index 00000000..9533256d Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zkmax.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zkplus.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zkplus.jar new file mode 100644 index 00000000..ce3f35a5 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zkplus.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zml.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zml.jar new file mode 100644 index 00000000..926fb71f Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zml.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zsoup.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zsoup.jar new file mode 100644 index 00000000..eeb7ffb6 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zsoup.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zul.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zul.jar new file mode 100644 index 00000000..63f49535 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zul.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zuti.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zuti.jar new file mode 100644 index 00000000..97311194 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zuti.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/lib/zweb.jar b/server/user.jobengine.osgi.server/WEB-INF/lib/zweb.jar new file mode 100644 index 00000000..79ca2437 Binary files /dev/null and b/server/user.jobengine.osgi.server/WEB-INF/lib/zweb.jar differ diff --git a/server/user.jobengine.osgi.server/WEB-INF/web.xml b/server/user.jobengine.osgi.server/WEB-INF/web.xml new file mode 100644 index 00000000..1ffb7923 --- /dev/null +++ b/server/user.jobengine.osgi.server/WEB-INF/web.xml @@ -0,0 +1,69 @@ + + + + Media Archivum + + + org.zkoss.zk.ui.http.HttpSessionListener + + + + + + + + + ZK loader for ZUML pages + zkLoader + org.zkoss.zk.ui.http.DHtmlLayoutServlet + + update-uri + /zkau + + 1 + + + + The asynchronous update engine for ZK + auEngine + org.zkoss.zk.au.http.DHtmlUpdateServlet + + + + + + + + zkLoader + *.zul + + + + zkLoader + *.zhtml + + + + auEngine + /zkau/* + + + + + + + 120 + + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + index.zul + index.zhtml + + diff --git a/server/user.jobengine.osgi.server/WEB-INF/zk.xml b/server/user.jobengine.osgi.server/WEB-INF/zk.xml new file mode 100644 index 00000000..f2bcef43 --- /dev/null +++ b/server/user.jobengine.osgi.server/WEB-INF/zk.xml @@ -0,0 +1,29 @@ + + + + org.zkoss.web.preferred.locale + hu + + + + ajax + Lejárt a munkamenet, kérem töltse be újra az alkalmazást. + + + + + + /resources/i3-label_hu.properties + + + + + Monitor the statistic + org.zkoss.zk.ui.util.Statistic + + + ZK performance monitor + org.zkoss.performance.monitor.PerformanceMeter + + + \ No newline at end of file diff --git a/server/user.jobengine.osgi.server/build.properties b/server/user.jobengine.osgi.server/build.properties new file mode 100644 index 00000000..32f89993 --- /dev/null +++ b/server/user.jobengine.osgi.server/build.properties @@ -0,0 +1,15 @@ +source.. = src/,\ + test/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + resources/,\ + OSGI-INF/,\ + src/,\ + WEB-INF/,\ + index.jsp,\ + css/,\ + img/,\ + js/,\ + pages/ +src.includes = resources/ \ No newline at end of file diff --git a/server/user.jobengine.osgi.server/buildbundle.xml b/server/user.jobengine.osgi.server/buildbundle.xml new file mode 100644 index 00000000..5eda1a3e --- /dev/null +++ b/server/user.jobengine.osgi.server/buildbundle.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/server/user.jobengine.osgi.server/css/archivum.css b/server/user.jobengine.osgi.server/css/archivum.css new file mode 100644 index 00000000..05bd90b8 --- /dev/null +++ b/server/user.jobengine.osgi.server/css/archivum.css @@ -0,0 +1,226 @@ +@CHARSET "ISO-8859-1"; + +body { + margin: 0; + padding: 0; +} + +.stcb>.z-combobox-input[readonly]{ + font-weight: bold; +} + +.z-combobox-input[readonly]{ + background: #eeeeee; +} + +body *:not([class*="z-icon-"]) { + font-family: Verdana; +} + +.z-comboitem, .z-comboitem a, .z-comboitem a:visited { + font-size: 12px; + font-weight: bold; + color: #000; + text-decoration: none; +} + +.z-tabpanel { + border: 1px solid #cfcfcf; + border-top: 0; + padding: 0px; + zoom: 1; +} + +.z-tab-text { + color: black; +} + + +/* Feldolgozás... szöveg középre nagyban */ +.z-loading { + top: 50% !important; + left: 45% !important; + align: center; + vertical-align: middle; + font-size: 18px; + font-weight: bold; + padding: 5px; +} + +/* táblázat szöveg feketével */ +.z-column-content, .z-row-content, .z-group-content, .z-groupfoot-content, .z-footer-content{ + color: black; +} + +.imagebutton { + padding: 0px; +} + +.imagebutton[disabled]{ + opacity: 0.3; +} + +.rozsdacoloredlabel{ + color: #790015; +} + +.todo, .todo:disabled{ + background: yellow; + font-weight: bold; + color: red; + min-width: 160px; + margin: 5px; +} + + +.z-grid, .grid-odd-rows, .z-groupbox { + background: #e3e3e3 !important; +} + +.attributedeflistbox .z-listbox, .attributedeflistbox .z-listcell{ + background: #e3e3e3 !important; +} + + .listbox-odd-style{ + background: #ebebeb; + } + +.attributedeflistbox .z-listcell-content { + font-weight: bold; + color: black; +} + +.attributedeflistbox{ + border: 0px; +} + +.boldfont { + font-weight: bold; + color: black; +} + +.boldfontwithcolon { + font-weight: bold; + color: black; +} + +.boldfontwithcolon:after { + content: ": " +} + +.buttonboldfont { + font-weight: bold; + color: black; + min-width: 180px; + margin: 5px; +} + +.z-groupbox>.z-groupbox-header .z-caption, .z-groupbox>.z-groupbox-header .z-groupbox-title { + background: #e3e3e3; +} + +.z-row .z-row-inner, .z-row .z-cell { + border-left: 0px; +} + +.z-east-splitter, .z-west-splitter, .z-north-splitter, .z-south-splitter{ + background: #eeeeee; +} + +.z-combobox-popup, .z-bandbox-popup, .z-datebox-popup, .z-timebox-popup{ + background: #eeeeee; +} + +.listbox-normal-style .techcols { + padding: 0px 0px; + overflow: hidden; + vertical-align: middle; + border-color:gray; + border-left: 1px solid gray; + border-bottom: 1px solid gray; + cursor: pointer; +} + +.listbox-normal-style .z-listitem .z-listcell .z-listcell-content{ + padding: 0px 5px; + overflow: hidden; + cursor: pointer; + color: black; +} + +.z-listheader-content{ + color: black; +} + +.listbox-normal-style .z-listitem .z-listcell { + border-left: 1px solid gray; + border-bottom: 1px solid gray; +} + +.z-treerow, .z-tree-body{ + background: #e3e3e3 !important; +} + +.z-treecell-text{ + color: black; +} + +.z-treecell-content{ + color: black; +} + +.z-treecol-content{ + color: black; +} + +.dottedlabel{ + overflow: hidden; + text-overflow: ellipsis; + display: block; + width:inherit; + white-space: nowrap;" +} + +.z-messagebox-icon { + font-size: 30px; + display: inline-block; + width: 32px; + height: 32px; + border: 0; + background-repeat: no-repeat; + text-align: center; + vertical-align: top; + cursor: auto; +} + +.z-calendar-selected{ + font-weight: bold; + color: black; + background: #78d2ff; +} + +.z-calendar-cell:hover{ + background: #78d2ff; + font-weight: bold; + color: black; +} + +.z-messagebox.z-div{ + padding-left: 10px; + padding-right: 10px; +} + +.z-combobox-popup, .z-combobox-rounded-popup { + display: inline-block; + max-height: 160px; + overflow-x: hidden; +} + +.z-listbox-autopaging .z-listcell-content { + height: 26px; + overflow: hidden; +} + +.z-listbox-autopaging .z-listitem .z-listcell .z-listcell-content{ + padding: 5px; +} diff --git a/server/user.jobengine.osgi.server/css/video-js.css b/server/user.jobengine.osgi.server/css/video-js.css new file mode 100644 index 00000000..33c9f56e --- /dev/null +++ b/server/user.jobengine.osgi.server/css/video-js.css @@ -0,0 +1,1393 @@ +.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before, .video-js .vjs-modal-dialog, .vjs-modal-dialog .vjs-modal-dialog-content { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } + +.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before { + text-align: center; } + +@font-face { + font-family: VideoJS; + src: url("../font/2.0.0/VideoJS.eot?#iefix") format("eot"); } + +@font-face { + font-family: VideoJS; + src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAA54AAoAAAAAFmgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAAA9AAAAD4AAABWUZFeBWNtYXAAAAE0AAAAOgAAAUriMBC2Z2x5ZgAAAXAAAAouAAAPUFvx6AdoZWFkAAALoAAAACsAAAA2DIPpX2hoZWEAAAvMAAAAGAAAACQOogcgaG10eAAAC+QAAAAPAAAAfNkAAABsb2NhAAAL9AAAAEAAAABAMMg06m1heHAAAAw0AAAAHwAAACABMAB5bmFtZQAADFQAAAElAAACCtXH9aBwb3N0AAANfAAAAPwAAAGBZkSN43icY2BkZ2CcwMDKwMFSyPKMgYHhF4RmjmEIZzzHwMDEwMrMgBUEpLmmMDh8ZPwoxw7iLmSHCDOCCADvEAo+AAB4nGNgYGBmgGAZBkYGEHAB8hjBfBYGDSDNBqQZGZgYGD7K/f8PUvCREUTzM0DVAwEjG8OIBwCPdwbVAAB4nI1Xe1CU1xX/zv1eLItLln0JwrIfC7sJGET2hRJ2N1GUoBJE8AESQEEhmBHjaB7UuBMTO4GMaSu7aY3RNlOdRPNqO2pqRmuTaSZtR6JJILUZk00a/4imjpmiecB303O/XUgMJOPufvd+99xzzz33nN855y4HHH7EfrGfIxwHRiANvF/sH71I9BzHszmpW+rGOQOXxXE6YhI4PoMT8zkT4cDFuf1cwMrZJI5cglM0HKVv0MaUFDgIFfg9mJJCG+kbKn1JkqBOVaFOkuhLpARq8fu0Nnc9/zdvfY9PxXW4PdH0C6N+PCejhorxFjAqRjgFRXSINEARbBGsoxcFK7IJmr4OycFJnInL59zIXwxui80fkGRbEHyosMWaATJKUfCskmwJQsAWANkmnIGOhlf514h7U8HNIv3owoHB0WMt0Eb3sx0guLi5pq/8Ny1q6969fKR9X9GBV6dPv6dp04K99SOwtmyPl47ApRa6n4ZpP1yjr5fn7MmYP/vXLUJs715UguklHBaHOZHZmG1N9FAIW2mf0MqWCIdo/8RZ1yGfxKUldDcGIbFA7ICO+vqOMSPTh/ZrSqgHi/bB/O8E8Mnzp+M+acxfpsTShBwej26TiGxBn7m4eEIO+Rueu6Hj+IFBnh88cAEUEQ//nVLx5C7kf+yIR47QEe+eMlhz9SqsGbe3hh2R03NGzoY6O42Kz8l7fB6fAk6LYnTyFo/FYyT6GGyNx2Jx2sdH4rA1Fo/HyCXaFyOp8dhYBCfJb2NIn1ImE6CYNGmgSTb52DawJR6jfXEmDU4xyTEmpgHHOIStoxfjSGdkbsK2w2jbdMQG4sgAstEONgURYCwGHhEhhscioQaAhhCf7McifEQc0l6+mxj9nI+gmSdiQ0Zbm7gZnIO7GSMEXG6UDAVocxAV8GcEXCKg1a02RcTtwANWRGIAyElor6n/+ZU2yOB3+T77Hb1MLqhn4KHVnQBjJnqe9QZSon6Kc5DxAD2vMdPL/BXSmQGwspa67z9wLUjdi9TN7QC7lyyBr9rpt7uXVC1CMpyjKRoXnGPHTuiaPLsNdc2dbAFQLAooPkXEh33FodHl4XpC6sPCIa0ftUIhHSYXVSu5iME+DIXsbZJ51BeidCgajcai43jU9nVzoSn2dPqcFvSoxSzJzgRKAx47WMRxOrIj3Wf0+hndxhJTiOkSEqxar3b3RKM9hY64oxBA64ieURLvCfpkDb8siBdUJ1bgT+urJ5PGfewQrmm5R5+0HmfyIPySD7OYkT0WxRePah8oEiyjlxIP74thVoRTURpmL6QhGuWS+QDjdANXjIM8SQa/1w128ODx0Qp4aLMNg9+JL3joUn8AMxW+aLNiuKjarn4uyyTdXjOzZTsh21uwldUvJoYza+zELALfu3p1L8/3krtyZ0Ag058J3hxHghvbGZn0dHZy6Mim/7Blre4lpHd1c28yVqRViO153F2oIWoXCIKbL4Z0cM1iaQn9mI5KuV2SzEvWXJDMNtkANpMdQoDDhIdD4A/YrP6Aye9ysxyE+uOEAcTDorgvVZJjcua043PnZ/PmdDqcbibZlXOOT8uSo7Kof0YUn9GL+Jo17ficymxiTofC6znUso0DhAxs1Fo+kF+d36vLmgZ8mk5cdGv2mwYj5k3Dm9m3LhJ1aVRNm6HrTbLgYAoWXDhDd/u4PGy5CT+xGMdiaBovewUCF/1BiWNljI9MLn7jeScpg+WyH6mfU62eVDql7hsrmvx1ezp/YldE2LhjbkiDnAn8tGy/MW3IXRMYJduvq9HpmIcKuFt+JCtgdGEGKAcF6UacVwIYbVPGfw/+YuNBS4cx/CUHcnyfc+wRDMtTr72mMSBjT/yn/GKSdeDWQUCH6Xoqq5R10RE60gV6erUL0iCti16d0hZjxut4QI/rEpgSh6WjnJXdBXRg1GKCucGJPtFqM27aD1tOqqKonsQ2KsFSSmEpmvRlsR+TcD9OFwrqXxIclL4sJTnGMSuG8KpkZvKdeVIOKDyWSyPLV16/p1QMPbP8NihwUzr47bdnXtwtjdCvqqpO0H+pOvIl3Pzv46e5CT/tQjklXCXXym1AaWY7bzHLkuDMc7ldKCvgxzLn8wYkJLBhEDyK7MT8bTbwbkxbfp+3mKAGsmTBpabSIEECzMIcQlzOPAMKsxMs7uhsnxPLuofPDTc1hkuq6MX9j16YU7CqegcYHbmWYuvAP6tCS97tgWf7dlQvnl25YPavXLVZvrzQPeHCpZmzzEUVq/xzu5sChnSTPTW7oOYmh69z4zL/gk3b+O6hoa733uviP82vnFcbqWlc9tDmZa23LVzaV1yXURi+JX+28NeBuj3+O8IrQ080Vm1eWB4OKjPmrJu7c1udWynvKF6/vs479lSW9+5gZkn+dKfellNGDPllzeULustz+A0bPvhgw7lkvEUwn/N4Ty7U7nhGsEpFkOfy+kutbOh1JQxhVDJumoW11hnkPThznh6FFlhfT+ra1x9sF56kx5YuDzVY9PQYAYA7iblw4frQ4TPCk2MK/xGU3rlmze62trHz6lsko+v+So/do74PT8KVkpJfOErKcv8znrMGsHTNxoEkWy1mYgDB6XBbPaWsuiS6CryGaL6zCjaXBgvtkuyXBua1wOKnh+k7L9AvPnYWffxK18FcJbuosGf3/Jo7amY+CE1vppzY+UTrva0FXc1i55pKQ/YjVL187N5fCn1kW5uot/1hi+DiZ+5atnJR9E+prvydJ9ZZ5mwOpU5gM4KYysMBQ71UzPuMTl9QQOyUo5nwioeYCPjFklrbK6s6X+ypUZ6rum9+CZYzWRiBJfSP0xzzSmrg7f86g0DKVj/wwFzieD9rRfPGFbeKMl05pn5j9/rsQJJ2iEgRrpohlyBo3f4QK7Kl+EcAYZgAoNVmZWXK704YAa3FwBxgSGUOs5htvGRz4Sgj3yFkSJFBuv/sxu5yk998T8WDJzvv/2RX19HtTUW1S+wpKRKRjJ6zzz/1/OPdFdWGlAKbvzS4PHOtURikg9AGz0LbIB85S/cPOpoXvuue8/iV2H1vPTy3ddvOeZ37HGmO3OmSzVzR+NS53+84dHlFhXPLqtzSO+5ruHM2vXtBdxP87LOzKAD359j/INYIbyPabIi3Cq6Wa+SaGe78diIzu7qcblcAa6/fJRvNopXFJnO+U9KKM5bqH5LM0iQSVmpPCPDu7ZT4Aoubz3709EBTyrTDjyx8MQXgUH1nqm7TWng4TzE4i4AsKskBITXfSyC4Fkl5MxnJDiKSIDSJAsGvd1y+/eNDp2e+A+5d8HeiiunrTkT6TqWLIs+/QRoWr98s0qj8uuzLuS22Ytufg3rdTaHn1m46sfgGKHXt0MGnLaRHdnwN37tvHcWKo2V6lnPxL4UvUQcRdOzmZSQs8X5CH5OxXMXpkATuDz8Et0SH4uyCRR+TjmBDP1GvsVrWEGVzEj33YVQ9jAtIKpqsl/s/0xrocwAAeJxjYGRgYADig3cEzsTz23xl4GZnAIHLRucNkWl2BrA4BwMTiAIAF4IITwB4nGNgZGBgZwCChWASxGZkQAXyABOUANh4nGNnYGBgHyAMADa8ANoAAAAAAAAOAFAAZgCyAMYA5gEeAUgBdAGcAfICLgKOAroDCgOOA7AD6gQ4BHwEuAToBQwFogXoBjYGbAbaB3IHqHicY2BkYGCQZ8hlYGcAASYg5gJCBob/YD4DABbVAaoAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2P2XLCMAxFfYFspGUp3Te+IB9lHJF4cOzUS2n/voaEGR6qB+lKo+WITdhga/a/bRnDBFPMkCBFhhwF5ihxg1sssMQKa9xhg3s84BFPeMYLXvGGd3zgE9tZr/hveXKVkFYoSnoeHJXfRoWOqi54mo9ameNFdrK+dLSyaVf7oJQTlkhXpD3Z5XXhR/rUfQVuKXO91Jps4cLOS6/I5YL3XhodRRsVWZe4NnZOhWnSAWgxhMoEr6SmzZieF43Mk7ZOBdeCVGrp9Eu+54J2xhySplfB5XHwQLXUmT9KH6+kPnQ7ZYuIEzNyfs1DLU1VU4SWZ6LkXGHsD1ZKbMw=) format("woff"), url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMlGRXgUAAAEoAAAAVmNtYXDiMBC2AAAB/AAAAUpnbHlmW/HoBwAAA4gAAA9QaGVhZAyD6V8AAADQAAAANmhoZWEOogcgAAAArAAAACRobXR42QAAAAAAAYAAAAB8bG9jYTDINOoAAANIAAAAQG1heHABMAB5AAABCAAAACBuYW1l1cf1oAAAEtgAAAIKcG9zdGZEjeMAABTkAAABgQABAAAHAAAAAKEHAAAAAAAHAAABAAAAAAAAAAAAAAAAAAAAHwABAAAAAQAAwdxheF8PPPUACwcAAAAAANMyzzEAAAAA0zLPMQAAAAAHAAcAAAAACAACAAAAAAAAAAEAAAAfAG0ABwAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQcAAZAABQAIBHEE5gAAAPoEcQTmAAADXABXAc4AAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA8QHxHgcAAAAAoQcAAAAAAAABAAAAAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAcAAAAHAAAABwAAAAAAAAMAAAADAAAAHAABAAAAAABEAAMAAQAAABwABAAoAAAABgAEAAEAAgAA8R7//wAAAADxAf//AAAPAAABAAAAAAAAAAABBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAFAAZgCyAMYA5gEeAUgBdAGcAfICLgKOAroDCgOOA7AD6gQ4BHwEuAToBQwFogXoBjYGbAbaB3IHqAABAAAAAAWLBYsAAgAAAREBAlUDNgWL++oCCwAAAwAAAAAGawZrAAIADgAaAAAJAhMEAAMSAAUkABMCAAEmACc2ADcWABcGAALrAcD+QJX+w/5aCAgBpgE9AT0BpggI/lr+w/3+rgYGAVL9/QFSBgb+rgIwAVABUAGbCP5a/sP+w/5aCAgBpgE9AT0BpvrIBgFS/f0BUgYG/q79/f6uAAAAAgAAAAAFQAWLAAMABwAAASERKQERIREBwAEr/tUCVQErAXUEFvvqBBYAAAAEAAAAAAYgBiAABgATACQAJwAAAS4BJxUXNjcGBxc+ATUmACcVFhIBBwEhESEBEQEGBxU+ATcXNwEHFwTQAWVVuAO7AidxJSgF/t/lpc77t18BYf6fASsBdQE+TF1OijuZX/1gnJwDgGSeK6W4GBhqW3FGnFT0AWM4mjT+9AHrX/6f/kD+iwH2/sI7HZoSRDGYXwSWnJwAAAEAAAAABKsF1gAFAAABESEBEQECCwEqAXb+igRg/kD+iwSq/osAAAACAAAAAAVmBdYABgAMAAABLgEnET4BAREhAREBBWUBZVRUZfwRASsBdf6LA4Bkniv9piueAUT+QP6LBKr+iwAAAwAAAAAGIAYPAAUADAAaAAATESEBEQEFLgEnET4BAxUWEhcGAgcVNgA3JgDgASsBdf6LAsUBZVVVZbqlzgMDzqXlASEFBf7fBGD+QP6LBKr+i+Bkniv9piueAvOaNP70tbX+9DSaOAFi9fUBYgAAAAQAAAAABYsFiwAFAAsAEQAXAAABIxEhNSMDMzUzNSEBIxUhESMDFTMVMxECC5YBduCWluD+igOA4AF2luDglgLr/oqWAgrglvyAlgF2AqCW4AF2AAQAAAAABYsFiwAFAAsAEQAXAAABMxUzESETIxUhESMBMzUzNSETNSMRITUBdeCW/org4AF2lgHAluD+ipaWAXYCVeABdgHAlgF2++rglgHA4P6KlgAAAAACAAAAAAXWBdYADwATAAABIQ4BBxEeARchPgE3ES4BAyERIQVA/IA/VQEBVT8DgD9VAQFVP/yAA4AF1QFVP/yAP1UBAVU/A4A/VfvsA4AAAAYAAAAABmsGawAHAAwAEwAbACAAKAAACQEmJw4BBwElLgEnAQUhATYSNyYFAQYCBxYXIQUeARcBMwEWFz4BNwECvgFkTlSH8GEBEgOONemh/u4C5f3QAXpcaAEB/BP+3VxoAQEOAjD95DXpoQESeP7dTlSH8GH+7gPwAmgSAQFYUP4nd6X2Pv4nS/1zZAEBk01NAfhk/v+TTUhLpfY+Adn+CBIBAVhQAdkAAAAFAAAAAAZrBdYADwATABcAGwAfAAABIQ4BBxEeARchPgE3ES4BASEVIQEhNSEFITUhNSE1IQXV+1ZAVAICVEAEqkBUAgJU+xYBKv7WAur9FgLqAcD+1gEq/RYC6gXVAVU//IA/VQEBVT8DgD9V/ayV/tWVlZWWlQADAAAAAAYgBdYADwAnAD8AAAEhDgEHER4BFyE+ATcRLgEBIzUjFTM1MxUUBgcjLgEnET4BNzMeARUFIzUjFTM1MxUOAQcjLgE1ETQ2NzMeARcFi/vqP1QCAlQ/BBY/VAICVP1rcJWVcCog4CAqAQEqIOAgKgILcJWVcAEqIOAgKiog4CAqAQXVAVU//IA/VQEBVT8DgD9V/fcl4CVKICoBASogASogKgEBKiBKJeAlSiAqAQEqIAEqICoBASogAAAGAAAAAAYgBPYAAwAHAAsADwATABcAABMzNSMRMzUjETM1IwEhNSERITUhERUhNeCVlZWVlZUBKwQV++sEFfvrBBUDNZb+QJUBwJX+QJb+QJUCVZWVAAAAAQAAAAAGIAZsAC4AAAEiBgcBNjQnAR4BMz4BNy4BJw4BBxQXAS4BIw4BBx4BFzI2NwEGBx4BFz4BNy4BBUArSh797AcHAg8eTixffwICf19ffwIH/fEeTixffwICf18sTh4CFAUBA3tcXHsDA3sCTx8bATcZNhkBNB0gAn9fX38CAn9fGxn+zRwgAn9fX38CIBz+yhcaXHsCAntcXXsAAAIAAAAABlkGawBDAE8AAAE2NCc3PgEnAy4BDwEmLwEuASchDgEPAQYHJyYGBwMGFh8BBhQXBw4BFxMeAT8BFh8BHgEXIT4BPwE2NxcWNjcTNiYnBS4BJz4BNx4BFw4BBasFBZ4KBgeWBxkNujpEHAMUD/7WDxQCHEU5ug0aB5UHBQudBQWdCwUHlQcaDbo5RRwCFA8BKg8UAhxFOboNGgeVBwUL/ThvlAIClG9vlAIClAM3JEokewkaDQEDDAkFSy0cxg4RAQERDsYcLUsFCQz+/QwbCXskSiR7CRoN/v0MCQVLLRzGDhEBAREOxhwtSwUJDAEDDBsJQQKUb2+UAgKUb2+UAAAAAAEAAAAABmsGawALAAATEgAFJAATAgAlBACVCAGmAT0BPQGmCAj+Wv7D/sP+WgOA/sP+WggIAaYBPQE9AaYICP5aAAAAAgAAAAAGawZrAAsAFwAAAQQAAxIABSQAEwIAASYAJzYANxYAFwYAA4D+w/5aCAgBpgE9AT0BpggI/lr+w/3+rgYGAVL9/QFSBgb+rgZrCP5a/sP+w/5aCAgBpgE9AT0BpvrIBgFS/f0BUgYG/q79/f6uAAADAAAAAAZrBmsACwAXACMAAAEEAAMSAAUkABMCAAEmACc2ADcWABcGAAMOAQcuASc+ATceAQOA/sP+WggIAaYBPQE9AaYICP5a/sP9/q4GBgFS/f0BUgYG/q4dAn9fX38CAn9fX38Gawj+Wv7D/sP+WggIAaYBPQE9Aab6yAYBUv39AVIGBv6u/f3+rgJPX38CAn9fX38CAn8AAAAEAAAAAAYgBiAADwAbACUAKQAAASEOAQcRHgEXIT4BNxEuAQEjNSMVIxEzFTM1OwEhHgEXEQ4BByE3MzUjBYv76j9UAgJUPwQWP1QCAlT9a3CVcHCVcJYBKiAqAQEqIP7WcJWVBiACVD/76j9UAgJUPwQWP1T8gpWVAcC7uwEqIP7WICoBcOAAAgAAAAAGawZrAAsAFwAAAQQAAxIABSQAEwIAEwcJAScJATcJARcBA4D+w/5aCAgBpgE9AT0BpggI/lo4af70/vRpAQv+9WkBDAEMaf71BmsI/lr+w/7D/loICAGmAT0BPQGm/BFpAQv+9WkBDAEMaf71AQtp/vQAAQAAAAAF1ga2ABYAAAERCQERHgEXDgEHLgEnIxYAFzYANyYAA4D+iwF1vv0FBf2+vv0FlQYBUf7+AVEGBv6vBYsBKv6L/osBKgT9v779BQX9vv7+rwYGAVH+/gFRAAAAAQAAAAAFPwcAABQAAAERIyIGHQEhAyMRIREjETM1NDYzMgU/nVY8ASUn/v7O///QrZMG9P74SEi9/tj9CQL3ASjaus0AAAAABAAAAAAGjgcAADAARQBgAGwAAAEUHgMVFAcGBCMiJicmNTQ2NzYlLgE1NDcGIyImNTQ2Nz4BMyEHIx4BFRQOAycyNjc2NTQuAiMiBgcGFRQeAxMyPgI1NC4BLwEmLwImIyIOAxUUHgIBMxUjFSM1IzUzNTMDH0BbWkAwSP7qn4TlOSVZSoMBESAfFS4WlMtIP03TcAGiioNKTDFFRjGSJlAaNSI/akAqURkvFCs9WTY6a1s3Dg8THgocJU4QIDVob1M2RnF9A2vV1WnU1GkD5CRFQ1CATlpTenNTYDxHUYouUhIqQCkkMQTBlFKaNkJAWD+MWkhzRztAPiEbOWY6hn1SJyE7ZS5nZ1I0/JcaNF4+GTAkGCMLFx04Ag4kOF07Rms7HQNsbNvbbNkAAwAAAAAGgAZsAAMADgAqAAABESERARYGKwEiJjQ2MhYBESERNCYjIgYHBhURIRIQLwEhFSM+AzMyFgHd/rYBXwFnVAJSZGemZASP/rdRVj9VFQv+twIBAQFJAhQqR2c/q9AEj/whA98BMkliYpNhYfzd/cgCEml3RTMeM/3XAY8B8DAwkCAwOB/jAAABAAAAAAaUBgAAMQAAAQYHFhUUAg4BBCMgJxYzMjcuAScWMzI3LgE9ARYXLgE1NDcWBBcmNTQ2MzIXNjcGBzYGlENfAUyb1v7SrP7x4SMr4bBpph8hHCsqcJNETkJOLHkBW8YIvYaMYG1gJWldBWhiRQ4cgv797rdtkQSKAn1hBQsXsXUEJgMsjlNYS5WzCiYkhr1mFTlzPwoAAAABAAAAAAWABwAAIgAAARcOAQcGLgM1ESM1PgQ3PgE7AREhFSERFB4CNzYFMFAXsFlorXBOIahIckQwFAUBBwT0AU3+sg0gQzBOAc/tIz4BAjhceHg6AiDXGlddb1ctBQf+WPz9+h40NR4BAgABAAAAAAaABoAASgAAARQCBCMiJzY/AR4BMzI+ATU0LgEjIg4DFRQWFxY/ATY3NicmNTQ2MzIWFRQGIyImNz4CNTQmIyIGFRQXAwYXJgI1NBIkIAQSBoDO/p/Rb2s7EzYUaj15vmh34o5ptn9bK1BNHggIBgIGETPRqZepiWs9Sg4IJRc2Mj5WGWMRBM7+zgFhAaIBYc4DgNH+n84gXUfTJzmJ8JZyyH46YH2GQ2ieIAwgHxgGFxQ9WpfZpIOq7lc9I3VZHzJCclVJMf5eRmtbAXzp0QFhzs7+nwAABwAAAAAHAATPAA4AFwAqAD0AUABaAF0AAAERNh4CBw4BBwYmIycmNxY2NzYmBxEUBRY2Nz4BNy4BJyMGHwEeARcOARcWNjc+ATcuAScjBh8BHgEXFAYXFjY3PgE3LgEnIwYfAR4BFw4BBTM/ARUzESMGAyUVJwMchM2UWwgNq4JHrQgBAapUaAoJcWMBfiIhDiMrAQJLMB0BBAokNAIBPmMiIQ4iLAECSzAeAQUKJDQBP2MiIQ4iLAECSzAeAQUKJDQBAT75g+5B4arNLNIBJ44ByQL9BQ9mvYCKwA8FBQMDwwJVTGdzBf6VB8IHNR08lld9uT4LCRA/qGNxvUwHNR08lld9uT4LCRA/qGNxvUwHNR08lld9uT4LCRA/qGNxvVJkAWUDDEf+tYP5AQAAAAEAAAAABiAGtgAbAAABBAADER4BFzMRITU2ADcWABcVIREzPgE3EQIAA4D+4v6FBwJ/X+D+1QYBJ97eAScG/tXgX38CB/6FBrUH/oX+4v32X38CAlWV3gEnBgb+2d6V/asCf18CCgEeAXsAAAAAEADGAAEAAAAAAAEABwAAAAEAAAAAAAIABwAHAAEAAAAAAAMABwAOAAEAAAAAAAQABwAVAAEAAAAAAAUACwAcAAEAAAAAAAYABwAnAAEAAAAAAAoAKwAuAAEAAAAAAAsAEwBZAAMAAQQJAAEADgBsAAMAAQQJAAIADgB6AAMAAQQJAAMADgCIAAMAAQQJAAQADgCWAAMAAQQJAAUAFgCkAAMAAQQJAAYADgC6AAMAAQQJAAoAVgDIAAMAAQQJAAsAJgEeVmlkZW9KU1JlZ3VsYXJWaWRlb0pTVmlkZW9KU1ZlcnNpb24gMS4wVmlkZW9KU0dlbmVyYXRlZCBieSBzdmcydHRmIGZyb20gRm9udGVsbG8gcHJvamVjdC5odHRwOi8vZm9udGVsbG8uY29tAFYAaQBkAGUAbwBKAFMAUgBlAGcAdQBsAGEAcgBWAGkAZABlAG8ASgBTAFYAaQBkAGUAbwBKAFMAVgBlAHIAcwBpAG8AbgAgADEALgAwAFYAaQBkAGUAbwBKAFMARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAgAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfAAABAgEDAQQBBQEGAQcBCAEJAQoBCwEMAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGgEbARwBHQEeAR8EcGxheQtwbGF5LWNpcmNsZQVwYXVzZQt2b2x1bWUtbXV0ZQp2b2x1bWUtbG93CnZvbHVtZS1taWQLdm9sdW1lLWhpZ2gQZnVsbHNjcmVlbi1lbnRlcg9mdWxsc2NyZWVuLWV4aXQGc3F1YXJlB3NwaW5uZXIJc3VidGl0bGVzCGNhcHRpb25zCGNoYXB0ZXJzBXNoYXJlA2NvZwZjaXJjbGUOY2lyY2xlLW91dGxpbmUTY2lyY2xlLWlubmVyLWNpcmNsZQJoZAZjYW5jZWwGcmVwbGF5CGZhY2Vib29rBWdwbHVzCGxpbmtlZGluB3R3aXR0ZXIGdHVtYmxyCXBpbnRlcmVzdBFhdWRpby1kZXNjcmlwdGlvbgVhdWRpbwAAAAAA) format("truetype"); + font-weight: normal; + font-style: normal; } + +.vjs-icon-play, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before { + content: "\f101"; } + +.vjs-icon-play-circle { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-play-circle:before { + content: "\f102"; } + +.vjs-icon-pause, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-pause:before, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before { + content: "\f103"; } + +.vjs-icon-volume-mute, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-mute:before, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before { + content: "\f104"; } + +.vjs-icon-volume-low, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-low:before, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before { + content: "\f105"; } + +.vjs-icon-volume-mid, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-mid:before, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before { + content: "\f106"; } + +.vjs-icon-volume-high, .video-js .vjs-mute-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-high:before, .video-js .vjs-mute-control .vjs-icon-placeholder:before { + content: "\f107"; } + +.vjs-icon-fullscreen-enter, .video-js .vjs-fullscreen-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-fullscreen-enter:before, .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before { + content: "\f108"; } + +.vjs-icon-fullscreen-exit, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-fullscreen-exit:before, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before { + content: "\f109"; } + +.vjs-icon-square { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-square:before { + content: "\f10a"; } + +.vjs-icon-spinner { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-spinner:before { + content: "\f10b"; } + +.vjs-icon-subtitles, .video-js .vjs-subtitles-button .vjs-icon-placeholder, .video-js .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-subtitles:before, .video-js .vjs-subtitles-button .vjs-icon-placeholder:before, .video-js .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before { + content: "\f10c"; } + +.vjs-icon-captions, .video-js .vjs-captions-button .vjs-icon-placeholder, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-captions:before, .video-js .vjs-captions-button .vjs-icon-placeholder:before, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before { + content: "\f10d"; } + +.vjs-icon-chapters, .video-js .vjs-chapters-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-chapters:before, .video-js .vjs-chapters-button .vjs-icon-placeholder:before { + content: "\f10e"; } + +.vjs-icon-share { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-share:before { + content: "\f10f"; } + +.vjs-icon-cog { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-cog:before { + content: "\f110"; } + +.vjs-icon-circle, .video-js .vjs-play-progress, .video-js .vjs-volume-level { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-circle:before, .video-js .vjs-play-progress:before, .video-js .vjs-volume-level:before { + content: "\f111"; } + +.vjs-icon-circle-outline { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-circle-outline:before { + content: "\f112"; } + +.vjs-icon-circle-inner-circle { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-circle-inner-circle:before { + content: "\f113"; } + +.vjs-icon-hd { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-hd:before { + content: "\f114"; } + +.vjs-icon-cancel, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-cancel:before, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before { + content: "\f115"; } + +.vjs-icon-replay, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-replay:before, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before { + content: "\f116"; } + +.vjs-icon-facebook { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-facebook:before { + content: "\f117"; } + +.vjs-icon-gplus { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-gplus:before { + content: "\f118"; } + +.vjs-icon-linkedin { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-linkedin:before { + content: "\f119"; } + +.vjs-icon-twitter { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-twitter:before { + content: "\f11a"; } + +.vjs-icon-tumblr { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-tumblr:before { + content: "\f11b"; } + +.vjs-icon-pinterest { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-pinterest:before { + content: "\f11c"; } + +.vjs-icon-audio-description, .video-js .vjs-descriptions-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-audio-description:before, .video-js .vjs-descriptions-button .vjs-icon-placeholder:before { + content: "\f11d"; } + +.vjs-icon-audio, .video-js .vjs-audio-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-audio:before, .video-js .vjs-audio-button .vjs-icon-placeholder:before { + content: "\f11e"; } + +.video-js { + display: block; + vertical-align: top; + box-sizing: border-box; + color: #fff; + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + line-height: 1; + font-weight: normal; + font-style: normal; + font-family: Arial, Helvetica, sans-serif; } + .video-js:-moz-full-screen { + position: absolute; } + .video-js:-webkit-full-screen { + width: 100% !important; + height: 100% !important; } + +.video-js[tabindex="-1"] { + outline: none; } + +.video-js *, +.video-js *:before, +.video-js *:after { + box-sizing: inherit; } + +.video-js ul { + font-family: inherit; + font-size: inherit; + line-height: inherit; + list-style-position: outside; + margin-left: 0; + margin-right: 0; + margin-top: 0; + margin-bottom: 0; } + +.video-js.vjs-fluid, +.video-js.vjs-16-9, +.video-js.vjs-4-3 { + width: 100%; + max-width: 100%; + height: 0; } + +.video-js.vjs-16-9 { + padding-top: 56.25%; } + +.video-js.vjs-4-3 { + padding-top: 75%; } + +.video-js.vjs-fill { + width: 100%; + height: 100%; } + +.video-js .vjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } + +body.vjs-full-window { + padding: 0; + margin: 0; + height: 100%; + overflow-y: auto; } + +.vjs-full-window .video-js.vjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; } + +.video-js.vjs-fullscreen { + width: 100% !important; + height: 100% !important; + padding-top: 0 !important; } + +.video-js.vjs-fullscreen.vjs-user-inactive { + cursor: none; } + +.vjs-hidden { + display: none !important; } + +.vjs-disabled { + opacity: 0.5; + cursor: default; } + +.video-js .vjs-offscreen { + height: 1px; + left: -9999px; + position: absolute; + top: 0; + width: 1px; } + +.vjs-lock-showing { + display: block !important; + opacity: 1; + visibility: visible; } + +.vjs-no-js { + padding: 20px; + color: #fff; + background-color: #000; + font-size: 18px; + font-family: Arial, Helvetica, sans-serif; + text-align: center; + width: 300px; + height: 150px; + margin: 0px auto; } + +.vjs-no-js a, +.vjs-no-js a:visited { + color: #66A8CC; } + +.video-js .vjs-big-play-button { + font-size: 3em; + line-height: 1.5em; + height: 1.5em; + width: 3em; + display: block; + position: absolute; + top: 10px; + left: 10px; + padding: 0; + cursor: pointer; + opacity: 1; + border: 0.06666em solid #fff; + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); + -webkit-border-radius: 0.3em; + -moz-border-radius: 0.3em; + border-radius: 0.3em; + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -ms-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; } + +.vjs-big-play-centered .vjs-big-play-button { + top: 50%; + left: 50%; + margin-top: -0.75em; + margin-left: -1.5em; } + +.video-js:hover .vjs-big-play-button, +.video-js .vjs-big-play-button:focus { + border-color: #fff; + background-color: #73859f; + background-color: rgba(115, 133, 159, 0.5); + -webkit-transition: all 0s; + -moz-transition: all 0s; + -ms-transition: all 0s; + -o-transition: all 0s; + transition: all 0s; } + +.vjs-controls-disabled .vjs-big-play-button, +.vjs-has-started .vjs-big-play-button, +.vjs-using-native-controls .vjs-big-play-button, +.vjs-error .vjs-big-play-button { + display: none; } + +.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button { + display: block; } + +.video-js button { + background: none; + border: none; + color: inherit; + display: inline-block; + overflow: visible; + font-size: inherit; + line-height: inherit; + text-transform: none; + text-decoration: none; + transition: none; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } + +.video-js .vjs-control.vjs-close-button { + cursor: pointer; + height: 3em; + position: absolute; + right: 0; + top: 0.5em; + z-index: 2; } + +.video-js .vjs-modal-dialog { + background: rgba(0, 0, 0, 0.8); + background: -webkit-linear-gradient(-90deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0)); + background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0)); + overflow: auto; + box-sizing: content-box; } + +.video-js .vjs-modal-dialog > * { + box-sizing: border-box; } + +.vjs-modal-dialog .vjs-modal-dialog-content { + font-size: 1.2em; + line-height: 1.5; + padding: 20px 24px; + z-index: 1; } + +.vjs-menu-button { + cursor: pointer; } + +.vjs-menu-button.vjs-disabled { + cursor: default; } + +.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu { + display: none; } + +.vjs-menu .vjs-menu-content { + display: block; + padding: 0; + margin: 0; + font-family: Arial, Helvetica, sans-serif; + overflow: auto; + box-sizing: content-box; } + +.vjs-menu .vjs-menu-content > * { + box-sizing: border-box; } + +.vjs-scrubbing .vjs-menu-button:hover .vjs-menu { + display: none; } + +.vjs-menu li { + list-style: none; + margin: 0; + padding: 0.2em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; } + +.vjs-menu li.vjs-menu-item:focus, +.vjs-menu li.vjs-menu-item:hover { + background-color: #73859f; + background-color: rgba(115, 133, 159, 0.5); } + +.vjs-menu li.vjs-selected, +.vjs-menu li.vjs-selected:focus, +.vjs-menu li.vjs-selected:hover { + background-color: #fff; + color: #2B333F; } + +.vjs-menu li.vjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 0.3em 0; + font-weight: bold; + cursor: default; } + +.vjs-menu-button-popup .vjs-menu { + display: none; + position: absolute; + bottom: 0; + width: 10em; + left: -3em; + height: 0em; + margin-bottom: 1.5em; + border-top-color: rgba(43, 51, 63, 0.7); } + +.vjs-menu-button-popup .vjs-menu .vjs-menu-content { + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); + position: absolute; + width: 100%; + bottom: 1.5em; + max-height: 15em; } + +.vjs-workinghover .vjs-menu-button-popup:hover .vjs-menu, +.vjs-menu-button-popup .vjs-menu.vjs-lock-showing { + display: block; } + +.video-js .vjs-menu-button-inline { + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -ms-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; + overflow: hidden; } + +.video-js .vjs-menu-button-inline:before { + width: 2.222222222em; } + +.video-js .vjs-menu-button-inline:hover, +.video-js .vjs-menu-button-inline:focus, +.video-js .vjs-menu-button-inline.vjs-slider-active, +.video-js.vjs-no-flex .vjs-menu-button-inline { + width: 12em; } + +.vjs-menu-button-inline .vjs-menu { + opacity: 0; + height: 100%; + width: auto; + position: absolute; + left: 4em; + top: 0; + padding: 0; + margin: 0; + -webkit-transition: all 0.4s; + -moz-transition: all 0.4s; + -ms-transition: all 0.4s; + -o-transition: all 0.4s; + transition: all 0.4s; } + +.vjs-menu-button-inline:hover .vjs-menu, +.vjs-menu-button-inline:focus .vjs-menu, +.vjs-menu-button-inline.vjs-slider-active .vjs-menu { + display: block; + opacity: 1; } + +.vjs-no-flex .vjs-menu-button-inline .vjs-menu { + display: block; + opacity: 1; + position: relative; + width: auto; } + +.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu, +.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu, +.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu { + width: auto; } + +.vjs-menu-button-inline .vjs-menu-content { + width: auto; + height: 100%; + margin: 0; + overflow: hidden; } + +.video-js .vjs-control-bar { + display: none; + width: 100%; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 3.0em; + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); } + +.vjs-has-started .vjs-control-bar { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + visibility: visible; + opacity: 1; + -webkit-transition: visibility 0.1s, opacity 0.1s; + -moz-transition: visibility 0.1s, opacity 0.1s; + -ms-transition: visibility 0.1s, opacity 0.1s; + -o-transition: visibility 0.1s, opacity 0.1s; + transition: visibility 0.1s, opacity 0.1s; } + +.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar { + visibility: visible; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -ms-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s; } + +.vjs-controls-disabled .vjs-control-bar, +.vjs-using-native-controls .vjs-control-bar, +.vjs-error .vjs-control-bar { + display: none !important; } + +.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar { + opacity: 1; + visibility: visible; } + +.vjs-has-started.vjs-no-flex .vjs-control-bar { + display: table; } + +.video-js .vjs-control { + position: relative; + text-align: center; + margin: 0; + padding: 0; + height: 100%; + width: 4em; + -webkit-box-flex: none; + -moz-box-flex: none; + -webkit-flex: none; + -ms-flex: none; + flex: none; } + +.vjs-button > .vjs-icon-placeholder:before { + font-size: 1.8em; + line-height: 1.67; } + +.video-js .vjs-control:focus:before, +.video-js .vjs-control:hover:before, +.video-js .vjs-control:focus { + text-shadow: 0em 0em 1em white; } + +.video-js .vjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; } + +.vjs-no-flex .vjs-control { + display: table-cell; + vertical-align: middle; } + +.video-js .vjs-custom-control-spacer { + display: none; } + +.video-js .vjs-progress-control { + cursor: pointer; + -webkit-box-flex: auto; + -moz-box-flex: auto; + -webkit-flex: auto; + -ms-flex: auto; + flex: auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + min-width: 4em; } + +.vjs-live .vjs-progress-control { + display: none; } + +.vjs-no-flex .vjs-progress-control { + width: auto; } + +.video-js .vjs-progress-holder { + -webkit-box-flex: auto; + -moz-box-flex: auto; + -webkit-flex: auto; + -ms-flex: auto; + flex: auto; + -webkit-transition: all 0.2s; + -moz-transition: all 0.2s; + -ms-transition: all 0.2s; + -o-transition: all 0.2s; + transition: all 0.2s; + height: 0.3em; } + +.video-js .vjs-progress-control .vjs-progress-holder { + margin: 0 10px; } + +.video-js .vjs-progress-control:hover .vjs-progress-holder { + font-size: 1.666666666666666666em; } + +.video-js .vjs-progress-holder .vjs-play-progress, +.video-js .vjs-progress-holder .vjs-load-progress, +.video-js .vjs-progress-holder .vjs-load-progress div { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + width: 0; + left: 0; + top: 0; } + +.video-js .vjs-play-progress { + background-color: #fff; } + .video-js .vjs-play-progress:before { + font-size: 0.9em; + position: absolute; + right: -0.5em; + top: -0.333333333333333em; + z-index: 1; } + +.video-js .vjs-load-progress { + background: #bfc7d3; + background: rgba(115, 133, 159, 0.5); } + +.video-js .vjs-load-progress div { + background: white; + background: rgba(115, 133, 159, 0.75); } + +.video-js .vjs-time-tooltip { + background-color: #fff; + background-color: rgba(255, 255, 255, 0.8); + -webkit-border-radius: 0.3em; + -moz-border-radius: 0.3em; + border-radius: 0.3em; + color: #000; + float: right; + font-family: Arial, Helvetica, sans-serif; + font-size: 1em; + padding: 6px 8px 8px 8px; + pointer-events: none; + position: relative; + top: -3.4em; + visibility: hidden; + z-index: 1; } + +.video-js .vjs-progress-holder:focus .vjs-time-tooltip { + display: none; } + +.video-js .vjs-progress-control:hover .vjs-time-tooltip, +.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip { + display: block; + font-size: 0.6em; + visibility: visible; } + +.video-js .vjs-progress-control .vjs-mouse-display { + display: none; + position: absolute; + width: 1px; + height: 100%; + background-color: #000; + z-index: 1; } + +.vjs-no-flex .vjs-progress-control .vjs-mouse-display { + z-index: 0; } + +.video-js .vjs-progress-control:hover .vjs-mouse-display { + display: block; } + +.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display { + visibility: hidden; + opacity: 0; + -webkit-transition: visibility 1s, opacity 1s; + -moz-transition: visibility 1s, opacity 1s; + -ms-transition: visibility 1s, opacity 1s; + -o-transition: visibility 1s, opacity 1s; + transition: visibility 1s, opacity 1s; } + +.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display { + display: none; } + +.vjs-mouse-display .vjs-time-tooltip { + color: #fff; + background-color: #000; + background-color: rgba(0, 0, 0, 0.8); } + +.video-js .vjs-slider { + position: relative; + cursor: pointer; + padding: 0; + margin: 0 0.45em 0 0.45em; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: #73859f; + background-color: rgba(115, 133, 159, 0.5); } + +.video-js .vjs-slider:focus { + text-shadow: 0em 0em 1em white; + -webkit-box-shadow: 0 0 1em #fff; + -moz-box-shadow: 0 0 1em #fff; + box-shadow: 0 0 1em #fff; } + +.video-js .vjs-mute-control { + cursor: pointer; + -webkit-box-flex: none; + -moz-box-flex: none; + -webkit-flex: none; + -ms-flex: none; + flex: none; + padding-left: 2em; + padding-right: 2em; + padding-bottom: 3em; } + +.video-js .vjs-volume-control { + cursor: pointer; + margin-right: 1em; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; } + +.video-js .vjs-volume-control.vjs-volume-horizontal { + width: 5em; } + +.video-js .vjs-volume-panel .vjs-volume-control { + visibility: visible; + opacity: 0; + width: 1px; + height: 1px; + margin-left: -1px; } + +.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; } + .vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical .vjs-volume-bar, + .vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical .vjs-volume-level { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; } + +.video-js .vjs-volume-panel { + -webkit-transition: width 1s; + -moz-transition: width 1s; + -ms-transition: width 1s; + -o-transition: width 1s; + transition: width 1s; } + .video-js .vjs-volume-panel:hover .vjs-volume-control, + .video-js .vjs-volume-panel:active .vjs-volume-control, + .video-js .vjs-volume-panel:focus .vjs-volume-control, + .video-js .vjs-volume-panel .vjs-volume-control:hover, + .video-js .vjs-volume-panel .vjs-volume-control:active, + .video-js .vjs-volume-panel .vjs-volume-control:focus, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control, + .video-js .vjs-volume-panel .vjs-mute-control:active ~ .vjs-volume-control, + .video-js .vjs-volume-panel .vjs-mute-control:focus ~ .vjs-volume-control, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active { + visibility: visible; + opacity: 1; + position: relative; + -webkit-transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; + -moz-transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; + -ms-transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; + -o-transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; + transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; } + .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-volume-control:focus.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-mute-control:active ~ .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-mute-control:focus ~ .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal { + width: 5em; + height: 3em; } + .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-volume-control:focus.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-mute-control:active ~ .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-mute-control:focus ~ .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; } + .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel .vjs-volume-control:focus.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel .vjs-volume-control:focus.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel .vjs-mute-control:active ~ .vjs-volume-control.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel .vjs-mute-control:active ~ .vjs-volume-control.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel .vjs-mute-control:focus ~ .vjs-volume-control.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel .vjs-mute-control:focus ~ .vjs-volume-control.vjs-volume-vertical .vjs-volume-level, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical .vjs-volume-bar, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical .vjs-volume-level { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; } + .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:focus, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active { + width: 9em; + -webkit-transition: width 0.1s; + -moz-transition: width 0.1s; + -ms-transition: width 0.1s; + -o-transition: width 0.1s; + transition: width 0.1s; } + +.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical { + height: 8em; + width: 3em; + left: -3.5em; + -webkit-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; + -moz-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; + -ms-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; + -o-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; + transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; } + +.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { + -webkit-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; + -moz-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; + -ms-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; + -o-transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; + transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; } + +.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { + width: 5em; + height: 3em; + visibility: visible; + opacity: 1; + position: relative; + -webkit-transition: none; + -moz-transition: none; + -ms-transition: none; + -o-transition: none; + transition: none; } + +.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical, +.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical { + position: absolute; + bottom: 3em; + left: 0.5em; } + +.video-js .vjs-volume-panel { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; } + +.video-js .vjs-volume-bar { + margin: 1.35em 0.45em; } + +.vjs-volume-bar.vjs-slider-horizontal { + width: 5em; + height: 0.3em; } + +.vjs-volume-bar.vjs-slider-vertical { + width: 0.3em; + height: 5em; + margin: 1.35em auto; } + +.video-js .vjs-volume-level { + position: absolute; + bottom: 0; + left: 0; + background-color: #fff; } + .video-js .vjs-volume-level:before { + position: absolute; + font-size: 0.9em; } + +.vjs-slider-vertical .vjs-volume-level { + width: 0.3em; } + .vjs-slider-vertical .vjs-volume-level:before { + top: -0.5em; + left: -0.3em; } + +.vjs-slider-horizontal .vjs-volume-level { + height: 0.3em; } + .vjs-slider-horizontal .vjs-volume-level:before { + top: -0.3em; + right: -0.5em; } + +.video-js .vjs-volume-panel.vjs-volume-panel-vertical { + width: 4em; } + +.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level { + height: 100%; } + +.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level { + width: 100%; } + +.video-js .vjs-volume-vertical { + width: 3em; + height: 8em; + bottom: 8em; + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); } + +.video-js .vjs-volume-horizontal .vjs-menu { + left: -2em; } + +.vjs-poster { + display: inline-block; + vertical-align: middle; + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + background-color: #000000; + cursor: pointer; + margin: 0; + padding: 0; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + height: 100%; } + +.vjs-poster img { + display: block; + vertical-align: middle; + margin: 0 auto; + max-height: 100%; + padding: 0; + width: 100%; } + +.vjs-has-started .vjs-poster { + display: none; } + +.vjs-audio.vjs-has-started .vjs-poster { + display: block; } + +.vjs-using-native-controls .vjs-poster { + display: none; } + +.video-js .vjs-live-control { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: flex-start; + -webkit-align-items: flex-start; + -ms-flex-align: flex-start; + align-items: flex-start; + -webkit-box-flex: auto; + -moz-box-flex: auto; + -webkit-flex: auto; + -ms-flex: auto; + flex: auto; + font-size: 1em; + line-height: 3em; } + +.vjs-no-flex .vjs-live-control { + display: table-cell; + width: auto; + text-align: left; } + +.video-js .vjs-time-control { + -webkit-box-flex: none; + -moz-box-flex: none; + -webkit-flex: none; + -ms-flex: none; + flex: none; + font-size: 1em; + line-height: 3em; + min-width: 2em; + width: auto; + padding-left: 1em; + padding-right: 1em; } + +.vjs-live .vjs-time-control { + display: none; } + +.video-js .vjs-current-time, +.vjs-no-flex .vjs-current-time { + display: none; } + +.vjs-no-flex .vjs-remaining-time.vjs-time-control.vjs-control { + width: 0px !important; + white-space: nowrap; } + +.video-js .vjs-duration, +.vjs-no-flex .vjs-duration { + display: none; } + +.vjs-time-divider { + display: none; + line-height: 3em; } + +.vjs-live .vjs-time-divider { + display: none; } + +.video-js .vjs-play-control .vjs-icon-placeholder { + cursor: pointer; + -webkit-box-flex: none; + -moz-box-flex: none; + -webkit-flex: none; + -ms-flex: none; + flex: none; } + +.vjs-text-track-display { + position: absolute; + bottom: 3em; + left: 0; + right: 0; + top: 0; + pointer-events: none; } + +.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display { + bottom: 1em; } + +.video-js .vjs-text-track { + font-size: 1.4em; + text-align: center; + margin-bottom: 0.1em; + background-color: #000; + background-color: rgba(0, 0, 0, 0.5); } + +.vjs-subtitles { + color: #fff; } + +.vjs-captions { + color: #fc6; } + +.vjs-tt-cue { + display: block; } + +video::-webkit-media-text-track-display { + -moz-transform: translateY(-3em); + -ms-transform: translateY(-3em); + -o-transform: translateY(-3em); + -webkit-transform: translateY(-3em); + transform: translateY(-3em); } + +.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display { + -moz-transform: translateY(-1.5em); + -ms-transform: translateY(-1.5em); + -o-transform: translateY(-1.5em); + -webkit-transform: translateY(-1.5em); + transform: translateY(-1.5em); } + +.video-js .vjs-fullscreen-control { + cursor: pointer; + -webkit-box-flex: none; + -moz-box-flex: none; + -webkit-flex: none; + -ms-flex: none; + flex: none; } + +.vjs-playback-rate .vjs-playback-rate-value { + font-size: 1.5em; + line-height: 2; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + text-align: center; } + +.vjs-playback-rate .vjs-menu { + width: 4em; + left: 0em; } + +.vjs-error .vjs-error-display .vjs-modal-dialog-content { + font-size: 1.4em; + text-align: center; } + +.vjs-error .vjs-error-display:before { + color: #fff; + content: 'X'; + font-family: Arial, Helvetica, sans-serif; + font-size: 4em; + left: 0; + line-height: 1; + margin-top: -0.5em; + position: absolute; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center; + top: 50%; + vertical-align: middle; + width: 100%; } + +.vjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + margin: -25px 0 0 -25px; + opacity: 0.85; + text-align: left; + border: 6px solid rgba(43, 51, 63, 0.7); + box-sizing: border-box; + background-clip: padding-box; + width: 50px; + height: 50px; + border-radius: 25px; } + +.vjs-seeking .vjs-loading-spinner, +.vjs-waiting .vjs-loading-spinner { + display: block; } + +.vjs-loading-spinner:before, +.vjs-loading-spinner:after { + content: ""; + position: absolute; + margin: -6px; + box-sizing: inherit; + width: inherit; + height: inherit; + border-radius: inherit; + opacity: 1; + border: inherit; + border-color: transparent; + border-top-color: white; } + +.vjs-seeking .vjs-loading-spinner:before, +.vjs-seeking .vjs-loading-spinner:after, +.vjs-waiting .vjs-loading-spinner:before, +.vjs-waiting .vjs-loading-spinner:after { + -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; + animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; } + +.vjs-seeking .vjs-loading-spinner:before, +.vjs-waiting .vjs-loading-spinner:before { + border-top-color: white; } + +.vjs-seeking .vjs-loading-spinner:after, +.vjs-waiting .vjs-loading-spinner:after { + border-top-color: white; + -webkit-animation-delay: 0.44s; + animation-delay: 0.44s; } + +@keyframes vjs-spinner-spin { + 100% { + transform: rotate(360deg); } } + +@-webkit-keyframes vjs-spinner-spin { + 100% { + -webkit-transform: rotate(360deg); } } + +@keyframes vjs-spinner-fade { + 0% { + border-top-color: #73859f; } + 20% { + border-top-color: #73859f; } + 35% { + border-top-color: white; } + 60% { + border-top-color: #73859f; } + 100% { + border-top-color: #73859f; } } + +@-webkit-keyframes vjs-spinner-fade { + 0% { + border-top-color: #73859f; } + 20% { + border-top-color: #73859f; } + 35% { + border-top-color: white; } + 60% { + border-top-color: #73859f; } + 100% { + border-top-color: #73859f; } } + +.vjs-chapters-button .vjs-menu ul { + width: 24em; } + +.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder { + position: absolute; } + +.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before { + font-family: VideoJS; + content: "\f10d"; + font-size: 1.5em; + line-height: inherit; } + +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-custom-control-spacer { + -webkit-box-flex: auto; + -moz-box-flex: auto; + -webkit-flex: auto; + -ms-flex: auto; + flex: auto; } + +.video-js.vjs-layout-tiny:not(.vjs-fullscreen).vjs-no-flex .vjs-custom-control-spacer { + width: auto; } + +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-remaining-time, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-playback-rate, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-progress-control, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-control, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-captions-button, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-audio-button { + display: none; } + +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-remaining-time, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-playback-rate, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-control, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-captions-button, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-audio-button { + display: none; } + +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-remaining-time, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-playback-rate, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-control, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-captions-button, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-subtitles-button .vjs-audio-button { + display: none; } + +.vjs-modal-dialog.vjs-text-track-settings { + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.75); + color: #fff; + height: 70%; } + +.vjs-text-track-settings .vjs-modal-dialog-content { + display: table; } + +.vjs-text-track-settings .vjs-track-settings-colors, +.vjs-text-track-settings .vjs-track-settings-font, +.vjs-text-track-settings .vjs-track-settings-controls { + display: table-cell; } + +.vjs-text-track-settings .vjs-track-settings-controls { + text-align: right; + vertical-align: bottom; } + +.vjs-text-track-settings fieldset { + margin: 5px; + padding: 3px; + border: none; } + +.vjs-text-track-settings fieldset span { + display: inline-block; + margin-left: 5px; } + +.vjs-text-track-settings legend { + color: #fff; + margin: 0 0 5px 0; } + +.vjs-text-track-settings .vjs-label { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + display: block; + margin: 0 0 5px 0; + padding: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; } + +.vjs-track-settings-controls button:focus, +.vjs-track-settings-controls button:active { + outline-style: solid; + outline-width: medium; + background-image: linear-gradient(0deg, #fff 88%, #73859f 100%); } + +.vjs-track-settings-controls button:hover { + color: rgba(43, 51, 63, 0.75); } + +.vjs-track-settings-controls button { + background-color: #fff; + background-image: linear-gradient(-180deg, #fff 88%, #73859f 100%); + color: #2B333F; + cursor: pointer; + border-radius: 2px; } + +.vjs-track-settings-controls .vjs-default-button { + margin-right: 1em; } + +@media print { + .video-js > *:not(.vjs-tech):not(.vjs-poster) { + visibility: hidden; } } + +@media \0screen { + .vjs-user-inactive.vjs-playing .vjs-control-bar :before { + content: ""; + } +} + +@media \0screen { + .vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar { + visibility: hidden; + } +} diff --git a/server/user.jobengine.osgi.server/deploy.launch b/server/user.jobengine.osgi.server/deploy.launch new file mode 100644 index 00000000..9e855386 --- /dev/null +++ b/server/user.jobengine.osgi.server/deploy.launch @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/AjaxPushAnimation-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/AjaxPushAnimation-48x48.png new file mode 100644 index 00000000..16b6bd3d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/AjaxPushAnimation-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Animations-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Animations-24x24.png new file mode 100644 index 00000000..00aead9b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Animations-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowDown-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowDown-16x16.png new file mode 100644 index 00000000..5ebe1a38 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowDown-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowDownGreen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowDownGreen-16x16.png new file mode 100644 index 00000000..07362083 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowDownGreen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowLeft-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowLeft-16x16.png new file mode 100644 index 00000000..82afaeef Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowLeft-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowLeftGreen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowLeftGreen-16x16.png new file mode 100644 index 00000000..d152cb86 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowLeftGreen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowRight-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowRight-16x16.png new file mode 100644 index 00000000..8169d08b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowRight-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowRightGreen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowRightGreen-16x16.png new file mode 100644 index 00000000..51bff670 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowRightGreen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUp-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUp-16x16.png new file mode 100644 index 00000000..96dd275d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUp-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUpGreen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUpGreen-16x16.png new file mode 100644 index 00000000..1489488a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUpGreen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUpOrange-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUpOrange-16x16.png new file mode 100644 index 00000000..f6f63c66 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowUpOrange-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowsUpDown-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowsUpDown-16x16.png new file mode 100644 index 00000000..59d6a6a4 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ArrowsUpDown-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Audio-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Audio-24x24.png new file mode 100644 index 00000000..e0e77d12 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Audio-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/AuxiliaryHeaders-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/AuxiliaryHeaders-24x24.png new file mode 100644 index 00000000..7e7dd87e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/AuxiliaryHeaders-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bandbox-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bandbox-24x24.png new file mode 100644 index 00000000..5c4bc3b5 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bandbox-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookBlue-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookBlue-16x16.png new file mode 100644 index 00000000..91f30493 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookBlue-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookBrown-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookBrown-16x16.png new file mode 100644 index 00000000..03e1afa3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookBrown-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookGreen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookGreen-16x16.png new file mode 100644 index 00000000..85b4ca4d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BookGreen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Booklet-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Booklet-16x16.png new file mode 100644 index 00000000..3387b62a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Booklet-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BorderLayout-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BorderLayout-24x24.png new file mode 100644 index 00000000..a5324fc3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BorderLayout-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BoxModel-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BoxModel-24x24.png new file mode 100644 index 00000000..e04189ba Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BoxModel-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Briefcase-128x128.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Briefcase-128x128.png new file mode 100644 index 00000000..91c9a40a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Briefcase-128x128.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Briefcase-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Briefcase-16x16.png new file mode 100644 index 00000000..58740324 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Briefcase-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BriefcaseOpen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BriefcaseOpen-16x16.png new file mode 100644 index 00000000..334c2e45 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BriefcaseOpen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BriefcaseSpark-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BriefcaseSpark-16x16.png new file mode 100644 index 00000000..f5143873 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/BriefcaseSpark-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bubble-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bubble-16x16.png new file mode 100644 index 00000000..dd5abd37 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bubble-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bullet-10x10.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bullet-10x10.png new file mode 100644 index 00000000..d63d0ecb Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Bullet-10x10.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Button-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Button-24x24.png new file mode 100644 index 00000000..92521650 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Button-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonArrowLeftDouble-32x32.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonArrowLeftDouble-32x32.png new file mode 100644 index 00000000..02ca5f51 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonArrowLeftDouble-32x32.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonArrowRightDouble-32x32.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonArrowRightDouble-32x32.png new file mode 100644 index 00000000..22f288df Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonArrowRightDouble-32x32.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonBlue.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonBlue.png new file mode 100644 index 00000000..8bb6acac Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonBlue.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonGray.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonGray.png new file mode 100644 index 00000000..54017f1d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ButtonGray.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Calendar-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Calendar-16x16.png new file mode 100644 index 00000000..ac970bda Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Calendar-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserFemale-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserFemale-16x16.png new file mode 100644 index 00000000..23b2924e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserFemale-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserMale-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserMale-16x16.png new file mode 100644 index 00000000..6c1f358a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserMale-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserMaleProhibition-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserMaleProhibition-16x16.png new file mode 100644 index 00000000..e9366246 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUserMaleProhibition-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUsers-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUsers-16x16.png new file mode 100644 index 00000000..bfd6e85c Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CasualUsers-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Chart-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Chart-24x24.png new file mode 100644 index 00000000..0b7dec18 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Chart-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Checkmark-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Checkmark-24x24.png new file mode 100644 index 00000000..e37ff14d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Checkmark-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ClientSideAction-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ClientSideAction-24x24.png new file mode 100644 index 00000000..a00b41e8 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ClientSideAction-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CogwheelEye-32x32.gif b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CogwheelEye-32x32.gif new file mode 100644 index 00000000..40682134 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CogwheelEye-32x32.gif differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ColumnLayout-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ColumnLayout-24x24.png new file mode 100644 index 00000000..978be4cb Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ColumnLayout-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Columns-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Columns-16x16.png new file mode 100644 index 00000000..8472104a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Columns-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Combobox-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Combobox-24x24.png new file mode 100644 index 00000000..efe7a207 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Combobox-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CometServerPush-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CometServerPush-24x24.png new file mode 100644 index 00000000..cb29fe96 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/CometServerPush-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ComplexBorderLayout-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ComplexBorderLayout-24x24.png new file mode 100644 index 00000000..0491b6a2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ComplexBorderLayout-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ContextMenus-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ContextMenus-24x24.png new file mode 100644 index 00000000..d6d70b1e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ContextMenus-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DashBoard-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DashBoard-24x24.png new file mode 100644 index 00000000..22f70d18 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DashBoard-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DataAndReport-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DataAndReport-48x48.png new file mode 100644 index 00000000..fe71bc7a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DataAndReport-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DataBinding-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DataBinding-24x24.png new file mode 100644 index 00000000..e6ac7e97 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DataBinding-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DeleteCross-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DeleteCross-16x16.png new file mode 100644 index 00000000..79daacfc Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DeleteCross-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Detail-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Detail-24x24.png new file mode 100644 index 00000000..bc291e19 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Detail-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DisketteBlack-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DisketteBlack-16x16.png new file mode 100644 index 00000000..1d579551 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DisketteBlack-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DoorOpen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DoorOpen-16x16.png new file mode 100644 index 00000000..88287b1f Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DoorOpen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DragAndDrop-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DragAndDrop-24x24.png new file mode 100644 index 00000000..0529de8e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DragAndDrop-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DynamicImage-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DynamicImage-24x24.png new file mode 100644 index 00000000..73612ec7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/DynamicImage-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EnterpriseAndIntegration-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EnterpriseAndIntegration-48x48.png new file mode 100644 index 00000000..5e75ff53 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EnterpriseAndIntegration-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Envelope-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Envelope-16x16.png new file mode 100644 index 00000000..bcf7d254 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Envelope-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EnvelopeOpen-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EnvelopeOpen-16x16.png new file mode 100644 index 00000000..728a4d39 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EnvelopeOpen-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EventListener-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EventListener-24x24.png new file mode 100644 index 00000000..a7337aca Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EventListener-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EventsAndScripts-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EventsAndScripts-48x48.png new file mode 100644 index 00000000..ba2863e3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/EventsAndScripts-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FCKEditor-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FCKEditor-24x24.png new file mode 100644 index 00000000..8f555368 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FCKEditor-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileDownload-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileDownload-24x24.png new file mode 100644 index 00000000..8080766e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileDownload-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileDrawer-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileDrawer-16x16.png new file mode 100644 index 00000000..fcc10a8a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileDrawer-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileUpload-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileUpload-24x24.png new file mode 100644 index 00000000..0e4c40b5 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FileUpload-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FirstWindow-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FirstWindow-24x24.png new file mode 100644 index 00000000..5bf89886 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FirstWindow-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FisheyeMenu-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FisheyeMenu-24x24.png new file mode 100644 index 00000000..d5f8be9d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FisheyeMenu-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FlashComponents-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FlashComponents-24x24.png new file mode 100644 index 00000000..ed7f22e6 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FlashComponents-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Focus-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Focus-24x24.png new file mode 100644 index 00000000..1abc2907 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Focus-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FolderABlue-128x128.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FolderABlue-128x128.png new file mode 100644 index 00000000..80bd5ad3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FolderABlue-128x128.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FormWithPopup-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FormWithPopup-24x24.png new file mode 100644 index 00000000..73367dd9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FormWithPopup-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FormsAndInputs-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FormsAndInputs-48x48.png new file mode 100644 index 00000000..35cf174b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/FormsAndInputs-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Globe-128x128.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Globe-128x128.png new file mode 100644 index 00000000..13244f95 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Globe-128x128.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GoldBar-32x32.gif b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GoldBar-32x32.gif new file mode 100644 index 00000000..a5cb7638 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GoldBar-32x32.gif differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GoogleMaps-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GoogleMaps-24x24.png new file mode 100644 index 00000000..47a8c3b1 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GoogleMaps-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GradientGray.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GradientGray.png new file mode 100644 index 00000000..ddd8a914 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GradientGray.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridAdvancedGrouping-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridAdvancedGrouping-24x24.png new file mode 100644 index 00000000..9c4157ca Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridAdvancedGrouping-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridSortingAndMenu-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridSortingAndMenu-24x24.png new file mode 100644 index 00000000..b7d03717 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridSortingAndMenu-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Grids-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Grids-24x24.png new file mode 100644 index 00000000..9b68991f Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Grids-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsAndTrees-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsAndTrees-48x48.png new file mode 100644 index 00000000..128defe9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsAndTrees-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsGrouping-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsGrouping-24x24.png new file mode 100644 index 00000000..25ebb3ee Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsGrouping-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsPaging-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsPaging-24x24.png new file mode 100644 index 00000000..9d0de317 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/GridsPaging-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Groupbox-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Groupbox-24x24.png new file mode 100644 index 00000000..ce5012b2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Groupbox-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/HTML-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/HTML-24x24.png new file mode 100644 index 00000000..1c79eb74 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/HTML-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Hibernate-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Hibernate-24x24.png new file mode 100644 index 00000000..cc485121 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Hibernate-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/IconsDesignedByCentigradeSi.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/IconsDesignedByCentigradeSi.png new file mode 100644 index 00000000..0d13d365 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/IconsDesignedByCentigradeSi.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Iframe-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Iframe-24x24.png new file mode 100644 index 00000000..9e6df9e9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Iframe-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Include-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Include-24x24.png new file mode 100644 index 00000000..a74ace9b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Include-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JDBC-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JDBC-24x24.png new file mode 100644 index 00000000..7adb420c Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JDBC-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JPA-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JPA-24x24.png new file mode 100644 index 00000000..881567a9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JPA-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JSF-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JSF-24x24.png new file mode 100644 index 00000000..e3f35d24 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JSF-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JSP-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JSP-24x24.png new file mode 100644 index 00000000..10ecd498 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JSP-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JasperReports-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JasperReports-24x24.png new file mode 100644 index 00000000..7c690198 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/JasperReports-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/KeyEvent-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/KeyEvent-24x24.png new file mode 100644 index 00000000..f9bd9467 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/KeyEvent-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/LayoutAndWindows-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/LayoutAndWindows-48x48.png new file mode 100644 index 00000000..aacea889 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/LayoutAndWindows-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Listbox-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Listbox-24x24.png new file mode 100644 index 00000000..3fce19bc Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Listbox-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ListboxCheckmarks-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ListboxCheckmarks-24x24.png new file mode 100644 index 00000000..260685b8 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ListboxCheckmarks-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ListboxPaging-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ListboxPaging-24x24.png new file mode 100644 index 00000000..a715baa6 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ListboxPaging-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/LiveData-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/LiveData-24x24.png new file mode 100644 index 00000000..1fddb4ac Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/LiveData-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Localization-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Localization-24x24.png new file mode 100644 index 00000000..76b44b2e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Localization-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MVC-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MVC-24x24.png new file mode 100644 index 00000000..c405e4a8 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MVC-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MacroComponents-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MacroComponents-24x24.png new file mode 100644 index 00000000..7fb9d5db Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MacroComponents-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MailboxFlag-128x128.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MailboxFlag-128x128.png new file mode 100644 index 00000000..4d2b61c0 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MailboxFlag-128x128.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Menu-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Menu-24x24.png new file mode 100644 index 00000000..e8e0531c Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Menu-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MessageBox-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MessageBox-24x24.png new file mode 100644 index 00000000..630d8171 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MessageBox-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Miscellaneous-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Miscellaneous-48x48.png new file mode 100644 index 00000000..684a8057 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Miscellaneous-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Miscellaneous2-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Miscellaneous2-48x48.png new file mode 100644 index 00000000..e558d3dd Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Miscellaneous2-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ModalDialog-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ModalDialog-24x24.png new file mode 100644 index 00000000..6020d410 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ModalDialog-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MultimediaAndUtilities-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MultimediaAndUtilities-48x48.png new file mode 100644 index 00000000..25232c65 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/MultimediaAndUtilities-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/OnChangingEvent-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/OnChangingEvent-24x24.png new file mode 100644 index 00000000..3ae69862 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/OnChangingEvent-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/OnOpenEvent-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/OnOpenEvent-24x24.png new file mode 100644 index 00000000..efb9a2fe Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/OnOpenEvent-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Paging-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Paging-24x24.png new file mode 100644 index 00000000..73189d21 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Paging-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Panel-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Panel-24x24.png new file mode 100644 index 00000000..ccc79a41 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Panel-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/PaperClip-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/PaperClip-16x16.png new file mode 100644 index 00000000..f2bd4aaa Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/PaperClip-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/PortalLayout-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/PortalLayout-24x24.png new file mode 100644 index 00000000..8eef2946 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/PortalLayout-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/QuestionmarkButton-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/QuestionmarkButton-16x16.png new file mode 100644 index 00000000..d8b41272 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/QuestionmarkButton-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Radio-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Radio-24x24.png new file mode 100644 index 00000000..620a874d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Radio-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ReadingGlass-128x128.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ReadingGlass-128x128.png new file mode 100644 index 00000000..1e42bb31 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ReadingGlass-128x128.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptGroovy-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptGroovy-24x24.png new file mode 100644 index 00000000..677b8913 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptGroovy-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptJava-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptJava-24x24.png new file mode 100644 index 00000000..2c067dbe Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptJava-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptJavascript-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptJavascript-24x24.png new file mode 100644 index 00000000..aa6e13f8 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptJavascript-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptPython-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptPython-24x24.png new file mode 100644 index 00000000..42e08375 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptPython-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptRuby-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptRuby-24x24.png new file mode 100644 index 00000000..cad0f6a4 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ScriptRuby-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Scripts-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Scripts-24x24.png new file mode 100644 index 00000000..fc345ed7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Scripts-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Seam-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Seam-24x24.png new file mode 100644 index 00000000..d5dbc6d1 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Seam-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ShoppingCart-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ShoppingCart-16x16.png new file mode 100644 index 00000000..3e2bb625 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ShoppingCart-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SimileTimeline-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SimileTimeline-24x24.png new file mode 100644 index 00000000..8b6f6029 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SimileTimeline-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SimileTimeplot-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SimileTimeplot-24x24.png new file mode 100644 index 00000000..642a583b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SimileTimeplot-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Slider-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Slider-24x24.png new file mode 100644 index 00000000..2789c944 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Slider-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Splitters-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Splitters-24x24.png new file mode 100644 index 00000000..63921df7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Splitters-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SpringSecurity-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SpringSecurity-24x24.png new file mode 100644 index 00000000..a78f062a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SpringSecurity-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SpringWebflow-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SpringWebflow-24x24.png new file mode 100644 index 00000000..dfd0e78b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/SpringWebflow-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Spyglass-128x128.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Spyglass-128x128.png new file mode 100644 index 00000000..0f4da1e1 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Spyglass-128x128.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Spyglass-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Spyglass-16x16.png new file mode 100644 index 00000000..59f51566 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Spyglass-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/StyleSheets-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/StyleSheets-24x24.png new file mode 100644 index 00000000..e2f9fdc5 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/StyleSheets-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Tabbox-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Tabbox-24x24.png new file mode 100644 index 00000000..d0365b0a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Tabbox-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TableLayout-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TableLayout-24x24.png new file mode 100644 index 00000000..8cad870d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TableLayout-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Target-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Target-24x24.png new file mode 100644 index 00000000..7506e76d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Target-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Timer-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Timer-24x24.png new file mode 100644 index 00000000..7f80a6a0 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Timer-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Toolbar-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Toolbar-24x24.png new file mode 100644 index 00000000..8ea485e4 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Toolbar-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ToolbarsAndMenus-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ToolbarsAndMenus-48x48.png new file mode 100644 index 00000000..d13a5bd3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ToolbarsAndMenus-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TooltipsAndPopups-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TooltipsAndPopups-24x24.png new file mode 100644 index 00000000..fa6edc90 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TooltipsAndPopups-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Tree-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Tree-24x24.png new file mode 100644 index 00000000..5b7c75f0 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Tree-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TreeLiveData-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TreeLiveData-24x24.png new file mode 100644 index 00000000..7e1c75ae Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TreeLiveData-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TreePaging-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TreePaging-24x24.png new file mode 100644 index 00000000..27e02f8c Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/TreePaging-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/UserProfileMale-16x16.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/UserProfileMale-16x16.png new file mode 100644 index 00000000..ee3139cd Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/UserProfileMale-16x16.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/VariousForm-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/VariousForm-24x24.png new file mode 100644 index 00000000..677f2628 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/VariousForm-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Window-24x24.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Window-24x24.png new file mode 100644 index 00000000..938219ab Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/Window-24x24.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/WindowGlobe-32x32.gif b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/WindowGlobe-32x32.gif new file mode 100644 index 00000000..d3cca6e1 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/WindowGlobe-32x32.gif differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ZKMore-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ZKMore-48x48.png new file mode 100644 index 00000000..07c22fcd Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ZKMore-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ZKMore2-48x48.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ZKMore2-48x48.png new file mode 100644 index 00000000..b556f88a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/ZKMore2-48x48.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/large-sel.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/large-sel.png new file mode 100644 index 00000000..b0183fcf Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/large-sel.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/large.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/large.png new file mode 100644 index 00000000..fb632b4b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/large.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/normal-sel.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/normal-sel.png new file mode 100644 index 00000000..94e8840b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/normal-sel.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/normal.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/normal.png new file mode 100644 index 00000000..2f7ddac3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/normal.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/readme.txt b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/readme.txt new file mode 100644 index 00000000..b677e9c3 --- /dev/null +++ b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/readme.txt @@ -0,0 +1,6 @@ +ZK widget icons created by +Centigrade GmbH, Germany +http://www.centigrade.de +Copyright 2008. All rights reserved. + +Limited usage rights granted by Centigrade. Reselling of these icons is strictly prohibited. To use or redistribute icons in this folder please consult Centigrade GmbH for licensing details (www.centigrade.de). \ No newline at end of file diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/small-sel.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/small-sel.png new file mode 100644 index 00000000..05f061d4 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/small-sel.png differ diff --git a/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/small.png b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/small.png new file mode 100644 index 00000000..31658659 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/Centigrade-Widget-Icons/small.png differ diff --git a/server/user.jobengine.osgi.server/img/ZK-Logo-old.gif b/server/user.jobengine.osgi.server/img/ZK-Logo-old.gif new file mode 100644 index 00000000..0db6cee9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/ZK-Logo-old.gif differ diff --git a/server/user.jobengine.osgi.server/img/ZK-Logo.gif b/server/user.jobengine.osgi.server/img/ZK-Logo.gif new file mode 100644 index 00000000..8722f4bc Binary files /dev/null and b/server/user.jobengine.osgi.server/img/ZK-Logo.gif differ diff --git a/server/user.jobengine.osgi.server/img/b-button.png b/server/user.jobengine.osgi.server/img/b-button.png new file mode 100644 index 00000000..2f01ac43 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/b-button.png differ diff --git a/server/user.jobengine.osgi.server/img/bar.png b/server/user.jobengine.osgi.server/img/bar.png new file mode 100644 index 00000000..eae70388 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/bar.png differ diff --git a/server/user.jobengine.osgi.server/img/battery.gif b/server/user.jobengine.osgi.server/img/battery.gif new file mode 100644 index 00000000..f736423b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/battery.gif differ diff --git a/server/user.jobengine.osgi.server/img/breeze-arrow-left.png b/server/user.jobengine.osgi.server/img/breeze-arrow-left.png new file mode 100644 index 00000000..4d8e5c71 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/breeze-arrow-left.png differ diff --git a/server/user.jobengine.osgi.server/img/breeze-arrow-right.png b/server/user.jobengine.osgi.server/img/breeze-arrow-right.png new file mode 100644 index 00000000..68955b6c Binary files /dev/null and b/server/user.jobengine.osgi.server/img/breeze-arrow-right.png differ diff --git a/server/user.jobengine.osgi.server/img/breeze-category-bg.png b/server/user.jobengine.osgi.server/img/breeze-category-bg.png new file mode 100644 index 00000000..0ddee7c2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/breeze-category-bg.png differ diff --git a/server/user.jobengine.osgi.server/img/breeze-category-over-seld.png b/server/user.jobengine.osgi.server/img/breeze-category-over-seld.png new file mode 100644 index 00000000..1368f466 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/breeze-category-over-seld.png differ diff --git a/server/user.jobengine.osgi.server/img/breeze-category-over.png b/server/user.jobengine.osgi.server/img/breeze-category-over.png new file mode 100644 index 00000000..6f3a8fc9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/breeze-category-over.png differ diff --git a/server/user.jobengine.osgi.server/img/breeze-category-seld.png b/server/user.jobengine.osgi.server/img/breeze-category-seld.png new file mode 100644 index 00000000..c2a18df3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/breeze-category-seld.png differ diff --git a/server/user.jobengine.osgi.server/img/button.png b/server/user.jobengine.osgi.server/img/button.png new file mode 100644 index 00000000..7aae9d36 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/button.png differ diff --git a/server/user.jobengine.osgi.server/img/calendar.gif b/server/user.jobengine.osgi.server/img/calendar.gif new file mode 100644 index 00000000..d1a87714 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/calendar.gif differ diff --git a/server/user.jobengine.osgi.server/img/castle.png b/server/user.jobengine.osgi.server/img/castle.png new file mode 100644 index 00000000..de9b27e2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/castle.png differ diff --git a/server/user.jobengine.osgi.server/img/category-bg.png b/server/user.jobengine.osgi.server/img/category-bg.png new file mode 100644 index 00000000..0dfaf681 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/category-bg.png differ diff --git a/server/user.jobengine.osgi.server/img/category-over-seld.png b/server/user.jobengine.osgi.server/img/category-over-seld.png new file mode 100644 index 00000000..989b14f7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/category-over-seld.png differ diff --git a/server/user.jobengine.osgi.server/img/category-over.png b/server/user.jobengine.osgi.server/img/category-over.png new file mode 100644 index 00000000..3735b11a Binary files /dev/null and b/server/user.jobengine.osgi.server/img/category-over.png differ diff --git a/server/user.jobengine.osgi.server/img/category-seld.png b/server/user.jobengine.osgi.server/img/category-seld.png new file mode 100644 index 00000000..89893717 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/category-seld.png differ diff --git a/server/user.jobengine.osgi.server/img/compare.jpg b/server/user.jobengine.osgi.server/img/compare.jpg new file mode 100644 index 00000000..ebd83f69 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/compare.jpg differ diff --git a/server/user.jobengine.osgi.server/img/component/bandbox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/bandbox-rounded-l.gif new file mode 100644 index 00000000..58dbd480 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/bandbox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/bandbox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/bandbox-rounded-s.gif new file mode 100644 index 00000000..0b86a53b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/bandbox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/bandbox-rounded.gif b/server/user.jobengine.osgi.server/img/component/bandbox-rounded.gif new file mode 100644 index 00000000..1d9e874f Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/bandbox-rounded.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/combobox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/combobox-rounded-l.gif new file mode 100644 index 00000000..e6d221f2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/combobox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/combobox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/combobox-rounded-s.gif new file mode 100644 index 00000000..35e11ddc Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/combobox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/combobox-rounded.gif b/server/user.jobengine.osgi.server/img/component/combobox-rounded.gif new file mode 100644 index 00000000..7e574a48 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/combobox-rounded.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/datebox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/datebox-rounded-l.gif new file mode 100644 index 00000000..5fdac13b Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/datebox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/datebox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/datebox-rounded-s.gif new file mode 100644 index 00000000..a0cbf0e6 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/datebox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/datebox-rounded.gif b/server/user.jobengine.osgi.server/img/component/datebox-rounded.gif new file mode 100644 index 00000000..dd18dff0 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/datebox-rounded.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-bandbox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/g-bandbox-rounded-l.gif new file mode 100644 index 00000000..60193c9c Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-bandbox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-bandbox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/g-bandbox-rounded-s.gif new file mode 100644 index 00000000..ddbfe04d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-bandbox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-combobox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/g-combobox-rounded-l.gif new file mode 100644 index 00000000..c1c76af5 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-combobox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-combobox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/g-combobox-rounded-s.gif new file mode 100644 index 00000000..b3470fda Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-combobox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-datebox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/g-datebox-rounded-l.gif new file mode 100644 index 00000000..be54fa66 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-datebox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-datebox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/g-datebox-rounded-s.gif new file mode 100644 index 00000000..7c859fa9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-datebox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-timebox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/g-timebox-rounded-l.gif new file mode 100644 index 00000000..ebb0450d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-timebox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/g-timebox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/g-timebox-rounded-s.gif new file mode 100644 index 00000000..64733bc8 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/g-timebox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/redcombo-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/redcombo-rounded-l.gif new file mode 100644 index 00000000..72594108 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/redcombo-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/redcombo-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/redcombo-rounded-s.gif new file mode 100644 index 00000000..1d91d9b7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/redcombo-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/redcombo-rounded.gif b/server/user.jobengine.osgi.server/img/component/redcombo-rounded.gif new file mode 100644 index 00000000..76d562f5 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/redcombo-rounded.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/timebox-rounded-l.gif b/server/user.jobengine.osgi.server/img/component/timebox-rounded-l.gif new file mode 100644 index 00000000..0cee7a63 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/timebox-rounded-l.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/timebox-rounded-s.gif b/server/user.jobengine.osgi.server/img/component/timebox-rounded-s.gif new file mode 100644 index 00000000..95c119d8 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/timebox-rounded-s.gif differ diff --git a/server/user.jobengine.osgi.server/img/component/timebox-rounded.gif b/server/user.jobengine.osgi.server/img/component/timebox-rounded.gif new file mode 100644 index 00000000..af9eeeea Binary files /dev/null and b/server/user.jobengine.osgi.server/img/component/timebox-rounded.gif differ diff --git a/server/user.jobengine.osgi.server/img/copy_icon.jpg b/server/user.jobengine.osgi.server/img/copy_icon.jpg new file mode 100644 index 00000000..20a1d310 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/copy_icon.jpg differ diff --git a/server/user.jobengine.osgi.server/img/cross-small.png b/server/user.jobengine.osgi.server/img/cross-small.png new file mode 100644 index 00000000..bf0ccbe7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/cross-small.png differ diff --git a/server/user.jobengine.osgi.server/img/defender.gif b/server/user.jobengine.osgi.server/img/defender.gif new file mode 100644 index 00000000..64649008 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/defender.gif differ diff --git a/server/user.jobengine.osgi.server/img/delete.gif b/server/user.jobengine.osgi.server/img/delete.gif new file mode 100644 index 00000000..d39a9b70 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/delete.gif differ diff --git a/server/user.jobengine.osgi.server/img/delete.png b/server/user.jobengine.osgi.server/img/delete.png new file mode 100644 index 00000000..a84f673f Binary files /dev/null and b/server/user.jobengine.osgi.server/img/delete.png differ diff --git a/server/user.jobengine.osgi.server/img/delete_small.png b/server/user.jobengine.osgi.server/img/delete_small.png new file mode 100644 index 00000000..254b3ec6 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/delete_small.png differ diff --git a/server/user.jobengine.osgi.server/img/down.gif b/server/user.jobengine.osgi.server/img/down.gif new file mode 100644 index 00000000..24bccd94 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/down.gif differ diff --git a/server/user.jobengine.osgi.server/img/earth.png b/server/user.jobengine.osgi.server/img/earth.png new file mode 100644 index 00000000..8a234471 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/earth.png differ diff --git a/server/user.jobengine.osgi.server/img/edit.gif b/server/user.jobengine.osgi.server/img/edit.gif new file mode 100644 index 00000000..17f0bf62 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/edit.gif differ diff --git a/server/user.jobengine.osgi.server/img/edit_no_ann.gif b/server/user.jobengine.osgi.server/img/edit_no_ann.gif new file mode 100644 index 00000000..ac2ec9d4 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/edit_no_ann.gif differ diff --git a/server/user.jobengine.osgi.server/img/equal.gif b/server/user.jobengine.osgi.server/img/equal.gif new file mode 100644 index 00000000..44428689 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/equal.gif differ diff --git a/server/user.jobengine.osgi.server/img/extended.gif b/server/user.jobengine.osgi.server/img/extended.gif new file mode 100644 index 00000000..0f65f364 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/extended.gif differ diff --git a/server/user.jobengine.osgi.server/img/funnel.png b/server/user.jobengine.osgi.server/img/funnel.png new file mode 100644 index 00000000..35f1d259 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/funnel.png differ diff --git a/server/user.jobengine.osgi.server/img/g-category-bg.png b/server/user.jobengine.osgi.server/img/g-category-bg.png new file mode 100644 index 00000000..ddd8a914 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/g-category-bg.png differ diff --git a/server/user.jobengine.osgi.server/img/g-category-over-seld.png b/server/user.jobengine.osgi.server/img/g-category-over-seld.png new file mode 100644 index 00000000..7bb783c3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/g-category-over-seld.png differ diff --git a/server/user.jobengine.osgi.server/img/g-category-over.png b/server/user.jobengine.osgi.server/img/g-category-over.png new file mode 100644 index 00000000..0311cd15 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/g-category-over.png differ diff --git a/server/user.jobengine.osgi.server/img/g-category-seld.png b/server/user.jobengine.osgi.server/img/g-category-seld.png new file mode 100644 index 00000000..da648764 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/g-category-seld.png differ diff --git a/server/user.jobengine.osgi.server/img/g-scroll-left.png b/server/user.jobengine.osgi.server/img/g-scroll-left.png new file mode 100644 index 00000000..3ee540c9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/g-scroll-left.png differ diff --git a/server/user.jobengine.osgi.server/img/g-scroll-right.png b/server/user.jobengine.osgi.server/img/g-scroll-right.png new file mode 100644 index 00000000..9f7eb403 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/g-scroll-right.png differ diff --git a/server/user.jobengine.osgi.server/img/generali_logo.gif b/server/user.jobengine.osgi.server/img/generali_logo.gif new file mode 100644 index 00000000..d3e2c633 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/generali_logo.gif differ diff --git a/server/user.jobengine.osgi.server/img/generali_logo2.gif b/server/user.jobengine.osgi.server/img/generali_logo2.gif new file mode 100644 index 00000000..cb6ddbaf Binary files /dev/null and b/server/user.jobengine.osgi.server/img/generali_logo2.gif differ diff --git a/server/user.jobengine.osgi.server/img/genertel_logo.jpg b/server/user.jobengine.osgi.server/img/genertel_logo.jpg new file mode 100644 index 00000000..afae37e0 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/genertel_logo.jpg differ diff --git a/server/user.jobengine.osgi.server/img/inet.png b/server/user.jobengine.osgi.server/img/inet.png new file mode 100644 index 00000000..c4001f80 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/inet.png differ diff --git a/server/user.jobengine.osgi.server/img/item1.jpg b/server/user.jobengine.osgi.server/img/item1.jpg new file mode 100644 index 00000000..de6dab69 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/item1.jpg differ diff --git a/server/user.jobengine.osgi.server/img/item2.jpg b/server/user.jobengine.osgi.server/img/item2.jpg new file mode 100644 index 00000000..ba34e072 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/item2.jpg differ diff --git a/server/user.jobengine.osgi.server/img/item3.jpg b/server/user.jobengine.osgi.server/img/item3.jpg new file mode 100644 index 00000000..d726f8a7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/item3.jpg differ diff --git a/server/user.jobengine.osgi.server/img/item4.jpg b/server/user.jobengine.osgi.server/img/item4.jpg new file mode 100644 index 00000000..c7a592a2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/item4.jpg differ diff --git a/server/user.jobengine.osgi.server/img/live.gif b/server/user.jobengine.osgi.server/img/live.gif new file mode 100644 index 00000000..4ed2cb24 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/live.gif differ diff --git a/server/user.jobengine.osgi.server/img/m1.gif b/server/user.jobengine.osgi.server/img/m1.gif new file mode 100644 index 00000000..9c4e9803 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/m1.gif differ diff --git a/server/user.jobengine.osgi.server/img/m2.gif b/server/user.jobengine.osgi.server/img/m2.gif new file mode 100644 index 00000000..3f6304ae Binary files /dev/null and b/server/user.jobengine.osgi.server/img/m2.gif differ diff --git a/server/user.jobengine.osgi.server/img/m3.gif b/server/user.jobengine.osgi.server/img/m3.gif new file mode 100644 index 00000000..29c7b57e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/m3.gif differ diff --git a/server/user.jobengine.osgi.server/img/media_poster.png b/server/user.jobengine.osgi.server/img/media_poster.png new file mode 100644 index 00000000..64e46c6d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/media_poster.png differ diff --git a/server/user.jobengine.osgi.server/img/mediacube_logo_v2_50x50.png b/server/user.jobengine.osgi.server/img/mediacube_logo_v2_50x50.png new file mode 100644 index 00000000..2da62733 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/mediacube_logo_v2_50x50.png differ diff --git a/server/user.jobengine.osgi.server/img/msn1.gif b/server/user.jobengine.osgi.server/img/msn1.gif new file mode 100644 index 00000000..5faee429 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/msn1.gif differ diff --git a/server/user.jobengine.osgi.server/img/msn2.gif b/server/user.jobengine.osgi.server/img/msn2.gif new file mode 100644 index 00000000..bc110275 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/msn2.gif differ diff --git a/server/user.jobengine.osgi.server/img/network.gif b/server/user.jobengine.osgi.server/img/network.gif new file mode 100644 index 00000000..937ecd6c Binary files /dev/null and b/server/user.jobengine.osgi.server/img/network.gif differ diff --git a/server/user.jobengine.osgi.server/img/open.gif b/server/user.jobengine.osgi.server/img/open.gif new file mode 100644 index 00000000..6bafd402 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/open.gif differ diff --git a/server/user.jobengine.osgi.server/img/paste.gif b/server/user.jobengine.osgi.server/img/paste.gif new file mode 100644 index 00000000..184cc359 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/paste.gif differ diff --git a/server/user.jobengine.osgi.server/img/pencil-small.png b/server/user.jobengine.osgi.server/img/pencil-small.png new file mode 100644 index 00000000..e6f2ca02 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/pencil-small.png differ diff --git a/server/user.jobengine.osgi.server/img/r-button.png b/server/user.jobengine.osgi.server/img/r-button.png new file mode 100644 index 00000000..20cc5959 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/r-button.png differ diff --git a/server/user.jobengine.osgi.server/img/received.png b/server/user.jobengine.osgi.server/img/received.png new file mode 100644 index 00000000..43addf3e Binary files /dev/null and b/server/user.jobengine.osgi.server/img/received.png differ diff --git a/server/user.jobengine.osgi.server/img/save.gif b/server/user.jobengine.osgi.server/img/save.gif new file mode 100644 index 00000000..bd456bca Binary files /dev/null and b/server/user.jobengine.osgi.server/img/save.gif differ diff --git a/server/user.jobengine.osgi.server/img/scroll-left.png b/server/user.jobengine.osgi.server/img/scroll-left.png new file mode 100644 index 00000000..b504c7e5 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/scroll-left.png differ diff --git a/server/user.jobengine.osgi.server/img/scroll-right.png b/server/user.jobengine.osgi.server/img/scroll-right.png new file mode 100644 index 00000000..48bfa3d6 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/scroll-right.png differ diff --git a/server/user.jobengine.osgi.server/img/search.gif b/server/user.jobengine.osgi.server/img/search.gif new file mode 100644 index 00000000..39fba5ce Binary files /dev/null and b/server/user.jobengine.osgi.server/img/search.gif differ diff --git a/server/user.jobengine.osgi.server/img/search.png b/server/user.jobengine.osgi.server/img/search.png new file mode 100644 index 00000000..d9bc3382 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/search.png differ diff --git a/server/user.jobengine.osgi.server/img/sent.png b/server/user.jobengine.osgi.server/img/sent.png new file mode 100644 index 00000000..128cb4e2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/sent.png differ diff --git a/server/user.jobengine.osgi.server/img/sun.jpg b/server/user.jobengine.osgi.server/img/sun.jpg new file mode 100644 index 00000000..cfc3c1d3 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/sun.jpg differ diff --git a/server/user.jobengine.osgi.server/img/tick-small.png b/server/user.jobengine.osgi.server/img/tick-small.png new file mode 100644 index 00000000..a110aef9 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/tick-small.png differ diff --git a/server/user.jobengine.osgi.server/img/undo.png b/server/user.jobengine.osgi.server/img/undo.png new file mode 100644 index 00000000..16086b99 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/undo.png differ diff --git a/server/user.jobengine.osgi.server/img/undo_small.png b/server/user.jobengine.osgi.server/img/undo_small.png new file mode 100644 index 00000000..381b1ba2 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/undo_small.png differ diff --git a/server/user.jobengine.osgi.server/img/unknowndoc.jpg b/server/user.jobengine.osgi.server/img/unknowndoc.jpg new file mode 100644 index 00000000..f6f9058d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/unknowndoc.jpg differ diff --git a/server/user.jobengine.osgi.server/img/up.gif b/server/user.jobengine.osgi.server/img/up.gif new file mode 100644 index 00000000..7f0d5dbc Binary files /dev/null and b/server/user.jobengine.osgi.server/img/up.gif differ diff --git a/server/user.jobengine.osgi.server/img/volumn.gif b/server/user.jobengine.osgi.server/img/volumn.gif new file mode 100644 index 00000000..4dcc7c52 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/volumn.gif differ diff --git a/server/user.jobengine.osgi.server/img/watermark.gif b/server/user.jobengine.osgi.server/img/watermark.gif new file mode 100644 index 00000000..4acde918 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/watermark.gif differ diff --git a/server/user.jobengine.osgi.server/img/wireless.gif b/server/user.jobengine.osgi.server/img/wireless.gif new file mode 100644 index 00000000..8f0f6de6 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/wireless.gif differ diff --git a/server/user.jobengine.osgi.server/img/z-bullet1.gif b/server/user.jobengine.osgi.server/img/z-bullet1.gif new file mode 100644 index 00000000..be21553d Binary files /dev/null and b/server/user.jobengine.osgi.server/img/z-bullet1.gif differ diff --git a/server/user.jobengine.osgi.server/img/z-bullet2.gif b/server/user.jobengine.osgi.server/img/z-bullet2.gif new file mode 100644 index 00000000..088b46f7 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/z-bullet2.gif differ diff --git a/server/user.jobengine.osgi.server/img/z-bullet3.gif b/server/user.jobengine.osgi.server/img/z-bullet3.gif new file mode 100644 index 00000000..6d152528 Binary files /dev/null and b/server/user.jobengine.osgi.server/img/z-bullet3.gif differ diff --git a/server/user.jobengine.osgi.server/index.jsp b/server/user.jobengine.osgi.server/index.jsp new file mode 100644 index 00000000..4d136e80 --- /dev/null +++ b/server/user.jobengine.osgi.server/index.jsp @@ -0,0 +1,4 @@ +<% + pageContext.forward("/pages/login.jsp"); + //response.sendRedirect("/pages/login.jsp"); +%> \ No newline at end of file diff --git a/server/user.jobengine.osgi.server/javadoc.xml b/server/user.jobengine.osgi.server/javadoc.xml new file mode 100644 index 00000000..054303c5 --- /dev/null +++ b/server/user.jobengine.osgi.server/javadoc.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/server/user.jobengine.osgi.server/js/video.js b/server/user.jobengine.osgi.server/js/video.js new file mode 100644 index 00000000..101006a4 --- /dev/null +++ b/server/user.jobengine.osgi.server/js/video.js @@ -0,0 +1,27410 @@ +/** + * @license + * Video.js 6.1.0 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */ + +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.videojs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 1 && arguments[1] !== undefined ? arguments[1] : {}; + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + tag = 'button'; + + props = (0, _obj.assign)({ + innerHTML: '', + className: this.buildCSSClass() + }, props); + + // Add attributes for button element + attributes = (0, _obj.assign)({ + + // Necessary since the default button type is "submit" + 'type': 'button', + + // let the screen reader user know that the text of the button may change + 'aria-live': 'polite' + }, attributes); + + var el = _component2['default'].prototype.createEl.call(this, tag, props, attributes); + + this.createControlTextEl(el); + + return el; + }; + + /** + * Add a child `Component` inside of this `Button`. + * + * @param {string|Component} child + * The name or instance of a child to add. + * + * @param {Object} [options={}] + * The key/value store of options that will get passed to children of + * the child. + * + * @return {Component} + * The `Component` that gets added as a child. When using a string the + * `Component` will get created by this process. + * + * @deprecated since version 5 + */ + + + Button.prototype.addChild = function addChild(child) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var className = this.constructor.name; + + _log2['default'].warn('Adding an actionable (user controllable) child to a Button (' + className + ') is not supported; use a ClickableComponent instead.'); + + // Avoid the error message generated by ClickableComponent's addChild method + return _component2['default'].prototype.addChild.call(this, child, options); + }; + + /** + * Enable the `Button` element so that it can be activated or clicked. Use this with + * {@link Button#disable}. + */ + + + Button.prototype.enable = function enable() { + _ClickableComponent.prototype.enable.call(this); + this.el_.removeAttribute('disabled'); + }; + + /** + * Enable the `Button` element so that it cannot be activated or clicked. Use this with + * {@link Button#enable}. + */ + + + Button.prototype.disable = function disable() { + _ClickableComponent.prototype.disable.call(this); + this.el_.setAttribute('disabled', 'disabled'); + }; + + /** + * This gets called when a `Button` has focus and `keydown` is triggered via a key + * press. + * + * @param {EventTarget~Event} event + * The event that caused this function to get called. + * + * @listens keydown + */ + + + Button.prototype.handleKeyPress = function handleKeyPress(event) { + + // Ignore Space (32) or Enter (13) key operation, which is handled by the browser for a button. + if (event.which === 32 || event.which === 13) { + return; + } + + // Pass keypress handling up for unsupported keys + _ClickableComponent.prototype.handleKeyPress.call(this, event); + }; + + return Button; +}(_clickableComponent2['default']); + +_component2['default'].registerComponent('Button', Button); +exports['default'] = Button; + +},{"3":3,"5":5,"91":91,"93":93}],3:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _log = _dereq_(91); + +var _log2 = _interopRequireDefault(_log); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +var _obj = _dereq_(93); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file button.js + */ + + +/** + * Clickable Component which is clickable or keyboard actionable, + * but is not a native HTML button. + * + * @extends Component + */ +var ClickableComponent = function (_Component) { + _inherits(ClickableComponent, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function ClickableComponent(player, options) { + _classCallCheck(this, ClickableComponent); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.emitTapEvents(); + + _this.enable(); + return _this; + } + + /** + * Create the `Component`s DOM element. + * + * @param {string} [tag=div] + * The element's node type. + * + * @param {Object} [props={}] + * An object of properties that should be set on the element. + * + * @param {Object} [attributes={}] + * An object of attributes that should be set on the element. + * + * @return {Element} + * The element that gets created. + */ + + + ClickableComponent.prototype.createEl = function createEl() { + var tag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'div'; + var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + props = (0, _obj.assign)({ + innerHTML: '', + className: this.buildCSSClass(), + tabIndex: 0 + }, props); + + if (tag === 'button') { + _log2['default'].error('Creating a ClickableComponent with an HTML element of ' + tag + ' is not supported; use a Button instead.'); + } + + // Add ARIA attributes for clickable element which is not a native HTML button + attributes = (0, _obj.assign)({ + 'role': 'button', + + // let the screen reader user know that the text of the element may change + 'aria-live': 'polite' + }, attributes); + + this.tabIndex_ = props.tabIndex; + + var el = _Component.prototype.createEl.call(this, tag, props, attributes); + + this.createControlTextEl(el); + + return el; + }; + + /** + * Create a control text element on this `Component` + * + * @param {Element} [el] + * Parent element for the control text. + * + * @return {Element} + * The control text element that gets created. + */ + + + ClickableComponent.prototype.createControlTextEl = function createControlTextEl(el) { + this.controlTextEl_ = Dom.createEl('span', { + className: 'vjs-control-text' + }); + + if (el) { + el.appendChild(this.controlTextEl_); + } + + this.controlText(this.controlText_, el); + + return this.controlTextEl_; + }; + + /** + * Get or set the localize text to use for the controls on the `Component`. + * + * @param {string} [text] + * Control text for element. + * + * @param {Element} [el=this.el()] + * Element to set the title on. + * + * @return {string} + * - The control text when getting + */ + + + ClickableComponent.prototype.controlText = function controlText(text) { + var el = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.el(); + + if (!text) { + return this.controlText_ || 'Need Text'; + } + + var localizedText = this.localize(text); + + this.controlText_ = text; + this.controlTextEl_.innerHTML = localizedText; + if (!this.nonIconControl) { + // Set title attribute if only an icon is shown + el.setAttribute('title', localizedText); + } + }; + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + ClickableComponent.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-control vjs-button ' + _Component.prototype.buildCSSClass.call(this); + }; + + /** + * Enable this `Component`s element. + */ + + + ClickableComponent.prototype.enable = function enable() { + if (!this.enabled_) { + this.enabled_ = true; + this.removeClass('vjs-disabled'); + this.el_.setAttribute('aria-disabled', 'false'); + if (typeof this.tabIndex_ !== 'undefined') { + this.el_.setAttribute('tabIndex', this.tabIndex_); + } + this.on(['tap', 'click'], this.handleClick); + this.on('focus', this.handleFocus); + this.on('blur', this.handleBlur); + } + }; + + /** + * Disable this `Component`s element. + */ + + + ClickableComponent.prototype.disable = function disable() { + this.enabled_ = false; + this.addClass('vjs-disabled'); + this.el_.setAttribute('aria-disabled', 'true'); + if (typeof this.tabIndex_ !== 'undefined') { + this.el_.removeAttribute('tabIndex'); + } + this.off(['tap', 'click'], this.handleClick); + this.off('focus', this.handleFocus); + this.off('blur', this.handleBlur); + }; + + /** + * This gets called when a `ClickableComponent` gets: + * - Clicked (via the `click` event, listening starts in the constructor) + * - Tapped (via the `tap` event, listening starts in the constructor) + * - The following things happen in order: + * 1. {@link ClickableComponent#handleFocus} is called via a `focus` event on the + * `ClickableComponent`. + * 2. {@link ClickableComponent#handleFocus} adds a listener for `keydown` on using + * {@link ClickableComponent#handleKeyPress}. + * 3. `ClickableComponent` has not had a `blur` event (`blur` means that focus was lost). The user presses + * the space or enter key. + * 4. {@link ClickableComponent#handleKeyPress} calls this function with the `keydown` + * event as a parameter. + * + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + * @abstract + */ + + + ClickableComponent.prototype.handleClick = function handleClick(event) {}; + + /** + * This gets called when a `ClickableComponent` gains focus via a `focus` event. + * Turns on listening for `keydown` events. When they happen it + * calls `this.handleKeyPress`. + * + * @param {EventTarget~Event} event + * The `focus` event that caused this function to be called. + * + * @listens focus + */ + + + ClickableComponent.prototype.handleFocus = function handleFocus(event) { + Events.on(_document2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); + }; + + /** + * Called when this ClickableComponent has focus and a key gets pressed down. By + * default it will call `this.handleClick` when the key is space or enter. + * + * @param {EventTarget~Event} event + * The `keydown` event that caused this function to be called. + * + * @listens keydown + */ + + + ClickableComponent.prototype.handleKeyPress = function handleKeyPress(event) { + + // Support Space (32) or Enter (13) key operation to fire a click event + if (event.which === 32 || event.which === 13) { + event.preventDefault(); + this.trigger('click'); + } else if (_Component.prototype.handleKeyPress) { + + // Pass keypress handling up for unsupported keys + _Component.prototype.handleKeyPress.call(this, event); + } + }; + + /** + * Called when a `ClickableComponent` loses focus. Turns off the listener for + * `keydown` events. Which Stops `this.handleKeyPress` from getting called. + * + * @param {EventTarget~Event} event + * The `blur` event that caused this function to be called. + * + * @listens blur + */ + + + ClickableComponent.prototype.handleBlur = function handleBlur(event) { + Events.off(_document2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); + }; + + return ClickableComponent; +}(_component2['default']); + +_component2['default'].registerComponent('ClickableComponent', ClickableComponent); +exports['default'] = ClickableComponent; + +},{"5":5,"85":85,"86":86,"88":88,"91":91,"93":93,"99":99}],4:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _button = _dereq_(2); + +var _button2 = _interopRequireDefault(_button); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file close-button.js + */ + + +/** + * The `CloseButton` is a `{@link Button}` that fires a `close` event when + * it gets clicked. + * + * @extends Button + */ +var CloseButton = function (_Button) { + _inherits(CloseButton, _Button); + + /** + * Creates an instance of the this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function CloseButton(player, options) { + _classCallCheck(this, CloseButton); + + var _this = _possibleConstructorReturn(this, _Button.call(this, player, options)); + + _this.controlText(options && options.controlText || _this.localize('Close')); + return _this; + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + CloseButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-close-button ' + _Button.prototype.buildCSSClass.call(this); + }; + + /** + * This gets called when a `CloseButton` gets clicked. See + * {@link ClickableComponent#handleClick} for more information on when this will be + * triggered + * + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + * @fires CloseButton#close + */ + + + CloseButton.prototype.handleClick = function handleClick(event) { + + /** + * Triggered when the a `CloseButton` is clicked. + * + * @event CloseButton#close + * @type {EventTarget~Event} + * + * @property {boolean} [bubbles=false] + * set to false so that the close event does not + * bubble up to parents if there is no listener + */ + this.trigger({ type: 'close', bubbles: false }); + }; + + return CloseButton; +}(_button2['default']); + +_component2['default'].registerComponent('CloseButton', CloseButton); +exports['default'] = CloseButton; + +},{"2":2,"5":5}],5:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _window = _dereq_(100); + +var _window2 = _interopRequireDefault(_window); + +var _evented = _dereq_(53); + +var _evented2 = _interopRequireDefault(_evented); + +var _stateful = _dereq_(54); + +var _stateful2 = _interopRequireDefault(_stateful); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _domData = _dereq_(84); + +var DomData = _interopRequireWildcard(_domData); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _guid = _dereq_(90); + +var Guid = _interopRequireWildcard(_guid); + +var _log = _dereq_(91); + +var _log2 = _interopRequireDefault(_log); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +var _mergeOptions = _dereq_(92); + +var _mergeOptions2 = _interopRequireDefault(_mergeOptions); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** + * Player Component - Base class for all UI objects + * + * @file component.js + */ + + +/** + * Base class for all UI Components. + * Components are UI objects which represent both a javascript object and an element + * in the DOM. They can be children of other components, and can have + * children themselves. + * + * Components can also use methods from {@link EventTarget} + */ +var Component = function () { + + /** + * A callback that is called when a component is ready. Does not have any + * paramters and any callback value will be ignored. + * + * @callback Component~ReadyCallback + * @this Component + */ + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Object[]} [options.children] + * An array of children objects to intialize this component with. Children objects have + * a name property that will be used if more than one component of the same type needs to be + * added. + * + * @param {Component~ReadyCallback} [ready] + * Function that gets called when the `Component` is ready. + */ + function Component(player, options, ready) { + _classCallCheck(this, Component); + + // The component might be the player itself and we can't pass `this` to super + if (!player && this.play) { + this.player_ = player = this; // eslint-disable-line + } else { + this.player_ = player; + } + + // Make a copy of prototype.options_ to protect against overriding defaults + this.options_ = (0, _mergeOptions2['default'])({}, this.options_); + + // Updated options with supplied options + options = this.options_ = (0, _mergeOptions2['default'])(this.options_, options); + + // Get ID from options or options element if one is supplied + this.id_ = options.id || options.el && options.el.id; + + // If there was no ID from the options, generate one + if (!this.id_) { + // Don't require the player ID function in the case of mock players + var id = player && player.id && player.id() || 'no_player'; + + this.id_ = id + '_component_' + Guid.newGUID(); + } + + this.name_ = options.name || null; + + // Create element if one wasn't provided in options + if (options.el) { + this.el_ = options.el; + } else if (options.createEl !== false) { + this.el_ = this.createEl(); + } + + // Make this an evented object and use `el_`, if available, as its event bus + (0, _evented2['default'])(this, { eventBusKey: this.el_ ? 'el_' : null }); + (0, _stateful2['default'])(this, this.constructor.defaultState); + + this.children_ = []; + this.childIndex_ = {}; + this.childNameIndex_ = {}; + + // Add any child components in options + if (options.initChildren !== false) { + this.initChildren(); + } + + this.ready(ready); + // Don't want to trigger ready here or it will before init is actually + // finished for all children that run this constructor + + if (options.reportTouchActivity !== false) { + this.enableTouchActivity(); + } + } + + /** + * Dispose of the `Component` and all child components. + * + * @fires Component#dispose + */ + + + Component.prototype.dispose = function dispose() { + + /** + * Triggered when a `Component` is disposed. + * + * @event Component#dispose + * @type {EventTarget~Event} + * + * @property {boolean} [bubbles=false] + * set to false so that the close event does not + * bubble up + */ + this.trigger({ type: 'dispose', bubbles: false }); + + // Dispose all children. + if (this.children_) { + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i].dispose) { + this.children_[i].dispose(); + } + } + } + + // Delete child references + this.children_ = null; + this.childIndex_ = null; + this.childNameIndex_ = null; + + if (this.el_) { + // Remove element from DOM + if (this.el_.parentNode) { + this.el_.parentNode.removeChild(this.el_); + } + + DomData.removeData(this.el_); + this.el_ = null; + } + }; + + /** + * Return the {@link Player} that the `Component` has attached to. + * + * @return {Player} + * The player that this `Component` has attached to. + */ + + + Component.prototype.player = function player() { + return this.player_; + }; + + /** + * Deep merge of options objects with new options. + * > Note: When both `obj` and `options` contain properties whose values are objects. + * The two properties get merged using {@link module:mergeOptions} + * + * @param {Object} obj + * The object that contains new options. + * + * @return {Object} + * A new object of `this.options_` and `obj` merged together. + * + * @deprecated since version 5 + */ + + + Component.prototype.options = function options(obj) { + _log2['default'].warn('this.options() has been deprecated and will be moved to the constructor in 6.0'); + + if (!obj) { + return this.options_; + } + + this.options_ = (0, _mergeOptions2['default'])(this.options_, obj); + return this.options_; + }; + + /** + * Get the `Component`s DOM element + * + * @return {Element} + * The DOM element for this `Component`. + */ + + + Component.prototype.el = function el() { + return this.el_; + }; + + /** + * Create the `Component`s DOM element. + * + * @param {string} [tagName] + * Element's DOM node type. e.g. 'div' + * + * @param {Object} [properties] + * An object of properties that should be set. + * + * @param {Object} [attributes] + * An object of attributes that should be set. + * + * @return {Element} + * The element that gets created. + */ + + + Component.prototype.createEl = function createEl(tagName, properties, attributes) { + return Dom.createEl(tagName, properties, attributes); + }; + + /** + * Localize a string given the string in english. + * + * If tokens are provided, it'll try and run a simple token replacement on the provided string. + * The tokens it loooks for look like `{1}` with the index being 1-indexed into the tokens array. + * + * If a `defaultValue` is provided, it'll use that over `string`, + * if a value isn't found in provided language files. + * This is useful if you want to have a descriptive key for token replacement + * but have a succinct localized string and not require `en.json` to be included. + * + * Currently, it is used for the progress bar timing. + * ```js + * { + * "progress bar timing: currentTime={1} duration={2}": "{1} of {2}" + * } + * ``` + * It is then used like so: + * ```js + * this.localize('progress bar timing: currentTime={1} duration{2}', + * [this.player_.currentTime(), this.player_.duration()], + * '{1} of {2}'); + * ``` + * + * Which outputs something like: `01:23 of 24:56`. + * + * + * @param {string} string + * The string to localize and the key to lookup in the language files. + * @param {string[]} [tokens] + * If the current item has token replacements, provide the tokens here. + * @param {string} [defaultValue] + * Defaults to `string`. Can be a default value to use for token replacement + * if the lookup key is needed to be separate. + * + * @return {string} + * The localized string or if no localization exists the english string. + */ + + + Component.prototype.localize = function localize(string, tokens) { + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : string; + + var code = this.player_.language && this.player_.language(); + var languages = this.player_.languages && this.player_.languages(); + var language = languages && languages[code]; + var primaryCode = code && code.split('-')[0]; + var primaryLang = languages && languages[primaryCode]; + + var localizedString = defaultValue; + + if (language && language[string]) { + localizedString = language[string]; + } else if (primaryLang && primaryLang[string]) { + localizedString = primaryLang[string]; + } + + if (tokens) { + localizedString = localizedString.replace(/\{(\d+)\}/g, function (match, index) { + var value = tokens[index - 1]; + var ret = value; + + if (typeof value === 'undefined') { + ret = match; + } + + return ret; + }); + } + + return localizedString; + }; + + /** + * Return the `Component`s DOM element. This is where children get inserted. + * This will usually be the the same as the element returned in {@link Component#el}. + * + * @return {Element} + * The content element for this `Component`. + */ + + + Component.prototype.contentEl = function contentEl() { + return this.contentEl_ || this.el_; + }; + + /** + * Get this `Component`s ID + * + * @return {string} + * The id of this `Component` + */ + + + Component.prototype.id = function id() { + return this.id_; + }; + + /** + * Get the `Component`s name. The name gets used to reference the `Component` + * and is set during registration. + * + * @return {string} + * The name of this `Component`. + */ + + + Component.prototype.name = function name() { + return this.name_; + }; + + /** + * Get an array of all child components + * + * @return {Array} + * The children + */ + + + Component.prototype.children = function children() { + return this.children_; + }; + + /** + * Returns the child `Component` with the given `id`. + * + * @param {string} id + * The id of the child `Component` to get. + * + * @return {Component|undefined} + * The child `Component` with the given `id` or undefined. + */ + + + Component.prototype.getChildById = function getChildById(id) { + return this.childIndex_[id]; + }; + + /** + * Returns the child `Component` with the given `name`. + * + * @param {string} name + * The name of the child `Component` to get. + * + * @return {Component|undefined} + * The child `Component` with the given `name` or undefined. + */ + + + Component.prototype.getChild = function getChild(name) { + if (!name) { + return; + } + + name = (0, _toTitleCase2['default'])(name); + + return this.childNameIndex_[name]; + }; + + /** + * Add a child `Component` inside the current `Component`. + * + * + * @param {string|Component} child + * The name or instance of a child to add. + * + * @param {Object} [options={}] + * The key/value store of options that will get passed to children of + * the child. + * + * @param {number} [index=this.children_.length] + * The index to attempt to add a child into. + * + * @return {Component} + * The `Component` that gets added as a child. When using a string the + * `Component` will get created by this process. + */ + + + Component.prototype.addChild = function addChild(child) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.children_.length; + + var component = void 0; + var componentName = void 0; + + // If child is a string, create component with options + if (typeof child === 'string') { + componentName = (0, _toTitleCase2['default'])(child); + + var componentClassName = options.componentClass || componentName; + + // Set name through options + options.name = componentName; + + // Create a new object & element for this controls set + // If there's no .player_, this is a player + var ComponentClass = Component.getComponent(componentClassName); + + if (!ComponentClass) { + throw new Error('Component ' + componentClassName + ' does not exist'); + } + + // data stored directly on the videojs object may be + // misidentified as a component to retain + // backwards-compatibility with 4.x. check to make sure the + // component class can be instantiated. + if (typeof ComponentClass !== 'function') { + return null; + } + + component = new ComponentClass(this.player_ || this, options); + + // child is a component instance + } else { + component = child; + } + + this.children_.splice(index, 0, component); + + if (typeof component.id === 'function') { + this.childIndex_[component.id()] = component; + } + + // If a name wasn't used to create the component, check if we can use the + // name function of the component + componentName = componentName || component.name && (0, _toTitleCase2['default'])(component.name()); + + if (componentName) { + this.childNameIndex_[componentName] = component; + } + + // Add the UI object's element to the container div (box) + // Having an element is not required + if (typeof component.el === 'function' && component.el()) { + var childNodes = this.contentEl().children; + var refNode = childNodes[index] || null; + + this.contentEl().insertBefore(component.el(), refNode); + } + + // Return so it can stored on parent object if desired. + return component; + }; + + /** + * Remove a child `Component` from this `Component`s list of children. Also removes + * the child `Component`s element from this `Component`s element. + * + * @param {Component} component + * The child `Component` to remove. + */ + + + Component.prototype.removeChild = function removeChild(component) { + if (typeof component === 'string') { + component = this.getChild(component); + } + + if (!component || !this.children_) { + return; + } + + var childFound = false; + + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i] === component) { + childFound = true; + this.children_.splice(i, 1); + break; + } + } + + if (!childFound) { + return; + } + + this.childIndex_[component.id()] = null; + this.childNameIndex_[component.name()] = null; + + var compEl = component.el(); + + if (compEl && compEl.parentNode === this.contentEl()) { + this.contentEl().removeChild(component.el()); + } + }; + + /** + * Add and initialize default child `Component`s based upon options. + */ + + + Component.prototype.initChildren = function initChildren() { + var _this = this; + + var children = this.options_.children; + + if (children) { + // `this` is `parent` + var parentOptions = this.options_; + + var handleAdd = function handleAdd(child) { + var name = child.name; + var opts = child.opts; + + // Allow options for children to be set at the parent options + // e.g. videojs(id, { controlBar: false }); + // instead of videojs(id, { children: { controlBar: false }); + if (parentOptions[name] !== undefined) { + opts = parentOptions[name]; + } + + // Allow for disabling default components + // e.g. options['children']['posterImage'] = false + if (opts === false) { + return; + } + + // Allow options to be passed as a simple boolean if no configuration + // is necessary. + if (opts === true) { + opts = {}; + } + + // We also want to pass the original player options + // to each component as well so they don't need to + // reach back into the player for options later. + opts.playerOptions = _this.options_.playerOptions; + + // Create and add the child component. + // Add a direct reference to the child by name on the parent instance. + // If two of the same component are used, different names should be supplied + // for each + var newChild = _this.addChild(name, opts); + + if (newChild) { + _this[name] = newChild; + } + }; + + // Allow for an array of children details to passed in the options + var workingChildren = void 0; + var Tech = Component.getComponent('Tech'); + + if (Array.isArray(children)) { + workingChildren = children; + } else { + workingChildren = Object.keys(children); + } + + workingChildren + // children that are in this.options_ but also in workingChildren would + // give us extra children we do not want. So, we want to filter them out. + .concat(Object.keys(this.options_).filter(function (child) { + return !workingChildren.some(function (wchild) { + if (typeof wchild === 'string') { + return child === wchild; + } + return child === wchild.name; + }); + })).map(function (child) { + var name = void 0; + var opts = void 0; + + if (typeof child === 'string') { + name = child; + opts = children[name] || _this.options_[name] || {}; + } else { + name = child.name; + opts = child; + } + + return { name: name, opts: opts }; + }).filter(function (child) { + // we have to make sure that child.name isn't in the techOrder since + // techs are registerd as Components but can't aren't compatible + // See https://github.com/videojs/video.js/issues/2772 + var c = Component.getComponent(child.opts.componentClass || (0, _toTitleCase2['default'])(child.name)); + + return c && !Tech.isTech(c); + }).forEach(handleAdd); + } + }; + + /** + * Builds the default DOM class name. Should be overriden by sub-components. + * + * @return {string} + * The DOM class name for this object. + * + * @abstract + */ + + + Component.prototype.buildCSSClass = function buildCSSClass() { + // Child classes can include a function that does: + // return 'CLASS NAME' + this._super(); + return ''; + }; + + /** + * Bind a listener to the component's ready state. + * Different from event listeners in that if the ready event has already happened + * it will trigger the function immediately. + * + * @return {Component} + * Returns itself; method can be chained. + */ + + + Component.prototype.ready = function ready(fn) { + var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (fn) { + if (this.isReady_) { + if (sync) { + fn.call(this); + } else { + // Call the function asynchronously by default for consistency + this.setTimeout(fn, 1); + } + } else { + this.readyQueue_ = this.readyQueue_ || []; + this.readyQueue_.push(fn); + } + } + }; + + /** + * Trigger all the ready listeners for this `Component`. + * + * @fires Component#ready + */ + + + Component.prototype.triggerReady = function triggerReady() { + this.isReady_ = true; + + // Ensure ready is triggerd asynchronously + this.setTimeout(function () { + var readyQueue = this.readyQueue_; + + // Reset Ready Queue + this.readyQueue_ = []; + + if (readyQueue && readyQueue.length > 0) { + readyQueue.forEach(function (fn) { + fn.call(this); + }, this); + } + + // Allow for using event listeners also + /** + * Triggered when a `Component` is ready. + * + * @event Component#ready + * @type {EventTarget~Event} + */ + this.trigger('ready'); + }, 1); + }; + + /** + * Find a single DOM element matching a `selector`. This can be within the `Component`s + * `contentEl()` or another custom context. + * + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelector`. + * + * @param {Element|string} [context=this.contentEl()] + * A DOM element within which to query. Can also be a selector string in + * which case the first matching element will get used as context. If + * missing `this.contentEl()` gets used. If `this.contentEl()` returns + * nothing it falls back to `document`. + * + * @return {Element|null} + * the dom element that was found, or null + * + * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors) + */ + + + Component.prototype.$ = function $(selector, context) { + return Dom.$(selector, context || this.contentEl()); + }; + + /** + * Finds all DOM element matching a `selector`. This can be within the `Component`s + * `contentEl()` or another custom context. + * + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelectorAll`. + * + * @param {Element|string} [context=this.contentEl()] + * A DOM element within which to query. Can also be a selector string in + * which case the first matching element will get used as context. If + * missing `this.contentEl()` gets used. If `this.contentEl()` returns + * nothing it falls back to `document`. + * + * @return {NodeList} + * a list of dom elements that were found + * + * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors) + */ + + + Component.prototype.$$ = function $$(selector, context) { + return Dom.$$(selector, context || this.contentEl()); + }; + + /** + * Check if a component's element has a CSS class name. + * + * @param {string} classToCheck + * CSS class name to check. + * + * @return {boolean} + * - True if the `Component` has the class. + * - False if the `Component` does not have the class` + */ + + + Component.prototype.hasClass = function hasClass(classToCheck) { + return Dom.hasClass(this.el_, classToCheck); + }; + + /** + * Add a CSS class name to the `Component`s element. + * + * @param {string} classToAdd + * CSS class name to add + */ + + + Component.prototype.addClass = function addClass(classToAdd) { + Dom.addClass(this.el_, classToAdd); + }; + + /** + * Remove a CSS class name from the `Component`s element. + * + * @param {string} classToRemove + * CSS class name to remove + */ + + + Component.prototype.removeClass = function removeClass(classToRemove) { + Dom.removeClass(this.el_, classToRemove); + }; + + /** + * Add or remove a CSS class name from the component's element. + * - `classToToggle` gets added when {@link Component#hasClass} would return false. + * - `classToToggle` gets removed when {@link Component#hasClass} would return true. + * + * @param {string} classToToggle + * The class to add or remove based on (@link Component#hasClass} + * + * @param {boolean|Dom~predicate} [predicate] + * An {@link Dom~predicate} function or a boolean + */ + + + Component.prototype.toggleClass = function toggleClass(classToToggle, predicate) { + Dom.toggleClass(this.el_, classToToggle, predicate); + }; + + /** + * Show the `Component`s element if it is hidden by removing the + * 'vjs-hidden' class name from it. + */ + + + Component.prototype.show = function show() { + this.removeClass('vjs-hidden'); + }; + + /** + * Hide the `Component`s element if it is currently showing by adding the + * 'vjs-hidden` class name to it. + */ + + + Component.prototype.hide = function hide() { + this.addClass('vjs-hidden'); + }; + + /** + * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing' + * class name to it. Used during fadeIn/fadeOut. + * + * @private + */ + + + Component.prototype.lockShowing = function lockShowing() { + this.addClass('vjs-lock-showing'); + }; + + /** + * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing' + * class name from it. Used during fadeIn/fadeOut. + * + * @private + */ + + + Component.prototype.unlockShowing = function unlockShowing() { + this.removeClass('vjs-lock-showing'); + }; + + /** + * Get the value of an attribute on the `Component`s element. + * + * @param {string} attribute + * Name of the attribute to get the value from. + * + * @return {string|null} + * - The value of the attribute that was asked for. + * - Can be an empty string on some browsers if the attribute does not exist + * or has no value + * - Most browsers will return null if the attibute does not exist or has + * no value. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute} + */ + + + Component.prototype.getAttribute = function getAttribute(attribute) { + return Dom.getAttribute(this.el_, attribute); + }; + + /** + * Set the value of an attribute on the `Component`'s element + * + * @param {string} attribute + * Name of the attribute to set. + * + * @param {string} value + * Value to set the attribute to. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute} + */ + + + Component.prototype.setAttribute = function setAttribute(attribute, value) { + Dom.setAttribute(this.el_, attribute, value); + }; + + /** + * Remove an attribute from the `Component`s element. + * + * @param {string} attribute + * Name of the attribute to remove. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute} + */ + + + Component.prototype.removeAttribute = function removeAttribute(attribute) { + Dom.removeAttribute(this.el_, attribute); + }; + + /** + * Get or set the width of the component based upon the CSS styles. + * See {@link Component#dimension} for more detailed information. + * + * @param {number|string} [num] + * The width that you want to set postfixed with '%', 'px' or nothing. + * + * @param {boolean} [skipListeners] + * Skip the componentresize event trigger + * + * @return {number|string} + * The width when getting, zero if there is no width. Can be a string + * postpixed with '%' or 'px'. + */ + + + Component.prototype.width = function width(num, skipListeners) { + return this.dimension('width', num, skipListeners); + }; + + /** + * Get or set the height of the component based upon the CSS styles. + * See {@link Component#dimension} for more detailed information. + * + * @param {number|string} [num] + * The height that you want to set postfixed with '%', 'px' or nothing. + * + * @param {boolean} [skipListeners] + * Skip the componentresize event trigger + * + * @return {number|string} + * The width when getting, zero if there is no width. Can be a string + * postpixed with '%' or 'px'. + */ + + + Component.prototype.height = function height(num, skipListeners) { + return this.dimension('height', num, skipListeners); + }; + + /** + * Set both the width and height of the `Component` element at the same time. + * + * @param {number|string} width + * Width to set the `Component`s element to. + * + * @param {number|string} height + * Height to set the `Component`s element to. + */ + + + Component.prototype.dimensions = function dimensions(width, height) { + // Skip componentresize listeners on width for optimization + this.width(width, true); + this.height(height); + }; + + /** + * Get or set width or height of the `Component` element. This is the shared code + * for the {@link Component#width} and {@link Component#height}. + * + * Things to know: + * - If the width or height in an number this will return the number postfixed with 'px'. + * - If the width/height is a percent this will return the percent postfixed with '%' + * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function + * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`. + * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/} + * for more information + * - If you want the computed style of the component, use {@link Component#currentWidth} + * and {@link {Component#currentHeight} + * + * @fires Component#componentresize + * + * @param {string} widthOrHeight + 8 'width' or 'height' + * + * @param {number|string} [num] + 8 New dimension + * + * @param {boolean} [skipListeners] + * Skip componentresize event trigger + * + * @return {number} + * The dimension when getting or 0 if unset + */ + + + Component.prototype.dimension = function dimension(widthOrHeight, num, skipListeners) { + if (num !== undefined) { + // Set to zero if null or literally NaN (NaN !== NaN) + if (num === null || num !== num) { + num = 0; + } + + // Check if using css width/height (% or px) and adjust + if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) { + this.el_.style[widthOrHeight] = num; + } else if (num === 'auto') { + this.el_.style[widthOrHeight] = ''; + } else { + this.el_.style[widthOrHeight] = num + 'px'; + } + + // skipListeners allows us to avoid triggering the resize event when setting both width and height + if (!skipListeners) { + /** + * Triggered when a component is resized. + * + * @event Component#componentresize + * @type {EventTarget~Event} + */ + this.trigger('componentresize'); + } + + return; + } + + // Not setting a value, so getting it + // Make sure element exists + if (!this.el_) { + return 0; + } + + // Get dimension value from style + var val = this.el_.style[widthOrHeight]; + var pxIndex = val.indexOf('px'); + + if (pxIndex !== -1) { + // Return the pixel value with no 'px' + return parseInt(val.slice(0, pxIndex), 10); + } + + // No px so using % or no style was set, so falling back to offsetWidth/height + // If component has display:none, offset will return 0 + // TODO: handle display:none and no dimension style using px + return parseInt(this.el_['offset' + (0, _toTitleCase2['default'])(widthOrHeight)], 10); + }; + + /** + * Get the width or the height of the `Component` elements computed style. Uses + * `window.getComputedStyle`. + * + * @param {string} widthOrHeight + * A string containing 'width' or 'height'. Whichever one you want to get. + * + * @return {number} + * The dimension that gets asked for or 0 if nothing was set + * for that dimension. + */ + + + Component.prototype.currentDimension = function currentDimension(widthOrHeight) { + var computedWidthOrHeight = 0; + + if (widthOrHeight !== 'width' && widthOrHeight !== 'height') { + throw new Error('currentDimension only accepts width or height value'); + } + + if (typeof _window2['default'].getComputedStyle === 'function') { + var computedStyle = _window2['default'].getComputedStyle(this.el_); + + computedWidthOrHeight = computedStyle.getPropertyValue(widthOrHeight) || computedStyle[widthOrHeight]; + } + + // remove 'px' from variable and parse as integer + computedWidthOrHeight = parseFloat(computedWidthOrHeight); + + // if the computed value is still 0, it's possible that the browser is lying + // and we want to check the offset values. + // This code also runs on IE8 and wherever getComputedStyle doesn't exist. + if (computedWidthOrHeight === 0) { + var rule = 'offset' + (0, _toTitleCase2['default'])(widthOrHeight); + + computedWidthOrHeight = this.el_[rule]; + } + + return computedWidthOrHeight; + }; + + /** + * An object that contains width and height values of the `Component`s + * computed style. Uses `window.getComputedStyle`. + * + * @typedef {Object} Component~DimensionObject + * + * @property {number} width + * The width of the `Component`s computed style. + * + * @property {number} height + * The height of the `Component`s computed style. + */ + + /** + * Get an object that contains width and height values of the `Component`s + * computed style. + * + * @return {Component~DimensionObject} + * The dimensions of the components element + */ + + + Component.prototype.currentDimensions = function currentDimensions() { + return { + width: this.currentDimension('width'), + height: this.currentDimension('height') + }; + }; + + /** + * Get the width of the `Component`s computed style. Uses `window.getComputedStyle`. + * + * @return {number} width + * The width of the `Component`s computed style. + */ + + + Component.prototype.currentWidth = function currentWidth() { + return this.currentDimension('width'); + }; + + /** + * Get the height of the `Component`s computed style. Uses `window.getComputedStyle`. + * + * @return {number} height + * The height of the `Component`s computed style. + */ + + + Component.prototype.currentHeight = function currentHeight() { + return this.currentDimension('height'); + }; + + /** + * Set the focus to this component + */ + + + Component.prototype.focus = function focus() { + this.el_.focus(); + }; + + /** + * Remove the focus from this component + */ + + + Component.prototype.blur = function blur() { + this.el_.blur(); + }; + + /** + * Emit a 'tap' events when touch event support gets detected. This gets used to + * support toggling the controls through a tap on the video. They get enabled + * because every sub-component would have extra overhead otherwise. + * + * @private + * @fires Component#tap + * @listens Component#touchstart + * @listens Component#touchmove + * @listens Component#touchleave + * @listens Component#touchcancel + * @listens Component#touchend + */ + + + Component.prototype.emitTapEvents = function emitTapEvents() { + // Track the start time so we can determine how long the touch lasted + var touchStart = 0; + var firstTouch = null; + + // Maximum movement allowed during a touch event to still be considered a tap + // Other popular libs use anywhere from 2 (hammer.js) to 15, + // so 10 seems like a nice, round number. + var tapMovementThreshold = 10; + + // The maximum length a touch can be while still being considered a tap + var touchTimeThreshold = 200; + + var couldBeTap = void 0; + + this.on('touchstart', function (event) { + // If more than one finger, don't consider treating this as a click + if (event.touches.length === 1) { + // Copy pageX/pageY from the object + firstTouch = { + pageX: event.touches[0].pageX, + pageY: event.touches[0].pageY + }; + // Record start time so we can detect a tap vs. "touch and hold" + touchStart = new Date().getTime(); + // Reset couldBeTap tracking + couldBeTap = true; + } + }); + + this.on('touchmove', function (event) { + // If more than one finger, don't consider treating this as a click + if (event.touches.length > 1) { + couldBeTap = false; + } else if (firstTouch) { + // Some devices will throw touchmoves for all but the slightest of taps. + // So, if we moved only a small distance, this could still be a tap + var xdiff = event.touches[0].pageX - firstTouch.pageX; + var ydiff = event.touches[0].pageY - firstTouch.pageY; + var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff); + + if (touchDistance > tapMovementThreshold) { + couldBeTap = false; + } + } + }); + + var noTap = function noTap() { + couldBeTap = false; + }; + + // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s + this.on('touchleave', noTap); + this.on('touchcancel', noTap); + + // When the touch ends, measure how long it took and trigger the appropriate + // event + this.on('touchend', function (event) { + firstTouch = null; + // Proceed only if the touchmove/leave/cancel event didn't happen + if (couldBeTap === true) { + // Measure how long the touch lasted + var touchTime = new Date().getTime() - touchStart; + + // Make sure the touch was less than the threshold to be considered a tap + if (touchTime < touchTimeThreshold) { + // Don't let browser turn this into a click + event.preventDefault(); + /** + * Triggered when a `Component` is tapped. + * + * @event Component#tap + * @type {EventTarget~Event} + */ + this.trigger('tap'); + // It may be good to copy the touchend event object and change the + // type to tap, if the other event properties aren't exact after + // Events.fixEvent runs (e.g. event.target) + } + } + }); + }; + + /** + * This function reports user activity whenever touch events happen. This can get + * turned off by any sub-components that wants touch events to act another way. + * + * Report user touch activity when touch events occur. User activity gets used to + * determine when controls should show/hide. It is simple when it comes to mouse + * events, because any mouse event should show the controls. So we capture mouse + * events that bubble up to the player and report activity when that happens. + * With touch events it isn't as easy as `touchstart` and `touchend` toggle player + * controls. So touch events can't help us at the player level either. + * + * User activity gets checked asynchronously. So what could happen is a tap event + * on the video turns the controls off. Then the `touchend` event bubbles up to + * the player. Which, if it reported user activity, would turn the controls right + * back on. We also don't want to completely block touch events from bubbling up. + * Furthermore a `touchmove` event and anything other than a tap, should not turn + * controls back on. + * + * @listens Component#touchstart + * @listens Component#touchmove + * @listens Component#touchend + * @listens Component#touchcancel + */ + + + Component.prototype.enableTouchActivity = function enableTouchActivity() { + // Don't continue if the root player doesn't support reporting user activity + if (!this.player() || !this.player().reportUserActivity) { + return; + } + + // listener for reporting that the user is active + var report = Fn.bind(this.player(), this.player().reportUserActivity); + + var touchHolding = void 0; + + this.on('touchstart', function () { + report(); + // For as long as the they are touching the device or have their mouse down, + // we consider them active even if they're not moving their finger or mouse. + // So we want to continue to update that they are active + this.clearInterval(touchHolding); + // report at the same interval as activityCheck + touchHolding = this.setInterval(report, 250); + }); + + var touchEnd = function touchEnd(event) { + report(); + // stop the interval that maintains activity if the touch is holding + this.clearInterval(touchHolding); + }; + + this.on('touchmove', report); + this.on('touchend', touchEnd); + this.on('touchcancel', touchEnd); + }; + + /** + * A callback that has no parameters and is bound into `Component`s context. + * + * @callback Component~GenericCallback + * @this Component + */ + + /** + * Creates a function that runs after an `x` millisecond timeout. This function is a + * wrapper around `window.setTimeout`. There are a few reasons to use this one + * instead though: + * 1. It gets cleared via {@link Component#clearTimeout} when + * {@link Component#dispose} gets called. + * 2. The function callback will gets turned into a {@link Component~GenericCallback} + * + * > Note: You can use `window.clearTimeout` on the id returned by this function. This + * will cause its dispose listener not to get cleaned up! Please use + * {@link Component#clearTimeout} or {@link Component#dispose}. + * + * @param {Component~GenericCallback} fn + * The function that will be run after `timeout`. + * + * @param {number} timeout + * Timeout in milliseconds to delay before executing the specified function. + * + * @return {number} + * Returns a timeout ID that gets used to identify the timeout. It can also + * get used in {@link Component#clearTimeout} to clear the timeout that + * was set. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout} + */ + + + Component.prototype.setTimeout = function setTimeout(fn, timeout) { + fn = Fn.bind(this, fn); + + var timeoutId = _window2['default'].setTimeout(fn, timeout); + var disposeFn = function disposeFn() { + this.clearTimeout(timeoutId); + }; + + disposeFn.guid = 'vjs-timeout-' + timeoutId; + + this.on('dispose', disposeFn); + + return timeoutId; + }; + + /** + * Clears a timeout that gets created via `window.setTimeout` or + * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout} + * use this function instead of `window.clearTimout`. If you don't your dispose + * listener will not get cleaned up until {@link Component#dispose}! + * + * @param {number} timeoutId + * The id of the timeout to clear. The return value of + * {@link Component#setTimeout} or `window.setTimeout`. + * + * @return {number} + * Returns the timeout id that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout} + */ + + + Component.prototype.clearTimeout = function clearTimeout(timeoutId) { + _window2['default'].clearTimeout(timeoutId); + + var disposeFn = function disposeFn() {}; + + disposeFn.guid = 'vjs-timeout-' + timeoutId; + + this.off('dispose', disposeFn); + + return timeoutId; + }; + + /** + * Creates a function that gets run every `x` milliseconds. This function is a wrapper + * around `window.setInterval`. There are a few reasons to use this one instead though. + * 1. It gets cleared via {@link Component#clearInterval} when + * {@link Component#dispose} gets called. + * 2. The function callback will be a {@link Component~GenericCallback} + * + * @param {Component~GenericCallback} fn + * The function to run every `x` seconds. + * + * @param {number} interval + * Execute the specified function every `x` milliseconds. + * + * @return {number} + * Returns an id that can be used to identify the interval. It can also be be used in + * {@link Component#clearInterval} to clear the interval. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval} + */ + + + Component.prototype.setInterval = function setInterval(fn, interval) { + fn = Fn.bind(this, fn); + + var intervalId = _window2['default'].setInterval(fn, interval); + + var disposeFn = function disposeFn() { + this.clearInterval(intervalId); + }; + + disposeFn.guid = 'vjs-interval-' + intervalId; + + this.on('dispose', disposeFn); + + return intervalId; + }; + + /** + * Clears an interval that gets created via `window.setInterval` or + * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval} + * use this function instead of `window.clearInterval`. If you don't your dispose + * listener will not get cleaned up until {@link Component#dispose}! + * + * @param {number} intervalId + * The id of the interval to clear. The return value of + * {@link Component#setInterval} or `window.setInterval`. + * + * @return {number} + * Returns the interval id that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval} + */ + + + Component.prototype.clearInterval = function clearInterval(intervalId) { + _window2['default'].clearInterval(intervalId); + + var disposeFn = function disposeFn() {}; + + disposeFn.guid = 'vjs-interval-' + intervalId; + + this.off('dispose', disposeFn); + + return intervalId; + }; + + /** + * Queues up a callback to be passed to requestAnimationFrame (rAF), but + * with a few extra bonuses: + * + * - Supports browsers that do not support rAF by falling back to + * {@link Component#setTimeout}. + * + * - The callback is turned into a {@link Component~GenericCallback} (i.e. + * bound to the component). + * + * - Automatic cancellation of the rAF callback is handled if the component + * is disposed before it is called. + * + * @param {Component~GenericCallback} fn + * A function that will be bound to this component and executed just + * before the browser's next repaint. + * + * @return {number} + * Returns an rAF ID that gets used to identify the timeout. It can + * also be used in {@link Component#cancelAnimationFrame} to cancel + * the animation frame callback. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame} + */ + + + Component.prototype.requestAnimationFrame = function requestAnimationFrame(fn) { + var _this2 = this; + + if (this.supportsRaf_) { + fn = Fn.bind(this, fn); + + var id = _window2['default'].requestAnimationFrame(fn); + var disposeFn = function disposeFn() { + return _this2.cancelAnimationFrame(id); + }; + + disposeFn.guid = 'vjs-raf-' + id; + this.on('dispose', disposeFn); + + return id; + } + + // Fall back to using a timer. + return this.setTimeout(fn, 1000 / 60); + }; + + /** + * Cancels a queued callback passed to {@link Component#requestAnimationFrame} + * (rAF). + * + * If you queue an rAF callback via {@link Component#requestAnimationFrame}, + * use this function instead of `window.cancelAnimationFrame`. If you don't, + * your dispose listener will not get cleaned up until {@link Component#dispose}! + * + * @param {number} id + * The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}. + * + * @return {number} + * Returns the rAF ID that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame} + */ + + + Component.prototype.cancelAnimationFrame = function cancelAnimationFrame(id) { + if (this.supportsRaf_) { + _window2['default'].cancelAnimationFrame(id); + + var disposeFn = function disposeFn() {}; + + disposeFn.guid = 'vjs-raf-' + id; + + this.off('dispose', disposeFn); + + return id; + } + + // Fall back to using a timer. + return this.clearTimeout(id); + }; + + /** + * Register a `Component` with `videojs` given the name and the component. + * + * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s + * should be registered using {@link Tech.registerTech} or + * {@link videojs:videojs.registerTech}. + * + * > NOTE: This function can also be seen on videojs as + * {@link videojs:videojs.registerComponent}. + * + * @param {string} name + * The name of the `Component` to register. + * + * @param {Component} ComponentToRegister + * The `Component` class to register. + * + * @return {Component} + * The `Component` that was registered. + */ + + + Component.registerComponent = function registerComponent(name, ComponentToRegister) { + if (typeof name !== 'string' || !name) { + throw new Error('Illegal component name, "' + name + '"; must be a non-empty string.'); + } + + var Tech = Component.getComponent('Tech'); + + // We need to make sure this check is only done if Tech has been registered. + var isTech = Tech && Tech.isTech(ComponentToRegister); + var isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype); + + if (isTech || !isComp) { + var reason = void 0; + + if (isTech) { + reason = 'techs must be registered using Tech.registerTech()'; + } else { + reason = 'must be a Component subclass'; + } + + throw new Error('Illegal component, "' + name + '"; ' + reason + '.'); + } + + name = (0, _toTitleCase2['default'])(name); + + if (!Component.components_) { + Component.components_ = {}; + } + + var Player = Component.getComponent('Player'); + + if (name === 'Player' && Player && Player.players) { + var players = Player.players; + var playerNames = Object.keys(players); + + // If we have players that were disposed, then their name will still be + // in Players.players. So, we must loop through and verify that the value + // for each item is not null. This allows registration of the Player component + // after all players have been disposed or before any were created. + if (players && playerNames.length > 0 && playerNames.map(function (pname) { + return players[pname]; + }).every(Boolean)) { + throw new Error('Can not register Player component after player has been created.'); + } + } + + Component.components_[name] = ComponentToRegister; + + return ComponentToRegister; + }; + + /** + * Get a `Component` based on the name it was registered with. + * + * @param {string} name + * The Name of the component to get. + * + * @return {Component} + * The `Component` that got registered under the given name. + * + * @deprecated In `videojs` 6 this will not return `Component`s that were not + * registered using {@link Component.registerComponent}. Currently we + * check the global `videojs` object for a `Component` name and + * return that if it exists. + */ + + + Component.getComponent = function getComponent(name) { + if (!name) { + return; + } + + name = (0, _toTitleCase2['default'])(name); + + if (Component.components_ && Component.components_[name]) { + return Component.components_[name]; + } + }; + + return Component; +}(); + +/** + * Whether or not this component supports `requestAnimationFrame`. + * + * This is exposed primarily for testing purposes. + * + * @private + * @type {Boolean} + */ + + +Component.prototype.supportsRaf_ = typeof _window2['default'].requestAnimationFrame === 'function' && typeof _window2['default'].cancelAnimationFrame === 'function'; + +Component.registerComponent('Component', Component); + +exports['default'] = Component; + +},{"100":100,"53":53,"54":54,"84":84,"85":85,"88":88,"90":90,"91":91,"92":92,"96":96}],6:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _trackButton = _dereq_(38); + +var _trackButton2 = _interopRequireDefault(_trackButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _audioTrackMenuItem = _dereq_(7); + +var _audioTrackMenuItem2 = _interopRequireDefault(_audioTrackMenuItem); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file audio-track-button.js + */ + + +/** + * The base class for buttons that toggle specific {@link AudioTrack} types. + * + * @extends TrackButton + */ +var AudioTrackButton = function (_TrackButton) { + _inherits(AudioTrackButton, _TrackButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ + function AudioTrackButton(player) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, AudioTrackButton); + + options.tracks = player.audioTracks(); + + return _possibleConstructorReturn(this, _TrackButton.call(this, player, options)); + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + AudioTrackButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-audio-button ' + _TrackButton.prototype.buildCSSClass.call(this); + }; + + AudioTrackButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + return 'vjs-audio-button ' + _TrackButton.prototype.buildWrapperCSSClass.call(this); + }; + + /** + * Create a menu item for each audio track + * + * @param {AudioTrackMenuItem[]} [items=[]] + * An array of existing menu items to use. + * + * @return {AudioTrackMenuItem[]} + * An array of menu items + */ + + + AudioTrackButton.prototype.createItems = function createItems() { + var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + + // if there's only one audio track, there no point in showing it + this.hideThreshold_ = 1; + + var tracks = this.player_.audioTracks(); + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + items.push(new _audioTrackMenuItem2['default'](this.player_, { + track: track, + // MenuItem is selectable + selectable: true + })); + } + + return items; + }; + + return AudioTrackButton; +}(_trackButton2['default']); + +/** + * The text that should display over the `AudioTrackButton`s controls. Added for localization. + * + * @type {string} + * @private + */ + + +AudioTrackButton.prototype.controlText_ = 'Audio Track'; +_component2['default'].registerComponent('AudioTrackButton', AudioTrackButton); +exports['default'] = AudioTrackButton; + +},{"38":38,"5":5,"7":7}],7:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _menuItem = _dereq_(51); + +var _menuItem2 = _interopRequireDefault(_menuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file audio-track-menu-item.js + */ + + +/** + * An {@link AudioTrack} {@link MenuItem} + * + * @extends MenuItem + */ +var AudioTrackMenuItem = function (_MenuItem) { + _inherits(AudioTrackMenuItem, _MenuItem); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function AudioTrackMenuItem(player, options) { + _classCallCheck(this, AudioTrackMenuItem); + + var track = options.track; + var tracks = player.audioTracks(); + + // Modify options for parent MenuItem class's init. + options.label = track.label || track.language || 'Unknown'; + options.selected = track.enabled; + + var _this = _possibleConstructorReturn(this, _MenuItem.call(this, player, options)); + + _this.track = track; + + var changeHandler = Fn.bind(_this, _this.handleTracksChange); + + tracks.addEventListener('change', changeHandler); + _this.on('dispose', function () { + tracks.removeEventListener('change', changeHandler); + }); + return _this; + } + + /** + * This gets called when an `AudioTrackMenuItem is "clicked". See {@link ClickableComponent} + * for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + AudioTrackMenuItem.prototype.handleClick = function handleClick(event) { + var tracks = this.player_.audioTracks(); + + _MenuItem.prototype.handleClick.call(this, event); + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + track.enabled = track === this.track; + } + }; + + /** + * Handle any {@link AudioTrack} change. + * + * @param {EventTarget~Event} [event] + * The {@link AudioTrackList#change} event that caused this to run. + * + * @listens AudioTrackList#change + */ + + + AudioTrackMenuItem.prototype.handleTracksChange = function handleTracksChange(event) { + this.selected(this.track.enabled); + }; + + return AudioTrackMenuItem; +}(_menuItem2['default']); + +_component2['default'].registerComponent('AudioTrackMenuItem', AudioTrackMenuItem); +exports['default'] = AudioTrackMenuItem; + +},{"5":5,"51":51,"88":88}],8:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +_dereq_(12); + +_dereq_(34); + +_dereq_(35); + +_dereq_(37); + +_dereq_(36); + +_dereq_(10); + +_dereq_(18); + +_dereq_(9); + +_dereq_(43); + +_dereq_(25); + +_dereq_(27); + +_dereq_(31); + +_dereq_(24); + +_dereq_(29); + +_dereq_(6); + +_dereq_(13); + +_dereq_(21); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file control-bar.js + */ + + +// Required children + + +/** + * Container of main controls. + * + * @extends Component + */ +var ControlBar = function (_Component) { + _inherits(ControlBar, _Component); + + function ControlBar() { + _classCallCheck(this, ControlBar); + + return _possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + ControlBar.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-control-bar', + dir: 'ltr' + }, { + // The control bar is a group, but we don't aria-label it to avoid + // over-announcing by JAWS + role: 'group' + }); + }; + + return ControlBar; +}(_component2['default']); + +/** + * Default options for `ControlBar` + * + * @type {Object} + * @private + */ + + +ControlBar.prototype.options_ = { + children: ['playToggle', 'volumePanel', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'subsCapsButton', 'audioTrackButton', 'fullscreenToggle'] +}; + +_component2['default'].registerComponent('ControlBar', ControlBar); +exports['default'] = ControlBar; + +},{"10":10,"12":12,"13":13,"18":18,"21":21,"24":24,"25":25,"27":27,"29":29,"31":31,"34":34,"35":35,"36":36,"37":37,"43":43,"5":5,"6":6,"9":9}],9:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _button = _dereq_(2); + +var _button2 = _interopRequireDefault(_button); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file fullscreen-toggle.js + */ + + +/** + * Toggle fullscreen video + * + * @extends Button + */ +var FullscreenToggle = function (_Button) { + _inherits(FullscreenToggle, _Button); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function FullscreenToggle(player, options) { + _classCallCheck(this, FullscreenToggle); + + var _this = _possibleConstructorReturn(this, _Button.call(this, player, options)); + + _this.on(player, 'fullscreenchange', _this.handleFullscreenChange); + return _this; + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + FullscreenToggle.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-fullscreen-control ' + _Button.prototype.buildCSSClass.call(this); + }; + + /** + * Handles fullscreenchange on the player and change control text accordingly. + * + * @param {EventTarget~Event} [event] + * The {@link Player#fullscreenchange} event that caused this function to be + * called. + * + * @listens Player#fullscreenchange + */ + + + FullscreenToggle.prototype.handleFullscreenChange = function handleFullscreenChange(event) { + if (this.player_.isFullscreen()) { + this.controlText('Non-Fullscreen'); + } else { + this.controlText('Fullscreen'); + } + }; + + /** + * This gets called when an `FullscreenToggle` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + FullscreenToggle.prototype.handleClick = function handleClick(event) { + if (!this.player_.isFullscreen()) { + this.player_.requestFullscreen(); + } else { + this.player_.exitFullscreen(); + } + }; + + return FullscreenToggle; +}(_button2['default']); + +/** + * The text that should display over the `FullscreenToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + +FullscreenToggle.prototype.controlText_ = 'Fullscreen'; + +_component2['default'].registerComponent('FullscreenToggle', FullscreenToggle); +exports['default'] = FullscreenToggle; + +},{"2":2,"5":5}],10:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file live-display.js + */ + + +// TODO - Future make it click to snap to live + +/** + * Displays the live indicator when duration is Infinity. + * + * @extends Component + */ +var LiveDisplay = function (_Component) { + _inherits(LiveDisplay, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function LiveDisplay(player, options) { + _classCallCheck(this, LiveDisplay); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.updateShowing(); + _this.on(_this.player(), 'durationchange', _this.updateShowing); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + LiveDisplay.prototype.createEl = function createEl() { + var el = _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-live-control vjs-control' + }); + + this.contentEl_ = Dom.createEl('div', { + className: 'vjs-live-display', + innerHTML: '' + this.localize('Stream Type') + '' + this.localize('LIVE') + }, { + 'aria-live': 'off' + }); + + el.appendChild(this.contentEl_); + return el; + }; + + /** + * Check the duration to see if the LiveDisplay should be showing or not. Then show/hide + * it accordingly + * + * @param {EventTarget~Event} [event] + * The {@link Player#durationchange} event that caused this function to run. + * + * @listens Player#durationchange + */ + + + LiveDisplay.prototype.updateShowing = function updateShowing(event) { + if (this.player().duration() === Infinity) { + this.show(); + } else { + this.hide(); + } + }; + + return LiveDisplay; +}(_component2['default']); + +_component2['default'].registerComponent('LiveDisplay', LiveDisplay); +exports['default'] = LiveDisplay; + +},{"5":5,"85":85}],11:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _button = _dereq_(2); + +var _button2 = _interopRequireDefault(_button); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _checkVolumeSupport = _dereq_(39); + +var _checkVolumeSupport2 = _interopRequireDefault(_checkVolumeSupport); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file mute-toggle.js + */ + + +/** + * A button component for muting the audio. + * + * @extends Button + */ +var MuteToggle = function (_Button) { + _inherits(MuteToggle, _Button); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function MuteToggle(player, options) { + _classCallCheck(this, MuteToggle); + + // hide this control if volume support is missing + var _this = _possibleConstructorReturn(this, _Button.call(this, player, options)); + + (0, _checkVolumeSupport2['default'])(_this, player); + + _this.on(player, ['loadstart', 'volumechange'], _this.update); + return _this; + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + MuteToggle.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-mute-control ' + _Button.prototype.buildCSSClass.call(this); + }; + + /** + * This gets called when an `MuteToggle` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + MuteToggle.prototype.handleClick = function handleClick(event) { + var vol = this.player_.volume(); + var lastVolume = this.player_.lastVolume_(); + + if (vol === 0) { + var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume; + + this.player_.volume(volumeToSet); + this.player_.muted(false); + } else { + this.player_.muted(this.player_.muted() ? false : true); + } + }; + + /** + * Update the `MuteToggle` button based on the state of `volume` and `muted` + * on the player. + * + * @param {EventTarget~Event} [event] + * The {@link Player#loadstart} event if this function was called + * through an event. + * + * @listens Player#loadstart + * @listens Player#volumechange + */ + + + MuteToggle.prototype.update = function update(event) { + this.updateIcon_(); + this.updateControlText_(); + }; + + /** + * Update the appearance of the `MuteToggle` icon. + * + * Possible states (given `level` variable below): + * - 0: crossed out + * - 1: zero bars of volume + * - 2: one bar of volume + * - 3: two bars of volume + * + * @private + */ + + + MuteToggle.prototype.updateIcon_ = function updateIcon_() { + var vol = this.player_.volume(); + var level = 3; + + if (vol === 0 || this.player_.muted()) { + level = 0; + } else if (vol < 0.33) { + level = 1; + } else if (vol < 0.67) { + level = 2; + } + + // TODO improve muted icon classes + for (var i = 0; i < 4; i++) { + Dom.removeClass(this.el_, 'vjs-vol-' + i); + } + Dom.addClass(this.el_, 'vjs-vol-' + level); + }; + + /** + * If `muted` has changed on the player, update the control text + * (`title` attribute on `vjs-mute-control` element and content of + * `vjs-control-text` element). + * + * @private + */ + + + MuteToggle.prototype.updateControlText_ = function updateControlText_() { + var soundOff = this.player_.muted() || this.player_.volume() === 0; + var text = soundOff ? 'Unmute' : 'Mute'; + + if (this.controlText() !== text) { + this.controlText(text); + } + }; + + return MuteToggle; +}(_button2['default']); + +/** + * The text that should display over the `MuteToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + +MuteToggle.prototype.controlText_ = 'Mute'; + +_component2['default'].registerComponent('MuteToggle', MuteToggle); +exports['default'] = MuteToggle; + +},{"2":2,"39":39,"5":5,"85":85}],12:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _button = _dereq_(2); + +var _button2 = _interopRequireDefault(_button); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file play-toggle.js + */ + + +/** + * Button to toggle between play and pause. + * + * @extends Button + */ +var PlayToggle = function (_Button) { + _inherits(PlayToggle, _Button); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function PlayToggle(player, options) { + _classCallCheck(this, PlayToggle); + + var _this = _possibleConstructorReturn(this, _Button.call(this, player, options)); + + _this.on(player, 'play', _this.handlePlay); + _this.on(player, 'pause', _this.handlePause); + _this.on(player, 'ended', _this.handleEnded); + return _this; + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + PlayToggle.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-play-control ' + _Button.prototype.buildCSSClass.call(this); + }; + + /** + * This gets called when an `PlayToggle` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + PlayToggle.prototype.handleClick = function handleClick(event) { + if (this.player_.paused()) { + this.player_.play(); + } else { + this.player_.pause(); + } + }; + + /** + * Add the vjs-playing class to the element so it can change appearance. + * + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#play + */ + + + PlayToggle.prototype.handlePlay = function handlePlay(event) { + this.removeClass('vjs-ended'); + this.removeClass('vjs-paused'); + this.addClass('vjs-playing'); + // change the button text to "Pause" + this.controlText('Pause'); + }; + + /** + * Add the vjs-paused class to the element so it can change appearance. + * + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#pause + */ + + + PlayToggle.prototype.handlePause = function handlePause(event) { + this.removeClass('vjs-playing'); + this.addClass('vjs-paused'); + // change the button text to "Play" + this.controlText('Play'); + }; + + /** + * Add the vjs-ended class to the element so it can change appearance + * + */ + + + PlayToggle.prototype.handleEnded = function handleEnded(event) { + this.removeClass('vjs-playing'); + this.addClass('vjs-ended'); + // change the button text to "Replay" + this.controlText('Replay'); + }; + + return PlayToggle; +}(_button2['default']); + +/** + * The text that should display over the `PlayToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + +PlayToggle.prototype.controlText_ = 'Play'; + +_component2['default'].registerComponent('PlayToggle', PlayToggle); +exports['default'] = PlayToggle; + +},{"2":2,"5":5}],13:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _menuButton = _dereq_(50); + +var _menuButton2 = _interopRequireDefault(_menuButton); + +var _menu = _dereq_(52); + +var _menu2 = _interopRequireDefault(_menu); + +var _playbackRateMenuItem = _dereq_(14); + +var _playbackRateMenuItem2 = _interopRequireDefault(_playbackRateMenuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file playback-rate-menu-button.js + */ + + +/** + * The component for controlling the playback rate. + * + * @extends MenuButton + */ +var PlaybackRateMenuButton = function (_MenuButton) { + _inherits(PlaybackRateMenuButton, _MenuButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function PlaybackRateMenuButton(player, options) { + _classCallCheck(this, PlaybackRateMenuButton); + + var _this = _possibleConstructorReturn(this, _MenuButton.call(this, player, options)); + + _this.updateVisibility(); + _this.updateLabel(); + + _this.on(player, 'loadstart', _this.updateVisibility); + _this.on(player, 'ratechange', _this.updateLabel); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + PlaybackRateMenuButton.prototype.createEl = function createEl() { + var el = _MenuButton.prototype.createEl.call(this); + + this.labelEl_ = Dom.createEl('div', { + className: 'vjs-playback-rate-value', + innerHTML: 1.0 + }); + + el.appendChild(this.labelEl_); + + return el; + }; + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + PlaybackRateMenuButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-playback-rate ' + _MenuButton.prototype.buildCSSClass.call(this); + }; + + PlaybackRateMenuButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + return 'vjs-playback-rate ' + _MenuButton.prototype.buildWrapperCSSClass.call(this); + }; + + /** + * Create the playback rate menu + * + * @return {Menu} + * Menu object populated with {@link PlaybackRateMenuItem}s + */ + + + PlaybackRateMenuButton.prototype.createMenu = function createMenu() { + var menu = new _menu2['default'](this.player()); + var rates = this.playbackRates(); + + if (rates) { + for (var i = rates.length - 1; i >= 0; i--) { + menu.addChild(new _playbackRateMenuItem2['default'](this.player(), { rate: rates[i] + 'x' })); + } + } + + return menu; + }; + + /** + * Updates ARIA accessibility attributes + */ + + + PlaybackRateMenuButton.prototype.updateARIAAttributes = function updateARIAAttributes() { + // Current playback rate + this.el().setAttribute('aria-valuenow', this.player().playbackRate()); + }; + + /** + * This gets called when an `PlaybackRateMenuButton` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + PlaybackRateMenuButton.prototype.handleClick = function handleClick(event) { + // select next rate option + var currentRate = this.player().playbackRate(); + var rates = this.playbackRates(); + + // this will select first one if the last one currently selected + var newRate = rates[0]; + + for (var i = 0; i < rates.length; i++) { + if (rates[i] > currentRate) { + newRate = rates[i]; + break; + } + } + this.player().playbackRate(newRate); + }; + + /** + * Get possible playback rates + * + * @return {Array} + * All possible playback rates + */ + + + PlaybackRateMenuButton.prototype.playbackRates = function playbackRates() { + return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates; + }; + + /** + * Get whether playback rates is supported by the tech + * and an array of playback rates exists + * + * @return {boolean} + * Whether changing playback rate is supported + */ + + + PlaybackRateMenuButton.prototype.playbackRateSupported = function playbackRateSupported() { + return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0; + }; + + /** + * Hide playback rate controls when they're no playback rate options to select + * + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#loadstart + */ + + + PlaybackRateMenuButton.prototype.updateVisibility = function updateVisibility(event) { + if (this.playbackRateSupported()) { + this.removeClass('vjs-hidden'); + } else { + this.addClass('vjs-hidden'); + } + }; + + /** + * Update button label when rate changed + * + * @param {EventTarget~Event} [event] + * The event that caused this function to run. + * + * @listens Player#ratechange + */ + + + PlaybackRateMenuButton.prototype.updateLabel = function updateLabel(event) { + if (this.playbackRateSupported()) { + this.labelEl_.innerHTML = this.player().playbackRate() + 'x'; + } + }; + + return PlaybackRateMenuButton; +}(_menuButton2['default']); + +/** + * The text that should display over the `FullscreenToggle`s controls. Added for localization. + * + * @type {string} + * @private + */ + + +PlaybackRateMenuButton.prototype.controlText_ = 'Playback Rate'; + +_component2['default'].registerComponent('PlaybackRateMenuButton', PlaybackRateMenuButton); +exports['default'] = PlaybackRateMenuButton; + +},{"14":14,"5":5,"50":50,"52":52,"85":85}],14:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _menuItem = _dereq_(51); + +var _menuItem2 = _interopRequireDefault(_menuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file playback-rate-menu-item.js + */ + + +/** + * The specific menu item type for selecting a playback rate. + * + * @extends MenuItem + */ +var PlaybackRateMenuItem = function (_MenuItem) { + _inherits(PlaybackRateMenuItem, _MenuItem); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function PlaybackRateMenuItem(player, options) { + _classCallCheck(this, PlaybackRateMenuItem); + + var label = options.rate; + var rate = parseFloat(label, 10); + + // Modify options for parent MenuItem class's init. + options.label = label; + options.selected = rate === 1; + options.selectable = true; + + var _this = _possibleConstructorReturn(this, _MenuItem.call(this, player, options)); + + _this.label = label; + _this.rate = rate; + + _this.on(player, 'ratechange', _this.update); + return _this; + } + + /** + * This gets called when an `PlaybackRateMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + PlaybackRateMenuItem.prototype.handleClick = function handleClick(event) { + _MenuItem.prototype.handleClick.call(this); + this.player().playbackRate(this.rate); + }; + + /** + * Update the PlaybackRateMenuItem when the playbackrate changes. + * + * @param {EventTarget~Event} [event] + * The `ratechange` event that caused this function to run. + * + * @listens Player#ratechange + */ + + + PlaybackRateMenuItem.prototype.update = function update(event) { + this.selected(this.player().playbackRate() === this.rate); + }; + + return PlaybackRateMenuItem; +}(_menuItem2['default']); + +/** + * The text that should display over the `PlaybackRateMenuItem`s controls. Added for localization. + * + * @type {string} + * @private + */ + + +PlaybackRateMenuItem.prototype.contentElType = 'button'; + +_component2['default'].registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem); +exports['default'] = PlaybackRateMenuItem; + +},{"5":5,"51":51}],15:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file load-progress-bar.js + */ + + +/** + * Shows loading progress + * + * @extends Component + */ +var LoadProgressBar = function (_Component) { + _inherits(LoadProgressBar, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function LoadProgressBar(player, options) { + _classCallCheck(this, LoadProgressBar); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.partEls_ = []; + _this.on(player, 'progress', _this.update); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + LoadProgressBar.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-load-progress', + innerHTML: '' + this.localize('Loaded') + ': 0%' + }); + }; + + /** + * Update progress bar + * + * @param {EventTarget~Event} [event] + * The `progress` event that caused this function to run. + * + * @listens Player#progress + */ + + + LoadProgressBar.prototype.update = function update(event) { + var buffered = this.player_.buffered(); + var duration = this.player_.duration(); + var bufferedEnd = this.player_.bufferedEnd(); + var children = this.partEls_; + + // get the percent width of a time compared to the total end + var percentify = function percentify(time, end) { + // no NaN + var percent = time / end || 0; + + return (percent >= 1 ? 1 : percent) * 100 + '%'; + }; + + // update the width of the progress bar + this.el_.style.width = percentify(bufferedEnd, duration); + + // add child elements to represent the individual buffered time ranges + for (var i = 0; i < buffered.length; i++) { + var start = buffered.start(i); + var end = buffered.end(i); + var part = children[i]; + + if (!part) { + part = this.el_.appendChild(Dom.createEl()); + children[i] = part; + } + + // set the percent based on the width of the progress bar (bufferedEnd) + part.style.left = percentify(start, bufferedEnd); + part.style.width = percentify(end - start, bufferedEnd); + } + + // remove unused buffered range elements + for (var _i = children.length; _i > buffered.length; _i--) { + this.el_.removeChild(children[_i - 1]); + } + children.length = buffered.length; + }; + + return LoadProgressBar; +}(_component2['default']); + +_component2['default'].registerComponent('LoadProgressBar', LoadProgressBar); +exports['default'] = LoadProgressBar; + +},{"5":5,"85":85}],16:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _formatTime = _dereq_(89); + +var _formatTime2 = _interopRequireDefault(_formatTime); + +_dereq_(20); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file mouse-time-display.js + */ + + +/** + * The {@link MouseTimeDisplay} component tracks mouse movement over the + * {@link ProgressControl}. It displays an indicator and a {@link TimeTooltip} + * indicating the time which is represented by a given point in the + * {@link ProgressControl}. + * + * @extends Component + */ +var MouseTimeDisplay = function (_Component) { + _inherits(MouseTimeDisplay, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The {@link Player} that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function MouseTimeDisplay(player, options) { + _classCallCheck(this, MouseTimeDisplay); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.update = Fn.throttle(Fn.bind(_this, _this.update), 25); + return _this; + } + + /** + * Create the DOM element for this class. + * + * @return {Element} + * The element that was created. + */ + + + MouseTimeDisplay.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-mouse-display' + }); + }; + + /** + * Enqueues updates to its own DOM as well as the DOM of its + * {@link TimeTooltip} child. + * + * @param {Object} seekBarRect + * The `ClientRect` for the {@link SeekBar} element. + * + * @param {number} seekBarPoint + * A number from 0 to 1, representing a horizontal reference point + * from the left edge of the {@link SeekBar} + */ + + + MouseTimeDisplay.prototype.update = function update(seekBarRect, seekBarPoint) { + var _this2 = this; + + // If there is an existing rAF ID, cancel it so we don't over-queue. + if (this.rafId_) { + this.cancelAnimationFrame(this.rafId_); + } + + this.rafId_ = this.requestAnimationFrame(function () { + var duration = _this2.player_.duration(); + var content = (0, _formatTime2['default'])(seekBarPoint * duration, duration); + + _this2.el_.style.left = seekBarRect.width * seekBarPoint + 'px'; + _this2.getChild('timeTooltip').update(seekBarRect, seekBarPoint, content); + }); + }; + + return MouseTimeDisplay; +}(_component2['default']); + +/** + * Default options for `MouseTimeDisplay` + * + * @type {Object} + * @private + */ + + +MouseTimeDisplay.prototype.options_ = { + children: ['timeTooltip'] +}; + +_component2['default'].registerComponent('MouseTimeDisplay', MouseTimeDisplay); +exports['default'] = MouseTimeDisplay; + +},{"20":20,"5":5,"88":88,"89":89}],17:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _browser = _dereq_(81); + +var _formatTime = _dereq_(89); + +var _formatTime2 = _interopRequireDefault(_formatTime); + +_dereq_(20); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file play-progress-bar.js + */ + + +/** + * Used by {@link SeekBar} to display media playback progress as part of the + * {@link ProgressControl}. + * + * @extends Component + */ +var PlayProgressBar = function (_Component) { + _inherits(PlayProgressBar, _Component); + + function PlayProgressBar() { + _classCallCheck(this, PlayProgressBar); + + return _possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + /** + * Create the the DOM element for this class. + * + * @return {Element} + * The element that was created. + */ + PlayProgressBar.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-play-progress vjs-slider-bar', + innerHTML: '' + this.localize('Progress') + ': 0%' + }); + }; + + /** + * Enqueues updates to its own DOM as well as the DOM of its + * {@link TimeTooltip} child. + * + * @param {Object} seekBarRect + * The `ClientRect` for the {@link SeekBar} element. + * + * @param {number} seekBarPoint + * A number from 0 to 1, representing a horizontal reference point + * from the left edge of the {@link SeekBar} + */ + + + PlayProgressBar.prototype.update = function update(seekBarRect, seekBarPoint) { + var _this2 = this; + + // If there is an existing rAF ID, cancel it so we don't over-queue. + if (this.rafId_) { + this.cancelAnimationFrame(this.rafId_); + } + + this.rafId_ = this.requestAnimationFrame(function () { + var time = _this2.player_.scrubbing() ? _this2.player_.getCache().currentTime : _this2.player_.currentTime(); + + var content = (0, _formatTime2['default'])(time, _this2.player_.duration()); + var timeTooltip = _this2.getChild('timeTooltip'); + + if (timeTooltip) { + timeTooltip.update(seekBarRect, seekBarPoint, content); + } + }); + }; + + return PlayProgressBar; +}(_component2['default']); + +/** + * Default options for {@link PlayProgressBar}. + * + * @type {Object} + * @private + */ + + +PlayProgressBar.prototype.options_ = { + children: [] +}; + +// Time tooltips should not be added to a player on mobile devices or IE8 +if ((!_browser.IE_VERSION || _browser.IE_VERSION > 8) && !_browser.IS_IOS && !_browser.IS_ANDROID) { + PlayProgressBar.prototype.options_.children.push('timeTooltip'); +} + +_component2['default'].registerComponent('PlayProgressBar', PlayProgressBar); +exports['default'] = PlayProgressBar; + +},{"20":20,"5":5,"81":81,"89":89}],18:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _fn = _dereq_(88); + +_dereq_(19); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file progress-control.js + */ + + +/** + * The Progress Control component contains the seek bar, load progress, + * and play progress. + * + * @extends Component + */ +var ProgressControl = function (_Component) { + _inherits(ProgressControl, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function ProgressControl(player, options) { + _classCallCheck(this, ProgressControl); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.handleMouseMove = (0, _fn.throttle)((0, _fn.bind)(_this, _this.handleMouseMove), 25); + _this.on(_this.el_, 'mousemove', _this.handleMouseMove); + + _this.throttledHandleMouseSeek = (0, _fn.throttle)((0, _fn.bind)(_this, _this.handleMouseSeek), 25); + _this.on(['mousedown', 'touchstart'], _this.handleMouseDown); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + ProgressControl.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-progress-control vjs-control' + }); + }; + + /** + * When the mouse moves over the `ProgressControl`, the pointer position + * gets passed down to the `MouseTimeDisplay` component. + * + * @param {EventTarget~Event} event + * The `mousemove` event that caused this function to run. + * + * @listen mousemove + */ + + + ProgressControl.prototype.handleMouseMove = function handleMouseMove(event) { + var seekBar = this.getChild('seekBar'); + var mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay'); + var seekBarEl = seekBar.el(); + var seekBarRect = Dom.getBoundingClientRect(seekBarEl); + var seekBarPoint = Dom.getPointerPosition(seekBarEl, event).x; + + // The default skin has a gap on either side of the `SeekBar`. This means + // that it's possible to trigger this behavior outside the boundaries of + // the `SeekBar`. This ensures we stay within it at all times. + if (seekBarPoint > 1) { + seekBarPoint = 1; + } else if (seekBarPoint < 0) { + seekBarPoint = 0; + } + + if (mouseTimeDisplay) { + mouseTimeDisplay.update(seekBarRect, seekBarPoint); + } + }; + + /** + * A throttled version of the {@link ProgressControl#handleMouseSeek} listener. + * + * @method ProgressControl#throttledHandleMouseSeek + * @param {EventTarget~Event} event + * The `mousemove` event that caused this function to run. + * + * @listen mousemove + * @listen touchmove + */ + + /** + * Handle `mousemove` or `touchmove` events on the `ProgressControl`. + * + * @param {EventTarget~Event} event + * `mousedown` or `touchstart` event that triggered this function + * + * @listens mousemove + * @listens touchmove + */ + + + ProgressControl.prototype.handleMouseSeek = function handleMouseSeek(event) { + var seekBar = this.getChild('seekBar'); + + seekBar.handleMouseMove(event); + }; + + /** + * Handle `mousedown` or `touchstart` events on the `ProgressControl`. + * + * @param {EventTarget~Event} event + * `mousedown` or `touchstart` event that triggered this function + * + * @listens mousedown + * @listens touchstart + */ + + + ProgressControl.prototype.handleMouseDown = function handleMouseDown(event) { + var doc = this.el_.ownerDocument; + + this.on(doc, 'mousemove', this.throttledHandleMouseSeek); + this.on(doc, 'touchmove', this.throttledHandleMouseSeek); + this.on(doc, 'mouseup', this.handleMouseUp); + this.on(doc, 'touchend', this.handleMouseUp); + }; + + /** + * Handle `mouseup` or `touchend` events on the `ProgressControl`. + * + * @param {EventTarget~Event} event + * `mouseup` or `touchend` event that triggered this function. + * + * @listens touchend + * @listens mouseup + */ + + + ProgressControl.prototype.handleMouseUp = function handleMouseUp(event) { + var doc = this.el_.ownerDocument; + + this.off(doc, 'mousemove', this.throttledHandleMouseSeek); + this.off(doc, 'touchmove', this.throttledHandleMouseSeek); + this.off(doc, 'mouseup', this.handleMouseUp); + this.off(doc, 'touchend', this.handleMouseUp); + }; + + return ProgressControl; +}(_component2['default']); + +/** + * Default options for `ProgressControl` + * + * @type {Object} + * @private + */ + + +ProgressControl.prototype.options_ = { + children: ['seekBar'] +}; + +_component2['default'].registerComponent('ProgressControl', ProgressControl); +exports['default'] = ProgressControl; + +},{"19":19,"5":5,"85":85,"88":88}],19:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _slider = _dereq_(60); + +var _slider2 = _interopRequireDefault(_slider); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _browser = _dereq_(81); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _formatTime = _dereq_(89); + +var _formatTime2 = _interopRequireDefault(_formatTime); + +_dereq_(15); + +_dereq_(17); + +_dereq_(16); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file seek-bar.js + */ + + +// The number of seconds the `step*` functions move the timeline. +var STEP_SECONDS = 5; + +/** + * Seek bar and container for the progress bars. Uses {@link PlayProgressBar} + * as its `bar`. + * + * @extends Slider + */ + +var SeekBar = function (_Slider) { + _inherits(SeekBar, _Slider); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function SeekBar(player, options) { + _classCallCheck(this, SeekBar); + + var _this = _possibleConstructorReturn(this, _Slider.call(this, player, options)); + + _this.update = Fn.throttle(Fn.bind(_this, _this.update), 50); + _this.on(player, ['timeupdate', 'ended'], _this.update); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + SeekBar.prototype.createEl = function createEl() { + return _Slider.prototype.createEl.call(this, 'div', { + className: 'vjs-progress-holder' + }, { + 'aria-label': this.localize('Progress Bar') + }); + }; + + /** + * Update the seek bar's UI. + * + * @param {EventTarget~Event} [event] + * The `timeupdate` or `ended` event that caused this to run. + * + * @listens Player#timeupdate + * @listens Player#ended + */ + + + SeekBar.prototype.update = function update() { + var percent = _Slider.prototype.update.call(this); + var duration = this.player_.duration(); + + // Allows for smooth scrubbing, when player can't keep up. + var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); + + // machine readable value of progress bar (percentage complete) + this.el_.setAttribute('aria-valuenow', (percent * 100).toFixed(2)); + + // human readable value of progress bar (time complete) + this.el_.setAttribute('aria-valuetext', this.localize('progress bar timing: currentTime={1} duration={2}', [(0, _formatTime2['default'])(time, duration), (0, _formatTime2['default'])(duration, duration)], '{1} of {2}')); + + // Update the `PlayProgressBar`. + this.bar.update(Dom.getBoundingClientRect(this.el_), percent); + + return percent; + }; + + /** + * Get the percentage of media played so far. + * + * @return {number} + * The percentage of media played so far (0 to 1). + */ + + + SeekBar.prototype.getPercent = function getPercent() { + + // Allows for smooth scrubbing, when player can't keep up. + var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); + + var percent = time / this.player_.duration(); + + return percent >= 1 ? 1 : percent; + }; + + /** + * Handle mouse down on seek bar + * + * @param {EventTarget~Event} event + * The `mousedown` event that caused this to run. + * + * @listens mousedown + */ + + + SeekBar.prototype.handleMouseDown = function handleMouseDown(event) { + this.player_.scrubbing(true); + + this.videoWasPlaying = !this.player_.paused(); + this.player_.pause(); + + _Slider.prototype.handleMouseDown.call(this, event); + }; + + /** + * Handle mouse move on seek bar + * + * @param {EventTarget~Event} event + * The `mousemove` event that caused this to run. + * + * @listens mousemove + */ + + + SeekBar.prototype.handleMouseMove = function handleMouseMove(event) { + var newTime = this.calculateDistance(event) * this.player_.duration(); + + // Don't let video end while scrubbing. + if (newTime === this.player_.duration()) { + newTime = newTime - 0.1; + } + + // Set new time (tell player to seek to new time) + this.player_.currentTime(newTime); + }; + + /** + * Handle mouse up on seek bar + * + * @param {EventTarget~Event} event + * The `mouseup` event that caused this to run. + * + * @listens mouseup + */ + + + SeekBar.prototype.handleMouseUp = function handleMouseUp(event) { + _Slider.prototype.handleMouseUp.call(this, event); + + this.player_.scrubbing(false); + if (this.videoWasPlaying) { + this.player_.play(); + } + }; + + /** + * Move more quickly fast forward for keyboard-only users + */ + + + SeekBar.prototype.stepForward = function stepForward() { + this.player_.currentTime(this.player_.currentTime() + STEP_SECONDS); + }; + + /** + * Move more quickly rewind for keyboard-only users + */ + + + SeekBar.prototype.stepBack = function stepBack() { + this.player_.currentTime(this.player_.currentTime() - STEP_SECONDS); + }; + + /** + * Toggles the playback state of the player + * This gets called when enter or space is used on the seekbar + * + * @param {EventTarget~Event} event + * The `keydown` event that caused this function to be called + * + */ + + + SeekBar.prototype.handleAction = function handleAction(event) { + if (this.player_.paused()) { + this.player_.play(); + } else { + this.player_.pause(); + } + }; + + /** + * Called when this SeekBar has focus and a key gets pressed down. By + * default it will call `this.handleAction` when the key is space or enter. + * + * @param {EventTarget~Event} event + * The `keydown` event that caused this function to be called. + * + * @listens keydown + */ + + + SeekBar.prototype.handleKeyPress = function handleKeyPress(event) { + + // Support Space (32) or Enter (13) key operation to fire a click event + if (event.which === 32 || event.which === 13) { + event.preventDefault(); + this.handleAction(event); + } else if (_Slider.prototype.handleKeyPress) { + + // Pass keypress handling up for unsupported keys + _Slider.prototype.handleKeyPress.call(this, event); + } + }; + + return SeekBar; +}(_slider2['default']); + +/** + * Default options for the `SeekBar` + * + * @type {Object} + * @private + */ + + +SeekBar.prototype.options_ = { + children: ['loadProgressBar', 'playProgressBar'], + barName: 'playProgressBar' +}; + +// MouseTimeDisplay tooltips should not be added to a player on mobile devices or IE8 +if ((!_browser.IE_VERSION || _browser.IE_VERSION > 8) && !_browser.IS_IOS && !_browser.IS_ANDROID) { + SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay'); +} + +/** + * Call the update event for this Slider when this event happens on the player. + * + * @type {string} + */ +SeekBar.prototype.playerEvent = 'timeupdate'; + +_component2['default'].registerComponent('SeekBar', SeekBar); +exports['default'] = SeekBar; + +},{"15":15,"16":16,"17":17,"5":5,"60":60,"81":81,"85":85,"88":88,"89":89}],20:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file time-tooltip.js + */ + + +/** + * Time tooltips display a time above the progress bar. + * + * @extends Component + */ +var TimeTooltip = function (_Component) { + _inherits(TimeTooltip, _Component); + + function TimeTooltip() { + _classCallCheck(this, TimeTooltip); + + return _possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + /** + * Create the time tooltip DOM element + * + * @return {Element} + * The element that was created. + */ + TimeTooltip.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-time-tooltip' + }); + }; + + /** + * Updates the position of the time tooltip relative to the `SeekBar`. + * + * @param {Object} seekBarRect + * The `ClientRect` for the {@link SeekBar} element. + * + * @param {number} seekBarPoint + * A number from 0 to 1, representing a horizontal reference point + * from the left edge of the {@link SeekBar} + */ + + + TimeTooltip.prototype.update = function update(seekBarRect, seekBarPoint, content) { + var tooltipRect = Dom.getBoundingClientRect(this.el_); + var playerRect = Dom.getBoundingClientRect(this.player_.el()); + var seekBarPointPx = seekBarRect.width * seekBarPoint; + + // do nothing if either rect isn't available + // for example, if the player isn't in the DOM for testing + if (!playerRect || !tooltipRect) { + return; + } + + // This is the space left of the `seekBarPoint` available within the bounds + // of the player. We calculate any gap between the left edge of the player + // and the left edge of the `SeekBar` and add the number of pixels in the + // `SeekBar` before hitting the `seekBarPoint` + var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx; + + // This is the space right of the `seekBarPoint` available within the bounds + // of the player. We calculate the number of pixels from the `seekBarPoint` + // to the right edge of the `SeekBar` and add to that any gap between the + // right edge of the `SeekBar` and the player. + var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right); + + // This is the number of pixels by which the tooltip will need to be pulled + // further to the right to center it over the `seekBarPoint`. + var pullTooltipBy = tooltipRect.width / 2; + + // Adjust the `pullTooltipBy` distance to the left or right depending on + // the results of the space calculations above. + if (spaceLeftOfPoint < pullTooltipBy) { + pullTooltipBy += pullTooltipBy - spaceLeftOfPoint; + } else if (spaceRightOfPoint < pullTooltipBy) { + pullTooltipBy = spaceRightOfPoint; + } + + // Due to the imprecision of decimal/ratio based calculations and varying + // rounding behaviors, there are cases where the spacing adjustment is off + // by a pixel or two. This adds insurance to these calculations. + if (pullTooltipBy < 0) { + pullTooltipBy = 0; + } else if (pullTooltipBy > tooltipRect.width) { + pullTooltipBy = tooltipRect.width; + } + + this.el_.style.right = '-' + pullTooltipBy + 'px'; + Dom.textContent(this.el_, content); + }; + + return TimeTooltip; +}(_component2['default']); + +_component2['default'].registerComponent('TimeTooltip', TimeTooltip); +exports['default'] = TimeTooltip; + +},{"5":5,"85":85}],21:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _spacer = _dereq_(22); + +var _spacer2 = _interopRequireDefault(_spacer); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file custom-control-spacer.js + */ + + +/** + * Spacer specifically meant to be used as an insertion point for new plugins, etc. + * + * @extends Spacer + */ +var CustomControlSpacer = function (_Spacer) { + _inherits(CustomControlSpacer, _Spacer); + + function CustomControlSpacer() { + _classCallCheck(this, CustomControlSpacer); + + return _possibleConstructorReturn(this, _Spacer.apply(this, arguments)); + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + CustomControlSpacer.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-custom-control-spacer ' + _Spacer.prototype.buildCSSClass.call(this); + }; + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + CustomControlSpacer.prototype.createEl = function createEl() { + var el = _Spacer.prototype.createEl.call(this, { + className: this.buildCSSClass() + }); + + // No-flex/table-cell mode requires there be some content + // in the cell to fill the remaining space of the table. + el.innerHTML = ' '; + return el; + }; + + return CustomControlSpacer; +}(_spacer2['default']); + +_component2['default'].registerComponent('CustomControlSpacer', CustomControlSpacer); +exports['default'] = CustomControlSpacer; + +},{"22":22,"5":5}],22:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file spacer.js + */ + + +/** + * Just an empty spacer element that can be used as an append point for plugins, etc. + * Also can be used to create space between elements when necessary. + * + * @extends Component + */ +var Spacer = function (_Component) { + _inherits(Spacer, _Component); + + function Spacer() { + _classCallCheck(this, Spacer); + + return _possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + Spacer.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-spacer ' + _Component.prototype.buildCSSClass.call(this); + }; + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + Spacer.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: this.buildCSSClass() + }); + }; + + return Spacer; +}(_component2['default']); + +_component2['default'].registerComponent('Spacer', Spacer); + +exports['default'] = Spacer; + +},{"5":5}],23:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackMenuItem = _dereq_(33); + +var _textTrackMenuItem2 = _interopRequireDefault(_textTrackMenuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file caption-settings-menu-item.js + */ + + +/** + * The menu item for caption track settings menu + * + * @extends TextTrackMenuItem + */ +var CaptionSettingsMenuItem = function (_TextTrackMenuItem) { + _inherits(CaptionSettingsMenuItem, _TextTrackMenuItem); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function CaptionSettingsMenuItem(player, options) { + _classCallCheck(this, CaptionSettingsMenuItem); + + options.track = { + player: player, + kind: options.kind, + label: options.kind + ' settings', + selectable: false, + 'default': false, + mode: 'disabled' + }; + + // CaptionSettingsMenuItem has no concept of 'selected' + options.selectable = false; + + options.name = 'CaptionSettingsMenuItem'; + + var _this = _possibleConstructorReturn(this, _TextTrackMenuItem.call(this, player, options)); + + _this.addClass('vjs-texttrack-settings'); + _this.controlText(', opens ' + options.kind + ' settings dialog'); + return _this; + } + + /** + * This gets called when an `CaptionSettingsMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + CaptionSettingsMenuItem.prototype.handleClick = function handleClick(event) { + this.player().getChild('textTrackSettings').open(); + }; + + return CaptionSettingsMenuItem; +}(_textTrackMenuItem2['default']); + +_component2['default'].registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem); +exports['default'] = CaptionSettingsMenuItem; + +},{"33":33,"5":5}],24:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackButton = _dereq_(32); + +var _textTrackButton2 = _interopRequireDefault(_textTrackButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _captionSettingsMenuItem = _dereq_(23); + +var _captionSettingsMenuItem2 = _interopRequireDefault(_captionSettingsMenuItem); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file captions-button.js + */ + + +/** + * The button component for toggling and selecting captions + * + * @extends TextTrackButton + */ +var CaptionsButton = function (_TextTrackButton) { + _inherits(CaptionsButton, _TextTrackButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this component is ready. + */ + function CaptionsButton(player, options, ready) { + _classCallCheck(this, CaptionsButton); + + return _possibleConstructorReturn(this, _TextTrackButton.call(this, player, options, ready)); + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + CaptionsButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-captions-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); + }; + + CaptionsButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + return 'vjs-captions-button ' + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); + }; + + /** + * Create caption menu items + * + * @return {CaptionSettingsMenuItem[]} + * The array of current menu items. + */ + + + CaptionsButton.prototype.createItems = function createItems() { + var items = []; + + if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks)) { + items.push(new _captionSettingsMenuItem2['default'](this.player_, { kind: this.kind_ })); + + this.hideThreshold_ += 1; + } + + return _TextTrackButton.prototype.createItems.call(this, items); + }; + + return CaptionsButton; +}(_textTrackButton2['default']); + +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + +CaptionsButton.prototype.kind_ = 'captions'; + +/** + * The text that should display over the `CaptionsButton`s controls. Added for localization. + * + * @type {string} + * @private + */ +CaptionsButton.prototype.controlText_ = 'Captions'; + +_component2['default'].registerComponent('CaptionsButton', CaptionsButton); +exports['default'] = CaptionsButton; + +},{"23":23,"32":32,"5":5}],25:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackButton = _dereq_(32); + +var _textTrackButton2 = _interopRequireDefault(_textTrackButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _chaptersTrackMenuItem = _dereq_(26); + +var _chaptersTrackMenuItem2 = _interopRequireDefault(_chaptersTrackMenuItem); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file chapters-button.js + */ + + +/** + * The button component for toggling and selecting chapters + * Chapters act much differently than other text tracks + * Cues are navigation vs. other tracks of alternative languages + * + * @extends TextTrackButton + */ +var ChaptersButton = function (_TextTrackButton) { + _inherits(ChaptersButton, _TextTrackButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this function is ready. + */ + function ChaptersButton(player, options, ready) { + _classCallCheck(this, ChaptersButton); + + return _possibleConstructorReturn(this, _TextTrackButton.call(this, player, options, ready)); + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + ChaptersButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-chapters-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); + }; + + ChaptersButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + return 'vjs-chapters-button ' + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); + }; + + /** + * Update the menu based on the current state of its items. + * + * @param {EventTarget~Event} [event] + * An event that triggered this function to run. + * + * @listens TextTrackList#addtrack + * @listens TextTrackList#removetrack + * @listens TextTrackList#change + */ + + + ChaptersButton.prototype.update = function update(event) { + if (!this.track_ || event && (event.type === 'addtrack' || event.type === 'removetrack')) { + this.setTrack(this.findChaptersTrack()); + } + _TextTrackButton.prototype.update.call(this); + }; + + /** + * Set the currently selected track for the chapters button. + * + * @param {TextTrack} track + * The new track to select. Nothing will change if this is the currently selected + * track. + */ + + + ChaptersButton.prototype.setTrack = function setTrack(track) { + if (this.track_ === track) { + return; + } + + if (!this.updateHandler_) { + this.updateHandler_ = this.update.bind(this); + } + + // here this.track_ refers to the old track instance + if (this.track_) { + var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); + + if (remoteTextTrackEl) { + remoteTextTrackEl.removeEventListener('load', this.updateHandler_); + } + + this.track_ = null; + } + + this.track_ = track; + + // here this.track_ refers to the new track instance + if (this.track_) { + this.track_.mode = 'hidden'; + + var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_); + + if (_remoteTextTrackEl) { + _remoteTextTrackEl.addEventListener('load', this.updateHandler_); + } + } + }; + + /** + * Find the track object that is currently in use by this ChaptersButton + * + * @return {TextTrack|undefined} + * The current track or undefined if none was found. + */ + + + ChaptersButton.prototype.findChaptersTrack = function findChaptersTrack() { + var tracks = this.player_.textTracks() || []; + + for (var i = tracks.length - 1; i >= 0; i--) { + // We will always choose the last track as our chaptersTrack + var track = tracks[i]; + + if (track.kind === this.kind_) { + return track; + } + } + }; + + /** + * Get the caption for the ChaptersButton based on the track label. This will also + * use the current tracks localized kind as a fallback if a label does not exist. + * + * @return {string} + * The tracks current label or the localized track kind. + */ + + + ChaptersButton.prototype.getMenuCaption = function getMenuCaption() { + if (this.track_ && this.track_.label) { + return this.track_.label; + } + return this.localize((0, _toTitleCase2['default'])(this.kind_)); + }; + + /** + * Create menu from chapter track + * + * @return {Menu} + * New menu for the chapter buttons + */ + + + ChaptersButton.prototype.createMenu = function createMenu() { + this.options_.title = this.getMenuCaption(); + return _TextTrackButton.prototype.createMenu.call(this); + }; + + /** + * Create a menu item for each text track + * + * @return {TextTrackMenuItem[]} + * Array of menu items + */ + + + ChaptersButton.prototype.createItems = function createItems() { + var items = []; + + if (!this.track_) { + return items; + } + + var cues = this.track_.cues; + + if (!cues) { + return items; + } + + for (var i = 0, l = cues.length; i < l; i++) { + var cue = cues[i]; + var mi = new _chaptersTrackMenuItem2['default'](this.player_, { track: this.track_, cue: cue }); + + items.push(mi); + } + + return items; + }; + + return ChaptersButton; +}(_textTrackButton2['default']); + +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + +ChaptersButton.prototype.kind_ = 'chapters'; + +/** + * The text that should display over the `ChaptersButton`s controls. Added for localization. + * + * @type {string} + * @private + */ +ChaptersButton.prototype.controlText_ = 'Chapters'; + +_component2['default'].registerComponent('ChaptersButton', ChaptersButton); +exports['default'] = ChaptersButton; + +},{"26":26,"32":32,"5":5,"96":96}],26:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _menuItem = _dereq_(51); + +var _menuItem2 = _interopRequireDefault(_menuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file chapters-track-menu-item.js + */ + + +/** + * The chapter track menu item + * + * @extends MenuItem + */ +var ChaptersTrackMenuItem = function (_MenuItem) { + _inherits(ChaptersTrackMenuItem, _MenuItem); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function ChaptersTrackMenuItem(player, options) { + _classCallCheck(this, ChaptersTrackMenuItem); + + var track = options.track; + var cue = options.cue; + var currentTime = player.currentTime(); + + // Modify options for parent MenuItem class's init. + options.selectable = true; + options.label = cue.text; + options.selected = cue.startTime <= currentTime && currentTime < cue.endTime; + + var _this = _possibleConstructorReturn(this, _MenuItem.call(this, player, options)); + + _this.track = track; + _this.cue = cue; + track.addEventListener('cuechange', Fn.bind(_this, _this.update)); + return _this; + } + + /** + * This gets called when an `ChaptersTrackMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} [event] + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + ChaptersTrackMenuItem.prototype.handleClick = function handleClick(event) { + _MenuItem.prototype.handleClick.call(this); + this.player_.currentTime(this.cue.startTime); + this.update(this.cue.startTime); + }; + + /** + * Update chapter menu item + * + * @param {EventTarget~Event} [event] + * The `cuechange` event that caused this function to run. + * + * @listens TextTrack#cuechange + */ + + + ChaptersTrackMenuItem.prototype.update = function update(event) { + var cue = this.cue; + var currentTime = this.player_.currentTime(); + + // vjs.log(currentTime, cue.startTime); + this.selected(cue.startTime <= currentTime && currentTime < cue.endTime); + }; + + return ChaptersTrackMenuItem; +}(_menuItem2['default']); + +_component2['default'].registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem); +exports['default'] = ChaptersTrackMenuItem; + +},{"5":5,"51":51,"88":88}],27:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackButton = _dereq_(32); + +var _textTrackButton2 = _interopRequireDefault(_textTrackButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file descriptions-button.js + */ + + +/** + * The button component for toggling and selecting descriptions + * + * @extends TextTrackButton + */ +var DescriptionsButton = function (_TextTrackButton) { + _inherits(DescriptionsButton, _TextTrackButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this component is ready. + */ + function DescriptionsButton(player, options, ready) { + _classCallCheck(this, DescriptionsButton); + + var _this = _possibleConstructorReturn(this, _TextTrackButton.call(this, player, options, ready)); + + var tracks = player.textTracks(); + var changeHandler = Fn.bind(_this, _this.handleTracksChange); + + tracks.addEventListener('change', changeHandler); + _this.on('dispose', function () { + tracks.removeEventListener('change', changeHandler); + }); + return _this; + } + + /** + * Handle text track change + * + * @param {EventTarget~Event} event + * The event that caused this function to run + * + * @listens TextTrackList#change + */ + + + DescriptionsButton.prototype.handleTracksChange = function handleTracksChange(event) { + var tracks = this.player().textTracks(); + var disabled = false; + + // Check whether a track of a different kind is showing + for (var i = 0, l = tracks.length; i < l; i++) { + var track = tracks[i]; + + if (track.kind !== this.kind_ && track.mode === 'showing') { + disabled = true; + break; + } + } + + // If another track is showing, disable this menu button + if (disabled) { + this.disable(); + } else { + this.enable(); + } + }; + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + DescriptionsButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-descriptions-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); + }; + + DescriptionsButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + return 'vjs-descriptions-button ' + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); + }; + + return DescriptionsButton; +}(_textTrackButton2['default']); + +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + +DescriptionsButton.prototype.kind_ = 'descriptions'; + +/** + * The text that should display over the `DescriptionsButton`s controls. Added for localization. + * + * @type {string} + * @private + */ +DescriptionsButton.prototype.controlText_ = 'Descriptions'; + +_component2['default'].registerComponent('DescriptionsButton', DescriptionsButton); +exports['default'] = DescriptionsButton; + +},{"32":32,"5":5,"88":88}],28:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackMenuItem = _dereq_(33); + +var _textTrackMenuItem2 = _interopRequireDefault(_textTrackMenuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file off-text-track-menu-item.js + */ + + +/** + * A special menu item for turning of a specific type of text track + * + * @extends TextTrackMenuItem + */ +var OffTextTrackMenuItem = function (_TextTrackMenuItem) { + _inherits(OffTextTrackMenuItem, _TextTrackMenuItem); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function OffTextTrackMenuItem(player, options) { + _classCallCheck(this, OffTextTrackMenuItem); + + // Create pseudo track info + // Requires options['kind'] + options.track = { + player: player, + kind: options.kind, + kinds: options.kinds, + 'default': false, + mode: 'disabled' + }; + + if (!options.kinds) { + options.kinds = [options.kind]; + } + + if (options.label) { + options.track.label = options.label; + } else { + options.track.label = options.kinds.join(' and ') + ' off'; + } + + // MenuItem is selectable + options.selectable = true; + + var _this = _possibleConstructorReturn(this, _TextTrackMenuItem.call(this, player, options)); + + _this.selected(true); + return _this; + } + + /** + * Handle text track change + * + * @param {EventTarget~Event} event + * The event that caused this function to run + */ + + + OffTextTrackMenuItem.prototype.handleTracksChange = function handleTracksChange(event) { + var tracks = this.player().textTracks(); + var selected = true; + + for (var i = 0, l = tracks.length; i < l; i++) { + var track = tracks[i]; + + if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === 'showing') { + selected = false; + break; + } + } + + this.selected(selected); + }; + + return OffTextTrackMenuItem; +}(_textTrackMenuItem2['default']); + +_component2['default'].registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem); +exports['default'] = OffTextTrackMenuItem; + +},{"33":33,"5":5}],29:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackButton = _dereq_(32); + +var _textTrackButton2 = _interopRequireDefault(_textTrackButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _captionSettingsMenuItem = _dereq_(23); + +var _captionSettingsMenuItem2 = _interopRequireDefault(_captionSettingsMenuItem); + +var _subsCapsMenuItem = _dereq_(30); + +var _subsCapsMenuItem2 = _interopRequireDefault(_subsCapsMenuItem); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file sub-caps-button.js + */ + + +/** + * The button component for toggling and selecting captions and/or subtitles + * + * @extends TextTrackButton + */ +var SubsCapsButton = function (_TextTrackButton) { + _inherits(SubsCapsButton, _TextTrackButton); + + function SubsCapsButton(player) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, SubsCapsButton); + + // Although North America uses "captions" in most cases for + // "captions and subtitles" other locales use "subtitles" + var _this = _possibleConstructorReturn(this, _TextTrackButton.call(this, player, options)); + + _this.label_ = 'subtitles'; + if (['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(_this.player_.language_) > -1) { + _this.label_ = 'captions'; + } + _this.menuButton_.controlText((0, _toTitleCase2['default'])(_this.label_)); + return _this; + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + SubsCapsButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-subs-caps-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); + }; + + SubsCapsButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + return 'vjs-subs-caps-button ' + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); + }; + + /** + * Create caption/subtitles menu items + * + * @return {CaptionSettingsMenuItem[]} + * The array of current menu items. + */ + + + SubsCapsButton.prototype.createItems = function createItems() { + var items = []; + + if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks)) { + items.push(new _captionSettingsMenuItem2['default'](this.player_, { kind: this.label_ })); + + this.hideThreshold_ += 1; + } + + items = _TextTrackButton.prototype.createItems.call(this, items, _subsCapsMenuItem2['default']); + return items; + }; + + return SubsCapsButton; +}(_textTrackButton2['default']); + +/** + * `kind`s of TextTrack to look for to associate it with this menu. + * + * @type {array} + * @private + */ + + +SubsCapsButton.prototype.kinds_ = ['captions', 'subtitles']; + +/** + * The text that should display over the `SubsCapsButton`s controls. + * + * + * @type {string} + * @private + */ +SubsCapsButton.prototype.controlText_ = 'Subtitles'; + +_component2['default'].registerComponent('SubsCapsButton', SubsCapsButton); +exports['default'] = SubsCapsButton; + +},{"23":23,"30":30,"32":32,"5":5,"96":96}],30:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackMenuItem = _dereq_(33); + +var _textTrackMenuItem2 = _interopRequireDefault(_textTrackMenuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _obj = _dereq_(93); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file subs-caps-menu-item.js + */ + + +/** + * SubsCapsMenuItem has an [cc] icon to distinguish captions from subtitles + * in the SubsCapsMenu. + * + * @extends TextTrackMenuItem + */ +var SubsCapsMenuItem = function (_TextTrackMenuItem) { + _inherits(SubsCapsMenuItem, _TextTrackMenuItem); + + function SubsCapsMenuItem() { + _classCallCheck(this, SubsCapsMenuItem); + + return _possibleConstructorReturn(this, _TextTrackMenuItem.apply(this, arguments)); + } + + SubsCapsMenuItem.prototype.createEl = function createEl(type, props, attrs) { + var innerHTML = '' + this.localize(this.options_.label); + + if (this.options_.track.kind === 'captions') { + innerHTML += '\n \n ' + this.localize('Captions') + '\n '; + } + + innerHTML += ''; + + var el = _TextTrackMenuItem.prototype.createEl.call(this, type, (0, _obj.assign)({ + innerHTML: innerHTML + }, props), attrs); + + return el; + }; + + return SubsCapsMenuItem; +}(_textTrackMenuItem2['default']); + +_component2['default'].registerComponent('SubsCapsMenuItem', SubsCapsMenuItem); +exports['default'] = SubsCapsMenuItem; + +},{"33":33,"5":5,"93":93}],31:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _textTrackButton = _dereq_(32); + +var _textTrackButton2 = _interopRequireDefault(_textTrackButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file subtitles-button.js + */ + + +/** + * The button component for toggling and selecting subtitles + * + * @extends TextTrackButton + */ +var SubtitlesButton = function (_TextTrackButton) { + _inherits(SubtitlesButton, _TextTrackButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function to call when this component is ready. + */ + function SubtitlesButton(player, options, ready) { + _classCallCheck(this, SubtitlesButton); + + return _possibleConstructorReturn(this, _TextTrackButton.call(this, player, options, ready)); + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + SubtitlesButton.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-subtitles-button ' + _TextTrackButton.prototype.buildCSSClass.call(this); + }; + + SubtitlesButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + return 'vjs-subtitles-button ' + _TextTrackButton.prototype.buildWrapperCSSClass.call(this); + }; + + return SubtitlesButton; +}(_textTrackButton2['default']); + +/** + * `kind` of TextTrack to look for to associate it with this menu. + * + * @type {string} + * @private + */ + + +SubtitlesButton.prototype.kind_ = 'subtitles'; + +/** + * The text that should display over the `SubtitlesButton`s controls. Added for localization. + * + * @type {string} + * @private + */ +SubtitlesButton.prototype.controlText_ = 'Subtitles'; + +_component2['default'].registerComponent('SubtitlesButton', SubtitlesButton); +exports['default'] = SubtitlesButton; + +},{"32":32,"5":5}],32:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _trackButton = _dereq_(38); + +var _trackButton2 = _interopRequireDefault(_trackButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _textTrackMenuItem = _dereq_(33); + +var _textTrackMenuItem2 = _interopRequireDefault(_textTrackMenuItem); + +var _offTextTrackMenuItem = _dereq_(28); + +var _offTextTrackMenuItem2 = _interopRequireDefault(_offTextTrackMenuItem); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file text-track-button.js + */ + + +/** + * The base class for buttons that toggle specific text track types (e.g. subtitles) + * + * @extends MenuButton + */ +var TextTrackButton = function (_TrackButton) { + _inherits(TextTrackButton, _TrackButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ + function TextTrackButton(player) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, TextTrackButton); + + options.tracks = player.textTracks(); + + return _possibleConstructorReturn(this, _TrackButton.call(this, player, options)); + } + + /** + * Create a menu item for each text track + * + * @param {TextTrackMenuItem[]} [items=[]] + * Existing array of items to use during creation + * + * @return {TextTrackMenuItem[]} + * Array of menu items that were created + */ + + + TextTrackButton.prototype.createItems = function createItems() { + var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var TrackMenuItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _textTrackMenuItem2['default']; + + + // Label is an overide for the [track] off label + // USed to localise captions/subtitles + var label = void 0; + + if (this.label_) { + label = this.label_ + ' off'; + } + // Add an OFF menu item to turn all tracks off + items.push(new _offTextTrackMenuItem2['default'](this.player_, { + kinds: this.kinds_, + kind: this.kind_, + label: label + })); + + this.hideThreshold_ += 1; + + var tracks = this.player_.textTracks(); + + if (!Array.isArray(this.kinds_)) { + this.kinds_ = [this.kind_]; + } + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + // only add tracks that are of an appropriate kind and have a label + if (this.kinds_.indexOf(track.kind) > -1) { + var item = new TrackMenuItem(this.player_, { + track: track, + // MenuItem is selectable + selectable: true + }); + + item.addClass('vjs-' + track.kind + '-menu-item'); + items.push(item); + } + } + + return items; + }; + + return TextTrackButton; +}(_trackButton2['default']); + +_component2['default'].registerComponent('TextTrackButton', TextTrackButton); +exports['default'] = TextTrackButton; + +},{"28":28,"33":33,"38":38,"5":5}],33:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _menuItem = _dereq_(51); + +var _menuItem2 = _interopRequireDefault(_menuItem); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _window = _dereq_(100); + +var _window2 = _interopRequireDefault(_window); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file text-track-menu-item.js + */ + + +/** + * The specific menu item type for selecting a language within a text track kind + * + * @extends MenuItem + */ +var TextTrackMenuItem = function (_MenuItem) { + _inherits(TextTrackMenuItem, _MenuItem); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function TextTrackMenuItem(player, options) { + _classCallCheck(this, TextTrackMenuItem); + + var track = options.track; + var tracks = player.textTracks(); + + // Modify options for parent MenuItem class's init. + options.label = track.label || track.language || 'Unknown'; + options.selected = track['default'] || track.mode === 'showing'; + + var _this = _possibleConstructorReturn(this, _MenuItem.call(this, player, options)); + + _this.track = track; + var changeHandler = Fn.bind(_this, _this.handleTracksChange); + + player.on(['loadstart', 'texttrackchange'], changeHandler); + tracks.addEventListener('change', changeHandler); + _this.on('dispose', function () { + tracks.removeEventListener('change', changeHandler); + }); + + // iOS7 doesn't dispatch change events to TextTrackLists when an + // associated track's mode changes. Without something like + // Object.observe() (also not present on iOS7), it's not + // possible to detect changes to the mode attribute and polyfill + // the change event. As a poor substitute, we manually dispatch + // change events whenever the controls modify the mode. + if (tracks.onchange === undefined) { + var event = void 0; + + _this.on(['tap', 'click'], function () { + if (_typeof(_window2['default'].Event) !== 'object') { + // Android 2.3 throws an Illegal Constructor error for window.Event + try { + event = new _window2['default'].Event('change'); + } catch (err) { + // continue regardless of error + } + } + + if (!event) { + event = _document2['default'].createEvent('Event'); + event.initEvent('change', true, true); + } + + tracks.dispatchEvent(event); + }); + } + return _this; + } + + /** + * This gets called when an `TextTrackMenuItem` is "clicked". See + * {@link ClickableComponent} for more detailed information on what a click can be. + * + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + TextTrackMenuItem.prototype.handleClick = function handleClick(event) { + var kind = this.track.kind; + var kinds = this.track.kinds; + var tracks = this.player_.textTracks(); + + if (!kinds) { + kinds = [kind]; + } + + _MenuItem.prototype.handleClick.call(this, event); + + if (!tracks) { + return; + } + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + if (track === this.track && kinds.indexOf(track.kind) > -1) { + if (track.mode !== 'showing') { + track.mode = 'showing'; + } + } else if (track.mode !== 'disabled') { + track.mode = 'disabled'; + } + } + }; + + /** + * Handle text track list change + * + * @param {EventTarget~Event} event + * The `change` event that caused this function to be called. + * + * @listens TextTrackList#change + */ + + + TextTrackMenuItem.prototype.handleTracksChange = function handleTracksChange(event) { + this.selected(this.track.mode === 'showing'); + }; + + return TextTrackMenuItem; +}(_menuItem2['default']); + +_component2['default'].registerComponent('TextTrackMenuItem', TextTrackMenuItem); +exports['default'] = TextTrackMenuItem; + +},{"100":100,"5":5,"51":51,"88":88,"99":99}],34:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _formatTime = _dereq_(89); + +var _formatTime2 = _interopRequireDefault(_formatTime); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file current-time-display.js + */ + + +/** + * Displays the current time + * + * @extends Component + */ +var CurrentTimeDisplay = function (_Component) { + _inherits(CurrentTimeDisplay, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function CurrentTimeDisplay(player, options) { + _classCallCheck(this, CurrentTimeDisplay); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.on(player, 'timeupdate', _this.updateContent); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + CurrentTimeDisplay.prototype.createEl = function createEl() { + var el = _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-current-time vjs-time-control vjs-control' + }); + + this.contentEl_ = Dom.createEl('div', { + className: 'vjs-current-time-display', + // label the current time for screen reader users + innerHTML: 'Current Time ' + '0:00' + }, { + // tell screen readers not to automatically read the time as it changes + 'aria-live': 'off' + }); + + el.appendChild(this.contentEl_); + return el; + }; + + /** + * Update current time display + * + * @param {EventTarget~Event} [event] + * The `timeupdate` event that caused this function to run. + * + * @listens Player#timeupdate + */ + + + CurrentTimeDisplay.prototype.updateContent = function updateContent(event) { + // Allows for smooth scrubbing, when player can't keep up. + var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(); + var localizedText = this.localize('Current Time'); + var formattedTime = (0, _formatTime2['default'])(time, this.player_.duration()); + + if (formattedTime !== this.formattedTime_) { + this.formattedTime_ = formattedTime; + this.contentEl_.innerHTML = '' + localizedText + ' ' + formattedTime; + } + }; + + return CurrentTimeDisplay; +}(_component2['default']); + +_component2['default'].registerComponent('CurrentTimeDisplay', CurrentTimeDisplay); +exports['default'] = CurrentTimeDisplay; + +},{"5":5,"85":85,"89":89}],35:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _formatTime = _dereq_(89); + +var _formatTime2 = _interopRequireDefault(_formatTime); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file duration-display.js + */ + + +/** + * Displays the duration + * + * @extends Component + */ +var DurationDisplay = function (_Component) { + _inherits(DurationDisplay, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function DurationDisplay(player, options) { + _classCallCheck(this, DurationDisplay); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.on(player, 'durationchange', _this.updateContent); + + // Also listen for timeupdate and loadedmetadata because removing those + // listeners could have broken dependent applications/libraries. These + // can likely be removed for 6.0. + _this.on(player, 'timeupdate', _this.updateContent); + _this.on(player, 'loadedmetadata', _this.updateContent); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + DurationDisplay.prototype.createEl = function createEl() { + var el = _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-duration vjs-time-control vjs-control' + }); + + this.contentEl_ = Dom.createEl('div', { + className: 'vjs-duration-display', + // label the duration time for screen reader users + innerHTML: '' + this.localize('Duration Time') + ' 0:00' + }, { + // tell screen readers not to automatically read the time as it changes + 'aria-live': 'off' + }); + + el.appendChild(this.contentEl_); + return el; + }; + + /** + * Update duration time display. + * + * @param {EventTarget~Event} [event] + * The `durationchange`, `timeupdate`, or `loadedmetadata` event that caused + * this function to be called. + * + * @listens Player#durationchange + * @listens Player#timeupdate + * @listens Player#loadedmetadata + */ + + + DurationDisplay.prototype.updateContent = function updateContent(event) { + var duration = this.player_.duration(); + + if (duration && this.duration_ !== duration) { + this.duration_ = duration; + var localizedText = this.localize('Duration Time'); + var formattedTime = (0, _formatTime2['default'])(duration); + + // label the duration time for screen reader users + this.contentEl_.innerHTML = '' + localizedText + ' ' + formattedTime; + } + }; + + return DurationDisplay; +}(_component2['default']); + +_component2['default'].registerComponent('DurationDisplay', DurationDisplay); +exports['default'] = DurationDisplay; + +},{"5":5,"85":85,"89":89}],36:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _formatTime = _dereq_(89); + +var _formatTime2 = _interopRequireDefault(_formatTime); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file remaining-time-display.js + */ + + +/** + * Displays the time left in the video + * + * @extends Component + */ +var RemainingTimeDisplay = function (_Component) { + _inherits(RemainingTimeDisplay, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function RemainingTimeDisplay(player, options) { + _classCallCheck(this, RemainingTimeDisplay); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.on(player, 'timeupdate', _this.updateContent); + _this.on(player, 'durationchange', _this.updateContent); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + RemainingTimeDisplay.prototype.createEl = function createEl() { + var el = _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-remaining-time vjs-time-control vjs-control' + }); + + this.contentEl_ = Dom.createEl('div', { + className: 'vjs-remaining-time-display', + // label the remaining time for screen reader users + innerHTML: '' + this.localize('Remaining Time') + ' -0:00' + }, { + // tell screen readers not to automatically read the time as it changes + 'aria-live': 'off' + }); + + el.appendChild(this.contentEl_); + return el; + }; + + /** + * Update remaining time display. + * + * @param {EventTarget~Event} [event] + * The `timeupdate` or `durationchange` event that caused this to run. + * + * @listens Player#timeupdate + * @listens Player#durationchange + */ + + + RemainingTimeDisplay.prototype.updateContent = function updateContent(event) { + if (this.player_.duration()) { + var localizedText = this.localize('Remaining Time'); + var formattedTime = (0, _formatTime2['default'])(this.player_.remainingTime()); + + if (formattedTime !== this.formattedTime_) { + this.formattedTime_ = formattedTime; + this.contentEl_.innerHTML = '' + localizedText + ' -' + formattedTime; + } + } + + // Allows for smooth scrubbing, when player can't keep up. + // var time = (this.player_.scrubbing()) ? this.player_.getCache().currentTime : this.player_.currentTime(); + // this.contentEl_.innerHTML = vjs.formatTime(time, this.player_.duration()); + }; + + return RemainingTimeDisplay; +}(_component2['default']); + +_component2['default'].registerComponent('RemainingTimeDisplay', RemainingTimeDisplay); +exports['default'] = RemainingTimeDisplay; + +},{"5":5,"85":85,"89":89}],37:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file time-divider.js + */ + + +/** + * The separator between the current time and duration. + * Can be hidden if it's not needed in the design. + * + * @extends Component + */ +var TimeDivider = function (_Component) { + _inherits(TimeDivider, _Component); + + function TimeDivider() { + _classCallCheck(this, TimeDivider); + + return _possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + /** + * Create the component's DOM element + * + * @return {Element} + * The element that was created. + */ + TimeDivider.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-time-control vjs-time-divider', + innerHTML: '
/
' + }); + }; + + return TimeDivider; +}(_component2['default']); + +_component2['default'].registerComponent('TimeDivider', TimeDivider); +exports['default'] = TimeDivider; + +},{"5":5}],38:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _menuButton = _dereq_(50); + +var _menuButton2 = _interopRequireDefault(_menuButton); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file track-button.js + */ + + +/** + * The base class for buttons that toggle specific track types (e.g. subtitles). + * + * @extends MenuButton + */ +var TrackButton = function (_MenuButton) { + _inherits(TrackButton, _MenuButton); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function TrackButton(player, options) { + _classCallCheck(this, TrackButton); + + var tracks = options.tracks; + + var _this = _possibleConstructorReturn(this, _MenuButton.call(this, player, options)); + + if (_this.items.length <= 1) { + _this.hide(); + } + + if (!tracks) { + return _possibleConstructorReturn(_this); + } + + var updateHandler = Fn.bind(_this, _this.update); + + tracks.addEventListener('removetrack', updateHandler); + tracks.addEventListener('addtrack', updateHandler); + _this.player_.on('ready', updateHandler); + + _this.player_.on('dispose', function () { + tracks.removeEventListener('removetrack', updateHandler); + tracks.removeEventListener('addtrack', updateHandler); + }); + return _this; + } + + return TrackButton; +}(_menuButton2['default']); + +_component2['default'].registerComponent('TrackButton', TrackButton); +exports['default'] = TrackButton; + +},{"5":5,"50":50,"88":88}],39:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; +/** + * Check if volume control is supported and if it isn't hide the + * `Component` that was passed using the `vjs-hidden` class. + * + * @param {Component} self + * The component that should be hidden if volume is unsupported + * + * @param {Player} player + * A reference to the player + * + * @private + */ +var checkVolumeSupport = function checkVolumeSupport(self, player) { + // hide volume controls when they're not supported by the current tech + if (player.tech_ && !player.tech_.featuresVolumeControl) { + self.addClass('vjs-hidden'); + } + + self.on(player, 'loadstart', function () { + if (!player.tech_.featuresVolumeControl) { + self.addClass('vjs-hidden'); + } else { + self.removeClass('vjs-hidden'); + } + }); +}; + +exports['default'] = checkVolumeSupport; + +},{}],40:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _slider = _dereq_(60); + +var _slider2 = _interopRequireDefault(_slider); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +_dereq_(42); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file volume-bar.js + */ + + +// Required children + + +/** + * The bar that contains the volume level and can be clicked on to adjust the level + * + * @extends Slider + */ +var VolumeBar = function (_Slider) { + _inherits(VolumeBar, _Slider); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function VolumeBar(player, options) { + _classCallCheck(this, VolumeBar); + + var _this = _possibleConstructorReturn(this, _Slider.call(this, player, options)); + + _this.on('slideractive', _this.updateLastVolume_); + _this.on(player, 'volumechange', _this.updateARIAAttributes); + player.ready(function () { + return _this.updateARIAAttributes(); + }); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + VolumeBar.prototype.createEl = function createEl() { + return _Slider.prototype.createEl.call(this, 'div', { + className: 'vjs-volume-bar vjs-slider-bar' + }, { + 'aria-label': this.localize('Volume Level'), + 'aria-live': 'polite' + }); + }; + + /** + * Handle movement events on the {@link VolumeMenuButton}. + * + * @param {EventTarget~Event} event + * The event that caused this function to run. + * + * @listens mousemove + */ + + + VolumeBar.prototype.handleMouseMove = function handleMouseMove(event) { + this.checkMuted(); + this.player_.volume(this.calculateDistance(event)); + }; + + /** + * If the player is muted unmute it. + */ + + + VolumeBar.prototype.checkMuted = function checkMuted() { + if (this.player_.muted()) { + this.player_.muted(false); + } + }; + + /** + * Get percent of volume level + * + * @return {number} + * Volume level percent as a decimal number. + */ + + + VolumeBar.prototype.getPercent = function getPercent() { + if (this.player_.muted()) { + return 0; + } + return this.player_.volume(); + }; + + /** + * Increase volume level for keyboard users + */ + + + VolumeBar.prototype.stepForward = function stepForward() { + this.checkMuted(); + this.player_.volume(this.player_.volume() + 0.1); + }; + + /** + * Decrease volume level for keyboard users + */ + + + VolumeBar.prototype.stepBack = function stepBack() { + this.checkMuted(); + this.player_.volume(this.player_.volume() - 0.1); + }; + + /** + * Update ARIA accessibility attributes + * + * @param {EventTarget~Event} [event] + * The `volumechange` event that caused this function to run. + * + * @listens Player#volumechange + */ + + + VolumeBar.prototype.updateARIAAttributes = function updateARIAAttributes(event) { + var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_(); + + this.el_.setAttribute('aria-valuenow', ariaValue); + this.el_.setAttribute('aria-valuetext', ariaValue + '%'); + }; + + /** + * Returns the current value of the player volume as a percentage + * + * @private + */ + + + VolumeBar.prototype.volumeAsPercentage_ = function volumeAsPercentage_() { + return Math.round(this.player_.volume() * 100); + }; + + /** + * When user starts dragging the VolumeBar, store the volume and listen for + * the end of the drag. When the drag ends, if the volume was set to zero, + * set lastVolume to the stored volume. + * + * @listens slideractive + * @private + */ + + + VolumeBar.prototype.updateLastVolume_ = function updateLastVolume_() { + var _this2 = this; + + var volumeBeforeDrag = this.player_.volume(); + + this.one('sliderinactive', function () { + if (_this2.player_.volume() === 0) { + _this2.player_.lastVolume_(volumeBeforeDrag); + } + }); + }; + + return VolumeBar; +}(_slider2['default']); + +/** + * Default options for the `VolumeBar` + * + * @type {Object} + * @private + */ + + +VolumeBar.prototype.options_ = { + children: ['volumeLevel'], + barName: 'volumeLevel' +}; + +/** + * Call the update event for this Slider when this event happens on the player. + * + * @type {string} + */ +VolumeBar.prototype.playerEvent = 'volumechange'; + +_component2['default'].registerComponent('VolumeBar', VolumeBar); +exports['default'] = VolumeBar; + +},{"42":42,"5":5,"60":60}],41:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _checkVolumeSupport = _dereq_(39); + +var _checkVolumeSupport2 = _interopRequireDefault(_checkVolumeSupport); + +var _obj = _dereq_(93); + +var _fn = _dereq_(88); + +_dereq_(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file volume-control.js + */ + + +// Required children + + +/** + * The component for controlling the volume level + * + * @extends Component + */ +var VolumeControl = function (_Component) { + _inherits(VolumeControl, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ + function VolumeControl(player) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, VolumeControl); + + options.vertical = options.vertical || false; + + // Pass the vertical option down to the VolumeBar if + // the VolumeBar is turned on. + if (typeof options.volumeBar === 'undefined' || (0, _obj.isPlain)(options.volumeBar)) { + options.volumeBar = options.volumeBar || {}; + options.volumeBar.vertical = options.vertical; + } + + // hide this control if volume support is missing + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + (0, _checkVolumeSupport2['default'])(_this, player); + + _this.throttledHandleMouseMove = (0, _fn.throttle)((0, _fn.bind)(_this, _this.handleMouseMove), 25); + + _this.on('mousedown', _this.handleMouseDown); + _this.on('touchstart', _this.handleMouseDown); + + // while the slider is active (the mouse has been pressed down and + // is dragging) or in focus we do not want to hide the VolumeBar + _this.on(_this.volumeBar, ['focus', 'slideractive'], function () { + _this.volumeBar.addClass('vjs-slider-active'); + _this.addClass('vjs-slider-active'); + _this.trigger('slideractive'); + }); + + _this.on(_this.volumeBar, ['blur', 'sliderinactive'], function () { + _this.volumeBar.removeClass('vjs-slider-active'); + _this.removeClass('vjs-slider-active'); + _this.trigger('sliderinactive'); + }); + return _this; + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + VolumeControl.prototype.createEl = function createEl() { + var orientationClass = 'vjs-volume-horizontal'; + + if (this.options_.vertical) { + orientationClass = 'vjs-volume-vertical'; + } + + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-volume-control vjs-control ' + orientationClass + }); + }; + + /** + * Handle `mousedown` or `touchstart` events on the `VolumeControl`. + * + * @param {EventTarget~Event} event + * `mousedown` or `touchstart` event that triggered this function + * + * @listens mousedown + * @listens touchstart + */ + + + VolumeControl.prototype.handleMouseDown = function handleMouseDown(event) { + var doc = this.el_.ownerDocument; + + this.on(doc, 'mousemove', this.throttledHandleMouseMove); + this.on(doc, 'touchmove', this.throttledHandleMouseMove); + this.on(doc, 'mouseup', this.handleMouseUp); + this.on(doc, 'touchend', this.handleMouseUp); + }; + + /** + * Handle `mouseup` or `touchend` events on the `VolumeControl`. + * + * @param {EventTarget~Event} event + * `mouseup` or `touchend` event that triggered this function. + * + * @listens touchend + * @listens mouseup + */ + + + VolumeControl.prototype.handleMouseUp = function handleMouseUp(event) { + var doc = this.el_.ownerDocument; + + this.off(doc, 'mousemove', this.throttledHandleMouseMove); + this.off(doc, 'touchmove', this.throttledHandleMouseMove); + this.off(doc, 'mouseup', this.handleMouseUp); + this.off(doc, 'touchend', this.handleMouseUp); + }; + + /** + * Handle `mousedown` or `touchstart` events on the `VolumeControl`. + * + * @param {EventTarget~Event} event + * `mousedown` or `touchstart` event that triggered this function + * + * @listens mousedown + * @listens touchstart + */ + + + VolumeControl.prototype.handleMouseMove = function handleMouseMove(event) { + this.volumeBar.handleMouseMove(event); + }; + + return VolumeControl; +}(_component2['default']); + +/** + * Default options for the `VolumeControl` + * + * @type {Object} + * @private + */ + + +VolumeControl.prototype.options_ = { + children: ['volumeBar'] +}; + +_component2['default'].registerComponent('VolumeControl', VolumeControl); +exports['default'] = VolumeControl; + +},{"39":39,"40":40,"5":5,"88":88,"93":93}],42:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file volume-level.js + */ + + +/** + * Shows volume level + * + * @extends Component + */ +var VolumeLevel = function (_Component) { + _inherits(VolumeLevel, _Component); + + function VolumeLevel() { + _classCallCheck(this, VolumeLevel); + + return _possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + VolumeLevel.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-volume-level', + innerHTML: '' + }); + }; + + return VolumeLevel; +}(_component2['default']); + +_component2['default'].registerComponent('VolumeLevel', VolumeLevel); +exports['default'] = VolumeLevel; + +},{"5":5}],43:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _checkVolumeSupport = _dereq_(39); + +var _checkVolumeSupport2 = _interopRequireDefault(_checkVolumeSupport); + +var _obj = _dereq_(93); + +_dereq_(41); + +_dereq_(11); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file volume-control.js + */ + + +// Required children + + +/** + * A Component to contain the MuteToggle and VolumeControl so that + * they can work together. + * + * @extends Component + */ +var VolumePanel = function (_Component) { + _inherits(VolumePanel, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ + function VolumePanel(player) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, VolumePanel); + + if (typeof options.inline !== 'undefined') { + options.inline = options.inline; + } else { + options.inline = true; + } + + // pass the inline option down to the VolumeControl as vertical if + // the VolumeControl is on. + if (typeof options.volumeControl === 'undefined' || (0, _obj.isPlain)(options.volumeControl)) { + options.volumeControl = options.volumeControl || {}; + options.volumeControl.vertical = !options.inline; + } + + // hide this control if volume support is missing + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + (0, _checkVolumeSupport2['default'])(_this, player); + + // while the slider is active (the mouse has been pressed down and + // is dragging) or in focus we do not want to hide the VolumeBar + _this.on(_this.volumeControl, ['slideractive'], _this.sliderActive_); + _this.on(_this.muteToggle, 'focus', _this.sliderActive_); + + _this.on(_this.volumeControl, ['sliderinactive'], _this.sliderInactive_); + _this.on(_this.muteToggle, 'blur', _this.sliderInactive_); + return _this; + } + + /** + * Add vjs-slider-active class to the VolumePanel + * + * @listens VolumeControl#slideractive + * @private + */ + + + VolumePanel.prototype.sliderActive_ = function sliderActive_() { + this.addClass('vjs-slider-active'); + }; + + /** + * Removes vjs-slider-active class to the VolumePanel + * + * @listens VolumeControl#sliderinactive + * @private + */ + + + VolumePanel.prototype.sliderInactive_ = function sliderInactive_() { + this.removeClass('vjs-slider-active'); + }; + + /** + * Create the `Component`'s DOM element + * + * @return {Element} + * The element that was created. + */ + + + VolumePanel.prototype.createEl = function createEl() { + var orientationClass = 'vjs-volume-panel-horizontal'; + + if (!this.options_.inline) { + orientationClass = 'vjs-volume-panel-vertical'; + } + + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-volume-panel vjs-control ' + orientationClass + }); + }; + + return VolumePanel; +}(_component2['default']); + +/** + * Default options for the `VolumeControl` + * + * @type {Object} + * @private + */ + + +VolumePanel.prototype.options_ = { + children: ['muteToggle', 'volumeControl'] +}; + +_component2['default'].registerComponent('VolumePanel', VolumePanel); +exports['default'] = VolumePanel; + +},{"11":11,"39":39,"41":41,"5":5,"93":93}],44:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _modalDialog = _dereq_(55); + +var _modalDialog2 = _interopRequireDefault(_modalDialog); + +var _mergeOptions = _dereq_(92); + +var _mergeOptions2 = _interopRequireDefault(_mergeOptions); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file error-display.js + */ + + +/** + * A display that indicates an error has occurred. This means that the video + * is unplayable. + * + * @extends ModalDialog + */ +var ErrorDisplay = function (_ModalDialog) { + _inherits(ErrorDisplay, _ModalDialog); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function ErrorDisplay(player, options) { + _classCallCheck(this, ErrorDisplay); + + var _this = _possibleConstructorReturn(this, _ModalDialog.call(this, player, options)); + + _this.on(player, 'error', _this.open); + return _this; + } + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + * + * @deprecated Since version 5. + */ + + + ErrorDisplay.prototype.buildCSSClass = function buildCSSClass() { + return 'vjs-error-display ' + _ModalDialog.prototype.buildCSSClass.call(this); + }; + + /** + * Gets the localized error message based on the `Player`s error. + * + * @return {string} + * The `Player`s error message localized or an empty string. + */ + + + ErrorDisplay.prototype.content = function content() { + var error = this.player().error(); + + return error ? this.localize(error.message) : ''; + }; + + return ErrorDisplay; +}(_modalDialog2['default']); + +/** + * The default options for an `ErrorDisplay`. + * + * @private + */ + + +ErrorDisplay.prototype.options_ = (0, _mergeOptions2['default'])(_modalDialog2['default'].prototype.options_, { + pauseOnOpen: false, + fillAlways: true, + temporary: false, + uncloseable: true +}); + +_component2['default'].registerComponent('ErrorDisplay', ErrorDisplay); +exports['default'] = ErrorDisplay; + +},{"5":5,"55":55,"92":92}],45:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +/** + * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It + * adds shorthand functions that wrap around lengthy functions. For example: + * the `on` function is a wrapper around `addEventListener`. + * + * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget} + * @class EventTarget + */ +var EventTarget = function EventTarget() {}; + +/** + * A Custom DOM event. + * + * @typedef {Object} EventTarget~Event + * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent} + */ + +/** + * All event listeners should follow the following format. + * + * @callback EventTarget~EventListener + * @this {EventTarget} + * + * @param {EventTarget~Event} event + * the event that triggered this function + * + * @param {Object} [hash] + * hash of data sent during the event + */ + +/** + * An object containing event names as keys and booleans as values. + * + * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger} + * will have extra functionality. See that function for more information. + * + * @property EventTarget.prototype.allowedEvents_ + * @private + */ +/** + * @file src/js/event-target.js + */ +EventTarget.prototype.allowedEvents_ = {}; + +/** + * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a + * function that will get called when an event with a certain name gets triggered. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to call with `EventTarget`s + */ +EventTarget.prototype.on = function (type, fn) { + // Remove the addEventListener alias before calling Events.on + // so we don't get into an infinite type loop + var ael = this.addEventListener; + + this.addEventListener = function () {}; + Events.on(this, type, fn); + this.addEventListener = ael; +}; + +/** + * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#on} + */ +EventTarget.prototype.addEventListener = EventTarget.prototype.on; + +/** + * Removes an `event listener` for a specific event from an instance of `EventTarget`. + * This makes it so that the `event listener` will no longer get called when the + * named event happens. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to remove. + */ +EventTarget.prototype.off = function (type, fn) { + Events.off(this, type, fn); +}; + +/** + * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#off} + */ +EventTarget.prototype.removeEventListener = EventTarget.prototype.off; + +/** + * This function will add an `event listener` that gets triggered only once. After the + * first trigger it will get removed. This is like adding an `event listener` + * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to be called once for each event name. + */ +EventTarget.prototype.one = function (type, fn) { + // Remove the addEventListener alialing Events.on + // so we don't get into an infinite type loop + var ael = this.addEventListener; + + this.addEventListener = function () {}; + Events.one(this, type, fn); + this.addEventListener = ael; +}; + +/** + * This function causes an event to happen. This will then cause any `event listeners` + * that are waiting for that event, to get called. If there are no `event listeners` + * for an event then nothing will happen. + * + * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`. + * Trigger will also call the `on` + `uppercaseEventName` function. + * + * Example: + * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call + * `onClick` if it exists. + * + * @param {string|EventTarget~Event|Object} event + * The name of the event, an `Event`, or an object with a key of type set to + * an event name. + */ +EventTarget.prototype.trigger = function (event) { + var type = event.type || event; + + if (typeof event === 'string') { + event = { type: type }; + } + event = Events.fixEvent(event); + + if (this.allowedEvents_[type] && this['on' + type]) { + this['on' + type](event); + } + + Events.trigger(this, event); +}; + +/** + * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#trigger} + */ +EventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger; + +exports['default'] = EventTarget; + +},{"86":86}],46:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +/** + * @file extend.js + * @module extend + */ + +/** + * A combination of node inherits and babel's inherits (after transpile). + * Both work the same but node adds `super_` to the subClass + * and Bable adds the superClass as __proto__. Both seem useful. + * + * @param {Object} subClass + * The class to inherit to + * + * @param {Object} superClass + * The class to inherit from + * + * @private + */ +var _inherits = function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function, not ' + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass))); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + + if (superClass) { + // node + subClass.super_ = superClass; + } +}; + +/** + * Function for subclassing using the same inheritance that + * videojs uses internally + * + * @static + * @const + * + * @param {Object} superClass + * The class to inherit from + * + * @param {Object} [subClassMethods={}] + * The class to inherit to + * + * @return {Object} + * The new object with subClassMethods that inherited superClass. + */ +var extendFn = function extendFn(superClass) { + var subClassMethods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var subClass = function subClass() { + superClass.apply(this, arguments); + }; + + var methods = {}; + + if ((typeof subClassMethods === 'undefined' ? 'undefined' : _typeof(subClassMethods)) === 'object') { + if (subClassMethods.constructor !== Object.prototype.constructor) { + subClass = subClassMethods.constructor; + } + methods = subClassMethods; + } else if (typeof subClassMethods === 'function') { + subClass = subClassMethods; + } + + _inherits(subClass, superClass); + + // Extend subObj's prototype with functions and other properties from props + for (var name in methods) { + if (methods.hasOwnProperty(name)) { + subClass.prototype[name] = methods[name]; + } + } + + return subClass; +}; + +exports['default'] = extendFn; + +},{}],47:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +/** + * Store the browser-specific methods for the fullscreen API. + * + * @type {Object} + * @see [Specification]{@link https://fullscreen.spec.whatwg.org} + * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js} + */ +var FullscreenApi = {}; + +// browser API methods +/** + * @file fullscreen-api.js + * @module fullscreen-api + * @private + */ +var apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], +// WebKit +['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], +// Old WebKit (Safari 5.1) +['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], +// Mozilla +['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], +// Microsoft +['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']]; + +var specApi = apiMap[0]; +var browserApi = void 0; + +// determine the supported set of functions +for (var i = 0; i < apiMap.length; i++) { + // check for exitFullscreen function + if (apiMap[i][1] in _document2['default']) { + browserApi = apiMap[i]; + break; + } +} + +// map the browser API names to the spec API names +if (browserApi) { + for (var _i = 0; _i < browserApi.length; _i++) { + FullscreenApi[specApi[_i]] = browserApi[_i]; + } +} + +exports['default'] = FullscreenApi; + +},{"99":99}],48:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file loading-spinner.js + */ + + +/** + * A loading spinner for use during waiting/loading events. + * + * @extends Component + */ +var LoadingSpinner = function (_Component) { + _inherits(LoadingSpinner, _Component); + + function LoadingSpinner() { + _classCallCheck(this, LoadingSpinner); + + return _possibleConstructorReturn(this, _Component.apply(this, arguments)); + } + + /** + * Create the `LoadingSpinner`s DOM element. + * + * @return {Element} + * The dom element that gets created. + */ + LoadingSpinner.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: 'vjs-loading-spinner', + dir: 'ltr' + }); + }; + + return LoadingSpinner; +}(_component2['default']); + +_component2['default'].registerComponent('LoadingSpinner', LoadingSpinner); +exports['default'] = LoadingSpinner; + +},{"5":5}],49:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _obj = _dereq_(93); + +/** + * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class. + * + * @param {number|string|Object|MediaError} value + * This can be of multiple types: + * - number: should be a standard error code + * - string: an error message (the code will be 0) + * - Object: arbitrary properties + * - `MediaError` (native): used to populate a video.js `MediaError` object + * - `MediaError` (video.js): will return itself if it's already a + * video.js `MediaError` object. + * + * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror} + * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes} + * + * @class MediaError + */ +function MediaError(value) { + + // Allow redundant calls to this constructor to avoid having `instanceof` + // checks peppered around the code. + if (value instanceof MediaError) { + return value; + } + + if (typeof value === 'number') { + this.code = value; + } else if (typeof value === 'string') { + // default code is zero, so this is a custom error + this.message = value; + } else if ((0, _obj.isObject)(value)) { + + // We assign the `code` property manually because native `MediaError` objects + // do not expose it as an own/enumerable property of the object. + if (typeof value.code === 'number') { + this.code = value.code; + } + + (0, _obj.assign)(this, value); + } + + if (!this.message) { + this.message = MediaError.defaultMessages[this.code] || ''; + } +} + +/** + * The error code that refers two one of the defined `MediaError` types + * + * @type {Number} + */ +/** + * @file media-error.js + */ +MediaError.prototype.code = 0; + +/** + * An optional message that to show with the error. Message is not part of the HTML5 + * video spec but allows for more informative custom errors. + * + * @type {String} + */ +MediaError.prototype.message = ''; + +/** + * An optional status code that can be set by plugins to allow even more detail about + * the error. For example a plugin might provide a specific HTTP status code and an + * error message for that code. Then when the plugin gets that error this class will + * know how to display an error message for it. This allows a custom message to show + * up on the `Player` error overlay. + * + * @type {Array} + */ +MediaError.prototype.status = null; + +/** + * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the + * specification listed under {@link MediaError} for more information. + * + * @enum {array} + * @readonly + * @property {string} 0 - MEDIA_ERR_CUSTOM + * @property {string} 1 - MEDIA_ERR_CUSTOM + * @property {string} 2 - MEDIA_ERR_ABORTED + * @property {string} 3 - MEDIA_ERR_NETWORK + * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED + * @property {string} 5 - MEDIA_ERR_ENCRYPTED + */ +MediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED']; + +/** + * The default `MediaError` messages based on the {@link MediaError.errorTypes}. + * + * @type {Array} + * @constant + */ +MediaError.defaultMessages = { + 1: 'You aborted the media playback', + 2: 'A network error caused the media download to fail part-way.', + 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.', + 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.', + 5: 'The media is encrypted and we do not have the keys to decrypt it.' +}; + +// Add types as properties on MediaError +// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4; +for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) { + MediaError[MediaError.errorTypes[errNum]] = errNum; + // values should be accessible on both the class and instance + MediaError.prototype[MediaError.errorTypes[errNum]] = errNum; +} + +// jsdocs for instance/static members added above +// instance methods use `#` and static methods use `.` +/** + * W3C error code for any custom error. + * + * @member MediaError#MEDIA_ERR_CUSTOM + * @constant {number} + * @default 0 + */ +/** + * W3C error code for any custom error. + * + * @member MediaError.MEDIA_ERR_CUSTOM + * @constant {number} + * @default 0 + */ + +/** + * W3C error code for media error aborted. + * + * @member MediaError#MEDIA_ERR_ABORTED + * @constant {number} + * @default 1 + */ +/** + * W3C error code for media error aborted. + * + * @member MediaError.MEDIA_ERR_ABORTED + * @constant {number} + * @default 1 + */ + +/** + * W3C error code for any network error. + * + * @member MediaError#MEDIA_ERR_NETWORK + * @constant {number} + * @default 2 + */ +/** + * W3C error code for any network error. + * + * @member MediaError.MEDIA_ERR_NETWORK + * @constant {number} + * @default 2 + */ + +/** + * W3C error code for any decoding error. + * + * @member MediaError#MEDIA_ERR_DECODE + * @constant {number} + * @default 3 + */ +/** + * W3C error code for any decoding error. + * + * @member MediaError.MEDIA_ERR_DECODE + * @constant {number} + * @default 3 + */ + +/** + * W3C error code for any time that a source is not supported. + * + * @member MediaError#MEDIA_ERR_SRC_NOT_SUPPORTED + * @constant {number} + * @default 4 + */ +/** + * W3C error code for any time that a source is not supported. + * + * @member MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED + * @constant {number} + * @default 4 + */ + +/** + * W3C error code for any time that a source is encrypted. + * + * @member MediaError#MEDIA_ERR_ENCRYPTED + * @constant {number} + * @default 5 + */ +/** + * W3C error code for any time that a source is encrypted. + * + * @member MediaError.MEDIA_ERR_ENCRYPTED + * @constant {number} + * @default 5 + */ + +exports['default'] = MediaError; + +},{"93":93}],50:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _button = _dereq_(2); + +var _button2 = _interopRequireDefault(_button); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _menu = _dereq_(52); + +var _menu2 = _interopRequireDefault(_menu); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file menu-button.js + */ + + +/** + * A `MenuButton` class for any popup {@link Menu}. + * + * @extends Component + */ +var MenuButton = function (_Component) { + _inherits(MenuButton, _Component); + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + */ + function MenuButton(player) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, MenuButton); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.menuButton_ = new _button2['default'](player, options); + + _this.menuButton_.controlText(_this.controlText_); + _this.menuButton_.el_.setAttribute('aria-haspopup', 'true'); + + // Add buildCSSClass values to the button, not the wrapper + var buttonClass = _button2['default'].prototype.buildCSSClass(); + + _this.menuButton_.el_.className = _this.buildCSSClass() + ' ' + buttonClass; + _this.menuButton_.removeClass('vjs-control'); + + _this.addChild(_this.menuButton_); + + _this.update(); + + _this.enabled_ = true; + + _this.on(_this.menuButton_, 'tap', _this.handleClick); + _this.on(_this.menuButton_, 'click', _this.handleClick); + _this.on(_this.menuButton_, 'focus', _this.handleFocus); + _this.on(_this.menuButton_, 'blur', _this.handleBlur); + + _this.on('keydown', _this.handleSubmenuKeyPress); + return _this; + } + + /** + * Update the menu based on the current state of its items. + */ + + + MenuButton.prototype.update = function update() { + var menu = this.createMenu(); + + if (this.menu) { + this.removeChild(this.menu); + } + + this.menu = menu; + this.addChild(menu); + + /** + * Track the state of the menu button + * + * @type {Boolean} + * @private + */ + this.buttonPressed_ = false; + this.menuButton_.el_.setAttribute('aria-expanded', 'false'); + + if (this.items && this.items.length <= this.hideThreshold_) { + this.hide(); + } else { + this.show(); + } + }; + + /** + * Create the menu and add all items to it. + * + * @return {Menu} + * The constructed menu + */ + + + MenuButton.prototype.createMenu = function createMenu() { + var menu = new _menu2['default'](this.player_, { menuButton: this }); + + /** + * Hide the menu if the number of items is less than or equal to this threshold. This defaults + * to 0 and whenever we add items which can be hidden to the menu we'll increment it. We list + * it here because every time we run `createMenu` we need to reset the value. + * + * @protected + * @type {Number} + */ + this.hideThreshold_ = 0; + + // Add a title list item to the top + if (this.options_.title) { + var title = Dom.createEl('li', { + className: 'vjs-menu-title', + innerHTML: (0, _toTitleCase2['default'])(this.options_.title), + tabIndex: -1 + }); + + this.hideThreshold_ += 1; + + menu.children_.unshift(title); + Dom.prependTo(title, menu.contentEl()); + } + + this.items = this.createItems(); + + if (this.items) { + // Add menu items to the menu + for (var i = 0; i < this.items.length; i++) { + menu.addItem(this.items[i]); + } + } + + return menu; + }; + + /** + * Create the list of menu items. Specific to each subclass. + * + * @abstract + */ + + + MenuButton.prototype.createItems = function createItems() {}; + + /** + * Create the `MenuButtons`s DOM element. + * + * @return {Element} + * The element that gets created. + */ + + + MenuButton.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: this.buildWrapperCSSClass() + }, {}); + }; + + /** + * Allow sub components to stack CSS class names for the wrapper element + * + * @return {string} + * The constructed wrapper DOM `className` + */ + + + MenuButton.prototype.buildWrapperCSSClass = function buildWrapperCSSClass() { + var menuButtonClass = 'vjs-menu-button'; + + // If the inline option is passed, we want to use different styles altogether. + if (this.options_.inline === true) { + menuButtonClass += '-inline'; + } else { + menuButtonClass += '-popup'; + } + + // TODO: Fix the CSS so that this isn't necessary + var buttonClass = _button2['default'].prototype.buildCSSClass(); + + return 'vjs-menu-button ' + menuButtonClass + ' ' + buttonClass + ' ' + _Component.prototype.buildCSSClass.call(this); + }; + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + MenuButton.prototype.buildCSSClass = function buildCSSClass() { + var menuButtonClass = 'vjs-menu-button'; + + // If the inline option is passed, we want to use different styles altogether. + if (this.options_.inline === true) { + menuButtonClass += '-inline'; + } else { + menuButtonClass += '-popup'; + } + + return 'vjs-menu-button ' + menuButtonClass + ' ' + _Component.prototype.buildCSSClass.call(this); + }; + + /** + * Get or set the localized control text that will be used for accessibility. + * + * > NOTE: This will come from the internal `menuButton_` element. + * + * @param {string} [text] + * Control text for element. + * + * @param {Element} [el=this.menuButton_.el()] + * Element to set the title on. + * + * @return {string} + * - The control text when getting + */ + + + MenuButton.prototype.controlText = function controlText(text) { + var el = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.menuButton_.el(); + + return this.menuButton_.controlText(text, el); + }; + + /** + * Handle a click on a `MenuButton`. + * See {@link ClickableComponent#handleClick} for instances where this is called. + * + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + MenuButton.prototype.handleClick = function handleClick(event) { + // When you click the button it adds focus, which will show the menu. + // So we'll remove focus when the mouse leaves the button. Focus is needed + // for tab navigation. + + this.one(this.menu.contentEl(), 'mouseleave', Fn.bind(this, function (e) { + this.unpressButton(); + this.el_.blur(); + })); + if (this.buttonPressed_) { + this.unpressButton(); + } else { + this.pressButton(); + } + }; + + /** + * Set the focus to the actual button, not to this element + */ + + + MenuButton.prototype.focus = function focus() { + this.menuButton_.focus(); + }; + + /** + * Remove the focus from the actual button, not this element + */ + + + MenuButton.prototype.blur = function blur() { + this.menuButton_.blur(); + }; + + /** + * This gets called when a `MenuButton` gains focus via a `focus` event. + * Turns on listening for `keydown` events. When they happen it + * calls `this.handleKeyPress`. + * + * @param {EventTarget~Event} event + * The `focus` event that caused this function to be called. + * + * @listens focus + */ + + + MenuButton.prototype.handleFocus = function handleFocus() { + Events.on(_document2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); + }; + + /** + * Called when a `MenuButton` loses focus. Turns off the listener for + * `keydown` events. Which Stops `this.handleKeyPress` from getting called. + * + * @param {EventTarget~Event} event + * The `blur` event that caused this function to be called. + * + * @listens blur + */ + + + MenuButton.prototype.handleBlur = function handleBlur() { + Events.off(_document2['default'], 'keydown', Fn.bind(this, this.handleKeyPress)); + }; + + /** + * Handle tab, escape, down arrow, and up arrow keys for `MenuButton`. See + * {@link ClickableComponent#handleKeyPress} for instances where this is called. + * + * @param {EventTarget~Event} event + * The `keydown` event that caused this function to be called. + * + * @listens keydown + */ + + + MenuButton.prototype.handleKeyPress = function handleKeyPress(event) { + + // Escape (27) key or Tab (9) key unpress the 'button' + if (event.which === 27 || event.which === 9) { + if (this.buttonPressed_) { + this.unpressButton(); + } + // Don't preventDefault for Tab key - we still want to lose focus + if (event.which !== 9) { + event.preventDefault(); + // Set focus back to the menu button's button + this.menuButton_.el_.focus(); + } + // Up (38) key or Down (40) key press the 'button' + } else if (event.which === 38 || event.which === 40) { + if (!this.buttonPressed_) { + this.pressButton(); + event.preventDefault(); + } + } + }; + + /** + * Handle a `keydown` event on a sub-menu. The listener for this is added in + * the constructor. + * + * @param {EventTarget~Event} event + * Key press event + * + * @listens keydown + */ + + + MenuButton.prototype.handleSubmenuKeyPress = function handleSubmenuKeyPress(event) { + + // Escape (27) key or Tab (9) key unpress the 'button' + if (event.which === 27 || event.which === 9) { + if (this.buttonPressed_) { + this.unpressButton(); + } + // Don't preventDefault for Tab key - we still want to lose focus + if (event.which !== 9) { + event.preventDefault(); + // Set focus back to the menu button's button + this.menuButton_.el_.focus(); + } + } + }; + + /** + * Put the current `MenuButton` into a pressed state. + */ + + + MenuButton.prototype.pressButton = function pressButton() { + if (this.enabled_) { + this.buttonPressed_ = true; + this.menu.lockShowing(); + this.menuButton_.el_.setAttribute('aria-expanded', 'true'); + // set the focus into the submenu + this.menu.focus(); + } + }; + + /** + * Take the current `MenuButton` out of a pressed state. + */ + + + MenuButton.prototype.unpressButton = function unpressButton() { + if (this.enabled_) { + this.buttonPressed_ = false; + this.menu.unlockShowing(); + this.menuButton_.el_.setAttribute('aria-expanded', 'false'); + } + }; + + /** + * Disable the `MenuButton`. Don't allow it to be clicked. + */ + + + MenuButton.prototype.disable = function disable() { + this.unpressButton(); + + this.enabled_ = false; + this.addClass('vjs-disabled'); + + this.menuButton_.disable(); + }; + + /** + * Enable the `MenuButton`. Allow it to be clicked. + */ + + + MenuButton.prototype.enable = function enable() { + this.enabled_ = true; + this.removeClass('vjs-disabled'); + + this.menuButton_.enable(); + }; + + return MenuButton; +}(_component2['default']); + +_component2['default'].registerComponent('MenuButton', MenuButton); +exports['default'] = MenuButton; + +},{"2":2,"5":5,"52":52,"85":85,"86":86,"88":88,"96":96,"99":99}],51:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _clickableComponent = _dereq_(3); + +var _clickableComponent2 = _interopRequireDefault(_clickableComponent); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _obj = _dereq_(93); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file menu-item.js + */ + + +/** + * The component for a menu item. `
  • ` + * + * @extends ClickableComponent + */ +var MenuItem = function (_ClickableComponent) { + _inherits(MenuItem, _ClickableComponent); + + /** + * Creates an instance of the this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options={}] + * The key/value store of player options. + * + */ + function MenuItem(player, options) { + _classCallCheck(this, MenuItem); + + var _this = _possibleConstructorReturn(this, _ClickableComponent.call(this, player, options)); + + _this.selectable = options.selectable; + + _this.selected(options.selected); + + if (_this.selectable) { + // TODO: May need to be either menuitemcheckbox or menuitemradio, + // and may need logical grouping of menu items. + _this.el_.setAttribute('role', 'menuitemcheckbox'); + } else { + _this.el_.setAttribute('role', 'menuitem'); + } + return _this; + } + + /** + * Create the `MenuItem's DOM element + * + * @param {string} [type=li] + * Element's node type, not actually used, always set to `li`. + * + * @param {Object} [props={}] + * An object of properties that should be set on the element + * + * @param {Object} [attrs={}] + * An object of attributes that should be set on the element + * + * @return {Element} + * The element that gets created. + */ + + + MenuItem.prototype.createEl = function createEl(type, props, attrs) { + // The control is textual, not just an icon + this.nonIconControl = true; + + return _ClickableComponent.prototype.createEl.call(this, 'li', (0, _obj.assign)({ + className: 'vjs-menu-item', + innerHTML: '' + this.localize(this.options_.label) + '', + tabIndex: -1 + }, props), attrs); + }; + + /** + * Any click on a `MenuItem` puts int into the selected state. + * See {@link ClickableComponent#handleClick} for instances where this is called. + * + * @param {EventTarget~Event} event + * The `keydown`, `tap`, or `click` event that caused this function to be + * called. + * + * @listens tap + * @listens click + */ + + + MenuItem.prototype.handleClick = function handleClick(event) { + this.selected(true); + }; + + /** + * Set the state for this menu item as selected or not. + * + * @param {boolean} selected + * if the menu item is selected or not + */ + + + MenuItem.prototype.selected = function selected(_selected) { + if (this.selectable) { + if (_selected) { + this.addClass('vjs-selected'); + this.el_.setAttribute('aria-checked', 'true'); + // aria-checked isn't fully supported by browsers/screen readers, + // so indicate selected state to screen reader in the control text. + this.controlText(', selected'); + } else { + this.removeClass('vjs-selected'); + this.el_.setAttribute('aria-checked', 'false'); + // Indicate un-selected state to screen reader + // Note that a space clears out the selected state text + this.controlText(' '); + } + } + }; + + return MenuItem; +}(_clickableComponent2['default']); + +_component2['default'].registerComponent('MenuItem', MenuItem); +exports['default'] = MenuItem; + +},{"3":3,"5":5,"93":93}],52:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file menu.js + */ + + +/** + * The Menu component is used to build popup menus, including subtitle and + * captions selection menus. + * + * @extends Component + */ +var Menu = function (_Component) { + _inherits(Menu, _Component); + + /** + * Create an instance of this class. + * + * @param {Player} player + * the player that this component should attach to + * + * @param {Object} [options] + * Object of option names and values + * + */ + function Menu(player, options) { + _classCallCheck(this, Menu); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + if (options) { + _this.menuButton_ = options.menuButton; + } + + _this.focusedChild_ = -1; + + _this.on('keydown', _this.handleKeyPress); + return _this; + } + + /** + * Add a {@link MenuItem} to the menu. + * + * @param {Object|string} component + * The name or instance of the `MenuItem` to add. + * + */ + + + Menu.prototype.addItem = function addItem(component) { + this.addChild(component); + component.on('click', Fn.bind(this, function (event) { + // Unpress the associated MenuButton, and move focus back to it + if (this.menuButton_) { + this.menuButton_.unpressButton(); + + // don't focus menu button if item is a caption settings item + // because focus will move elsewhere and it logs an error on IE8 + if (component.name() !== 'CaptionSettingsMenuItem') { + this.menuButton_.focus(); + } + } + })); + }; + + /** + * Create the `Menu`s DOM element. + * + * @return {Element} + * the element that was created + */ + + + Menu.prototype.createEl = function createEl() { + var contentElType = this.options_.contentElType || 'ul'; + + this.contentEl_ = Dom.createEl(contentElType, { + className: 'vjs-menu-content' + }); + + this.contentEl_.setAttribute('role', 'menu'); + + var el = _Component.prototype.createEl.call(this, 'div', { + append: this.contentEl_, + className: 'vjs-menu' + }); + + el.appendChild(this.contentEl_); + + // Prevent clicks from bubbling up. Needed for Menu Buttons, + // where a click on the parent is significant + Events.on(el, 'click', function (event) { + event.preventDefault(); + event.stopImmediatePropagation(); + }); + + return el; + }; + + /** + * Handle a `keydown` event on this menu. This listener is added in the constructor. + * + * @param {EventTarget~Event} event + * A `keydown` event that happened on the menu. + * + * @listens keydown + */ + + + Menu.prototype.handleKeyPress = function handleKeyPress(event) { + // Left and Down Arrows + if (event.which === 37 || event.which === 40) { + event.preventDefault(); + this.stepForward(); + + // Up and Right Arrows + } else if (event.which === 38 || event.which === 39) { + event.preventDefault(); + this.stepBack(); + } + }; + + /** + * Move to next (lower) menu item for keyboard users. + */ + + + Menu.prototype.stepForward = function stepForward() { + var stepChild = 0; + + if (this.focusedChild_ !== undefined) { + stepChild = this.focusedChild_ + 1; + } + this.focus(stepChild); + }; + + /** + * Move to previous (higher) menu item for keyboard users. + */ + + + Menu.prototype.stepBack = function stepBack() { + var stepChild = 0; + + if (this.focusedChild_ !== undefined) { + stepChild = this.focusedChild_ - 1; + } + this.focus(stepChild); + }; + + /** + * Set focus on a {@link MenuItem} in the `Menu`. + * + * @param {Object|string} [item=0] + * Index of child item set focus on. + */ + + + Menu.prototype.focus = function focus() { + var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + var children = this.children().slice(); + var haveTitle = children.length && children[0].className && /vjs-menu-title/.test(children[0].className); + + if (haveTitle) { + children.shift(); + } + + if (children.length > 0) { + if (item < 0) { + item = 0; + } else if (item >= children.length) { + item = children.length - 1; + } + + this.focusedChild_ = item; + + children[item].el_.focus(); + } + }; + + return Menu; +}(_component2['default']); + +_component2['default'].registerComponent('Menu', Menu); +exports['default'] = Menu; + +},{"5":5,"85":85,"86":86,"88":88}],53:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; +exports.isEvented = undefined; + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _obj = _dereq_(93); + +var Obj = _interopRequireWildcard(_obj); + +var _eventTarget = _dereq_(45); + +var _eventTarget2 = _interopRequireDefault(_eventTarget); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +/** + * Returns whether or not an object has had the evented mixin applied. + * + * @param {Object} object + * An object to test. + * + * @return {boolean} + * Whether or not the object appears to be evented. + */ +var isEvented = function isEvented(object) { + return object instanceof _eventTarget2['default'] || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) { + return typeof object[k] === 'function'; + }); +}; + +/** + * Whether a value is a valid event type - non-empty string or array. + * + * @private + * @param {string|Array} type + * The type value to test. + * + * @return {boolean} + * Whether or not the type is a valid event type. + */ +/** + * @file mixins/evented.js + * @module evented + */ +var isValidEventType = function isValidEventType(type) { + return ( + // The regex here verifies that the `type` contains at least one non- + // whitespace character. + typeof type === 'string' && /\S/.test(type) || Array.isArray(type) && !!type.length + ); +}; + +/** + * Validates a value to determine if it is a valid event target. Throws if not. + * + * @private + * @throws {Error} + * If the target does not appear to be a valid event target. + * + * @param {Object} target + * The object to test. + */ +var validateTarget = function validateTarget(target) { + if (!target.nodeName && !isEvented(target)) { + throw new Error('Invalid target; must be a DOM node or evented object.'); + } +}; + +/** + * Validates a value to determine if it is a valid event target. Throws if not. + * + * @private + * @throws {Error} + * If the type does not appear to be a valid event type. + * + * @param {string|Array} type + * The type to test. + */ +var validateEventType = function validateEventType(type) { + if (!isValidEventType(type)) { + throw new Error('Invalid event type; must be a non-empty string or array.'); + } +}; + +/** + * Validates a value to determine if it is a valid listener. Throws if not. + * + * @private + * @throws {Error} + * If the listener is not a function. + * + * @param {Function} listener + * The listener to test. + */ +var validateListener = function validateListener(listener) { + if (typeof listener !== 'function') { + throw new Error('Invalid listener; must be a function.'); + } +}; + +/** + * Takes an array of arguments given to `on()` or `one()`, validates them, and + * normalizes them into an object. + * + * @private + * @param {Object} self + * The evented object on which `on()` or `one()` was called. This + * object will be bound as the `this` value for the listener. + * + * @param {Array} args + * An array of arguments passed to `on()` or `one()`. + * + * @return {Object} + * An object containing useful values for `on()` or `one()` calls. + */ +var normalizeListenArgs = function normalizeListenArgs(self, args) { + + // If the number of arguments is less than 3, the target is always the + // evented object itself. + var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_; + var target = void 0; + var type = void 0; + var listener = void 0; + + if (isTargetingSelf) { + target = self.eventBusEl_; + + // Deal with cases where we got 3 arguments, but we are still listening to + // the evented object itself. + if (args.length >= 3) { + args.shift(); + } + + type = args[0]; + listener = args[1]; + } else { + target = args[0]; + type = args[1]; + listener = args[2]; + } + + validateTarget(target); + validateEventType(type); + validateListener(listener); + + listener = Fn.bind(self, listener); + + return { isTargetingSelf: isTargetingSelf, target: target, type: type, listener: listener }; +}; + +/** + * Adds the listener to the event type(s) on the target, normalizing for + * the type of target. + * + * @private + * @param {Element|Object} target + * A DOM node or evented object. + * + * @param {string} method + * The event binding method to use ("on" or "one"). + * + * @param {string|Array} type + * One or more event type(s). + * + * @param {Function} listener + * A listener function. + */ +var listen = function listen(target, method, type, listener) { + validateTarget(target); + + if (target.nodeName) { + Events[method](target, type, listener); + } else { + target[method](type, listener); + } +}; + +/** + * Contains methods that provide event capabilites to an object which is passed + * to {@link module:evented|evented}. + * + * @mixin EventedMixin + */ +var EventedMixin = { + + /** + * Add a listener to an event (or events) on this object or another evented + * object. + * + * @param {string|Array|Element|Object} targetOrType + * If this is a string or array, it represents the event type(s) + * that will trigger the listener. + * + * Another evented object can be passed here instead, which will + * cause the listener to listen for events on _that_ object. + * + * In either case, the listener's `this` value will be bound to + * this object. + * + * @param {string|Array|Function} typeOrListener + * If the first argument was a string or array, this should be the + * listener function. Otherwise, this is a string or array of event + * type(s). + * + * @param {Function} [listener] + * If the first argument was another evented object, this will be + * the listener function. + */ + on: function on() { + var _this = this; + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var _normalizeListenArgs = normalizeListenArgs(this, args), + isTargetingSelf = _normalizeListenArgs.isTargetingSelf, + target = _normalizeListenArgs.target, + type = _normalizeListenArgs.type, + listener = _normalizeListenArgs.listener; + + listen(target, 'on', type, listener); + + // If this object is listening to another evented object. + if (!isTargetingSelf) { + + // If this object is disposed, remove the listener. + var removeListenerOnDispose = function removeListenerOnDispose() { + return _this.off(target, type, listener); + }; + + // Use the same function ID as the listener so we can remove it later it + // using the ID of the original listener. + removeListenerOnDispose.guid = listener.guid; + + // Add a listener to the target's dispose event as well. This ensures + // that if the target is disposed BEFORE this object, we remove the + // removal listener that was just added. Otherwise, we create a memory leak. + var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose() { + return _this.off('dispose', removeListenerOnDispose); + }; + + // Use the same function ID as the listener so we can remove it later + // it using the ID of the original listener. + removeRemoverOnTargetDispose.guid = listener.guid; + + listen(this, 'on', 'dispose', removeListenerOnDispose); + listen(target, 'on', 'dispose', removeRemoverOnTargetDispose); + } + }, + + + /** + * Add a listener to an event (or events) on this object or another evented + * object. The listener will only be called once and then removed. + * + * @param {string|Array|Element|Object} targetOrType + * If this is a string or array, it represents the event type(s) + * that will trigger the listener. + * + * Another evented object can be passed here instead, which will + * cause the listener to listen for events on _that_ object. + * + * In either case, the listener's `this` value will be bound to + * this object. + * + * @param {string|Array|Function} typeOrListener + * If the first argument was a string or array, this should be the + * listener function. Otherwise, this is a string or array of event + * type(s). + * + * @param {Function} [listener] + * If the first argument was another evented object, this will be + * the listener function. + */ + one: function one() { + var _this2 = this; + + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + var _normalizeListenArgs2 = normalizeListenArgs(this, args), + isTargetingSelf = _normalizeListenArgs2.isTargetingSelf, + target = _normalizeListenArgs2.target, + type = _normalizeListenArgs2.type, + listener = _normalizeListenArgs2.listener; + + // Targeting this evented object. + + + if (isTargetingSelf) { + listen(target, 'one', type, listener); + + // Targeting another evented object. + } else { + var wrapper = function wrapper() { + for (var _len3 = arguments.length, largs = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + largs[_key3] = arguments[_key3]; + } + + _this2.off(target, type, wrapper); + listener.apply(null, largs); + }; + + // Use the same function ID as the listener so we can remove it later + // it using the ID of the original listener. + wrapper.guid = listener.guid; + listen(target, 'one', type, wrapper); + } + }, + + + /** + * Removes listener(s) from event(s) on an evented object. + * + * @param {string|Array|Element|Object} [targetOrType] + * If this is a string or array, it represents the event type(s). + * + * Another evented object can be passed here instead, in which case + * ALL 3 arguments are _required_. + * + * @param {string|Array|Function} [typeOrListener] + * If the first argument was a string or array, this may be the + * listener function. Otherwise, this is a string or array of event + * type(s). + * + * @param {Function} [listener] + * If the first argument was another evented object, this will be + * the listener function; otherwise, _all_ listeners bound to the + * event type(s) will be removed. + */ + off: function off(targetOrType, typeOrListener, listener) { + + // Targeting this evented object. + if (!targetOrType || isValidEventType(targetOrType)) { + Events.off(this.eventBusEl_, targetOrType, typeOrListener); + + // Targeting another evented object. + } else { + var target = targetOrType; + var type = typeOrListener; + + // Fail fast and in a meaningful way! + validateTarget(target); + validateEventType(type); + validateListener(listener); + + // Ensure there's at least a guid, even if the function hasn't been used + listener = Fn.bind(this, listener); + + // Remove the dispose listener on this evented object, which was given + // the same guid as the event listener in on(). + this.off('dispose', listener); + + if (target.nodeName) { + Events.off(target, type, listener); + Events.off(target, 'dispose', listener); + } else if (isEvented(target)) { + target.off(type, listener); + target.off('dispose', listener); + } + } + }, + + + /** + * Fire an event on this evented object, causing its listeners to be called. + * + * @param {string|Object} event + * An event type or an object with a type property. + * + * @param {Object} [hash] + * An additional object to pass along to listeners. + * + * @returns {boolean} + * Whether or not the default behavior was prevented. + */ + trigger: function trigger(event, hash) { + return Events.trigger(this.eventBusEl_, event, hash); + } +}; + +/** + * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object. + * + * @param {Object} target + * The object to which to add event methods. + * + * @param {Object} [options={}] + * Options for customizing the mixin behavior. + * + * @param {String} [options.eventBusKey] + * By default, adds a `eventBusEl_` DOM element to the target object, + * which is used as an event bus. If the target object already has a + * DOM element that should be used, pass its key here. + * + * @return {Object} + * The target object. + */ +function evented(target) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var eventBusKey = options.eventBusKey; + + // Set or create the eventBusEl_. + + if (eventBusKey) { + if (!target[eventBusKey].nodeName) { + throw new Error('The eventBusKey "' + eventBusKey + '" does not refer to an element.'); + } + target.eventBusEl_ = target[eventBusKey]; + } else { + target.eventBusEl_ = Dom.createEl('span', { className: 'vjs-event-bus' }); + } + + Obj.assign(target, EventedMixin); + + // When any evented object is disposed, it removes all its listeners. + target.on('dispose', function () { + return target.off(); + }); + + return target; +} + +exports['default'] = evented; +exports.isEvented = isEvented; + +},{"45":45,"85":85,"86":86,"88":88,"93":93}],54:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _evented = _dereq_(53); + +var _obj = _dereq_(93); + +var Obj = _interopRequireWildcard(_obj); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +/** + * Contains methods that provide statefulness to an object which is passed + * to {@link module:stateful}. + * + * @mixin StatefulMixin + */ +/** + * @file mixins/stateful.js + * @module stateful + */ +var StatefulMixin = { + + /** + * A hash containing arbitrary keys and values representing the state of + * the object. + * + * @type {Object} + */ + state: {}, + + /** + * Set the state of an object by mutating its + * {@link module:stateful~StatefulMixin.state|state} object in place. + * + * @fires module:stateful~StatefulMixin#statechanged + * @param {Object|Function} stateUpdates + * A new set of properties to shallow-merge into the plugin state. + * Can be a plain object or a function returning a plain object. + * + * @returns {Object|undefined} + * An object containing changes that occurred. If no changes + * occurred, returns `undefined`. + */ + setState: function setState(stateUpdates) { + var _this = this; + + // Support providing the `stateUpdates` state as a function. + if (typeof stateUpdates === 'function') { + stateUpdates = stateUpdates(); + } + + var changes = void 0; + + Obj.each(stateUpdates, function (value, key) { + + // Record the change if the value is different from what's in the + // current state. + if (_this.state[key] !== value) { + changes = changes || {}; + changes[key] = { + from: _this.state[key], + to: value + }; + } + + _this.state[key] = value; + }); + + // Only trigger "statechange" if there were changes AND we have a trigger + // function. This allows us to not require that the target object be an + // evented object. + if (changes && (0, _evented.isEvented)(this)) { + + /** + * An event triggered on an object that is both + * {@link module:stateful|stateful} and {@link module:evented|evented} + * indicating that its state has changed. + * + * @event module:stateful~StatefulMixin#statechanged + * @type {Object} + * @property {Object} changes + * A hash containing the properties that were changed and + * the values they were changed `from` and `to`. + */ + this.trigger({ + changes: changes, + type: 'statechanged' + }); + } + + return changes; + } +}; + +/** + * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target + * object. + * + * If the target object is {@link module:evented|evented} and has a + * `handleStateChanged` method, that method will be automatically bound to the + * `statechanged` event on itself. + * + * @param {Object} target + * The object to be made stateful. + * + * @param {Object} [defaultState] + * A default set of properties to populate the newly-stateful object's + * `state` property. + * + * @returns {Object} + * Returns the `target`. + */ +function stateful(target, defaultState) { + Obj.assign(target, StatefulMixin); + + // This happens after the mixing-in because we need to replace the `state` + // added in that step. + target.state = Obj.assign({}, target.state, defaultState); + + // Auto-bind the `handleStateChanged` method of the target object if it exists. + if (typeof target.handleStateChanged === 'function' && (0, _evented.isEvented)(target)) { + target.on('statechanged', target.handleStateChanged); + } + + return target; +} + +exports['default'] = stateful; + +},{"53":53,"93":93}],55:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _window = _dereq_(100); + +var _window2 = _interopRequireDefault(_window); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file modal-dialog.js + */ + + +var MODAL_CLASS_NAME = 'vjs-modal-dialog'; +var ESC = 27; + +/** + * The `ModalDialog` displays over the video and its controls, which blocks + * interaction with the player until it is closed. + * + * Modal dialogs include a "Close" button and will close when that button + * is activated - or when ESC is pressed anywhere. + * + * @extends Component + */ + +var ModalDialog = function (_Component) { + _inherits(ModalDialog, _Component); + + /** + * Create an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Mixed} [options.content=undefined] + * Provide customized content for this modal. + * + * @param {string} [options.description] + * A text description for the modal, primarily for accessibility. + * + * @param {boolean} [options.fillAlways=false] + * Normally, modals are automatically filled only the first time + * they open. This tells the modal to refresh its content + * every time it opens. + * + * @param {string} [options.label] + * A text label for the modal, primarily for accessibility. + * + * @param {boolean} [options.temporary=true] + * If `true`, the modal can only be opened once; it will be + * disposed as soon as it's closed. + * + * @param {boolean} [options.uncloseable=false] + * If `true`, the user will not be able to close the modal + * through the UI in the normal ways. Programmatic closing is + * still possible. + */ + function ModalDialog(player, options) { + _classCallCheck(this, ModalDialog); + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false; + + _this.closeable(!_this.options_.uncloseable); + _this.content(_this.options_.content); + + // Make sure the contentEl is defined AFTER any children are initialized + // because we only want the contents of the modal in the contentEl + // (not the UI elements like the close button). + _this.contentEl_ = Dom.createEl('div', { + className: MODAL_CLASS_NAME + '-content' + }, { + role: 'document' + }); + + _this.descEl_ = Dom.createEl('p', { + className: MODAL_CLASS_NAME + '-description vjs-control-text', + id: _this.el().getAttribute('aria-describedby') + }); + + Dom.textContent(_this.descEl_, _this.description()); + _this.el_.appendChild(_this.descEl_); + _this.el_.appendChild(_this.contentEl_); + return _this; + } + + /** + * Create the `ModalDialog`'s DOM element + * + * @return {Element} + * The DOM element that gets created. + */ + + + ModalDialog.prototype.createEl = function createEl() { + return _Component.prototype.createEl.call(this, 'div', { + className: this.buildCSSClass(), + tabIndex: -1 + }, { + 'aria-describedby': this.id() + '_description', + 'aria-hidden': 'true', + 'aria-label': this.label(), + 'role': 'dialog' + }); + }; + + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + ModalDialog.prototype.buildCSSClass = function buildCSSClass() { + return MODAL_CLASS_NAME + ' vjs-hidden ' + _Component.prototype.buildCSSClass.call(this); + }; + + /** + * Handles `keydown` events on the document, looking for ESC, which closes + * the modal. + * + * @param {EventTarget~Event} e + * The keypress that triggered this event. + * + * @listens keydown + */ + + + ModalDialog.prototype.handleKeyPress = function handleKeyPress(e) { + if (e.which === ESC && this.closeable()) { + this.close(); + } + }; + + /** + * Returns the label string for this modal. Primarily used for accessibility. + * + * @return {string} + * the localized or raw label of this modal. + */ + + + ModalDialog.prototype.label = function label() { + return this.localize(this.options_.label || 'Modal Window'); + }; + + /** + * Returns the description string for this modal. Primarily used for + * accessibility. + * + * @return {string} + * The localized or raw description of this modal. + */ + + + ModalDialog.prototype.description = function description() { + var desc = this.options_.description || this.localize('This is a modal window.'); + + // Append a universal closeability message if the modal is closeable. + if (this.closeable()) { + desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.'); + } + + return desc; + }; + + /** + * Opens the modal. + * + * @fires ModalDialog#beforemodalopen + * @fires ModalDialog#modalopen + */ + + + ModalDialog.prototype.open = function open() { + if (!this.opened_) { + var player = this.player(); + + /** + * Fired just before a `ModalDialog` is opened. + * + * @event ModalDialog#beforemodalopen + * @type {EventTarget~Event} + */ + this.trigger('beforemodalopen'); + this.opened_ = true; + + // Fill content if the modal has never opened before and + // never been filled. + if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) { + this.fill(); + } + + // If the player was playing, pause it and take note of its previously + // playing state. + this.wasPlaying_ = !player.paused(); + + if (this.options_.pauseOnOpen && this.wasPlaying_) { + player.pause(); + } + + if (this.closeable()) { + this.on(this.el_.ownerDocument, 'keydown', Fn.bind(this, this.handleKeyPress)); + } + + player.controls(false); + this.show(); + this.conditionalFocus_(); + this.el().setAttribute('aria-hidden', 'false'); + + /** + * Fired just after a `ModalDialog` is opened. + * + * @event ModalDialog#modalopen + * @type {EventTarget~Event} + */ + this.trigger('modalopen'); + this.hasBeenOpened_ = true; + } + }; + + /** + * If the `ModalDialog` is currently open or closed. + * + * @param {boolean} [value] + * If given, it will open (`true`) or close (`false`) the modal. + * + * @return {boolean} + * the current open state of the modaldialog + */ + + + ModalDialog.prototype.opened = function opened(value) { + if (typeof value === 'boolean') { + this[value ? 'open' : 'close'](); + } + return this.opened_; + }; + + /** + * Closes the modal, does nothing if the `ModalDialog` is + * not open. + * + * @fires ModalDialog#beforemodalclose + * @fires ModalDialog#modalclose + */ + + + ModalDialog.prototype.close = function close() { + if (!this.opened_) { + return; + } + var player = this.player(); + + /** + * Fired just before a `ModalDialog` is closed. + * + * @event ModalDialog#beforemodalclose + * @type {EventTarget~Event} + */ + this.trigger('beforemodalclose'); + this.opened_ = false; + + if (this.wasPlaying_ && this.options_.pauseOnOpen) { + player.play(); + } + + if (this.closeable()) { + this.off(this.el_.ownerDocument, 'keydown', Fn.bind(this, this.handleKeyPress)); + } + + player.controls(true); + this.hide(); + this.el().setAttribute('aria-hidden', 'true'); + + /** + * Fired just after a `ModalDialog` is closed. + * + * @event ModalDialog#modalclose + * @type {EventTarget~Event} + */ + this.trigger('modalclose'); + this.conditionalBlur_(); + + if (this.options_.temporary) { + this.dispose(); + } + }; + + /** + * Check to see if the `ModalDialog` is closeable via the UI. + * + * @param {boolean} [value] + * If given as a boolean, it will set the `closeable` option. + * + * @return {boolean} + * Returns the final value of the closable option. + */ + + + ModalDialog.prototype.closeable = function closeable(value) { + if (typeof value === 'boolean') { + var closeable = this.closeable_ = !!value; + var close = this.getChild('closeButton'); + + // If this is being made closeable and has no close button, add one. + if (closeable && !close) { + + // The close button should be a child of the modal - not its + // content element, so temporarily change the content element. + var temp = this.contentEl_; + + this.contentEl_ = this.el_; + close = this.addChild('closeButton', { controlText: 'Close Modal Dialog' }); + this.contentEl_ = temp; + this.on(close, 'close', this.close); + } + + // If this is being made uncloseable and has a close button, remove it. + if (!closeable && close) { + this.off(close, 'close', this.close); + this.removeChild(close); + close.dispose(); + } + } + return this.closeable_; + }; + + /** + * Fill the modal's content element with the modal's "content" option. + * The content element will be emptied before this change takes place. + */ + + + ModalDialog.prototype.fill = function fill() { + this.fillWith(this.content()); + }; + + /** + * Fill the modal's content element with arbitrary content. + * The content element will be emptied before this change takes place. + * + * @fires ModalDialog#beforemodalfill + * @fires ModalDialog#modalfill + * + * @param {Mixed} [content] + * The same rules apply to this as apply to the `content` option. + */ + + + ModalDialog.prototype.fillWith = function fillWith(content) { + var contentEl = this.contentEl(); + var parentEl = contentEl.parentNode; + var nextSiblingEl = contentEl.nextSibling; + + /** + * Fired just before a `ModalDialog` is filled with content. + * + * @event ModalDialog#beforemodalfill + * @type {EventTarget~Event} + */ + this.trigger('beforemodalfill'); + this.hasBeenFilled_ = true; + + // Detach the content element from the DOM before performing + // manipulation to avoid modifying the live DOM multiple times. + parentEl.removeChild(contentEl); + this.empty(); + Dom.insertContent(contentEl, content); + /** + * Fired just after a `ModalDialog` is filled with content. + * + * @event ModalDialog#modalfill + * @type {EventTarget~Event} + */ + this.trigger('modalfill'); + + // Re-inject the re-filled content element. + if (nextSiblingEl) { + parentEl.insertBefore(contentEl, nextSiblingEl); + } else { + parentEl.appendChild(contentEl); + } + + // make sure that the close button is last in the dialog DOM + var closeButton = this.getChild('closeButton'); + + if (closeButton) { + parentEl.appendChild(closeButton.el_); + } + }; + + /** + * Empties the content element. This happens anytime the modal is filled. + * + * @fires ModalDialog#beforemodalempty + * @fires ModalDialog#modalempty + */ + + + ModalDialog.prototype.empty = function empty() { + /** + * Fired just before a `ModalDialog` is emptied. + * + * @event ModalDialog#beforemodalempty + * @type {EventTarget~Event} + */ + this.trigger('beforemodalempty'); + Dom.emptyEl(this.contentEl()); + + /** + * Fired just after a `ModalDialog` is emptied. + * + * @event ModalDialog#modalempty + * @type {EventTarget~Event} + */ + this.trigger('modalempty'); + }; + + /** + * Gets or sets the modal content, which gets normalized before being + * rendered into the DOM. + * + * This does not update the DOM or fill the modal, but it is called during + * that process. + * + * @param {Mixed} [value] + * If defined, sets the internal content value to be used on the + * next call(s) to `fill`. This value is normalized before being + * inserted. To "clear" the internal content value, pass `null`. + * + * @return {Mixed} + * The current content of the modal dialog + */ + + + ModalDialog.prototype.content = function content(value) { + if (typeof value !== 'undefined') { + this.content_ = value; + } + return this.content_; + }; + + /** + * conditionally focus the modal dialog if focus was previously on the player. + * + * @private + */ + + + ModalDialog.prototype.conditionalFocus_ = function conditionalFocus_() { + var activeEl = _document2['default'].activeElement; + var playerEl = this.player_.el_; + + this.previouslyActiveEl_ = null; + + if (playerEl.contains(activeEl) || playerEl === activeEl) { + this.previouslyActiveEl_ = activeEl; + + this.focus(); + + this.on(_document2['default'], 'keydown', this.handleKeyDown); + } + }; + + /** + * conditionally blur the element and refocus the last focused element + * + * @private + */ + + + ModalDialog.prototype.conditionalBlur_ = function conditionalBlur_() { + if (this.previouslyActiveEl_) { + this.previouslyActiveEl_.focus(); + this.previouslyActiveEl_ = null; + } + + this.off(_document2['default'], 'keydown', this.handleKeyDown); + }; + + /** + * Keydown handler. Attached when modal is focused. + * + * @listens keydown + */ + + + ModalDialog.prototype.handleKeyDown = function handleKeyDown(event) { + // exit early if it isn't a tab key + if (event.which !== 9) { + return; + } + + var focusableEls = this.focusableEls_(); + var activeEl = this.el_.querySelector(':focus'); + var focusIndex = void 0; + + for (var i = 0; i < focusableEls.length; i++) { + if (activeEl === focusableEls[i]) { + focusIndex = i; + break; + } + } + + if (_document2['default'].activeElement === this.el_) { + focusIndex = 0; + } + + if (event.shiftKey && focusIndex === 0) { + focusableEls[focusableEls.length - 1].focus(); + event.preventDefault(); + } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) { + focusableEls[0].focus(); + event.preventDefault(); + } + }; + + /** + * get all focusable elements + * + * @private + */ + + + ModalDialog.prototype.focusableEls_ = function focusableEls_() { + var allChildren = this.el_.querySelectorAll('*'); + + return Array.prototype.filter.call(allChildren, function (child) { + return (child instanceof _window2['default'].HTMLAnchorElement || child instanceof _window2['default'].HTMLAreaElement) && child.hasAttribute('href') || (child instanceof _window2['default'].HTMLInputElement || child instanceof _window2['default'].HTMLSelectElement || child instanceof _window2['default'].HTMLTextAreaElement || child instanceof _window2['default'].HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof _window2['default'].HTMLIFrameElement || child instanceof _window2['default'].HTMLObjectElement || child instanceof _window2['default'].HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable'); + }); + }; + + return ModalDialog; +}(_component2['default']); + +/** + * Default options for `ModalDialog` default options. + * + * @type {Object} + * @private + */ + + +ModalDialog.prototype.options_ = { + pauseOnOpen: true, + temporary: true +}; + +_component2['default'].registerComponent('ModalDialog', ModalDialog); +exports['default'] = ModalDialog; + +},{"100":100,"5":5,"85":85,"88":88,"99":99}],56:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _templateObject = _taggedTemplateLiteralLoose(['\n Using the tech directly can be dangerous. I hope you know what you\'re doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n '], ['\n Using the tech directly can be dangerous. I hope you know what you\'re doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n ']); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +var _window = _dereq_(100); + +var _window2 = _interopRequireDefault(_window); + +var _tsml = _dereq_(103); + +var _tsml2 = _interopRequireDefault(_tsml); + +var _evented = _dereq_(53); + +var _evented2 = _interopRequireDefault(_evented); + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _guid = _dereq_(90); + +var Guid = _interopRequireWildcard(_guid); + +var _browser = _dereq_(81); + +var browser = _interopRequireWildcard(_browser); + +var _log = _dereq_(91); + +var _log2 = _interopRequireDefault(_log); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +var _timeRanges = _dereq_(95); + +var _buffer = _dereq_(82); + +var _stylesheet = _dereq_(94); + +var stylesheet = _interopRequireWildcard(_stylesheet); + +var _fullscreenApi = _dereq_(47); + +var _fullscreenApi2 = _interopRequireDefault(_fullscreenApi); + +var _mediaError = _dereq_(49); + +var _mediaError2 = _interopRequireDefault(_mediaError); + +var _tuple = _dereq_(102); + +var _tuple2 = _interopRequireDefault(_tuple); + +var _obj = _dereq_(93); + +var _mergeOptions = _dereq_(92); + +var _mergeOptions2 = _interopRequireDefault(_mergeOptions); + +var _textTrackListConverter = _dereq_(71); + +var _textTrackListConverter2 = _interopRequireDefault(_textTrackListConverter); + +var _modalDialog = _dereq_(55); + +var _modalDialog2 = _interopRequireDefault(_modalDialog); + +var _tech = _dereq_(64); + +var _tech2 = _interopRequireDefault(_tech); + +var _middleware = _dereq_(63); + +var middleware = _interopRequireWildcard(_middleware); + +var _trackTypes = _dereq_(77); + +var _filterSource = _dereq_(87); + +var _filterSource2 = _interopRequireDefault(_filterSource); + +_dereq_(62); + +_dereq_(58); + +_dereq_(70); + +_dereq_(48); + +_dereq_(1); + +_dereq_(4); + +_dereq_(8); + +_dereq_(44); + +_dereq_(73); + +_dereq_(61); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file player.js + */ +// Subclasses Component + + +// The following imports are used only to ensure that the corresponding modules +// are always included in the video.js package. Importing the modules will +// execute them and they will register themselves with video.js. + + +// Import Html5 tech, at least for disposing the original video tag. + + +// The following tech events are simply re-triggered +// on the player when they happen +var TECH_EVENTS_RETRIGGER = [ +/** + * Fired while the user agent is downloading media data. + * + * @event Player#progress + * @type {EventTarget~Event} + */ +/** + * Retrigger the `progress` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechProgress_ + * @fires Player#progress + * @listens Tech#progress + */ +'progress', + +/** + * Fires when the loading of an audio/video is aborted. + * + * @event Player#abort + * @type {EventTarget~Event} + */ +/** + * Retrigger the `abort` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechAbort_ + * @fires Player#abort + * @listens Tech#abort + */ +'abort', + +/** + * Fires when the browser is intentionally not getting media data. + * + * @event Player#suspend + * @type {EventTarget~Event} + */ +/** + * Retrigger the `suspend` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechSuspend_ + * @fires Player#suspend + * @listens Tech#suspend + */ +'suspend', + +/** + * Fires when the current playlist is empty. + * + * @event Player#emptied + * @type {EventTarget~Event} + */ +/** + * Retrigger the `emptied` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechEmptied_ + * @fires Player#emptied + * @listens Tech#emptied + */ +'emptied', +/** + * Fires when the browser is trying to get media data, but data is not available. + * + * @event Player#stalled + * @type {EventTarget~Event} + */ +/** + * Retrigger the `stalled` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechStalled_ + * @fires Player#stalled + * @listens Tech#stalled + */ +'stalled', + +/** + * Fires when the browser has loaded meta data for the audio/video. + * + * @event Player#loadedmetadata + * @type {EventTarget~Event} + */ +/** + * Retrigger the `stalled` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechLoadedmetadata_ + * @fires Player#loadedmetadata + * @listens Tech#loadedmetadata + */ +'loadedmetadata', + +/** + * Fires when the browser has loaded the current frame of the audio/video. + * + * @event player#loadeddata + * @type {event} + */ +/** + * Retrigger the `loadeddata` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechLoaddeddata_ + * @fires Player#loadeddata + * @listens Tech#loadeddata + */ +'loadeddata', + +/** + * Fires when the current playback position has changed. + * + * @event player#timeupdate + * @type {event} + */ +/** + * Retrigger the `timeupdate` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechTimeUpdate_ + * @fires Player#timeupdate + * @listens Tech#timeupdate + */ +'timeupdate', + +/** + * Fires when the playing speed of the audio/video is changed + * + * @event player#ratechange + * @type {event} + */ +/** + * Retrigger the `ratechange` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechRatechange_ + * @fires Player#ratechange + * @listens Tech#ratechange + */ +'ratechange', + +/** + * Fires when the video's intrinsic dimensions change + * + * @event Player#resize + * @type {event} + */ +/** + * Retrigger the `resize` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechResize_ + * @fires Player#resize + * @listens Tech#resize + */ +'resize', + +/** + * Fires when the volume has been changed + * + * @event player#volumechange + * @type {event} + */ +/** + * Retrigger the `volumechange` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechVolumechange_ + * @fires Player#volumechange + * @listens Tech#volumechange + */ +'volumechange', + +/** + * Fires when the text track has been changed + * + * @event player#texttrackchange + * @type {event} + */ +/** + * Retrigger the `texttrackchange` event that was triggered by the {@link Tech}. + * + * @private + * @method Player#handleTechTexttrackchange_ + * @fires Player#texttrackchange + * @listens Tech#texttrackchange + */ +'texttrackchange']; + +/** + * An instance of the `Player` class is created when any of the Video.js setup methods + * are used to initialize a video. + * + * After an instance has been created it can be accessed globally in two ways: + * 1. By calling `videojs('example_video_1');` + * 2. By using it directly via `videojs.players.example_video_1;` + * + * @extends Component + */ + +var Player = function (_Component) { + _inherits(Player, _Component); + + /** + * Create an instance of this class. + * + * @param {Element} tag + * The original video DOM element used for configuring options. + * + * @param {Object} [options] + * Object of option names and values. + * + * @param {Component~ReadyCallback} [ready] + * Ready callback function. + */ + function Player(tag, options, ready) { + _classCallCheck(this, Player); + + // Make sure tag ID exists + tag.id = tag.id || 'vjs_video_' + Guid.newGUID(); + + // Set Options + // The options argument overrides options set in the video tag + // which overrides globally set options. + // This latter part coincides with the load order + // (tag must exist before Player) + options = (0, _obj.assign)(Player.getTagSettings(tag), options); + + // Delay the initialization of children because we need to set up + // player properties first, and can't use `this` before `super()` + options.initChildren = false; + + // Same with creating the element + options.createEl = false; + + // we don't want the player to report touch activity on itself + // see enableTouchActivity in Component + options.reportTouchActivity = false; + + // If language is not set, get the closest lang attribute + if (!options.language) { + if (typeof tag.closest === 'function') { + var closest = tag.closest('[lang]'); + + if (closest) { + options.language = closest.getAttribute('lang'); + } + } else { + var element = tag; + + while (element && element.nodeType === 1) { + if (Dom.getAttributes(element).hasOwnProperty('lang')) { + options.language = element.getAttribute('lang'); + break; + } + element = element.parentNode; + } + } + } + + // Run base component initializing with new options + + // Turn off API access because we're loading a new tech that might load asynchronously + var _this = _possibleConstructorReturn(this, _Component.call(this, null, options, ready)); + + _this.isReady_ = false; + + // if the global option object was accidentally blown away by + // someone, bail early with an informative error + if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) { + throw new Error('No techOrder specified. Did you overwrite ' + 'videojs.options instead of just changing the ' + 'properties you want to override?'); + } + + // Store the original tag used to set options + _this.tag = tag; + + // Store the tag attributes used to restore html5 element + _this.tagAttributes = tag && Dom.getAttributes(tag); + + // Update current language + _this.language(_this.options_.language); + + // Update Supported Languages + if (options.languages) { + // Normalise player option languages to lowercase + var languagesToLower = {}; + + Object.getOwnPropertyNames(options.languages).forEach(function (name) { + languagesToLower[name.toLowerCase()] = options.languages[name]; + }); + _this.languages_ = languagesToLower; + } else { + _this.languages_ = Player.prototype.options_.languages; + } + + // Cache for video property values. + _this.cache_ = {}; + + // Set poster + _this.poster_ = options.poster || ''; + + // Set controls + _this.controls_ = !!options.controls; + + // Set default values for lastVolume + _this.cache_.lastVolume = 1; + + // Original tag settings stored in options + // now remove immediately so native controls don't flash. + // May be turned back on by HTML5 tech if nativeControlsForTouch is true + tag.controls = false; + + /* + * Store the internal state of scrubbing + * + * @private + * @return {Boolean} True if the user is scrubbing + */ + _this.scrubbing_ = false; + + _this.el_ = _this.createEl(); + + // Make this an evented object and use `el_` as its event bus. + (0, _evented2['default'])(_this, { eventBusKey: 'el_' }); + + // We also want to pass the original player options to each component and plugin + // as well so they don't need to reach back into the player for options later. + // We also need to do another copy of this.options_ so we don't end up with + // an infinite loop. + var playerOptionsCopy = (0, _mergeOptions2['default'])(_this.options_); + + // Load plugins + if (options.plugins) { + var plugins = options.plugins; + + Object.keys(plugins).forEach(function (name) { + if (typeof this[name] === 'function') { + this[name](plugins[name]); + } else { + throw new Error('plugin "' + name + '" does not exist'); + } + }, _this); + } + + _this.options_.playerOptions = playerOptionsCopy; + + _this.middleware_ = []; + + _this.initChildren(); + + // Set isAudio based on whether or not an audio tag was used + _this.isAudio(tag.nodeName.toLowerCase() === 'audio'); + + // Update controls className. Can't do this when the controls are initially + // set because the element doesn't exist yet. + if (_this.controls()) { + _this.addClass('vjs-controls-enabled'); + } else { + _this.addClass('vjs-controls-disabled'); + } + + // Set ARIA label and region role depending on player type + _this.el_.setAttribute('role', 'region'); + if (_this.isAudio()) { + _this.el_.setAttribute('aria-label', _this.localize('Audio Player')); + } else { + _this.el_.setAttribute('aria-label', _this.localize('Video Player')); + } + + if (_this.isAudio()) { + _this.addClass('vjs-audio'); + } + + if (_this.flexNotSupported_()) { + _this.addClass('vjs-no-flex'); + } + + // TODO: Make this smarter. Toggle user state between touching/mousing + // using events, since devices can have both touch and mouse events. + // if (browser.TOUCH_ENABLED) { + // this.addClass('vjs-touch-enabled'); + // } + + // iOS Safari has broken hover handling + if (!browser.IS_IOS) { + _this.addClass('vjs-workinghover'); + } + + // Make player easily findable by ID + Player.players[_this.id_] = _this; + + // Add a major version class to aid css in plugins + var majorVersion = '6.1.0'.split('.')[0]; + + _this.addClass('vjs-v' + majorVersion); + + // When the player is first initialized, trigger activity so components + // like the control bar show themselves if needed + _this.userActive(true); + _this.reportUserActivity(); + _this.listenForUserActivity_(); + + _this.on('fullscreenchange', _this.handleFullscreenChange_); + _this.on('stageclick', _this.handleStageClick_); + + _this.changingSrc_ = false; + return _this; + } + + /** + * Destroys the video player and does any necessary cleanup. + * + * This is especially helpful if you are dynamically adding and removing videos + * to/from the DOM. + * + * @fires Player#dispose + */ + + + Player.prototype.dispose = function dispose() { + /** + * Called when the player is being disposed of. + * + * @event Player#dispose + * @type {EventTarget~Event} + */ + this.trigger('dispose'); + // prevent dispose from being called twice + this.off('dispose'); + + if (this.styleEl_ && this.styleEl_.parentNode) { + this.styleEl_.parentNode.removeChild(this.styleEl_); + } + + // Kill reference to this player + Player.players[this.id_] = null; + + if (this.tag && this.tag.player) { + this.tag.player = null; + } + + if (this.el_ && this.el_.player) { + this.el_.player = null; + } + + if (this.tech_) { + this.tech_.dispose(); + } + + _Component.prototype.dispose.call(this); + }; + + /** + * Create the `Player`'s DOM element. + * + * @return {Element} + * The DOM element that gets created. + */ + + + Player.prototype.createEl = function createEl() { + var tag = this.tag; + var el = void 0; + var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute('data-vjs-player'); + + if (playerElIngest) { + el = this.el_ = tag.parentNode; + } else { + el = this.el_ = _Component.prototype.createEl.call(this, 'div'); + } + + // set tabindex to -1 so we could focus on the player element + tag.setAttribute('tabindex', '-1'); + + // Remove width/height attrs from tag so CSS can make it 100% width/height + tag.removeAttribute('width'); + tag.removeAttribute('height'); + + // Copy over all the attributes from the tag, including ID and class + // ID will now reference player box, not the video tag + var attrs = Dom.getAttributes(tag); + + Object.getOwnPropertyNames(attrs).forEach(function (attr) { + // workaround so we don't totally break IE7 + // http://stackoverflow.com/questions/3653444/css-styles-not-applied-on-dynamic-elements-in-internet-explorer-7 + if (attr === 'class') { + el.className += ' ' + attrs[attr]; + } else { + el.setAttribute(attr, attrs[attr]); + } + }); + + // Update tag id/class for use as HTML5 playback tech + // Might think we should do this after embedding in container so .vjs-tech class + // doesn't flash 100% width/height, but class only applies with .video-js parent + tag.playerId = tag.id; + tag.id += '_html5_api'; + tag.className = 'vjs-tech'; + + // Make player findable on elements + tag.player = el.player = this; + // Default state of video is paused + this.addClass('vjs-paused'); + + // Add a style element in the player that we'll use to set the width/height + // of the player in a way that's still overrideable by CSS, just like the + // video element + if (_window2['default'].VIDEOJS_NO_DYNAMIC_STYLE !== true) { + this.styleEl_ = stylesheet.createStyleElement('vjs-styles-dimensions'); + var defaultsStyleEl = Dom.$('.vjs-styles-defaults'); + var head = Dom.$('head'); + + head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild); + } + + // Pass in the width/height/aspectRatio options which will update the style el + this.width(this.options_.width); + this.height(this.options_.height); + this.fluid(this.options_.fluid); + this.aspectRatio(this.options_.aspectRatio); + + // Hide any links within the video/audio tag, because IE doesn't hide them completely. + var links = tag.getElementsByTagName('a'); + + for (var i = 0; i < links.length; i++) { + var linkEl = links.item(i); + + Dom.addClass(linkEl, 'vjs-hidden'); + linkEl.setAttribute('hidden', 'hidden'); + } + + // insertElFirst seems to cause the networkState to flicker from 3 to 2, so + // keep track of the original for later so we can know if the source originally failed + tag.initNetworkState_ = tag.networkState; + + // Wrap video tag in div (el/box) container + if (tag.parentNode && !playerElIngest) { + tag.parentNode.insertBefore(el, tag); + } + + // insert the tag as the first child of the player element + // then manually add it to the children array so that this.addChild + // will work properly for other components + // + // Breaks iPhone, fixed in HTML5 setup. + Dom.prependTo(tag, el); + this.children_.unshift(tag); + + // Set lang attr on player to ensure CSS :lang() in consistent with player + // if it's been set to something different to the doc + this.el_.setAttribute('lang', this.language_); + + this.el_ = el; + + return el; + }; + + /** + * A getter/setter for the `Player`'s width. + * + * @param {number} [value] + * The value to set the `Player's width to. + * + * @return {number} + * The current width of the `Player` when getting. + */ + + + Player.prototype.width = function width(value) { + return this.dimension('width', value); + }; + + /** + * A getter/setter for the `Player`'s height. + * + * @param {number} [value] + * The value to set the `Player's heigth to. + * + * @return {number} + * The current height of the `Player` when getting. + */ + + + Player.prototype.height = function height(value) { + return this.dimension('height', value); + }; + + /** + * A getter/setter for the `Player`'s width & height. + * + * @param {string} dimension + * This string can be: + * - 'width' + * - 'height' + * + * @param {number} [value] + * Value for dimension specified in the first argument. + * + * @return {number} + * The dimension arguments value when getting (width/height). + */ + + + Player.prototype.dimension = function dimension(_dimension, value) { + var privDimension = _dimension + '_'; + + if (value === undefined) { + return this[privDimension] || 0; + } + + if (value === '') { + // If an empty string is given, reset the dimension to be automatic + this[privDimension] = undefined; + } else { + var parsedVal = parseFloat(value); + + if (isNaN(parsedVal)) { + _log2['default'].error('Improper value "' + value + '" supplied for for ' + _dimension); + return; + } + + this[privDimension] = parsedVal; + } + + this.updateStyleEl_(); + }; + + /** + * A getter/setter/toggler for the vjs-fluid `className` on the `Player`. + * + * @param {boolean} [bool] + * - A value of true adds the class. + * - A value of false removes the class. + * - No value will toggle the fluid class. + * + * @return {boolean|undefined} + * - The value of fluid when getting. + * - `undefined` when setting. + */ + + + Player.prototype.fluid = function fluid(bool) { + if (bool === undefined) { + return !!this.fluid_; + } + + this.fluid_ = !!bool; + + if (bool) { + this.addClass('vjs-fluid'); + } else { + this.removeClass('vjs-fluid'); + } + + this.updateStyleEl_(); + }; + + /** + * Get/Set the aspect ratio + * + * @param {string} [ratio] + * Aspect ratio for player + * + * @return {string|undefined} + * returns the current aspect ratio when getting + */ + + /** + * A getter/setter for the `Player`'s aspect ratio. + * + * @param {string} [ratio] + * The value to set the `Player's aspect ratio to. + * + * @return {string|undefined} + * - The current aspect ratio of the `Player` when getting. + * - undefined when setting + */ + + + Player.prototype.aspectRatio = function aspectRatio(ratio) { + if (ratio === undefined) { + return this.aspectRatio_; + } + + // Check for width:height format + if (!/^\d+\:\d+$/.test(ratio)) { + throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.'); + } + this.aspectRatio_ = ratio; + + // We're assuming if you set an aspect ratio you want fluid mode, + // because in fixed mode you could calculate width and height yourself. + this.fluid(true); + + this.updateStyleEl_(); + }; + + /** + * Update styles of the `Player` element (height, width and aspect ratio). + * + * @private + * @listens Tech#loadedmetadata + */ + + + Player.prototype.updateStyleEl_ = function updateStyleEl_() { + if (_window2['default'].VIDEOJS_NO_DYNAMIC_STYLE === true) { + var _width = typeof this.width_ === 'number' ? this.width_ : this.options_.width; + var _height = typeof this.height_ === 'number' ? this.height_ : this.options_.height; + var techEl = this.tech_ && this.tech_.el(); + + if (techEl) { + if (_width >= 0) { + techEl.width = _width; + } + if (_height >= 0) { + techEl.height = _height; + } + } + + return; + } + + var width = void 0; + var height = void 0; + var aspectRatio = void 0; + var idClass = void 0; + + // The aspect ratio is either used directly or to calculate width and height. + if (this.aspectRatio_ !== undefined && this.aspectRatio_ !== 'auto') { + // Use any aspectRatio that's been specifically set + aspectRatio = this.aspectRatio_; + } else if (this.videoWidth() > 0) { + // Otherwise try to get the aspect ratio from the video metadata + aspectRatio = this.videoWidth() + ':' + this.videoHeight(); + } else { + // Or use a default. The video element's is 2:1, but 16:9 is more common. + aspectRatio = '16:9'; + } + + // Get the ratio as a decimal we can use to calculate dimensions + var ratioParts = aspectRatio.split(':'); + var ratioMultiplier = ratioParts[1] / ratioParts[0]; + + if (this.width_ !== undefined) { + // Use any width that's been specifically set + width = this.width_; + } else if (this.height_ !== undefined) { + // Or calulate the width from the aspect ratio if a height has been set + width = this.height_ / ratioMultiplier; + } else { + // Or use the video's metadata, or use the video el's default of 300 + width = this.videoWidth() || 300; + } + + if (this.height_ !== undefined) { + // Use any height that's been specifically set + height = this.height_; + } else { + // Otherwise calculate the height from the ratio and the width + height = width * ratioMultiplier; + } + + // Ensure the CSS class is valid by starting with an alpha character + if (/^[^a-zA-Z]/.test(this.id())) { + idClass = 'dimensions-' + this.id(); + } else { + idClass = this.id() + '-dimensions'; + } + + // Ensure the right class is still on the player for the style element + this.addClass(idClass); + + stylesheet.setTextContent(this.styleEl_, '\n .' + idClass + ' {\n width: ' + width + 'px;\n height: ' + height + 'px;\n }\n\n .' + idClass + '.vjs-fluid {\n padding-top: ' + ratioMultiplier * 100 + '%;\n }\n '); + }; + + /** + * Load/Create an instance of playback {@link Tech} including element + * and API methods. Then append the `Tech` element in `Player` as a child. + * + * @param {string} techName + * name of the playback technology + * + * @param {string} source + * video source + * + * @private + */ + + + Player.prototype.loadTech_ = function loadTech_(techName, source) { + var _this2 = this; + + // Pause and remove current playback technology + if (this.tech_) { + this.unloadTech_(); + } + + var titleTechName = (0, _toTitleCase2['default'])(techName); + var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1); + + // get rid of the HTML5 video tag as soon as we are using another tech + if (titleTechName !== 'Html5' && this.tag) { + _tech2['default'].getTech('Html5').disposeMediaElement(this.tag); + this.tag.player = null; + this.tag = null; + } + + this.techName_ = titleTechName; + + // Turn off API access because we're loading a new tech that might load asynchronously + this.isReady_ = false; + + // Grab tech-specific options from player options and add source and parent element to use. + var techOptions = { + source: source, + 'nativeControlsForTouch': this.options_.nativeControlsForTouch, + 'playerId': this.id(), + 'techId': this.id() + '_' + titleTechName + '_api', + 'autoplay': this.options_.autoplay, + 'playsinline': this.options_.playsinline, + 'preload': this.options_.preload, + 'loop': this.options_.loop, + 'muted': this.options_.muted, + 'poster': this.poster(), + 'language': this.language(), + 'playerElIngest': this.playerElIngest_ || false, + 'vtt.js': this.options_['vtt.js'] + }; + + _trackTypes.ALL.names.forEach(function (name) { + var props = _trackTypes.ALL[name]; + + techOptions[props.getterName] = _this2[props.privateName]; + }); + + (0, _obj.assign)(techOptions, this.options_[titleTechName]); + (0, _obj.assign)(techOptions, this.options_[camelTechName]); + (0, _obj.assign)(techOptions, this.options_[techName.toLowerCase()]); + + if (this.tag) { + techOptions.tag = this.tag; + } + + if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) { + techOptions.startTime = this.cache_.currentTime; + } + + // Initialize tech instance + var TechClass = _tech2['default'].getTech(techName); + + if (!TechClass) { + throw new Error('No Tech named \'' + titleTechName + '\' exists! \'' + titleTechName + '\' should be registered using videojs.registerTech()\''); + } + + this.tech_ = new TechClass(techOptions); + + // player.triggerReady is always async, so don't need this to be async + this.tech_.ready(Fn.bind(this, this.handleTechReady_), true); + + _textTrackListConverter2['default'].jsonToTextTracks(this.textTracksJson_ || [], this.tech_); + + // Listen to all HTML5-defined events and trigger them on the player + TECH_EVENTS_RETRIGGER.forEach(function (event) { + _this2.on(_this2.tech_, event, _this2['handleTech' + (0, _toTitleCase2['default'])(event) + '_']); + }); + this.on(this.tech_, 'loadstart', this.handleTechLoadStart_); + this.on(this.tech_, 'waiting', this.handleTechWaiting_); + this.on(this.tech_, 'canplay', this.handleTechCanPlay_); + this.on(this.tech_, 'canplaythrough', this.handleTechCanPlayThrough_); + this.on(this.tech_, 'playing', this.handleTechPlaying_); + this.on(this.tech_, 'ended', this.handleTechEnded_); + this.on(this.tech_, 'seeking', this.handleTechSeeking_); + this.on(this.tech_, 'seeked', this.handleTechSeeked_); + this.on(this.tech_, 'play', this.handleTechPlay_); + this.on(this.tech_, 'firstplay', this.handleTechFirstPlay_); + this.on(this.tech_, 'pause', this.handleTechPause_); + this.on(this.tech_, 'durationchange', this.handleTechDurationChange_); + this.on(this.tech_, 'fullscreenchange', this.handleTechFullscreenChange_); + this.on(this.tech_, 'error', this.handleTechError_); + this.on(this.tech_, 'loadedmetadata', this.updateStyleEl_); + this.on(this.tech_, 'posterchange', this.handleTechPosterChange_); + this.on(this.tech_, 'textdata', this.handleTechTextData_); + + this.usingNativeControls(this.techGet_('controls')); + + if (this.controls() && !this.usingNativeControls()) { + this.addTechControlsListeners_(); + } + + // Add the tech element in the DOM if it was not already there + // Make sure to not insert the original video element if using Html5 + if (this.tech_.el().parentNode !== this.el() && (titleTechName !== 'Html5' || !this.tag)) { + Dom.prependTo(this.tech_.el(), this.el()); + } + + // Get rid of the original video tag reference after the first tech is loaded + if (this.tag) { + this.tag.player = null; + this.tag = null; + } + }; + + /** + * Unload and dispose of the current playback {@link Tech}. + * + * @private + */ + + + Player.prototype.unloadTech_ = function unloadTech_() { + var _this3 = this; + + // Save the current text tracks so that we can reuse the same text tracks with the next tech + _trackTypes.ALL.names.forEach(function (name) { + var props = _trackTypes.ALL[name]; + + _this3[props.privateName] = _this3[props.getterName](); + }); + this.textTracksJson_ = _textTrackListConverter2['default'].textTracksToJson(this.tech_); + + this.isReady_ = false; + + this.tech_.dispose(); + + this.tech_ = false; + }; + + /** + * Return a reference to the current {@link Tech}. + * It will print a warning by default about the danger of using the tech directly + * but any argument that is passed in will silence the warning. + * + * @param {*} [safety] + * Anything passed in to silence the warning + * + * @return {Tech} + * The Tech + */ + + + Player.prototype.tech = function tech(safety) { + if (safety === undefined) { + _log2['default'].warn((0, _tsml2['default'])(_templateObject)); + } + + return this.tech_; + }; + + /** + * Set up click and touch listeners for the playback element + * + * - On desktops: a click on the video itself will toggle playback + * - On mobile devices: a click on the video toggles controls + * which is done by toggling the user state between active and + * inactive + * - A tap can signal that a user has become active or has become inactive + * e.g. a quick tap on an iPhone movie should reveal the controls. Another + * quick tap should hide them again (signaling the user is in an inactive + * viewing state) + * - In addition to this, we still want the user to be considered inactive after + * a few seconds of inactivity. + * + * > Note: the only part of iOS interaction we can't mimic with this setup + * is a touch and hold on the video element counting as activity in order to + * keep the controls showing, but that shouldn't be an issue. A touch and hold + * on any controls will still keep the user active + * + * @private + */ + + + Player.prototype.addTechControlsListeners_ = function addTechControlsListeners_() { + // Make sure to remove all the previous listeners in case we are called multiple times. + this.removeTechControlsListeners_(); + + // Some browsers (Chrome & IE) don't trigger a click on a flash swf, but do + // trigger mousedown/up. + // http://stackoverflow.com/questions/1444562/javascript-onclick-event-over-flash-object + // Any touch events are set to block the mousedown event from happening + this.on(this.tech_, 'mousedown', this.handleTechClick_); + + // If the controls were hidden we don't want that to change without a tap event + // so we'll check if the controls were already showing before reporting user + // activity + this.on(this.tech_, 'touchstart', this.handleTechTouchStart_); + this.on(this.tech_, 'touchmove', this.handleTechTouchMove_); + this.on(this.tech_, 'touchend', this.handleTechTouchEnd_); + + // The tap listener needs to come after the touchend listener because the tap + // listener cancels out any reportedUserActivity when setting userActive(false) + this.on(this.tech_, 'tap', this.handleTechTap_); + }; + + /** + * Remove the listeners used for click and tap controls. This is needed for + * toggling to controls disabled, where a tap/touch should do nothing. + * + * @private + */ + + + Player.prototype.removeTechControlsListeners_ = function removeTechControlsListeners_() { + // We don't want to just use `this.off()` because there might be other needed + // listeners added by techs that extend this. + this.off(this.tech_, 'tap', this.handleTechTap_); + this.off(this.tech_, 'touchstart', this.handleTechTouchStart_); + this.off(this.tech_, 'touchmove', this.handleTechTouchMove_); + this.off(this.tech_, 'touchend', this.handleTechTouchEnd_); + this.off(this.tech_, 'mousedown', this.handleTechClick_); + }; + + /** + * Player waits for the tech to be ready + * + * @private + */ + + + Player.prototype.handleTechReady_ = function handleTechReady_() { + this.triggerReady(); + + // Keep the same volume as before + if (this.cache_.volume) { + this.techCall_('setVolume', this.cache_.volume); + } + + // Look if the tech found a higher resolution poster while loading + this.handleTechPosterChange_(); + + // Update the duration if available + this.handleTechDurationChange_(); + + // Chrome and Safari both have issues with autoplay. + // In Safari (5.1.1), when we move the video element into the container div, autoplay doesn't work. + // In Chrome (15), if you have autoplay + a poster + no controls, the video gets hidden (but audio plays) + // This fixes both issues. Need to wait for API, so it updates displays correctly + if ((this.src() || this.currentSrc()) && this.tag && this.options_.autoplay && this.paused()) { + try { + // Chrome Fix. Fixed in Chrome v16. + delete this.tag.poster; + } catch (e) { + (0, _log2['default'])('deleting tag.poster throws in some browsers', e); + } + this.play(); + } + }; + + /** + * Retrigger the `loadstart` event that was triggered by the {@link Tech}. This + * function will also trigger {@link Player#firstplay} if it is the first loadstart + * for a video. + * + * @fires Player#loadstart + * @fires Player#firstplay + * @listens Tech#loadstart + * @private + */ + + + Player.prototype.handleTechLoadStart_ = function handleTechLoadStart_() { + // TODO: Update to use `emptied` event instead. See #1277. + + this.removeClass('vjs-ended'); + this.removeClass('vjs-seeking'); + + // reset the error state + this.error(null); + + // If it's already playing we want to trigger a firstplay event now. + // The firstplay event relies on both the play and loadstart events + // which can happen in any order for a new source + if (!this.paused()) { + /** + * Fired when the user agent begins looking for media data + * + * @event Player#loadstart + * @type {EventTarget~Event} + */ + this.trigger('loadstart'); + this.trigger('firstplay'); + } else { + // reset the hasStarted state + this.hasStarted(false); + this.trigger('loadstart'); + } + }; + + /** + * Add/remove the vjs-has-started class + * + * @fires Player#firstplay + * + * @param {boolean} hasStarted + * - true: adds the class + * - false: remove the class + * + * @return {boolean} + * the boolean value of hasStarted + */ + + + Player.prototype.hasStarted = function hasStarted(_hasStarted) { + if (_hasStarted !== undefined) { + // only update if this is a new value + if (this.hasStarted_ !== _hasStarted) { + this.hasStarted_ = _hasStarted; + if (_hasStarted) { + this.addClass('vjs-has-started'); + // trigger the firstplay event if this newly has played + this.trigger('firstplay'); + } else { + this.removeClass('vjs-has-started'); + } + } + return; + } + return !!this.hasStarted_; + }; + + /** + * Fired whenever the media begins or resumes playback + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play} + * @fires Player#play + * @listens Tech#play + * @private + */ + + + Player.prototype.handleTechPlay_ = function handleTechPlay_() { + this.removeClass('vjs-ended'); + this.removeClass('vjs-paused'); + this.addClass('vjs-playing'); + + // hide the poster when the user hits play + this.hasStarted(true); + /** + * Triggered whenever an {@link Tech#play} event happens. Indicates that + * playback has started or resumed. + * + * @event Player#play + * @type {EventTarget~Event} + */ + this.trigger('play'); + }; + + /** + * Retrigger the `waiting` event that was triggered by the {@link Tech}. + * + * @fires Player#waiting + * @listens Tech#waiting + * @private + */ + + + Player.prototype.handleTechWaiting_ = function handleTechWaiting_() { + var _this4 = this; + + this.addClass('vjs-waiting'); + /** + * A readyState change on the DOM element has caused playback to stop. + * + * @event Player#waiting + * @type {EventTarget~Event} + */ + this.trigger('waiting'); + this.one('timeupdate', function () { + return _this4.removeClass('vjs-waiting'); + }); + }; + + /** + * Retrigger the `canplay` event that was triggered by the {@link Tech}. + * > Note: This is not consistent between browsers. See #1351 + * + * @fires Player#canplay + * @listens Tech#canplay + * @private + */ + + + Player.prototype.handleTechCanPlay_ = function handleTechCanPlay_() { + this.removeClass('vjs-waiting'); + /** + * The media has a readyState of HAVE_FUTURE_DATA or greater. + * + * @event Player#canplay + * @type {EventTarget~Event} + */ + this.trigger('canplay'); + }; + + /** + * Retrigger the `canplaythrough` event that was triggered by the {@link Tech}. + * + * @fires Player#canplaythrough + * @listens Tech#canplaythrough + * @private + */ + + + Player.prototype.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() { + this.removeClass('vjs-waiting'); + /** + * The media has a readyState of HAVE_ENOUGH_DATA or greater. This means that the + * entire media file can be played without buffering. + * + * @event Player#canplaythrough + * @type {EventTarget~Event} + */ + this.trigger('canplaythrough'); + }; + + /** + * Retrigger the `playing` event that was triggered by the {@link Tech}. + * + * @fires Player#playing + * @listens Tech#playing + * @private + */ + + + Player.prototype.handleTechPlaying_ = function handleTechPlaying_() { + this.removeClass('vjs-waiting'); + /** + * The media is no longer blocked from playback, and has started playing. + * + * @event Player#playing + * @type {EventTarget~Event} + */ + this.trigger('playing'); + }; + + /** + * Retrigger the `seeking` event that was triggered by the {@link Tech}. + * + * @fires Player#seeking + * @listens Tech#seeking + * @private + */ + + + Player.prototype.handleTechSeeking_ = function handleTechSeeking_() { + this.addClass('vjs-seeking'); + /** + * Fired whenever the player is jumping to a new time + * + * @event Player#seeking + * @type {EventTarget~Event} + */ + this.trigger('seeking'); + }; + + /** + * Retrigger the `seeked` event that was triggered by the {@link Tech}. + * + * @fires Player#seeked + * @listens Tech#seeked + * @private + */ + + + Player.prototype.handleTechSeeked_ = function handleTechSeeked_() { + this.removeClass('vjs-seeking'); + /** + * Fired when the player has finished jumping to a new time + * + * @event Player#seeked + * @type {EventTarget~Event} + */ + this.trigger('seeked'); + }; + + /** + * Retrigger the `firstplay` event that was triggered by the {@link Tech}. + * + * @fires Player#firstplay + * @listens Tech#firstplay + * @deprecated As of 6.0 firstplay event is deprecated. + * @deprecated As of 6.0 passing the `starttime` option to the player and the firstplay event are deprecated. + * @private + */ + + + Player.prototype.handleTechFirstPlay_ = function handleTechFirstPlay_() { + // If the first starttime attribute is specified + // then we will start at the given offset in seconds + if (this.options_.starttime) { + _log2['default'].warn('Passing the `starttime` option to the player will be deprecated in 6.0'); + this.currentTime(this.options_.starttime); + } + + this.addClass('vjs-has-started'); + /** + * Fired the first time a video is played. Not part of the HLS spec, and this is + * probably not the best implementation yet, so use sparingly. If you don't have a + * reason to prevent playback, use `myPlayer.one('play');` instead. + * + * @event Player#firstplay + * @deprecated As of 6.0 firstplay event is deprecated. + * @type {EventTarget~Event} + */ + this.trigger('firstplay'); + }; + + /** + * Retrigger the `pause` event that was triggered by the {@link Tech}. + * + * @fires Player#pause + * @listens Tech#pause + * @private + */ + + + Player.prototype.handleTechPause_ = function handleTechPause_() { + this.removeClass('vjs-playing'); + this.addClass('vjs-paused'); + /** + * Fired whenever the media has been paused + * + * @event Player#pause + * @type {EventTarget~Event} + */ + this.trigger('pause'); + }; + + /** + * Retrigger the `ended` event that was triggered by the {@link Tech}. + * + * @fires Player#ended + * @listens Tech#ended + * @private + */ + + + Player.prototype.handleTechEnded_ = function handleTechEnded_() { + this.addClass('vjs-ended'); + if (this.options_.loop) { + this.currentTime(0); + this.play(); + } else if (!this.paused()) { + this.pause(); + } + + /** + * Fired when the end of the media resource is reached (currentTime == duration) + * + * @event Player#ended + * @type {EventTarget~Event} + */ + this.trigger('ended'); + }; + + /** + * Fired when the duration of the media resource is first known or changed + * + * @listens Tech#durationchange + * @private + */ + + + Player.prototype.handleTechDurationChange_ = function handleTechDurationChange_() { + this.duration(this.techGet_('duration')); + }; + + /** + * Handle a click on the media element to play/pause + * + * @param {EventTarget~Event} event + * the event that caused this function to trigger + * + * @listens Tech#mousedown + * @private + */ + + + Player.prototype.handleTechClick_ = function handleTechClick_(event) { + // We're using mousedown to detect clicks thanks to Flash, but mousedown + // will also be triggered with right-clicks, so we need to prevent that + if (event.button !== 0) { + return; + } + + // When controls are disabled a click should not toggle playback because + // the click is considered a control + if (this.controls()) { + if (this.paused()) { + this.play(); + } else { + this.pause(); + } + } + }; + + /** + * Handle a tap on the media element. It will toggle the user + * activity state, which hides and shows the controls. + * + * @listens Tech#tap + * @private + */ + + + Player.prototype.handleTechTap_ = function handleTechTap_() { + this.userActive(!this.userActive()); + }; + + /** + * Handle touch to start + * + * @listens Tech#touchstart + * @private + */ + + + Player.prototype.handleTechTouchStart_ = function handleTechTouchStart_() { + this.userWasActive = this.userActive(); + }; + + /** + * Handle touch to move + * + * @listens Tech#touchmove + * @private + */ + + + Player.prototype.handleTechTouchMove_ = function handleTechTouchMove_() { + if (this.userWasActive) { + this.reportUserActivity(); + } + }; + + /** + * Handle touch to end + * + * @param {EventTarget~Event} event + * the touchend event that triggered + * this function + * + * @listens Tech#touchend + * @private + */ + + + Player.prototype.handleTechTouchEnd_ = function handleTechTouchEnd_(event) { + // Stop the mouse events from also happening + event.preventDefault(); + }; + + /** + * Fired when the player switches in or out of fullscreen mode + * + * @private + * @listens Player#fullscreenchange + */ + + + Player.prototype.handleFullscreenChange_ = function handleFullscreenChange_() { + if (this.isFullscreen()) { + this.addClass('vjs-fullscreen'); + } else { + this.removeClass('vjs-fullscreen'); + } + }; + + /** + * native click events on the SWF aren't triggered on IE11, Win8.1RT + * use stageclick events triggered from inside the SWF instead + * + * @private + * @listens stageclick + */ + + + Player.prototype.handleStageClick_ = function handleStageClick_() { + this.reportUserActivity(); + }; + + /** + * Handle Tech Fullscreen Change + * + * @param {EventTarget~Event} event + * the fullscreenchange event that triggered this function + * + * @param {Object} data + * the data that was sent with the event + * + * @private + * @listens Tech#fullscreenchange + * @fires Player#fullscreenchange + */ + + + Player.prototype.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event, data) { + if (data) { + this.isFullscreen(data.isFullscreen); + } + /** + * Fired when going in and out of fullscreen. + * + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ + this.trigger('fullscreenchange'); + }; + + /** + * Fires when an error occurred during the loading of an audio/video. + * + * @private + * @listens Tech#error + */ + + + Player.prototype.handleTechError_ = function handleTechError_() { + var error = this.tech_.error(); + + this.error(error); + }; + + /** + * Retrigger the `textdata` event that was triggered by the {@link Tech}. + * + * @fires Player#textdata + * @listens Tech#textdata + * @private + */ + + + Player.prototype.handleTechTextData_ = function handleTechTextData_() { + var data = null; + + if (arguments.length > 1) { + data = arguments[1]; + } + + /** + * Fires when we get a textdata event from tech + * + * @event Player#textdata + * @type {EventTarget~Event} + */ + this.trigger('textdata', data); + }; + + /** + * Get object for cached values. + * + * @return {Object} + * get the current object cache + */ + + + Player.prototype.getCache = function getCache() { + return this.cache_; + }; + + /** + * Pass values to the playback tech + * + * @param {string} [method] + * the method to call + * + * @param {Object} arg + * the argument to pass + * + * @private + */ + + + Player.prototype.techCall_ = function techCall_(method, arg) { + // If it's not ready yet, call method when it is + + this.ready(function () { + if (method in middleware.allowedSetters) { + return middleware.set(this.middleware_, this.tech_, method, arg); + } + + try { + if (this.tech_) { + this.tech_[method](arg); + } + } catch (e) { + (0, _log2['default'])(e); + throw e; + } + }, true); + }; + + /** + * Get calls can't wait for the tech, and sometimes don't need to. + * + * @param {string} method + * Tech method + * + * @return {Function|undefined} + * the method or undefined + * + * @private + */ + + + Player.prototype.techGet_ = function techGet_(method) { + if (this.tech_ && this.tech_.isReady_) { + + if (method in middleware.allowedGetters) { + return middleware.get(this.middleware_, this.tech_, method); + } + + // Flash likes to die and reload when you hide or reposition it. + // In these cases the object methods go away and we get errors. + // When that happens we'll catch the errors and inform tech that it's not ready any more. + try { + return this.tech_[method](); + } catch (e) { + // When building additional tech libs, an expected method may not be defined yet + if (this.tech_[method] === undefined) { + (0, _log2['default'])('Video.js: ' + method + ' method not defined for ' + this.techName_ + ' playback technology.', e); + + // When a method isn't available on the object it throws a TypeError + } else if (e.name === 'TypeError') { + (0, _log2['default'])('Video.js: ' + method + ' unavailable on ' + this.techName_ + ' playback technology element.', e); + this.tech_.isReady_ = false; + } else { + (0, _log2['default'])(e); + } + throw e; + } + } + + return; + }; + + /** + * start media playback + * + * @return {Promise|undefined} + * Returns a `Promise` if the browser returns one, for most browsers this will + * return undefined. + */ + + + Player.prototype.play = function play() { + if (this.changingSrc_) { + this.ready(function () { + var retval = this.techGet_('play'); + + // silence errors (unhandled promise from play) + if (retval !== undefined && typeof retval.then === 'function') { + retval.then(null, function (e) {}); + } + }); + + // Only calls the tech's play if we already have a src loaded + } else if (this.isReady_ && (this.src() || this.currentSrc())) { + return this.techGet_('play'); + } else { + this.ready(function () { + this.tech_.one('loadstart', function () { + var retval = this.play(); + + // silence errors (unhandled promise from play) + if (retval !== undefined && typeof retval.then === 'function') { + retval.then(null, function (e) {}); + } + }); + }); + } + }; + + /** + * Pause the video playback + * + * @return {Player} + * A reference to the player object this function was called on + */ + + + Player.prototype.pause = function pause() { + this.techCall_('pause'); + }; + + /** + * Check if the player is paused or has yet to play + * + * @return {boolean} + * - false: if the media is currently playing + * - true: if media is not currently playing + */ + + + Player.prototype.paused = function paused() { + // The initial state of paused should be true (in Safari it's actually false) + return this.techGet_('paused') === false ? false : true; + }; + + /** + * Get a TimeRange object representing the current ranges of time that the user + * has played. + * + * @return {TimeRange} + * A time range object that represents all the increments of time that have + * been played. + */ + + + Player.prototype.played = function played() { + return this.techGet_('played') || (0, _timeRanges.createTimeRange)(0, 0); + }; + + /** + * Returns whether or not the user is "scrubbing". Scrubbing is + * when the user has clicked the progress bar handle and is + * dragging it along the progress bar. + * + * @param {boolean} [isScrubbing] + * wether the user is or is not scrubbing + * + * @return {boolean} + * The value of scrubbing when getting + */ + + + Player.prototype.scrubbing = function scrubbing(isScrubbing) { + if (typeof isScrubbing === 'undefined') { + return this.scrubbing_; + } + this.scrubbing_ = !!isScrubbing; + + if (isScrubbing) { + this.addClass('vjs-scrubbing'); + } else { + this.removeClass('vjs-scrubbing'); + } + }; + + /** + * Get or set the current time (in seconds) + * + * @param {number|string} [seconds] + * The time to seek to in seconds + * + * @return {number} + * - the current time in seconds when getting + */ + + + Player.prototype.currentTime = function currentTime(seconds) { + if (typeof seconds !== 'undefined') { + this.techCall_('setCurrentTime', seconds); + return; + } + + // cache last currentTime and return. default to 0 seconds + // + // Caching the currentTime is meant to prevent a massive amount of reads on the tech's + // currentTime when scrubbing, but may not provide much performance benefit afterall. + // Should be tested. Also something has to read the actual current time or the cache will + // never get updated. + this.cache_.currentTime = this.techGet_('currentTime') || 0; + return this.cache_.currentTime; + }; + + /** + * Normally gets the length in time of the video in seconds; + * in all but the rarest use cases an argument will NOT be passed to the method + * + * > **NOTE**: The video must have started loading before the duration can be + * known, and in the case of Flash, may not be known until the video starts + * playing. + * + * @fires Player#durationchange + * + * @param {number} [seconds] + * The duration of the video to set in seconds + * + * @return {number} + * - The duration of the video in seconds when getting + */ + + + Player.prototype.duration = function duration(seconds) { + if (seconds === undefined) { + return this.cache_.duration || 0; + } + + seconds = parseFloat(seconds) || 0; + + // Standardize on Inifity for signaling video is live + if (seconds < 0) { + seconds = Infinity; + } + + if (seconds !== this.cache_.duration) { + // Cache the last set value for optimized scrubbing (esp. Flash) + this.cache_.duration = seconds; + + if (seconds === Infinity) { + this.addClass('vjs-live'); + } else { + this.removeClass('vjs-live'); + } + /** + * @event Player#durationchange + * @type {EventTarget~Event} + */ + this.trigger('durationchange'); + } + }; + + /** + * Calculates how much time is left in the video. Not part + * of the native video API. + * + * @return {number} + * The time remaining in seconds + */ + + + Player.prototype.remainingTime = function remainingTime() { + return this.duration() - this.currentTime(); + }; + + // + // Kind of like an array of portions of the video that have been downloaded. + + /** + * Get a TimeRange object with an array of the times of the video + * that have been downloaded. If you just want the percent of the + * video that's been downloaded, use bufferedPercent. + * + * @see [Buffered Spec]{@link http://dev.w3.org/html5/spec/video.html#dom-media-buffered} + * + * @return {TimeRange} + * A mock TimeRange object (following HTML spec) + */ + + + Player.prototype.buffered = function buffered() { + var buffered = this.techGet_('buffered'); + + if (!buffered || !buffered.length) { + buffered = (0, _timeRanges.createTimeRange)(0, 0); + } + + return buffered; + }; + + /** + * Get the percent (as a decimal) of the video that's been downloaded. + * This method is not a part of the native HTML video API. + * + * @return {number} + * A decimal between 0 and 1 representing the percent + * that is bufferred 0 being 0% and 1 being 100% + */ + + + Player.prototype.bufferedPercent = function bufferedPercent() { + return (0, _buffer.bufferedPercent)(this.buffered(), this.duration()); + }; + + /** + * Get the ending time of the last buffered time range + * This is used in the progress bar to encapsulate all time ranges. + * + * @return {number} + * The end of the last buffered time range + */ + + + Player.prototype.bufferedEnd = function bufferedEnd() { + var buffered = this.buffered(); + var duration = this.duration(); + var end = buffered.end(buffered.length - 1); + + if (end > duration) { + end = duration; + } + + return end; + }; + + /** + * Get or set the current volume of the media + * + * @param {number} [percentAsDecimal] + * The new volume as a decimal percent: + * - 0 is muted/0%/off + * - 1.0 is 100%/full + * - 0.5 is half volume or 50% + * + * @return {number} + * The current volume as a percent when getting + */ + + + Player.prototype.volume = function volume(percentAsDecimal) { + var vol = void 0; + + if (percentAsDecimal !== undefined) { + // Force value to between 0 and 1 + vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal))); + this.cache_.volume = vol; + this.techCall_('setVolume', vol); + + if (vol > 0) { + this.lastVolume_(vol); + } + + return; + } + + // Default to 1 when returning current volume. + vol = parseFloat(this.techGet_('volume')); + return isNaN(vol) ? 1 : vol; + }; + + /** + * Get the current muted state, or turn mute on or off + * + * @param {boolean} [muted] + * - true to mute + * - false to unmute + * + * @return {boolean} + * - true if mute is on and getting + * - false if mute is off and getting + */ + + + Player.prototype.muted = function muted(_muted) { + if (_muted !== undefined) { + this.techCall_('setMuted', _muted); + return; + } + return this.techGet_('muted') || false; + }; + + /** + * Get the current defaultMuted state, or turn defaultMuted on or off. defaultMuted + * indicates the state of muted on intial playback. + * + * ```js + * var myPlayer = videojs('some-player-id'); + * + * myPlayer.src("http://www.example.com/path/to/video.mp4"); + * + * // get, should be false + * console.log(myPlayer.defaultMuted()); + * // set to true + * myPlayer.defaultMuted(true); + * // get should be true + * console.log(myPlayer.defaultMuted()); + * ``` + * + * @param {boolean} [defaultMuted] + * - true to mute + * - false to unmute + * + * @return {boolean|Player} + * - true if defaultMuted is on and getting + * - false if defaultMuted is off and getting + * - A reference to the current player when setting + */ + + + Player.prototype.defaultMuted = function defaultMuted(_defaultMuted) { + if (_defaultMuted !== undefined) { + return this.techCall_('setDefaultMuted', _defaultMuted); + } + return this.techGet_('defaultMuted') || false; + }; + + /** + * Get the last volume, or set it + * + * @param {number} [percentAsDecimal] + * The new last volume as a decimal percent: + * - 0 is muted/0%/off + * - 1.0 is 100%/full + * - 0.5 is half volume or 50% + * + * @return {number} + * the current value of lastVolume as a percent when getting + * + * @private + */ + + + Player.prototype.lastVolume_ = function lastVolume_(percentAsDecimal) { + if (percentAsDecimal !== undefined && percentAsDecimal !== 0) { + this.cache_.lastVolume = percentAsDecimal; + return; + } + return this.cache_.lastVolume; + }; + + /** + * Check if current tech can support native fullscreen + * (e.g. with built in controls like iOS, so not our flash swf) + * + * @return {boolean} + * if native fullscreen is supported + */ + + + Player.prototype.supportsFullScreen = function supportsFullScreen() { + return this.techGet_('supportsFullScreen') || false; + }; + + /** + * Check if the player is in fullscreen mode or tell the player that it + * is or is not in fullscreen mode. + * + * > NOTE: As of the latest HTML5 spec, isFullscreen is no longer an official + * property and instead document.fullscreenElement is used. But isFullscreen is + * still a valuable property for internal player workings. + * + * @param {boolean} [isFS] + * Set the players current fullscreen state + * + * @return {boolean} + * - true if fullscreen is on and getting + * - false if fullscreen is off and getting + */ + + + Player.prototype.isFullscreen = function isFullscreen(isFS) { + if (isFS !== undefined) { + this.isFullscreen_ = !!isFS; + return; + } + return !!this.isFullscreen_; + }; + + /** + * Increase the size of the video to full screen + * In some browsers, full screen is not supported natively, so it enters + * "full window mode", where the video fills the browser window. + * In browsers and devices that support native full screen, sometimes the + * browser's default controls will be shown, and not the Video.js custom skin. + * This includes most mobile devices (iOS, Android) and older versions of + * Safari. + * + * @fires Player#fullscreenchange + */ + + + Player.prototype.requestFullscreen = function requestFullscreen() { + var fsApi = _fullscreenApi2['default']; + + this.isFullscreen(true); + + if (fsApi.requestFullscreen) { + // the browser supports going fullscreen at the element level so we can + // take the controls fullscreen as well as the video + + // Trigger fullscreenchange event after change + // We have to specifically add this each time, and remove + // when canceling fullscreen. Otherwise if there's multiple + // players on a page, they would all be reacting to the same fullscreen + // events + Events.on(_document2['default'], fsApi.fullscreenchange, Fn.bind(this, function documentFullscreenChange(e) { + this.isFullscreen(_document2['default'][fsApi.fullscreenElement]); + + // If cancelling fullscreen, remove event listener. + if (this.isFullscreen() === false) { + Events.off(_document2['default'], fsApi.fullscreenchange, documentFullscreenChange); + } + /** + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ + this.trigger('fullscreenchange'); + })); + + this.el_[fsApi.requestFullscreen](); + } else if (this.tech_.supportsFullScreen()) { + // we can't take the video.js controls fullscreen but we can go fullscreen + // with native controls + this.techCall_('enterFullScreen'); + } else { + // fullscreen isn't supported so we'll just stretch the video element to + // fill the viewport + this.enterFullWindow(); + /** + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ + this.trigger('fullscreenchange'); + } + }; + + /** + * Return the video to its normal size after having been in full screen mode + * + * @fires Player#fullscreenchange + */ + + + Player.prototype.exitFullscreen = function exitFullscreen() { + var fsApi = _fullscreenApi2['default']; + + this.isFullscreen(false); + + // Check for browser element fullscreen support + if (fsApi.requestFullscreen) { + _document2['default'][fsApi.exitFullscreen](); + } else if (this.tech_.supportsFullScreen()) { + this.techCall_('exitFullScreen'); + } else { + this.exitFullWindow(); + /** + * @event Player#fullscreenchange + * @type {EventTarget~Event} + */ + this.trigger('fullscreenchange'); + } + }; + + /** + * When fullscreen isn't supported we can stretch the + * video container to as wide as the browser will let us. + * + * @fires Player#enterFullWindow + */ + + + Player.prototype.enterFullWindow = function enterFullWindow() { + this.isFullWindow = true; + + // Storing original doc overflow value to return to when fullscreen is off + this.docOrigOverflow = _document2['default'].documentElement.style.overflow; + + // Add listener for esc key to exit fullscreen + Events.on(_document2['default'], 'keydown', Fn.bind(this, this.fullWindowOnEscKey)); + + // Hide any scroll bars + _document2['default'].documentElement.style.overflow = 'hidden'; + + // Apply fullscreen styles + Dom.addClass(_document2['default'].body, 'vjs-full-window'); + + /** + * @event Player#enterFullWindow + * @type {EventTarget~Event} + */ + this.trigger('enterFullWindow'); + }; + + /** + * Check for call to either exit full window or + * full screen on ESC key + * + * @param {string} event + * Event to check for key press + */ + + + Player.prototype.fullWindowOnEscKey = function fullWindowOnEscKey(event) { + if (event.keyCode === 27) { + if (this.isFullscreen() === true) { + this.exitFullscreen(); + } else { + this.exitFullWindow(); + } + } + }; + + /** + * Exit full window + * + * @fires Player#exitFullWindow + */ + + + Player.prototype.exitFullWindow = function exitFullWindow() { + this.isFullWindow = false; + Events.off(_document2['default'], 'keydown', this.fullWindowOnEscKey); + + // Unhide scroll bars. + _document2['default'].documentElement.style.overflow = this.docOrigOverflow; + + // Remove fullscreen styles + Dom.removeClass(_document2['default'].body, 'vjs-full-window'); + + // Resize the box, controller, and poster to original sizes + // this.positionAll(); + /** + * @event Player#exitFullWindow + * @type {EventTarget~Event} + */ + this.trigger('exitFullWindow'); + }; + + /** + * Check whether the player can play a given mimetype + * + * @see https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype + * + * @param {string} type + * The mimetype to check + * + * @return {string} + * 'probably', 'maybe', or '' (empty string) + */ + + + Player.prototype.canPlayType = function canPlayType(type) { + var can = void 0; + + // Loop through each playback technology in the options order + for (var i = 0, j = this.options_.techOrder; i < j.length; i++) { + var techName = j[i]; + var tech = _tech2['default'].getTech(techName); + + // Support old behavior of techs being registered as components. + // Remove once that deprecated behavior is removed. + if (!tech) { + tech = _component2['default'].getComponent(techName); + } + + // Check if the current tech is defined before continuing + if (!tech) { + _log2['default'].error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.'); + continue; + } + + // Check if the browser supports this technology + if (tech.isSupported()) { + can = tech.canPlayType(type); + + if (can) { + return can; + } + } + } + + return ''; + }; + + /** + * Select source based on tech-order or source-order + * Uses source-order selection if `options.sourceOrder` is truthy. Otherwise, + * defaults to tech-order selection + * + * @param {Array} sources + * The sources for a media asset + * + * @return {Object|boolean} + * Object of source and tech order or false + */ + + + Player.prototype.selectSource = function selectSource(sources) { + var _this5 = this; + + // Get only the techs specified in `techOrder` that exist and are supported by the + // current platform + var techs = this.options_.techOrder.map(function (techName) { + return [techName, _tech2['default'].getTech(techName)]; + }).filter(function (_ref) { + var techName = _ref[0], + tech = _ref[1]; + + // Check if the current tech is defined before continuing + if (tech) { + // Check if the browser supports this technology + return tech.isSupported(); + } + + _log2['default'].error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.'); + return false; + }); + + // Iterate over each `innerArray` element once per `outerArray` element and execute + // `tester` with both. If `tester` returns a non-falsy value, exit early and return + // that value. + var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair(outerArray, innerArray, tester) { + var found = void 0; + + outerArray.some(function (outerChoice) { + return innerArray.some(function (innerChoice) { + found = tester(outerChoice, innerChoice); + + if (found) { + return true; + } + }); + }); + + return found; + }; + + var foundSourceAndTech = void 0; + var flip = function flip(fn) { + return function (a, b) { + return fn(b, a); + }; + }; + var finder = function finder(_ref2, source) { + var techName = _ref2[0], + tech = _ref2[1]; + + if (tech.canPlaySource(source, _this5.options_[techName.toLowerCase()])) { + return { source: source, tech: techName }; + } + }; + + // Depending on the truthiness of `options.sourceOrder`, we swap the order of techs and sources + // to select from them based on their priority. + if (this.options_.sourceOrder) { + // Source-first ordering + foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder)); + } else { + // Tech-first ordering + foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder); + } + + return foundSourceAndTech || false; + }; + + /** + * The source function updates the video source + * There are three types of variables you can pass as the argument. + * **URL string**: A URL to the the video file. Use this method if you are sure + * the current playback technology (HTML5/Flash) can support the source you + * provide. Currently only MP4 files can be used in both HTML5 and Flash. + * + * @param {Tech~SourceObject|Tech~SourceObject[]} [source] + * One SourceObject or an array of SourceObjects + * + * @return {string} + * The current video source when getting + */ + + + Player.prototype.src = function src(source) { + var _this6 = this; + + // getter usage + if (typeof source === 'undefined') { + return this.cache_.src; + } + // filter out invalid sources and turn our source into + // an array of source objects + var sources = (0, _filterSource2['default'])(source); + + // if a source was passed in then it is invalid because + // it was filtered to a zero length Array. So we have to + // show an error + if (!sources.length) { + this.setTimeout(function () { + this.error({ code: 4, message: this.localize(this.options_.notSupportedMessage) }); + }, 0); + return; + } + + // intial sources + this.cache_.sources = sources; + this.changingSrc_ = true; + + // intial source + this.cache_.source = sources[0]; + + // middlewareSource is the source after it has been changed by middleware + middleware.setSource(this, sources[0], function (middlewareSource, mws) { + _this6.middleware_ = mws; + + var err = _this6.src_(middlewareSource); + + if (err) { + if (sources.length > 1) { + return _this6.src(sources.slice(1)); + } + + // We need to wrap this in a timeout to give folks a chance to add error event handlers + _this6.setTimeout(function () { + this.error({ code: 4, message: this.localize(this.options_.notSupportedMessage) }); + }, 0); + + // we could not find an appropriate tech, but let's still notify the delegate that this is it + // this needs a better comment about why this is needed + _this6.triggerReady(); + + return; + } + + _this6.changingSrc_ = false; + // video element listed source + _this6.cache_.src = middlewareSource.src; + + middleware.setTech(mws, _this6.tech_); + }); + }; + + /** + * Set the source object on the tech, returns a boolean that indicates wether + * there is a tech that can play the source or not + * + * @param {Tech~SourceObject} source + * The source object to set on the Tech + * + * @return {Boolean} + * - True if there is no Tech to playback this source + * - False otherwise + * + * @private + */ + + + Player.prototype.src_ = function src_(source) { + var sourceTech = this.selectSource([source]); + + if (!sourceTech) { + return true; + } + + if (!(0, _toTitleCase.titleCaseEquals)(sourceTech.tech, this.techName_)) { + this.changingSrc_ = true; + + // load this technology with the chosen source + this.loadTech_(sourceTech.tech, sourceTech.source); + return false; + } + + // wait until the tech is ready to set the source + this.ready(function () { + + // The setSource tech method was added with source handlers + // so older techs won't support it + // We need to check the direct prototype for the case where subclasses + // of the tech do not support source handlers + if (this.tech_.constructor.prototype.hasOwnProperty('setSource')) { + this.techCall_('setSource', source); + } else { + this.techCall_('src', source.src); + } + + if (this.options_.preload === 'auto') { + this.load(); + } + + if (this.options_.autoplay) { + this.play(); + } + + // Set the source synchronously if possible (#2326) + }, true); + + return false; + }; + + /** + * Begin loading the src data. + */ + + + Player.prototype.load = function load() { + this.techCall_('load'); + }; + + /** + * Reset the player. Loads the first tech in the techOrder, + * and calls `reset` on the tech`. + */ + + + Player.prototype.reset = function reset() { + this.loadTech_(this.options_.techOrder[0], null); + this.techCall_('reset'); + }; + + /** + * Returns all of the current source objects. + * + * @return {Tech~SourceObject[]} + * The current source objects + */ + + + Player.prototype.currentSources = function currentSources() { + var source = this.currentSource(); + var sources = []; + + // assume `{}` or `{ src }` + if (Object.keys(source).length !== 0) { + sources.push(source); + } + + return this.cache_.sources || sources; + }; + + /** + * Returns the current source object. + * + * @return {Tech~SourceObject} + * The current source object + */ + + + Player.prototype.currentSource = function currentSource() { + return this.cache_.source || {}; + }; + + /** + * Returns the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4 + * Can be used in conjuction with `currentType` to assist in rebuilding the current source object. + * + * @return {string} + * The current source + */ + + + Player.prototype.currentSrc = function currentSrc() { + return this.currentSource() && this.currentSource().src || ''; + }; + + /** + * Get the current source type e.g. video/mp4 + * This can allow you rebuild the current source object so that you could load the same + * source and tech later + * + * @return {string} + * The source MIME type + */ + + + Player.prototype.currentType = function currentType() { + return this.currentSource() && this.currentSource().type || ''; + }; + + /** + * Get or set the preload attribute + * + * @param {boolean} [value] + * - true means that we should preload + * - false maens that we should not preload + * + * @return {string} + * The preload attribute value when getting + */ + + + Player.prototype.preload = function preload(value) { + if (value !== undefined) { + this.techCall_('setPreload', value); + this.options_.preload = value; + return; + } + return this.techGet_('preload'); + }; + + /** + * Get or set the autoplay attribute. + * + * @param {boolean} [value] + * - true means that we should autoplay + * - false means that we should not autoplay + * + * @return {string} + * The current value of autoplay when getting + */ + + + Player.prototype.autoplay = function autoplay(value) { + if (value !== undefined) { + this.techCall_('setAutoplay', value); + this.options_.autoplay = value; + return; + } + return this.techGet_('autoplay', value); + }; + + /** + * Set or unset the playsinline attribute. + * Playsinline tells the browser that non-fullscreen playback is preferred. + * + * @param {boolean} [value] + * - true means that we should try to play inline by default + * - false means that we should use the browser's default playback mode, + * which in most cases is inline. iOS Safari is a notable exception + * and plays fullscreen by default. + * + * @return {string|Player} + * - the current value of playsinline + * - the player when setting + * + * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline} + */ + + + Player.prototype.playsinline = function playsinline(value) { + if (value !== undefined) { + this.techCall_('setPlaysinline', value); + this.options_.playsinline = value; + return this; + } + return this.techGet_('playsinline'); + }; + + /** + * Get or set the loop attribute on the video element. + * + * @param {boolean} [value] + * - true means that we should loop the video + * - false means that we should not loop the video + * + * @return {string} + * The current value of loop when getting + */ + + + Player.prototype.loop = function loop(value) { + if (value !== undefined) { + this.techCall_('setLoop', value); + this.options_.loop = value; + return; + } + return this.techGet_('loop'); + }; + + /** + * Get or set the poster image source url + * + * @fires Player#posterchange + * + * @param {string} [src] + * Poster image source URL + * + * @return {string} + * The current value of poster when getting + */ + + + Player.prototype.poster = function poster(src) { + if (src === undefined) { + return this.poster_; + } + + // The correct way to remove a poster is to set as an empty string + // other falsey values will throw errors + if (!src) { + src = ''; + } + + // update the internal poster variable + this.poster_ = src; + + // update the tech's poster + this.techCall_('setPoster', src); + + // alert components that the poster has been set + /** + * This event fires when the poster image is changed on the player. + * + * @event Player#posterchange + * @type {EventTarget~Event} + */ + this.trigger('posterchange'); + }; + + /** + * Some techs (e.g. YouTube) can provide a poster source in an + * asynchronous way. We want the poster component to use this + * poster source so that it covers up the tech's controls. + * (YouTube's play button). However we only want to use this + * source if the player user hasn't set a poster through + * the normal APIs. + * + * @fires Player#posterchange + * @listens Tech#posterchange + * @private + */ + + + Player.prototype.handleTechPosterChange_ = function handleTechPosterChange_() { + if (!this.poster_ && this.tech_ && this.tech_.poster) { + this.poster_ = this.tech_.poster() || ''; + + // Let components know the poster has changed + this.trigger('posterchange'); + } + }; + + /** + * Get or set whether or not the controls are showing. + * + * @fires Player#controlsenabled + * + * @param {boolean} [bool] + * - true to turn controls on + * - false to turn controls off + * + * @return {boolean} + * The current value of controls when getting + */ + + + Player.prototype.controls = function controls(bool) { + if (bool !== undefined) { + bool = !!bool; + + // Don't trigger a change event unless it actually changed + if (this.controls_ !== bool) { + this.controls_ = bool; + + if (this.usingNativeControls()) { + this.techCall_('setControls', bool); + } + + if (bool) { + this.removeClass('vjs-controls-disabled'); + this.addClass('vjs-controls-enabled'); + /** + * @event Player#controlsenabled + * @type {EventTarget~Event} + */ + this.trigger('controlsenabled'); + + if (!this.usingNativeControls()) { + this.addTechControlsListeners_(); + } + } else { + this.removeClass('vjs-controls-enabled'); + this.addClass('vjs-controls-disabled'); + /** + * @event Player#controlsdisabled + * @type {EventTarget~Event} + */ + this.trigger('controlsdisabled'); + + if (!this.usingNativeControls()) { + this.removeTechControlsListeners_(); + } + } + } + return; + } + return !!this.controls_; + }; + + /** + * Toggle native controls on/off. Native controls are the controls built into + * devices (e.g. default iPhone controls), Flash, or other techs + * (e.g. Vimeo Controls) + * **This should only be set by the current tech, because only the tech knows + * if it can support native controls** + * + * @fires Player#usingnativecontrols + * @fires Player#usingcustomcontrols + * + * @param {boolean} [bool] + * - true to turn native controls on + * - false to turn native controls off + * + * @return {boolean} + * The current value of native controls when getting + */ + + + Player.prototype.usingNativeControls = function usingNativeControls(bool) { + if (bool !== undefined) { + bool = !!bool; + + // Don't trigger a change event unless it actually changed + if (this.usingNativeControls_ !== bool) { + this.usingNativeControls_ = bool; + if (bool) { + this.addClass('vjs-using-native-controls'); + + /** + * player is using the native device controls + * + * @event Player#usingnativecontrols + * @type {EventTarget~Event} + */ + this.trigger('usingnativecontrols'); + } else { + this.removeClass('vjs-using-native-controls'); + + /** + * player is using the custom HTML controls + * + * @event Player#usingcustomcontrols + * @type {EventTarget~Event} + */ + this.trigger('usingcustomcontrols'); + } + } + return; + } + return !!this.usingNativeControls_; + }; + + /** + * Set or get the current MediaError + * + * @fires Player#error + * + * @param {MediaError|string|number} [err] + * A MediaError or a string/number to be turned + * into a MediaError + * + * @return {MediaError|null} + * The current MediaError when getting (or null) + */ + + + Player.prototype.error = function error(err) { + if (err === undefined) { + return this.error_ || null; + } + + // restoring to default + if (err === null) { + this.error_ = err; + this.removeClass('vjs-error'); + if (this.errorDisplay) { + this.errorDisplay.close(); + } + return; + } + + this.error_ = new _mediaError2['default'](err); + + // add the vjs-error classname to the player + this.addClass('vjs-error'); + + // log the name of the error type and any message + // ie8 just logs "[object object]" if you just log the error object + _log2['default'].error('(CODE:' + this.error_.code + ' ' + _mediaError2['default'].errorTypes[this.error_.code] + ')', this.error_.message, this.error_); + + /** + * @event Player#error + * @type {EventTarget~Event} + */ + this.trigger('error'); + + return; + }; + + /** + * Report user activity + * + * @param {Object} event + * Event object + */ + + + Player.prototype.reportUserActivity = function reportUserActivity(event) { + this.userActivity_ = true; + }; + + /** + * Get/set if user is active + * + * @fires Player#useractive + * @fires Player#userinactive + * + * @param {boolean} [bool] + * - true if the user is active + * - false if the user is inactive + * + * @return {boolean} + * The current value of userActive when getting + */ + + + Player.prototype.userActive = function userActive(bool) { + if (bool !== undefined) { + bool = !!bool; + if (bool !== this.userActive_) { + this.userActive_ = bool; + if (bool) { + // If the user was inactive and is now active we want to reset the + // inactivity timer + this.userActivity_ = true; + this.removeClass('vjs-user-inactive'); + this.addClass('vjs-user-active'); + /** + * @event Player#useractive + * @type {EventTarget~Event} + */ + this.trigger('useractive'); + } else { + // We're switching the state to inactive manually, so erase any other + // activity + this.userActivity_ = false; + + // Chrome/Safari/IE have bugs where when you change the cursor it can + // trigger a mousemove event. This causes an issue when you're hiding + // the cursor when the user is inactive, and a mousemove signals user + // activity. Making it impossible to go into inactive mode. Specifically + // this happens in fullscreen when we really need to hide the cursor. + // + // When this gets resolved in ALL browsers it can be removed + // https://code.google.com/p/chromium/issues/detail?id=103041 + if (this.tech_) { + this.tech_.one('mousemove', function (e) { + e.stopPropagation(); + e.preventDefault(); + }); + } + + this.removeClass('vjs-user-active'); + this.addClass('vjs-user-inactive'); + /** + * @event Player#userinactive + * @type {EventTarget~Event} + */ + this.trigger('userinactive'); + } + } + return; + } + return this.userActive_; + }; + + /** + * Listen for user activity based on timeout value + * + * @private + */ + + + Player.prototype.listenForUserActivity_ = function listenForUserActivity_() { + var mouseInProgress = void 0; + var lastMoveX = void 0; + var lastMoveY = void 0; + var handleActivity = Fn.bind(this, this.reportUserActivity); + + var handleMouseMove = function handleMouseMove(e) { + // #1068 - Prevent mousemove spamming + // Chrome Bug: https://code.google.com/p/chromium/issues/detail?id=366970 + if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) { + lastMoveX = e.screenX; + lastMoveY = e.screenY; + handleActivity(); + } + }; + + var handleMouseDown = function handleMouseDown() { + handleActivity(); + // For as long as the they are touching the device or have their mouse down, + // we consider them active even if they're not moving their finger or mouse. + // So we want to continue to update that they are active + this.clearInterval(mouseInProgress); + // Setting userActivity=true now and setting the interval to the same time + // as the activityCheck interval (250) should ensure we never miss the + // next activityCheck + mouseInProgress = this.setInterval(handleActivity, 250); + }; + + var handleMouseUp = function handleMouseUp(event) { + handleActivity(); + // Stop the interval that maintains activity if the mouse/touch is down + this.clearInterval(mouseInProgress); + }; + + // Any mouse movement will be considered user activity + this.on('mousedown', handleMouseDown); + this.on('mousemove', handleMouseMove); + this.on('mouseup', handleMouseUp); + + // Listen for keyboard navigation + // Shouldn't need to use inProgress interval because of key repeat + this.on('keydown', handleActivity); + this.on('keyup', handleActivity); + + // Run an interval every 250 milliseconds instead of stuffing everything into + // the mousemove/touchmove function itself, to prevent performance degradation. + // `this.reportUserActivity` simply sets this.userActivity_ to true, which + // then gets picked up by this loop + // http://ejohn.org/blog/learning-from-twitter/ + var inactivityTimeout = void 0; + + this.setInterval(function () { + // Check to see if mouse/touch activity has happened + if (this.userActivity_) { + // Reset the activity tracker + this.userActivity_ = false; + + // If the user state was inactive, set the state to active + this.userActive(true); + + // Clear any existing inactivity timeout to start the timer over + this.clearTimeout(inactivityTimeout); + + var timeout = this.options_.inactivityTimeout; + + if (timeout > 0) { + // In milliseconds, if no more activity has occurred the + // user will be considered inactive + inactivityTimeout = this.setTimeout(function () { + // Protect against the case where the inactivityTimeout can trigger just + // before the next user activity is picked up by the activity check loop + // causing a flicker + if (!this.userActivity_) { + this.userActive(false); + } + }, timeout); + } + } + }, 250); + }; + + /** + * Gets or sets the current playback rate. A playback rate of + * 1.0 represents normal speed and 0.5 would indicate half-speed + * playback, for instance. + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-playbackrate + * + * @param {number} [rate] + * New playback rate to set. + * + * @return {number} + * The current playback rate when getting or 1.0 + */ + + + Player.prototype.playbackRate = function playbackRate(rate) { + if (rate !== undefined) { + this.techCall_('setPlaybackRate', rate); + return; + } + + if (this.tech_ && this.tech_.featuresPlaybackRate) { + return this.techGet_('playbackRate'); + } + return 1.0; + }; + + /** + * Gets or sets the current default playback rate. A default playback rate of + * 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance. + * defaultPlaybackRate will only represent what the intial playbackRate of a video was, not + * not the current playbackRate. + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-defaultplaybackrate + * + * @param {number} [rate] + * New default playback rate to set. + * + * @return {number|Player} + * - The default playback rate when getting or 1.0 + * - the player when setting + */ + + + Player.prototype.defaultPlaybackRate = function defaultPlaybackRate(rate) { + if (rate !== undefined) { + return this.techCall_('setDefaultPlaybackRate', rate); + } + + if (this.tech_ && this.tech_.featuresPlaybackRate) { + return this.techGet_('defaultPlaybackRate'); + } + return 1.0; + }; + + /** + * Gets or sets the audio flag + * + * @param {boolean} bool + * - true signals that this is an audio player + * - false signals that this is not an audio player + * + * @return {boolean} + * The current value of isAudio when getting + */ + + + Player.prototype.isAudio = function isAudio(bool) { + if (bool !== undefined) { + this.isAudio_ = !!bool; + return; + } + + return !!this.isAudio_; + }; + + /** + * A helper method for adding a {@link TextTrack} to our + * {@link TextTrackList}. + * + * In addition to the W3C settings we allow adding additional info through options. + * + * @see http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack + * + * @param {string} [kind] + * the kind of TextTrack you are adding + * + * @param {string} [label] + * the label to give the TextTrack label + * + * @param {string} [language] + * the language to set on the TextTrack + * + * @return {TextTrack|undefined} + * the TextTrack that was added or undefined + * if there is no tech + */ + + + Player.prototype.addTextTrack = function addTextTrack(kind, label, language) { + if (this.tech_) { + return this.tech_.addTextTrack(kind, label, language); + } + }; + + /** + * Create a remote {@link TextTrack} and an {@link HTMLTrackElement}. It will + * automatically removed from the video element whenever the source changes, unless + * manualCleanup is set to false. + * + * @param {Object} options + * Options to pass to {@link HTMLTrackElement} during creation. See + * {@link HTMLTrackElement} for object properties that you should use. + * + * @param {boolean} [manualCleanup=true] if set to false, the TextTrack will be + * + * @return {HtmlTrackElement} + * the HTMLTrackElement that was created and added + * to the HtmlTrackElementList and the remote + * TextTrackList + * + * @deprecated The default value of the "manualCleanup" parameter will default + * to "false" in upcoming versions of Video.js + */ + + + Player.prototype.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { + if (this.tech_) { + return this.tech_.addRemoteTextTrack(options, manualCleanup); + } + }; + + /** + * Remove a remote {@link TextTrack} from the respective + * {@link TextTrackList} and {@link HtmlTrackElementList}. + * + * @param {Object} track + * Remote {@link TextTrack} to remove + * + * @return {undefined} + * does not return anything + */ + + + Player.prototype.removeRemoteTextTrack = function removeRemoteTextTrack() { + var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref3$track = _ref3.track, + track = _ref3$track === undefined ? arguments[0] : _ref3$track; + + // destructure the input into an object with a track argument, defaulting to arguments[0] + // default the whole argument to an empty object if nothing was passed in + + if (this.tech_) { + return this.tech_.removeRemoteTextTrack(track); + } + }; + + /** + * Gets available media playback quality metrics as specified by the W3C's Media + * Playback Quality API. + * + * @see [Spec]{@link https://wicg.github.io/media-playback-quality} + * + * @return {Object|undefined} + * An object with supported media playback quality metrics or undefined if there + * is no tech or the tech does not support it. + */ + + + Player.prototype.getVideoPlaybackQuality = function getVideoPlaybackQuality() { + return this.techGet_('getVideoPlaybackQuality'); + }; + + /** + * Get video width + * + * @return {number} + * current video width + */ + + + Player.prototype.videoWidth = function videoWidth() { + return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0; + }; + + /** + * Get video height + * + * @return {number} + * current video height + */ + + + Player.prototype.videoHeight = function videoHeight() { + return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0; + }; + + /** + * The player's language code + * NOTE: The language should be set in the player options if you want the + * the controls to be built with a specific language. Changing the lanugage + * later will not update controls text. + * + * @param {string} [code] + * the language code to set the player to + * + * @return {string} + * The current language code when getting + */ + + + Player.prototype.language = function language(code) { + if (code === undefined) { + return this.language_; + } + + this.language_ = String(code).toLowerCase(); + }; + + /** + * Get the player's language dictionary + * Merge every time, because a newly added plugin might call videojs.addLanguage() at any time + * Languages specified directly in the player options have precedence + * + * @return {Array} + * An array of of supported languages + */ + + + Player.prototype.languages = function languages() { + return (0, _mergeOptions2['default'])(Player.prototype.options_.languages, this.languages_); + }; + + /** + * returns a JavaScript object reperesenting the current track + * information. **DOES not return it as JSON** + * + * @return {Object} + * Object representing the current of track info + */ + + + Player.prototype.toJSON = function toJSON() { + var options = (0, _mergeOptions2['default'])(this.options_); + var tracks = options.tracks; + + options.tracks = []; + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + // deep merge tracks and null out player so no circular references + track = (0, _mergeOptions2['default'])(track); + track.player = undefined; + options.tracks[i] = track; + } + + return options; + }; + + /** + * Creates a simple modal dialog (an instance of the {@link ModalDialog} + * component) that immediately overlays the player with arbitrary + * content and removes itself when closed. + * + * @param {string|Function|Element|Array|null} content + * Same as {@link ModalDialog#content}'s param of the same name. + * The most straight-forward usage is to provide a string or DOM + * element. + * + * @param {Object} [options] + * Extra options which will be passed on to the {@link ModalDialog}. + * + * @return {ModalDialog} + * the {@link ModalDialog} that was created + */ + + + Player.prototype.createModal = function createModal(content, options) { + var _this7 = this; + + options = options || {}; + options.content = content || ''; + + var modal = new _modalDialog2['default'](this, options); + + this.addChild(modal); + modal.on('dispose', function () { + _this7.removeChild(modal); + }); + + modal.open(); + return modal; + }; + + /** + * Gets tag settings + * + * @param {Element} tag + * The player tag + * + * @return {Object} + * An object containing all of the settings + * for a player tag + */ + + + Player.getTagSettings = function getTagSettings(tag) { + var baseOptions = { + sources: [], + tracks: [] + }; + + var tagOptions = Dom.getAttributes(tag); + var dataSetup = tagOptions['data-setup']; + + if (Dom.hasClass(tag, 'vjs-fluid')) { + tagOptions.fluid = true; + } + + // Check if data-setup attr exists. + if (dataSetup !== null) { + // Parse options JSON + // If empty string, make it a parsable json object. + var _safeParseTuple = (0, _tuple2['default'])(dataSetup || '{}'), + err = _safeParseTuple[0], + data = _safeParseTuple[1]; + + if (err) { + _log2['default'].error(err); + } + (0, _obj.assign)(tagOptions, data); + } + + (0, _obj.assign)(baseOptions, tagOptions); + + // Get tag children settings + if (tag.hasChildNodes()) { + var children = tag.childNodes; + + for (var i = 0, j = children.length; i < j; i++) { + var child = children[i]; + // Change case needed: http://ejohn.org/blog/nodename-case-sensitivity/ + var childName = child.nodeName.toLowerCase(); + + if (childName === 'source') { + baseOptions.sources.push(Dom.getAttributes(child)); + } else if (childName === 'track') { + baseOptions.tracks.push(Dom.getAttributes(child)); + } + } + } + + return baseOptions; + }; + + /** + * Determine wether or not flexbox is supported + * + * @return {boolean} + * - true if flexbox is supported + * - false if flexbox is not supported + */ + + + Player.prototype.flexNotSupported_ = function flexNotSupported_() { + var elem = _document2['default'].createElement('i'); + + // Note: We don't actually use flexBasis (or flexOrder), but it's one of the more + // common flex features that we can rely on when checking for flex support. + return !('flexBasis' in elem.style || 'webkitFlexBasis' in elem.style || 'mozFlexBasis' in elem.style || 'msFlexBasis' in elem.style || + // IE10-specific (2012 flex spec) + 'msFlexOrder' in elem.style); + }; + + return Player; +}(_component2['default']); + +/** + * Get the {@link VideoTrackList} + * @link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist + * + * @return {VideoTrackList} + * the current video track list + * + * @method Player.prototype.videoTracks + */ + +/** + * Get the {@link AudioTrackList} + * @link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist + * + * @return {AudioTrackList} + * the current audio track list + * + * @method Player.prototype.audioTracks + */ + +/** + * Get the {@link TextTrackList} + * + * @link http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks + * + * @return {TextTrackList} + * the current text track list + * + * @method Player.prototype.textTracks + */ + +/** + * Get the remote {@link TextTrackList} + * + * @return {TextTrackList} + * The current remote text track list + * + * @method Player.prototype.textTracks + */ + +/** + * Get the remote {@link HtmlTrackElementList} tracks. + * + * @return {HtmlTrackElementList} + * The current remote text track element list + * + * @method Player.prototype.remoteTextTrackEls + */ + +_trackTypes.ALL.names.forEach(function (name) { + var props = _trackTypes.ALL[name]; + + Player.prototype[props.getterName] = function () { + if (this.tech_) { + return this.tech_[props.getterName](); + } + + // if we have not yet loadTech_, we create {video,audio,text}Tracks_ + // these will be passed to the tech during loading + this[props.privateName] = this[props.privateName] || new props.ListClass(); + return this[props.privateName]; + }; +}); + +/** + * Global player list + * + * @type {Object} + */ +Player.players = {}; + +var navigator = _window2['default'].navigator; + +/* + * Player instance options, surfaced using options + * options = Player.prototype.options_ + * Make changes in options, not here. + * + * @type {Object} + * @private + */ +Player.prototype.options_ = { + // Default order of fallback technology + techOrder: _tech2['default'].defaultTechOrder_, + + html5: {}, + flash: {}, + + // default inactivity timeout + inactivityTimeout: 2000, + + // default playback rates + playbackRates: [], + // Add playback rate selection by adding rates + // 'playbackRates': [0.5, 1, 1.5, 2], + + // Included control sets + children: ['mediaLoader', 'posterImage', 'textTrackDisplay', 'loadingSpinner', 'bigPlayButton', 'controlBar', 'errorDisplay', 'textTrackSettings'], + + language: navigator && (navigator.languages && navigator.languages[0] || navigator.userLanguage || navigator.language) || 'en', + + // locales and their language translations + languages: {}, + + // Default message to show when a video cannot be played. + notSupportedMessage: 'No compatible source was found for this media.' +}; + +[ +/** + * Returns whether or not the player is in the "ended" state. + * + * @return {Boolean} True if the player is in the ended state, false if not. + * @method Player#ended + */ +'ended', +/** + * Returns whether or not the player is in the "seeking" state. + * + * @return {Boolean} True if the player is in the seeking state, false if not. + * @method Player#seeking + */ +'seeking', +/** + * Returns the TimeRanges of the media that are currently available + * for seeking to. + * + * @return {TimeRanges} the seekable intervals of the media timeline + * @method Player#seekable + */ +'seekable', +/** + * Returns the current state of network activity for the element, from + * the codes in the list below. + * - NETWORK_EMPTY (numeric value 0) + * The element has not yet been initialised. All attributes are in + * their initial states. + * - NETWORK_IDLE (numeric value 1) + * The element's resource selection algorithm is active and has + * selected a resource, but it is not actually using the network at + * this time. + * - NETWORK_LOADING (numeric value 2) + * The user agent is actively trying to download data. + * - NETWORK_NO_SOURCE (numeric value 3) + * The element's resource selection algorithm is active, but it has + * not yet found a resource to use. + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#network-states + * @return {number} the current network activity state + * @method Player#networkState + */ +'networkState', +/** + * Returns a value that expresses the current state of the element + * with respect to rendering the current playback position, from the + * codes in the list below. + * - HAVE_NOTHING (numeric value 0) + * No information regarding the media resource is available. + * - HAVE_METADATA (numeric value 1) + * Enough of the resource has been obtained that the duration of the + * resource is available. + * - HAVE_CURRENT_DATA (numeric value 2) + * Data for the immediate current playback position is available. + * - HAVE_FUTURE_DATA (numeric value 3) + * Data for the immediate current playback position is available, as + * well as enough data for the user agent to advance the current + * playback position in the direction of playback. + * - HAVE_ENOUGH_DATA (numeric value 4) + * The user agent estimates that enough data is available for + * playback to proceed uninterrupted. + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-readystate + * @return {number} the current playback rendering state + * @method Player#readyState + */ +'readyState'].forEach(function (fn) { + Player.prototype[fn] = function () { + return this.techGet_(fn); + }; +}); + +TECH_EVENTS_RETRIGGER.forEach(function (event) { + Player.prototype['handleTech' + (0, _toTitleCase2['default'])(event) + '_'] = function () { + return this.trigger(event); + }; +}); + +/** + * Fired when the player has initial duration and dimension information + * + * @event Player#loadedmetadata + * @type {EventTarget~Event} + */ + +/** + * Fired when the player has downloaded data at the current playback position + * + * @event Player#loadeddata + * @type {EventTarget~Event} + */ + +/** + * Fired when the current playback position has changed * + * During playback this is fired every 15-250 milliseconds, depending on the + * playback technology in use. + * + * @event Player#timeupdate + * @type {EventTarget~Event} + */ + +/** + * Fired when the volume changes + * + * @event Player#volumechange + * @type {EventTarget~Event} + */ + +/** + * Reports whether or not a player has a plugin available. + * + * This does not report whether or not the plugin has ever been initialized + * on this player. For that, [usingPlugin]{@link Player#usingPlugin}. + * + * @method Player#hasPlugin + * @param {string} name + * The name of a plugin. + * + * @return {boolean} + * Whether or not this player has the requested plugin available. + */ + +/** + * Reports whether or not a player is using a plugin by name. + * + * For basic plugins, this only reports whether the plugin has _ever_ been + * initialized on this player. + * + * @method Player#usingPlugin + * @param {string} name + * The name of a plugin. + * + * @return {boolean} + * Whether or not this player is using the requested plugin. + */ + +_component2['default'].registerComponent('Player', Player); +exports['default'] = Player; + +},{"1":1,"100":100,"102":102,"103":103,"4":4,"44":44,"47":47,"48":48,"49":49,"5":5,"53":53,"55":55,"58":58,"61":61,"62":62,"63":63,"64":64,"70":70,"71":71,"73":73,"77":77,"8":8,"81":81,"82":82,"85":85,"86":86,"87":87,"88":88,"90":90,"91":91,"92":92,"93":93,"94":94,"95":95,"96":96,"99":99}],57:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _evented = _dereq_(53); + +var _evented2 = _interopRequireDefault(_evented); + +var _stateful = _dereq_(54); + +var _stateful2 = _interopRequireDefault(_stateful); + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _log = _dereq_(91); + +var _log2 = _interopRequireDefault(_log); + +var _player = _dereq_(56); + +var _player2 = _interopRequireDefault(_player); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** + * @file plugin.js + */ + + +/** + * The base plugin name. + * + * @private + * @constant + * @type {string} + */ +var BASE_PLUGIN_NAME = 'plugin'; + +/** + * The key on which a player's active plugins cache is stored. + * + * @private + * @constant + * @type {string} + */ +var PLUGIN_CACHE_KEY = 'activePlugins_'; + +/** + * Stores registered plugins in a private space. + * + * @private + * @type {Object} + */ +var pluginStorage = {}; + +/** + * Reports whether or not a plugin has been registered. + * + * @private + * @param {string} name + * The name of a plugin. + * + * @returns {boolean} + * Whether or not the plugin has been registered. + */ +var pluginExists = function pluginExists(name) { + return pluginStorage.hasOwnProperty(name); +}; + +/** + * Get a single registered plugin by name. + * + * @private + * @param {string} name + * The name of a plugin. + * + * @returns {Function|undefined} + * The plugin (or undefined). + */ +var getPlugin = function getPlugin(name) { + return pluginExists(name) ? pluginStorage[name] : undefined; +}; + +/** + * Marks a plugin as "active" on a player. + * + * Also, ensures that the player has an object for tracking active plugins. + * + * @private + * @param {Player} player + * A Video.js player instance. + * + * @param {string} name + * The name of a plugin. + */ +var markPluginAsActive = function markPluginAsActive(player, name) { + player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {}; + player[PLUGIN_CACHE_KEY][name] = true; +}; + +/** + * Triggers a pair of plugin setup events. + * + * @private + * @param {Player} player + * A Video.js player instance. + * + * @param {Plugin~PluginEventHash} hash + * A plugin event hash. + * + * @param {Boolean} [before] + * If true, prefixes the event name with "before". In other words, + * use this to trigger "beforepluginsetup" instead of "pluginsetup". + */ +var triggerSetupEvent = function triggerSetupEvent(player, hash, before) { + var eventName = (before ? 'before' : '') + 'pluginsetup'; + + player.trigger(eventName, hash); + player.trigger(eventName + ':' + hash.name, hash); +}; + +/** + * Takes a basic plugin function and returns a wrapper function which marks + * on the player that the plugin has been activated. + * + * @private + * @param {string} name + * The name of the plugin. + * + * @param {Function} plugin + * The basic plugin. + * + * @returns {Function} + * A wrapper function for the given plugin. + */ +var createBasicPlugin = function createBasicPlugin(name, plugin) { + var basicPluginWrapper = function basicPluginWrapper() { + + // We trigger the "beforepluginsetup" and "pluginsetup" events on the player + // regardless, but we want the hash to be consistent with the hash provided + // for advanced plugins. + // + // The only potentially counter-intuitive thing here is the `instance` in + // the "pluginsetup" event is the value returned by the `plugin` function. + triggerSetupEvent(this, { name: name, plugin: plugin, instance: null }, true); + + var instance = plugin.apply(this, arguments); + + markPluginAsActive(this, name); + triggerSetupEvent(this, { name: name, plugin: plugin, instance: instance }); + + return instance; + }; + + Object.keys(plugin).forEach(function (prop) { + basicPluginWrapper[prop] = plugin[prop]; + }); + + return basicPluginWrapper; +}; + +/** + * Takes a plugin sub-class and returns a factory function for generating + * instances of it. + * + * This factory function will replace itself with an instance of the requested + * sub-class of Plugin. + * + * @private + * @param {string} name + * The name of the plugin. + * + * @param {Plugin} PluginSubClass + * The advanced plugin. + * + * @returns {Function} + */ +var createPluginFactory = function createPluginFactory(name, PluginSubClass) { + + // Add a `name` property to the plugin prototype so that each plugin can + // refer to itself by name. + PluginSubClass.prototype.name = name; + + return function () { + triggerSetupEvent(this, { name: name, plugin: PluginSubClass, instance: null }, true); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var instance = new (Function.prototype.bind.apply(PluginSubClass, [null].concat([this].concat(args))))(); + + // The plugin is replaced by a function that returns the current instance. + this[name] = function () { + return instance; + }; + + triggerSetupEvent(this, instance.getEventHash()); + + return instance; + }; +}; + +/** + * Parent class for all advanced plugins. + * + * @mixes module:evented~EventedMixin + * @mixes module:stateful~StatefulMixin + * @fires Player#beforepluginsetup + * @fires Player#beforepluginsetup:$name + * @fires Player#pluginsetup + * @fires Player#pluginsetup:$name + * @listens Player#dispose + * @throws {Error} + * If attempting to instantiate the base {@link Plugin} class + * directly instead of via a sub-class. + */ + +var Plugin = function () { + + /** + * Creates an instance of this class. + * + * Sub-classes should call `super` to ensure plugins are properly initialized. + * + * @param {Player} player + * A Video.js player instance. + */ + function Plugin(player) { + _classCallCheck(this, Plugin); + + if (this.constructor === Plugin) { + throw new Error('Plugin must be sub-classed; not directly instantiated.'); + } + + this.player = player; + + // Make this object evented, but remove the added `trigger` method so we + // use the prototype version instead. + (0, _evented2['default'])(this); + delete this.trigger; + + (0, _stateful2['default'])(this, this.constructor.defaultState); + markPluginAsActive(player, this.name); + + // Auto-bind the dispose method so we can use it as a listener and unbind + // it later easily. + this.dispose = Fn.bind(this, this.dispose); + + // If the player is disposed, dispose the plugin. + player.on('dispose', this.dispose); + } + + /** + * Each event triggered by plugins includes a hash of additional data with + * conventional properties. + * + * This returns that object or mutates an existing hash. + * + * @param {Object} [hash={}] + * An object to be used as event an event hash. + * + * @returns {Plugin~PluginEventHash} + * An event hash object with provided properties mixed-in. + */ + + + Plugin.prototype.getEventHash = function getEventHash() { + var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + hash.name = this.name; + hash.plugin = this.constructor; + hash.instance = this; + return hash; + }; + + /** + * Triggers an event on the plugin object and overrides + * {@link module:evented~EventedMixin.trigger|EventedMixin.trigger}. + * + * @param {string|Object} event + * An event type or an object with a type property. + * + * @param {Object} [hash={}] + * Additional data hash to merge with a + * {@link Plugin~PluginEventHash|PluginEventHash}. + * + * @returns {boolean} + * Whether or not default was prevented. + */ + + + Plugin.prototype.trigger = function trigger(event) { + var hash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + return Events.trigger(this.eventBusEl_, event, this.getEventHash(hash)); + }; + + /** + * Handles "statechanged" events on the plugin. No-op by default, override by + * subclassing. + * + * @abstract + * @param {Event} e + * An event object provided by a "statechanged" event. + * + * @param {Object} e.changes + * An object describing changes that occurred with the "statechanged" + * event. + */ + + + Plugin.prototype.handleStateChanged = function handleStateChanged(e) {}; + + /** + * Disposes a plugin. + * + * Subclasses can override this if they want, but for the sake of safety, + * it's probably best to subscribe the "dispose" event. + * + * @fires Plugin#dispose + */ + + + Plugin.prototype.dispose = function dispose() { + var name = this.name, + player = this.player; + + /** + * Signals that a advanced plugin is about to be disposed. + * + * @event Plugin#dispose + * @type {EventTarget~Event} + */ + + this.trigger('dispose'); + this.off(); + player.off('dispose', this.dispose); + + // Eliminate any possible sources of leaking memory by clearing up + // references between the player and the plugin instance and nulling out + // the plugin's state and replacing methods with a function that throws. + player[PLUGIN_CACHE_KEY][name] = false; + this.player = this.state = null; + + // Finally, replace the plugin name on the player with a new factory + // function, so that the plugin is ready to be set up again. + player[name] = createPluginFactory(name, pluginStorage[name]); + }; + + /** + * Determines if a plugin is a basic plugin (i.e. not a sub-class of `Plugin`). + * + * @param {string|Function} plugin + * If a string, matches the name of a plugin. If a function, will be + * tested directly. + * + * @returns {boolean} + * Whether or not a plugin is a basic plugin. + */ + + + Plugin.isBasic = function isBasic(plugin) { + var p = typeof plugin === 'string' ? getPlugin(plugin) : plugin; + + return typeof p === 'function' && !Plugin.prototype.isPrototypeOf(p.prototype); + }; + + /** + * Register a Video.js plugin. + * + * @param {string} name + * The name of the plugin to be registered. Must be a string and + * must not match an existing plugin or a method on the `Player` + * prototype. + * + * @param {Function} plugin + * A sub-class of `Plugin` or a function for basic plugins. + * + * @returns {Function} + * For advanced plugins, a factory function for that plugin. For + * basic plugins, a wrapper function that initializes the plugin. + */ + + + Plugin.registerPlugin = function registerPlugin(name, plugin) { + if (typeof name !== 'string') { + throw new Error('Illegal plugin name, "' + name + '", must be a string, was ' + (typeof name === 'undefined' ? 'undefined' : _typeof(name)) + '.'); + } + + if (pluginExists(name)) { + _log2['default'].warn('A plugin named "' + name + '" already exists. You may want to avoid re-registering plugins!'); + } else if (_player2['default'].prototype.hasOwnProperty(name)) { + throw new Error('Illegal plugin name, "' + name + '", cannot share a name with an existing player method!'); + } + + if (typeof plugin !== 'function') { + throw new Error('Illegal plugin for "' + name + '", must be a function, was ' + (typeof plugin === 'undefined' ? 'undefined' : _typeof(plugin)) + '.'); + } + + pluginStorage[name] = plugin; + + // Add a player prototype method for all sub-classed plugins (but not for + // the base Plugin class). + if (name !== BASE_PLUGIN_NAME) { + if (Plugin.isBasic(plugin)) { + _player2['default'].prototype[name] = createBasicPlugin(name, plugin); + } else { + _player2['default'].prototype[name] = createPluginFactory(name, plugin); + } + } + + return plugin; + }; + + /** + * De-register a Video.js plugin. + * + * @param {string} name + * The name of the plugin to be deregistered. + */ + + + Plugin.deregisterPlugin = function deregisterPlugin(name) { + if (name === BASE_PLUGIN_NAME) { + throw new Error('Cannot de-register base plugin.'); + } + if (pluginExists(name)) { + delete pluginStorage[name]; + delete _player2['default'].prototype[name]; + } + }; + + /** + * Gets an object containing multiple Video.js plugins. + * + * @param {Array} [names] + * If provided, should be an array of plugin names. Defaults to _all_ + * plugin names. + * + * @returns {Object|undefined} + * An object containing plugin(s) associated with their name(s) or + * `undefined` if no matching plugins exist). + */ + + + Plugin.getPlugins = function getPlugins() { + var names = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Object.keys(pluginStorage); + + var result = void 0; + + names.forEach(function (name) { + var plugin = getPlugin(name); + + if (plugin) { + result = result || {}; + result[name] = plugin; + } + }); + + return result; + }; + + /** + * Gets a plugin's version, if available + * + * @param {string} name + * The name of a plugin. + * + * @returns {string} + * The plugin's version or an empty string. + */ + + + Plugin.getPluginVersion = function getPluginVersion(name) { + var plugin = getPlugin(name); + + return plugin && plugin.VERSION || ''; + }; + + return Plugin; +}(); + +/** + * Gets a plugin by name if it exists. + * + * @static + * @method getPlugin + * @memberOf Plugin + * @param {string} name + * The name of a plugin. + * + * @returns {Function|undefined} + * The plugin (or `undefined`). + */ + + +Plugin.getPlugin = getPlugin; + +/** + * The name of the base plugin class as it is registered. + * + * @type {string} + */ +Plugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME; + +Plugin.registerPlugin(BASE_PLUGIN_NAME, Plugin); + +/** + * Documented in player.js + * + * @ignore + */ +_player2['default'].prototype.usingPlugin = function (name) { + return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true; +}; + +/** + * Documented in player.js + * + * @ignore + */ +_player2['default'].prototype.hasPlugin = function (name) { + return !!pluginExists(name); +}; + +exports['default'] = Plugin; + +/** + * Signals that a plugin is about to be set up on a player. + * + * @event Player#beforepluginsetup + * @type {Plugin~PluginEventHash} + */ + +/** + * Signals that a plugin is about to be set up on a player - by name. The name + * is the name of the plugin. + * + * @event Player#beforepluginsetup:$name + * @type {Plugin~PluginEventHash} + */ + +/** + * Signals that a plugin has just been set up on a player. + * + * @event Player#pluginsetup + * @type {Plugin~PluginEventHash} + */ + +/** + * Signals that a plugin has just been set up on a player - by name. The name + * is the name of the plugin. + * + * @event Player#pluginsetup:$name + * @type {Plugin~PluginEventHash} + */ + +/** + * @typedef {Object} Plugin~PluginEventHash + * + * @property {string} instance + * For basic plugins, the return value of the plugin function. For + * advanced plugins, the plugin instance on which the event is fired. + * + * @property {string} name + * The name of the plugin. + * + * @property {string} plugin + * For basic plugins, the plugin function. For advanced plugins, the + * plugin class/constructor. + */ + +},{"53":53,"54":54,"56":56,"86":86,"88":88,"91":91}],58:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _clickableComponent = _dereq_(3); + +var _clickableComponent2 = _interopRequireDefault(_clickableComponent); + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _browser = _dereq_(81); + +var browser = _interopRequireWildcard(_browser); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file poster-image.js + */ + + +/** + * A `ClickableComponent` that handles showing the poster image for the player. + * + * @extends ClickableComponent + */ +var PosterImage = function (_ClickableComponent) { + _inherits(PosterImage, _ClickableComponent); + + /** + * Create an instance of this class. + * + * @param {Player} player + * The `Player` that this class should attach to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function PosterImage(player, options) { + _classCallCheck(this, PosterImage); + + var _this = _possibleConstructorReturn(this, _ClickableComponent.call(this, player, options)); + + _this.update(); + player.on('posterchange', Fn.bind(_this, _this.update)); + return _this; + } + + /** + * Clean up and dispose of the `PosterImage`. + */ + + + PosterImage.prototype.dispose = function dispose() { + this.player().off('posterchange', this.update); + _ClickableComponent.prototype.dispose.call(this); + }; + + /** + * Create the `PosterImage`s DOM element. + * + * @return {Element} + * The element that gets created. + */ + + + PosterImage.prototype.createEl = function createEl() { + var el = Dom.createEl('div', { + className: 'vjs-poster', + + // Don't want poster to be tabbable. + tabIndex: -1 + }); + + // To ensure the poster image resizes while maintaining its original aspect + // ratio, use a div with `background-size` when available. For browsers that + // do not support `background-size` (e.g. IE8), fall back on using a regular + // img element. + if (!browser.BACKGROUND_SIZE_SUPPORTED) { + this.fallbackImg_ = Dom.createEl('img'); + el.appendChild(this.fallbackImg_); + } + + return el; + }; + + /** + * An {@link EventTarget~EventListener} for {@link Player#posterchange} events. + * + * @listens Player#posterchange + * + * @param {EventTarget~Event} [event] + * The `Player#posterchange` event that triggered this function. + */ + + + PosterImage.prototype.update = function update(event) { + var url = this.player().poster(); + + this.setSrc(url); + + // If there's no poster source we should display:none on this component + // so it's not still clickable or right-clickable + if (url) { + this.show(); + } else { + this.hide(); + } + }; + + /** + * Set the source of the `PosterImage` depending on the display method. + * + * @param {string} url + * The URL to the source for the `PosterImage`. + */ + + + PosterImage.prototype.setSrc = function setSrc(url) { + if (this.fallbackImg_) { + this.fallbackImg_.src = url; + } else { + var backgroundImage = ''; + + // Any falsey values should stay as an empty string, otherwise + // this will throw an extra error + if (url) { + backgroundImage = 'url("' + url + '")'; + } + + this.el_.style.backgroundImage = backgroundImage; + } + }; + + /** + * An {@link EventTarget~EventListener} for clicks on the `PosterImage`. See + * {@link ClickableComponent#handleClick} for instances where this will be triggered. + * + * @listens tap + * @listens click + * @listens keydown + * + * @param {EventTarget~Event} event + + The `click`, `tap` or `keydown` event that caused this function to be called. + */ + + + PosterImage.prototype.handleClick = function handleClick(event) { + // We don't want a click to trigger playback when controls are disabled + if (!this.player_.controls()) { + return; + } + + if (this.player_.paused()) { + this.player_.play(); + } else { + this.player_.pause(); + } + }; + + return PosterImage; +}(_clickableComponent2['default']); + +_component2['default'].registerComponent('PosterImage', PosterImage); +exports['default'] = PosterImage; + +},{"3":3,"5":5,"81":81,"85":85,"88":88}],59:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; +exports.hasLoaded = exports.autoSetupTimeout = exports.autoSetup = undefined; + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _events = _dereq_(86); + +var Events = _interopRequireWildcard(_events); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +var _window = _dereq_(100); + +var _window2 = _interopRequireDefault(_window); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +/** + * @file setup.js - Functions for setting up a player without + * user interaction based on the data-setup `attribute` of the video tag. + * + * @module setup + */ +var _windowLoaded = false; +var videojs = void 0; + +/** + * Set up any tags that have a data-setup `attribute` when the player is started. + */ +var autoSetup = function autoSetup() { + + // Protect against breakage in non-browser environments. + if (!Dom.isReal()) { + return; + } + + // One day, when we stop supporting IE8, go back to this, but in the meantime...*hack hack hack* + // var vids = Array.prototype.slice.call(document.getElementsByTagName('video')); + // var audios = Array.prototype.slice.call(document.getElementsByTagName('audio')); + // var mediaEls = vids.concat(audios); + + // Because IE8 doesn't support calling slice on a node list, we need to loop + // through each list of elements to build up a new, combined list of elements. + var vids = _document2['default'].getElementsByTagName('video'); + var audios = _document2['default'].getElementsByTagName('audio'); + var mediaEls = []; + + if (vids && vids.length > 0) { + for (var i = 0, e = vids.length; i < e; i++) { + mediaEls.push(vids[i]); + } + } + + if (audios && audios.length > 0) { + for (var _i = 0, _e = audios.length; _i < _e; _i++) { + mediaEls.push(audios[_i]); + } + } + + // Check if any media elements exist + if (mediaEls && mediaEls.length > 0) { + + for (var _i2 = 0, _e2 = mediaEls.length; _i2 < _e2; _i2++) { + var mediaEl = mediaEls[_i2]; + + // Check if element exists, has getAttribute func. + // IE seems to consider typeof el.getAttribute == 'object' instead of + // 'function' like expected, at least when loading the player immediately. + if (mediaEl && mediaEl.getAttribute) { + + // Make sure this player hasn't already been set up. + if (mediaEl.player === undefined) { + var options = mediaEl.getAttribute('data-setup'); + + // Check if data-setup attr exists. + // We only auto-setup if they've added the data-setup attr. + if (options !== null) { + // Create new video.js instance. + videojs(mediaEl); + } + } + + // If getAttribute isn't defined, we need to wait for the DOM. + } else { + autoSetupTimeout(1); + break; + } + } + + // No videos were found, so keep looping unless page is finished loading. + } else if (!_windowLoaded) { + autoSetupTimeout(1); + } +}; + +/** + * Wait until the page is loaded before running autoSetup. This will be called in + * autoSetup if `hasLoaded` returns false. + * + * @param {number} wait + * How long to wait in ms + * + * @param {module:videojs} [vjs] + * The videojs library function + */ +function autoSetupTimeout(wait, vjs) { + if (vjs) { + videojs = vjs; + } + + _window2['default'].setTimeout(autoSetup, wait); +} + +if (Dom.isReal() && _document2['default'].readyState === 'complete') { + _windowLoaded = true; +} else { + /** + * Listen for the load event on window, and set _windowLoaded to true. + * + * @listens load + */ + Events.one(_window2['default'], 'load', function () { + _windowLoaded = true; + }); +} + +/** + * check if the document has been loaded + */ +var hasLoaded = function hasLoaded() { + return _windowLoaded; +}; + +exports.autoSetup = autoSetup; +exports.autoSetupTimeout = autoSetupTimeout; +exports.hasLoaded = hasLoaded; + +},{"100":100,"85":85,"86":86,"99":99}],60:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _obj = _dereq_(93); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file slider.js + */ + + +/** + * The base functionality for a slider. Can be vertical or horizontal. + * For instance the volume bar or the seek bar on a video is a slider. + * + * @extends Component + */ +var Slider = function (_Component) { + _inherits(Slider, _Component); + + /** + * Create an instance of this class + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + */ + function Slider(player, options) { + _classCallCheck(this, Slider); + + // Set property names to bar to match with the child Slider class is looking for + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options)); + + _this.bar = _this.getChild(_this.options_.barName); + + // Set a horizontal or vertical class on the slider depending on the slider type + _this.vertical(!!_this.options_.vertical); + + _this.on('mousedown', _this.handleMouseDown); + _this.on('touchstart', _this.handleMouseDown); + _this.on('focus', _this.handleFocus); + _this.on('blur', _this.handleBlur); + _this.on('click', _this.handleClick); + + _this.on(player, 'controlsvisible', _this.update); + + if (_this.playerEvent) { + _this.on(player, _this.playerEvent, _this.update); + } + return _this; + } + + /** + * Create the `Button`s DOM element. + * + * @param {string} type + * Type of element to create. + * + * @param {Object} [props={}] + * List of properties in Object form. + * + * @param {Object} [attributes={}] + * list of attributes in Object form. + * + * @return {Element} + * The element that gets created. + */ + + + Slider.prototype.createEl = function createEl(type) { + var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + // Add the slider element class to all sub classes + props.className = props.className + ' vjs-slider'; + props = (0, _obj.assign)({ + tabIndex: 0 + }, props); + + attributes = (0, _obj.assign)({ + 'role': 'slider', + 'aria-valuenow': 0, + 'aria-valuemin': 0, + 'aria-valuemax': 100, + 'tabIndex': 0 + }, attributes); + + return _Component.prototype.createEl.call(this, type, props, attributes); + }; + + /** + * Handle `mousedown` or `touchstart` events on the `Slider`. + * + * @param {EventTarget~Event} event + * `mousedown` or `touchstart` event that triggered this function + * + * @listens mousedown + * @listens touchstart + * @fires Slider#slideractive + */ + + + Slider.prototype.handleMouseDown = function handleMouseDown(event) { + var doc = this.bar.el_.ownerDocument; + + event.preventDefault(); + Dom.blockTextSelection(); + + this.addClass('vjs-sliding'); + /** + * Triggered when the slider is in an active state + * + * @event Slider#slideractive + * @type {EventTarget~Event} + */ + this.trigger('slideractive'); + + this.on(doc, 'mousemove', this.handleMouseMove); + this.on(doc, 'mouseup', this.handleMouseUp); + this.on(doc, 'touchmove', this.handleMouseMove); + this.on(doc, 'touchend', this.handleMouseUp); + + this.handleMouseMove(event); + }; + + /** + * Handle the `mousemove`, `touchmove`, and `mousedown` events on this `Slider`. + * The `mousemove` and `touchmove` events will only only trigger this function during + * `mousedown` and `touchstart`. This is due to {@link Slider#handleMouseDown} and + * {@link Slider#handleMouseUp}. + * + * @param {EventTarget~Event} event + * `mousedown`, `mousemove`, `touchstart`, or `touchmove` event that triggered + * this function + * + * @listens mousemove + * @listens touchmove + */ + + + Slider.prototype.handleMouseMove = function handleMouseMove(event) {}; + + /** + * Handle `mouseup` or `touchend` events on the `Slider`. + * + * @param {EventTarget~Event} event + * `mouseup` or `touchend` event that triggered this function. + * + * @listens touchend + * @listens mouseup + * @fires Slider#sliderinactive + */ + + + Slider.prototype.handleMouseUp = function handleMouseUp() { + var doc = this.bar.el_.ownerDocument; + + Dom.unblockTextSelection(); + + this.removeClass('vjs-sliding'); + /** + * Triggered when the slider is no longer in an active state. + * + * @event Slider#sliderinactive + * @type {EventTarget~Event} + */ + this.trigger('sliderinactive'); + + this.off(doc, 'mousemove', this.handleMouseMove); + this.off(doc, 'mouseup', this.handleMouseUp); + this.off(doc, 'touchmove', this.handleMouseMove); + this.off(doc, 'touchend', this.handleMouseUp); + + this.update(); + }; + + /** + * Update the progress bar of the `Slider`. + * + * @returns {number} + * The percentage of progress the progress bar represents as a + * number from 0 to 1. + */ + + + Slider.prototype.update = function update() { + + // In VolumeBar init we have a setTimeout for update that pops and update + // to the end of the execution stack. The player is destroyed before then + // update will cause an error + if (!this.el_) { + return; + } + + // If scrubbing, we could use a cached value to make the handle keep up + // with the user's mouse. On HTML5 browsers scrubbing is really smooth, but + // some flash players are slow, so we might want to utilize this later. + // var progress = (this.player_.scrubbing()) ? this.player_.getCache().currentTime / this.player_.duration() : this.player_.currentTime() / this.player_.duration(); + var progress = this.getPercent(); + var bar = this.bar; + + // If there's no bar... + if (!bar) { + return; + } + + // Protect against no duration and other division issues + if (typeof progress !== 'number' || progress !== progress || progress < 0 || progress === Infinity) { + progress = 0; + } + + // Convert to a percentage for setting + var percentage = (progress * 100).toFixed(2) + '%'; + var style = bar.el().style; + + // Set the new bar width or height + if (this.vertical()) { + style.height = percentage; + } else { + style.width = percentage; + } + + return progress; + }; + + /** + * Calculate distance for slider + * + * @param {EventTarget~Event} event + * The event that caused this function to run. + * + * @return {number} + * The current position of the Slider. + * - postition.x for vertical `Slider`s + * - postition.y for horizontal `Slider`s + */ + + + Slider.prototype.calculateDistance = function calculateDistance(event) { + var position = Dom.getPointerPosition(this.el_, event); + + if (this.vertical()) { + return position.y; + } + return position.x; + }; + + /** + * Handle a `focus` event on this `Slider`. + * + * @param {EventTarget~Event} event + * The `focus` event that caused this function to run. + * + * @listens focus + */ + + + Slider.prototype.handleFocus = function handleFocus() { + this.on(this.bar.el_.ownerDocument, 'keydown', this.handleKeyPress); + }; + + /** + * Handle a `keydown` event on the `Slider`. Watches for left, rigth, up, and down + * arrow keys. This function will only be called when the slider has focus. See + * {@link Slider#handleFocus} and {@link Slider#handleBlur}. + * + * @param {EventTarget~Event} event + * the `keydown` event that caused this function to run. + * + * @listens keydown + */ + + + Slider.prototype.handleKeyPress = function handleKeyPress(event) { + // Left and Down Arrows + if (event.which === 37 || event.which === 40) { + event.preventDefault(); + this.stepBack(); + + // Up and Right Arrows + } else if (event.which === 38 || event.which === 39) { + event.preventDefault(); + this.stepForward(); + } + }; + + /** + * Handle a `blur` event on this `Slider`. + * + * @param {EventTarget~Event} event + * The `blur` event that caused this function to run. + * + * @listens blur + */ + + Slider.prototype.handleBlur = function handleBlur() { + this.off(this.bar.el_.ownerDocument, 'keydown', this.handleKeyPress); + }; + + /** + * Listener for click events on slider, used to prevent clicks + * from bubbling up to parent elements like button menus. + * + * @param {Object} event + * Event that caused this object to run + */ + + + Slider.prototype.handleClick = function handleClick(event) { + event.stopImmediatePropagation(); + event.preventDefault(); + }; + + /** + * Get/set if slider is horizontal for vertical + * + * @param {boolean} [bool] + * - true if slider is vertical, + * - false is horizontal + * + * @return {boolean} + * - true if slider is vertical, and getting + * - false if the slider is horizontal, and getting + */ + + + Slider.prototype.vertical = function vertical(bool) { + if (bool === undefined) { + return this.vertical_ || false; + } + + this.vertical_ = !!bool; + + if (this.vertical_) { + this.addClass('vjs-slider-vertical'); + } else { + this.addClass('vjs-slider-horizontal'); + } + }; + + return Slider; +}(_component2['default']); + +_component2['default'].registerComponent('Slider', Slider); +exports['default'] = Slider; + +},{"5":5,"85":85,"93":93}],61:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _templateObject = _taggedTemplateLiteralLoose(['Text Tracks are being loaded from another origin but the crossorigin attribute isn\'t used.\n This may prevent text tracks from loading.'], ['Text Tracks are being loaded from another origin but the crossorigin attribute isn\'t used.\n This may prevent text tracks from loading.']); + +var _tech = _dereq_(64); + +var _tech2 = _interopRequireDefault(_tech); + +var _dom = _dereq_(85); + +var Dom = _interopRequireWildcard(_dom); + +var _url = _dereq_(97); + +var Url = _interopRequireWildcard(_url); + +var _log = _dereq_(91); + +var _log2 = _interopRequireDefault(_log); + +var _tsml = _dereq_(103); + +var _tsml2 = _interopRequireDefault(_tsml); + +var _browser = _dereq_(81); + +var browser = _interopRequireWildcard(_browser); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +var _window = _dereq_(100); + +var _window2 = _interopRequireDefault(_window); + +var _obj = _dereq_(93); + +var _mergeOptions = _dereq_(92); + +var _mergeOptions2 = _interopRequireDefault(_mergeOptions); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +var _trackTypes = _dereq_(77); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file html5.js + */ + + +/** + * HTML5 Media Controller - Wrapper for HTML5 Media API + * + * @mixes Tech~SouceHandlerAdditions + * @extends Tech + */ +var Html5 = function (_Tech) { + _inherits(Html5, _Tech); + + /** + * Create an instance of this Tech. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} ready + * Callback function to call when the `HTML5` Tech is ready. + */ + function Html5(options, ready) { + _classCallCheck(this, Html5); + + var _this = _possibleConstructorReturn(this, _Tech.call(this, options, ready)); + + var source = options.source; + var crossoriginTracks = false; + + // Set the source if one is provided + // 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted) + // 2) Check to see if the network state of the tag was failed at init, and if so, reset the source + // anyway so the error gets fired. + if (source && (_this.el_.currentSrc !== source.src || options.tag && options.tag.initNetworkState_ === 3)) { + _this.setSource(source); + } else { + _this.handleLateInit_(_this.el_); + } + + if (_this.el_.hasChildNodes()) { + + var nodes = _this.el_.childNodes; + var nodesLength = nodes.length; + var removeNodes = []; + + while (nodesLength--) { + var node = nodes[nodesLength]; + var nodeName = node.nodeName.toLowerCase(); + + if (nodeName === 'track') { + if (!_this.featuresNativeTextTracks) { + // Empty video tag tracks so the built-in player doesn't use them also. + // This may not be fast enough to stop HTML5 browsers from reading the tags + // so we'll need to turn off any default tracks if we're manually doing + // captions and subtitles. videoElement.textTracks + removeNodes.push(node); + } else { + // store HTMLTrackElement and TextTrack to remote list + _this.remoteTextTrackEls().addTrackElement_(node); + _this.remoteTextTracks().addTrack(node.track); + _this.textTracks().addTrack(node.track); + if (!crossoriginTracks && !_this.el_.hasAttribute('crossorigin') && Url.isCrossOrigin(node.src)) { + crossoriginTracks = true; + } + } + } + } + + for (var i = 0; i < removeNodes.length; i++) { + _this.el_.removeChild(removeNodes[i]); + } + } + + _this.proxyNativeTracks_(); + if (_this.featuresNativeTextTracks && crossoriginTracks) { + _log2['default'].warn((0, _tsml2['default'])(_templateObject)); + } + + // Determine if native controls should be used + // Our goal should be to get the custom controls on mobile solid everywhere + // so we can remove this all together. Right now this will block custom + // controls on touch enabled laptops like the Chrome Pixel + if ((browser.TOUCH_ENABLED || browser.IS_IPHONE || browser.IS_NATIVE_ANDROID) && options.nativeControlsForTouch === true) { + _this.setControls(true); + } + + // on iOS, we want to proxy `webkitbeginfullscreen` and `webkitendfullscreen` + // into a `fullscreenchange` event + _this.proxyWebkitFullscreen_(); + + _this.triggerReady(); + return _this; + } + + /** + * Dispose of `HTML5` media element and remove all tracks. + */ + + + Html5.prototype.dispose = function dispose() { + Html5.disposeMediaElement(this.el_); + // tech will handle clearing of the emulated track list + _Tech.prototype.dispose.call(this); + }; + + /** + * Proxy all native track list events to our track lists if the browser we are playing + * in supports that type of track list. + * + * @private + */ + + + Html5.prototype.proxyNativeTracks_ = function proxyNativeTracks_() { + var _this2 = this; + + _trackTypes.NORMAL.names.forEach(function (name) { + var props = _trackTypes.NORMAL[name]; + var elTracks = _this2.el()[props.getterName]; + var techTracks = _this2[props.getterName](); + + if (!_this2['featuresNative' + props.capitalName + 'Tracks'] || !elTracks || !elTracks.addEventListener) { + return; + } + var listeners = { + change: function change(e) { + techTracks.trigger({ + type: 'change', + target: techTracks, + currentTarget: techTracks, + srcElement: techTracks + }); + }, + addtrack: function addtrack(e) { + techTracks.addTrack(e.track); + }, + removetrack: function removetrack(e) { + techTracks.removeTrack(e.track); + } + }; + var removeOldTracks = function removeOldTracks() { + var removeTracks = []; + + for (var i = 0; i < techTracks.length; i++) { + var found = false; + + for (var j = 0; j < elTracks.length; j++) { + if (elTracks[j] === techTracks[i]) { + found = true; + break; + } + } + + if (!found) { + removeTracks.push(techTracks[i]); + } + } + + while (removeTracks.length) { + techTracks.removeTrack(removeTracks.shift()); + } + }; + + Object.keys(listeners).forEach(function (eventName) { + var listener = listeners[eventName]; + + elTracks.addEventListener(eventName, listener); + _this2.on('dispose', function (e) { + return elTracks.removeEventListener(eventName, listener); + }); + }); + + // Remove (native) tracks that are not used anymore + _this2.on('loadstart', removeOldTracks); + _this2.on('dispose', function (e) { + return _this2.off('loadstart', removeOldTracks); + }); + }); + }; + + /** + * Create the `Html5` Tech's DOM element. + * + * @return {Element} + * The element that gets created. + */ + + + Html5.prototype.createEl = function createEl() { + var el = this.options_.tag; + + // Check if this browser supports moving the element into the box. + // On the iPhone video will break if you move the element, + // So we have to create a brand new element. + // If we ingested the player div, we do not need to move the media element. + if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) { + + // If the original tag is still there, clone and remove it. + if (el) { + var clone = el.cloneNode(true); + + if (el.parentNode) { + el.parentNode.insertBefore(clone, el); + } + Html5.disposeMediaElement(el); + el = clone; + } else { + el = _document2['default'].createElement('video'); + + // determine if native controls should be used + var tagAttributes = this.options_.tag && Dom.getAttributes(this.options_.tag); + var attributes = (0, _mergeOptions2['default'])({}, tagAttributes); + + if (!browser.TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) { + delete attributes.controls; + } + + Dom.setAttributes(el, (0, _obj.assign)(attributes, { + id: this.options_.techId, + 'class': 'vjs-tech' + })); + } + + el.playerId = this.options_.playerId; + } + + // Update specific tag settings, in case they were overridden + var settingsAttrs = ['autoplay', 'preload', 'loop', 'muted', 'playsinline']; + + for (var i = settingsAttrs.length - 1; i >= 0; i--) { + var attr = settingsAttrs[i]; + var overwriteAttrs = {}; + + if (typeof this.options_[attr] !== 'undefined') { + overwriteAttrs[attr] = this.options_[attr]; + } + Dom.setAttributes(el, overwriteAttrs); + } + + return el; + }; + + /** + * This will be triggered if the loadstart event has already fired, before videojs was + * ready. Two known examples of when this can happen are: + * 1. If we're loading the playback object after it has started loading + * 2. The media is already playing the (often with autoplay on) then + * + * This function will fire another loadstart so that videojs can catchup. + * + * @fires Tech#loadstart + * + * @return {undefined} + * returns nothing. + */ + + + Html5.prototype.handleLateInit_ = function handleLateInit_(el) { + if (el.networkState === 0 || el.networkState === 3) { + // The video element hasn't started loading the source yet + // or didn't find a source + return; + } + + if (el.readyState === 0) { + // NetworkState is set synchronously BUT loadstart is fired at the + // end of the current stack, usually before setInterval(fn, 0). + // So at this point we know loadstart may have already fired or is + // about to fire, and either way the player hasn't seen it yet. + // We don't want to fire loadstart prematurely here and cause a + // double loadstart so we'll wait and see if it happens between now + // and the next loop, and fire it if not. + // HOWEVER, we also want to make sure it fires before loadedmetadata + // which could also happen between now and the next loop, so we'll + // watch for that also. + var loadstartFired = false; + var setLoadstartFired = function setLoadstartFired() { + loadstartFired = true; + }; + + this.on('loadstart', setLoadstartFired); + + var triggerLoadstart = function triggerLoadstart() { + // We did miss the original loadstart. Make sure the player + // sees loadstart before loadedmetadata + if (!loadstartFired) { + this.trigger('loadstart'); + } + }; + + this.on('loadedmetadata', triggerLoadstart); + + this.ready(function () { + this.off('loadstart', setLoadstartFired); + this.off('loadedmetadata', triggerLoadstart); + + if (!loadstartFired) { + // We did miss the original native loadstart. Fire it now. + this.trigger('loadstart'); + } + }); + + return; + } + + // From here on we know that loadstart already fired and we missed it. + // The other readyState events aren't as much of a problem if we double + // them, so not going to go to as much trouble as loadstart to prevent + // that unless we find reason to. + var eventsToTrigger = ['loadstart']; + + // loadedmetadata: newly equal to HAVE_METADATA (1) or greater + eventsToTrigger.push('loadedmetadata'); + + // loadeddata: newly increased to HAVE_CURRENT_DATA (2) or greater + if (el.readyState >= 2) { + eventsToTrigger.push('loadeddata'); + } + + // canplay: newly increased to HAVE_FUTURE_DATA (3) or greater + if (el.readyState >= 3) { + eventsToTrigger.push('canplay'); + } + + // canplaythrough: newly equal to HAVE_ENOUGH_DATA (4) + if (el.readyState >= 4) { + eventsToTrigger.push('canplaythrough'); + } + + // We still need to give the player time to add event listeners + this.ready(function () { + eventsToTrigger.forEach(function (type) { + this.trigger(type); + }, this); + }); + }; + + /** + * Set current time for the `HTML5` tech. + * + * @param {number} seconds + * Set the current time of the media to this. + */ + + + Html5.prototype.setCurrentTime = function setCurrentTime(seconds) { + try { + this.el_.currentTime = seconds; + } catch (e) { + (0, _log2['default'])(e, 'Video is not ready. (Video.js)'); + // this.warning(VideoJS.warnings.videoNotReady); + } + }; + + /** + * Get the current duration of the HTML5 media element. + * + * @return {number} + * The duration of the media or 0 if there is no duration. + */ + + + Html5.prototype.duration = function duration() { + var _this3 = this; + + // Android Chrome will report duration as Infinity for VOD HLS until after + // playback has started, which triggers the live display erroneously. + // Return NaN if playback has not started and trigger a durationupdate once + // the duration can be reliably known. + if (this.el_.duration === Infinity && browser.IS_ANDROID && browser.IS_CHROME) { + if (this.el_.currentTime === 0) { + // Wait for the first `timeupdate` with currentTime > 0 - there may be + // several with 0 + var checkProgress = function checkProgress() { + if (_this3.el_.currentTime > 0) { + // Trigger durationchange for genuinely live video + if (_this3.el_.duration === Infinity) { + _this3.trigger('durationchange'); + } + _this3.off('timeupdate', checkProgress); + } + }; + + this.on('timeupdate', checkProgress); + return NaN; + } + } + return this.el_.duration || NaN; + }; + + /** + * Get the current width of the HTML5 media element. + * + * @return {number} + * The width of the HTML5 media element. + */ + + + Html5.prototype.width = function width() { + return this.el_.offsetWidth; + }; + + /** + * Get the current height of the HTML5 media element. + * + * @return {number} + * The heigth of the HTML5 media element. + */ + + + Html5.prototype.height = function height() { + return this.el_.offsetHeight; + }; + + /** + * Proxy iOS `webkitbeginfullscreen` and `webkitendfullscreen` into + * `fullscreenchange` event. + * + * @private + * @fires fullscreenchange + * @listens webkitendfullscreen + * @listens webkitbeginfullscreen + * @listens webkitbeginfullscreen + */ + + + Html5.prototype.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() { + var _this4 = this; + + if (!('webkitDisplayingFullscreen' in this.el_)) { + return; + } + + var endFn = function endFn() { + this.trigger('fullscreenchange', { isFullscreen: false }); + }; + + var beginFn = function beginFn() { + this.one('webkitendfullscreen', endFn); + + this.trigger('fullscreenchange', { isFullscreen: true }); + }; + + this.on('webkitbeginfullscreen', beginFn); + this.on('dispose', function () { + _this4.off('webkitbeginfullscreen', beginFn); + _this4.off('webkitendfullscreen', endFn); + }); + }; + + /** + * Check if fullscreen is supported on the current playback device. + * + * @return {boolean} + * - True if fullscreen is supported. + * - False if fullscreen is not supported. + */ + + + Html5.prototype.supportsFullScreen = function supportsFullScreen() { + if (typeof this.el_.webkitEnterFullScreen === 'function') { + var userAgent = _window2['default'].navigator && _window2['default'].navigator.userAgent || ''; + + // Seems to be broken in Chromium/Chrome && Safari in Leopard + if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) { + return true; + } + } + return false; + }; + + /** + * Request that the `HTML5` Tech enter fullscreen. + */ + + + Html5.prototype.enterFullScreen = function enterFullScreen() { + var video = this.el_; + + if (video.paused && video.networkState <= video.HAVE_METADATA) { + // attempt to prime the video element for programmatic access + // this isn't necessary on the desktop but shouldn't hurt + this.el_.play(); + + // playing and pausing synchronously during the transition to fullscreen + // can get iOS ~6.1 devices into a play/pause loop + this.setTimeout(function () { + video.pause(); + video.webkitEnterFullScreen(); + }, 0); + } else { + video.webkitEnterFullScreen(); + } + }; + + /** + * Request that the `HTML5` Tech exit fullscreen. + */ + + + Html5.prototype.exitFullScreen = function exitFullScreen() { + this.el_.webkitExitFullScreen(); + }; + + /** + * A getter/setter for the `Html5` Tech's source object. + * > Note: Please use {@link Html5#setSource} + * + * @param {Tech~SourceObject} [src] + * The source object you want to set on the `HTML5` techs element. + * + * @return {Tech~SourceObject|undefined} + * - The current source object when a source is not passed in. + * - undefined when setting + * + * @deprecated Since version 5. + */ + + + Html5.prototype.src = function src(_src) { + if (_src === undefined) { + return this.el_.src; + } + + // Setting src through `src` instead of `setSrc` will be deprecated + this.setSrc(_src); + }; + + /** + * Reset the tech by removing all sources and then calling + * {@link Html5.resetMediaElement}. + */ + + + Html5.prototype.reset = function reset() { + Html5.resetMediaElement(this.el_); + }; + + /** + * Get the current source on the `HTML5` Tech. Falls back to returning the source from + * the HTML5 media element. + * + * @return {Tech~SourceObject} + * The current source object from the HTML5 tech. With a fallback to the + * elements source. + */ + + + Html5.prototype.currentSrc = function currentSrc() { + if (this.currentSource_) { + return this.currentSource_.src; + } + return this.el_.currentSrc; + }; + + /** + * Set controls attribute for the HTML5 media Element. + * + * @param {string} val + * Value to set the controls attribute to + */ + + + Html5.prototype.setControls = function setControls(val) { + this.el_.controls = !!val; + }; + + /** + * Create and returns a remote {@link TextTrack} object. + * + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @return {TextTrack} + * The TextTrack that gets created. + */ + + + Html5.prototype.addTextTrack = function addTextTrack(kind, label, language) { + if (!this.featuresNativeTextTracks) { + return _Tech.prototype.addTextTrack.call(this, kind, label, language); + } + + return this.el_.addTextTrack(kind, label, language); + }; + + /** + * Creates either native TextTrack or an emulated TextTrack depending + * on the value of `featuresNativeTextTracks` + * + * @param {Object} options + * The object should contain the options to intialize the TextTrack with. + * + * @param {string} [options.kind] + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata). + * + * @param {string} [options.label]. + * Label to identify the text track + * + * @param {string} [options.language] + * Two letter language abbreviation. + * + * @param {boolean} [options.default] + * Default this track to on. + * + * @param {string} [options.id] + * The internal id to assign this track. + * + * @param {string} [options.src] + * A source url for the track. + * + * @return {HTMLTrackElement} + * The track element that gets created. + */ + + + Html5.prototype.createRemoteTextTrack = function createRemoteTextTrack(options) { + if (!this.featuresNativeTextTracks) { + return _Tech.prototype.createRemoteTextTrack.call(this, options); + } + var htmlTrackElement = _document2['default'].createElement('track'); + + if (options.kind) { + htmlTrackElement.kind = options.kind; + } + if (options.label) { + htmlTrackElement.label = options.label; + } + if (options.language || options.srclang) { + htmlTrackElement.srclang = options.language || options.srclang; + } + if (options['default']) { + htmlTrackElement['default'] = options['default']; + } + if (options.id) { + htmlTrackElement.id = options.id; + } + if (options.src) { + htmlTrackElement.src = options.src; + } + + return htmlTrackElement; + }; + + /** + * Creates a remote text track object and returns an html track element. + * + * @param {Object} options The object should contain values for + * kind, language, label, and src (location of the WebVTT file) + * @param {Boolean} [manualCleanup=true] if set to false, the TextTrack will be + * automatically removed from the video element whenever the source changes + * @return {HTMLTrackElement} An Html Track Element. + * This can be an emulated {@link HTMLTrackElement} or a native one. + * @deprecated The default value of the "manualCleanup" parameter will default + * to "false" in upcoming versions of Video.js + */ + + + Html5.prototype.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { + var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options, manualCleanup); + + if (this.featuresNativeTextTracks) { + this.el().appendChild(htmlTrackElement); + } + + return htmlTrackElement; + }; + + /** + * Remove remote `TextTrack` from `TextTrackList` object + * + * @param {TextTrack} track + * `TextTrack` object to remove + */ + + + Html5.prototype.removeRemoteTextTrack = function removeRemoteTextTrack(track) { + _Tech.prototype.removeRemoteTextTrack.call(this, track); + + if (this.featuresNativeTextTracks) { + var tracks = this.$$('track'); + + var i = tracks.length; + + while (i--) { + if (track === tracks[i] || track === tracks[i].track) { + this.el().removeChild(tracks[i]); + } + } + } + }; + + /** + * Get the value of `playsinline` from the media element. `playsinline` indicates + * to the browser that non-fullscreen playback is preferred when fullscreen + * playback is the native default, such as in iOS Safari. + * + * @method Html5#playsinline + * @return {boolean} + * - The value of `playsinline` from the media element. + * - True indicates that the media should play inline. + * - False indicates that the media should not play inline. + * + * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline} + */ + + + Html5.prototype.playsinline = function playsinline() { + return this.el_.hasAttribute('playsinline'); + }; + + /** + * Set the value of `playsinline` from the media element. `playsinline` indicates + * to the browser that non-fullscreen playback is preferred when fullscreen + * playback is the native default, such as in iOS Safari. + * + * @method Html5#setPlaysinline + * @param {boolean} playsinline + * - True indicates that the media should play inline. + * - False indicates that the media should not play inline. + * + * @see [Spec]{@link https://html.spec.whatwg.org/#attr-video-playsinline} + */ + + + Html5.prototype.setPlaysinline = function setPlaysinline(value) { + if (value) { + this.el_.setAttribute('playsinline', 'playsinline'); + } else { + this.el_.removeAttribute('playsinline'); + } + }; + + /** + * Gets available media playback quality metrics as specified by the W3C's Media + * Playback Quality API. + * + * @see [Spec]{@link https://wicg.github.io/media-playback-quality} + * + * @return {Object} + * An object with supported media playback quality metrics + */ + + + Html5.prototype.getVideoPlaybackQuality = function getVideoPlaybackQuality() { + if (typeof this.el().getVideoPlaybackQuality === 'function') { + return this.el().getVideoPlaybackQuality(); + } + + var videoPlaybackQuality = {}; + + if (typeof this.el().webkitDroppedFrameCount !== 'undefined' && typeof this.el().webkitDecodedFrameCount !== 'undefined') { + videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount; + videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount; + } + + if (_window2['default'].performance && typeof _window2['default'].performance.now === 'function') { + videoPlaybackQuality.creationTime = _window2['default'].performance.now(); + } else if (_window2['default'].performance && _window2['default'].performance.timing && typeof _window2['default'].performance.timing.navigationStart === 'number') { + videoPlaybackQuality.creationTime = _window2['default'].Date.now() - _window2['default'].performance.timing.navigationStart; + } + + return videoPlaybackQuality; + }; + + return Html5; +}(_tech2['default']); + +/* HTML5 Support Testing ---------------------------------------------------- */ + +if (Dom.isReal()) { + + /** + * Element for testing browser HTML5 media capabilities + * + * @type {Element} + * @constant + * @private + */ + Html5.TEST_VID = _document2['default'].createElement('video'); + var track = _document2['default'].createElement('track'); + + track.kind = 'captions'; + track.srclang = 'en'; + track.label = 'English'; + Html5.TEST_VID.appendChild(track); +} + +/** + * Check if HTML5 media is supported by this browser/device. + * + * @return {boolean} + * - True if HTML5 media is supported. + * - False if HTML5 media is not supported. + */ +Html5.isSupported = function () { + // IE9 with no Media Player is a LIAR! (#984) + try { + Html5.TEST_VID.volume = 0.5; + } catch (e) { + return false; + } + + return !!(Html5.TEST_VID && Html5.TEST_VID.canPlayType); +}; + +/** + * Check if the tech can support the given type + * + * @param {string} type + * The mimetype to check + * @return {string} 'probably', 'maybe', or '' (empty string) + */ +Html5.canPlayType = function (type) { + return Html5.TEST_VID.canPlayType(type); +}; + +/** + * Check if the tech can support the given source + * @param {Object} srcObj + * The source object + * @param {Object} options + * The options passed to the tech + * @return {string} 'probably', 'maybe', or '' (empty string) + */ +Html5.canPlaySource = function (srcObj, options) { + return Html5.canPlayType(srcObj.type); +}; + +/** + * Check if the volume can be changed in this browser/device. + * Volume cannot be changed in a lot of mobile devices. + * Specifically, it can't be changed from 1 on iOS. + * + * @return {boolean} + * - True if volume can be controlled + * - False otherwise + */ +Html5.canControlVolume = function () { + // IE will error if Windows Media Player not installed #3315 + try { + var volume = Html5.TEST_VID.volume; + + Html5.TEST_VID.volume = volume / 2 + 0.1; + return volume !== Html5.TEST_VID.volume; + } catch (e) { + return false; + } +}; + +/** + * Check if the playback rate can be changed in this browser/device. + * + * @return {boolean} + * - True if playback rate can be controlled + * - False otherwise + */ +Html5.canControlPlaybackRate = function () { + // Playback rate API is implemented in Android Chrome, but doesn't do anything + // https://github.com/videojs/video.js/issues/3180 + if (browser.IS_ANDROID && browser.IS_CHROME && browser.CHROME_VERSION < 58) { + return false; + } + // IE will error if Windows Media Player not installed #3315 + try { + var playbackRate = Html5.TEST_VID.playbackRate; + + Html5.TEST_VID.playbackRate = playbackRate / 2 + 0.1; + return playbackRate !== Html5.TEST_VID.playbackRate; + } catch (e) { + return false; + } +}; + +/** + * Check to see if native `TextTrack`s are supported by this browser/device. + * + * @return {boolean} + * - True if native `TextTrack`s are supported. + * - False otherwise + */ +Html5.supportsNativeTextTracks = function () { + return browser.IS_ANY_SAFARI; +}; + +/** + * Check to see if native `VideoTrack`s are supported by this browser/device + * + * @return {boolean} + * - True if native `VideoTrack`s are supported. + * - False otherwise + */ +Html5.supportsNativeVideoTracks = function () { + return !!(Html5.TEST_VID && Html5.TEST_VID.videoTracks); +}; + +/** + * Check to see if native `AudioTrack`s are supported by this browser/device + * + * @return {boolean} + * - True if native `AudioTrack`s are supported. + * - False otherwise + */ +Html5.supportsNativeAudioTracks = function () { + return !!(Html5.TEST_VID && Html5.TEST_VID.audioTracks); +}; + +/** + * An array of events available on the Html5 tech. + * + * @private + * @type {Array} + */ +Html5.Events = ['loadstart', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'canplay', 'canplaythrough', 'playing', 'waiting', 'seeking', 'seeked', 'ended', 'durationchange', 'timeupdate', 'progress', 'play', 'pause', 'ratechange', 'resize', 'volumechange']; + +/** + * Boolean indicating whether the `Tech` supports volume control. + * + * @type {boolean} + * @default {@link Html5.canControlVolume} + */ +Html5.prototype.featuresVolumeControl = Html5.canControlVolume(); + +/** + * Boolean indicating whether the `Tech` supports changing the speed at which the media + * plays. Examples: + * - Set player to play 2x (twice) as fast + * - Set player to play 0.5x (half) as fast + * + * @type {boolean} + * @default {@link Html5.canControlPlaybackRate} + */ +Html5.prototype.featuresPlaybackRate = Html5.canControlPlaybackRate(); + +/** + * Boolean indicating whether the `HTML5` tech currently supports the media element + * moving in the DOM. iOS breaks if you move the media element, so this is set this to + * false there. Everywhere else this should be true. + * + * @type {boolean} + * @default + */ +Html5.prototype.movingMediaElementInDOM = !browser.IS_IOS; + +// TODO: Previous comment: No longer appears to be used. Can probably be removed. +// Is this true? +/** + * Boolean indicating whether the `HTML5` tech currently supports automatic media resize + * when going into fullscreen. + * + * @type {boolean} + * @default + */ +Html5.prototype.featuresFullscreenResize = true; + +/** + * Boolean indicating whether the `HTML5` tech currently supports the progress event. + * If this is false, manual `progress` events will be triggred instead. + * + * @type {boolean} + * @default + */ +Html5.prototype.featuresProgressEvents = true; + +/** + * Boolean indicating whether the `HTML5` tech currently supports the timeupdate event. + * If this is false, manual `timeupdate` events will be triggred instead. + * + * @default + */ +Html5.prototype.featuresTimeupdateEvents = true; + +/** + * Boolean indicating whether the `HTML5` tech currently supports native `TextTrack`s. + * + * @type {boolean} + * @default {@link Html5.supportsNativeTextTracks} + */ +Html5.prototype.featuresNativeTextTracks = Html5.supportsNativeTextTracks(); + +/** + * Boolean indicating whether the `HTML5` tech currently supports native `VideoTrack`s. + * + * @type {boolean} + * @default {@link Html5.supportsNativeVideoTracks} + */ +Html5.prototype.featuresNativeVideoTracks = Html5.supportsNativeVideoTracks(); + +/** + * Boolean indicating whether the `HTML5` tech currently supports native `AudioTrack`s. + * + * @type {boolean} + * @default {@link Html5.supportsNativeAudioTracks} + */ +Html5.prototype.featuresNativeAudioTracks = Html5.supportsNativeAudioTracks(); + +// HTML5 Feature detection and Device Fixes --------------------------------- // +var canPlayType = Html5.TEST_VID && Html5.TEST_VID.constructor.prototype.canPlayType; +var mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i; +var mp4RE = /^video\/mp4/i; + +Html5.patchCanPlayType = function () { + + // Android 4.0 and above can play HLS to some extent but it reports being unable to do so + if (browser.ANDROID_VERSION >= 4.0 && !browser.IS_FIREFOX) { + Html5.TEST_VID.constructor.prototype.canPlayType = function (type) { + if (type && mpegurlRE.test(type)) { + return 'maybe'; + } + return canPlayType.call(this, type); + }; + + // Override Android 2.2 and less canPlayType method which is broken + } else if (browser.IS_OLD_ANDROID) { + Html5.TEST_VID.constructor.prototype.canPlayType = function (type) { + if (type && mp4RE.test(type)) { + return 'maybe'; + } + return canPlayType.call(this, type); + }; + } +}; + +Html5.unpatchCanPlayType = function () { + var r = Html5.TEST_VID.constructor.prototype.canPlayType; + + Html5.TEST_VID.constructor.prototype.canPlayType = canPlayType; + return r; +}; + +// by default, patch the media element +Html5.patchCanPlayType(); + +Html5.disposeMediaElement = function (el) { + if (!el) { + return; + } + + if (el.parentNode) { + el.parentNode.removeChild(el); + } + + // remove any child track or source nodes to prevent their loading + while (el.hasChildNodes()) { + el.removeChild(el.firstChild); + } + + // remove any src reference. not setting `src=''` because that causes a warning + // in firefox + el.removeAttribute('src'); + + // force the media element to update its loading state by calling load() + // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793) + if (typeof el.load === 'function') { + // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473) + (function () { + try { + el.load(); + } catch (e) { + // not supported + } + })(); + } +}; + +Html5.resetMediaElement = function (el) { + if (!el) { + return; + } + + var sources = el.querySelectorAll('source'); + var i = sources.length; + + while (i--) { + el.removeChild(sources[i]); + } + + // remove any src reference. + // not setting `src=''` because that throws an error + el.removeAttribute('src'); + + if (typeof el.load === 'function') { + // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473) + (function () { + try { + el.load(); + } catch (e) { + // satisfy linter + } + })(); + } +}; + +/* Native HTML5 element property wrapping ----------------------------------- */ +// Wrap native properties with a getter +[ +/** + * Get the value of `paused` from the media element. `paused` indicates whether the media element + * is currently paused or not. + * + * @method Html5#paused + * @return {boolean} + * The value of `paused` from the media element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-paused} + */ +'paused', + +/** + * Get the value of `currentTime` from the media element. `currentTime` indicates + * the current second that the media is at in playback. + * + * @method Html5#currentTime + * @return {number} + * The value of `currentTime` from the media element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-currenttime} + */ +'currentTime', + +/** + * Get the value of `buffered` from the media element. `buffered` is a `TimeRange` + * object that represents the parts of the media that are already downloaded and + * available for playback. + * + * @method Html5#buffered + * @return {TimeRange} + * The value of `buffered` from the media element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-buffered} + */ +'buffered', + +/** + * Get the value of `volume` from the media element. `volume` indicates + * the current playback volume of audio for a media. `volume` will be a value from 0 + * (silent) to 1 (loudest and default). + * + * @method Html5#volume + * @return {number} + * The value of `volume` from the media element. Value will be between 0-1. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume} + */ +'volume', + +/** + * Get the value of `muted` from the media element. `muted` indicates + * that the volume for the media should be set to silent. This does not actually change + * the `volume` attribute. + * + * @method Html5#muted + * @return {boolean} + * - True if the value of `volume` should be ignored and the audio set to silent. + * - False if the value of `volume` should be used. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted} + */ +'muted', + +/** + * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates + * that the volume for the media should be set to silent when the video first starts. + * This does not actually change the `volume` attribute. After playback has started `muted` + * will indicate the current status of the volume and `defaultMuted` will not. + * + * @method Html5.prototype.defaultMuted + * @return {boolean} + * - True if the value of `volume` should be ignored and the audio set to silent. + * - False if the value of `volume` should be used. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted} + */ +'defaultMuted', + +/** + * Get the value of `poster` from the media element. `poster` indicates + * that the url of an image file that can/will be shown when no media data is available. + * + * @method Html5#poster + * @return {string} + * The value of `poster` from the media element. Value will be a url to an + * image. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-video-poster} + */ +'poster', + +/** + * Get the value of `preload` from the media element. `preload` indicates + * what should download before the media is interacted with. It can have the following + * values: + * - none: nothing should be downloaded + * - metadata: poster and the first few frames of the media may be downloaded to get + * media dimensions and other metadata + * - auto: allow the media and metadata for the media to be downloaded before + * interaction + * + * @method Html5#preload + * @return {string} + * The value of `preload` from the media element. Will be 'none', 'metadata', + * or 'auto'. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload} + */ +'preload', + +/** + * Get the value of `autoplay` from the media element. `autoplay` indicates + * that the media should start to play as soon as the page is ready. + * + * @method Html5#autoplay + * @return {boolean} + * - The value of `autoplay` from the media element. + * - True indicates that the media should start as soon as the page loads. + * - False indicates that the media should not start as soon as the page loads. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay} + */ +'autoplay', + +/** + * Get the value of `controls` from the media element. `controls` indicates + * whether the native media controls should be shown or hidden. + * + * @method Html5#controls + * @return {boolean} + * - The value of `controls` from the media element. + * - True indicates that native controls should be showing. + * - False indicates that native controls should be hidden. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-controls} + */ +'controls', + +/** + * Get the value of `loop` from the media element. `loop` indicates + * that the media should return to the start of the media and continue playing once + * it reaches the end. + * + * @method Html5#loop + * @return {boolean} + * - The value of `loop` from the media element. + * - True indicates that playback should seek back to start once + * the end of a media is reached. + * - False indicates that playback should not loop back to the start when the + * end of the media is reached. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop} + */ +'loop', + +/** + * Get the value of the `error` from the media element. `error` indicates any + * MediaError that may have occured during playback. If error returns null there is no + * current error. + * + * @method Html5#error + * @return {MediaError|null} + * The value of `error` from the media element. Will be `MediaError` if there + * is a current error and null otherwise. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-error} + */ +'error', + +/** + * Get the value of `seeking` from the media element. `seeking` indicates whether the + * media is currently seeking to a new position or not. + * + * @method Html5#seeking + * @return {boolean} + * - The value of `seeking` from the media element. + * - True indicates that the media is currently seeking to a new position. + * - Flase indicates that the media is not seeking to a new position at this time. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seeking} + */ +'seeking', + +/** + * Get the value of `seekable` from the media element. `seekable` returns a + * `TimeRange` object indicating ranges of time that can currently be `seeked` to. + * + * @method Html5#seekable + * @return {TimeRange} + * The value of `seekable` from the media element. A `TimeRange` object + * indicating the current ranges of time that can be seeked to. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-seekable} + */ +'seekable', + +/** + * Get the value of `ended` from the media element. `ended` indicates whether + * the media has reached the end or not. + * + * @method Html5#ended + * @return {boolean} + * - The value of `ended` from the media element. + * - True indicates that the media has ended. + * - False indicates that the media has not ended. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-ended} + */ +'ended', + +/** + * Get the value of `defaultMuted` from the media element. `defaultMuted` indicates + * whether the media should start muted or not. Only changes the default state of the + * media. `muted` and `defaultMuted` can have different values. {@link Html5#muted} indicates the + * current state. + * + * @method Html5#defaultMuted + * @return {boolean} + * - The value of `defaultMuted` from the media element. + * - True indicates that the media should start muted. + * - False indicates that the media should not start muted + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted} + */ +'defaultMuted', + +/** + * Get the value of `playbackRate` from the media element. `playbackRate` indicates + * the rate at which the media is currently playing back. Examples: + * - if playbackRate is set to 2, media will play twice as fast. + * - if playbackRate is set to 0.5, media will play half as fast. + * + * @method Html5#playbackRate + * @return {number} + * The value of `playbackRate` from the media element. A number indicating + * the current playback speed of the media, where 1 is normal speed. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate} + */ +'playbackRate', + +/** + * Get the value of `defaultPlaybackRate` from the media element. `defaultPlaybackRate` indicates + * the rate at which the media is currently playing back. This value will not indicate the current + * `playbackRate` after playback has started, use {@link Html5#playbackRate} for that. + * + * Examples: + * - if defaultPlaybackRate is set to 2, media will play twice as fast. + * - if defaultPlaybackRate is set to 0.5, media will play half as fast. + * + * @method Html5.prototype.defaultPlaybackRate + * @return {number} + * The value of `defaultPlaybackRate` from the media element. A number indicating + * the current playback speed of the media, where 1 is normal speed. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate} + */ +'defaultPlaybackRate', + +/** + * Get the value of `played` from the media element. `played` returns a `TimeRange` + * object representing points in the media timeline that have been played. + * + * @method Html5#played + * @return {TimeRange} + * The value of `played` from the media element. A `TimeRange` object indicating + * the ranges of time that have been played. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-played} + */ +'played', + +/** + * Get the value of `networkState` from the media element. `networkState` indicates + * the current network state. It returns an enumeration from the following list: + * - 0: NETWORK_EMPTY + * - 1: NEWORK_IDLE + * - 2: NETWORK_LOADING + * - 3: NETWORK_NO_SOURCE + * + * @method Html5#networkState + * @return {number} + * The value of `networkState` from the media element. This will be a number + * from the list in the description. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-networkstate} + */ +'networkState', + +/** + * Get the value of `readyState` from the media element. `readyState` indicates + * the current state of the media element. It returns an enumeration from the + * following list: + * - 0: HAVE_NOTHING + * - 1: HAVE_METADATA + * - 2: HAVE_CURRENT_DATA + * - 3: HAVE_FUTURE_DATA + * - 4: HAVE_ENOUGH_DATA + * + * @method Html5#readyState + * @return {number} + * The value of `readyState` from the media element. This will be a number + * from the list in the description. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#ready-states} + */ +'readyState', + +/** + * Get the value of `videoWidth` from the video element. `videoWidth` indicates + * the current width of the video in css pixels. + * + * @method Html5#videoWidth + * @return {number} + * The value of `videoWidth` from the video element. This will be a number + * in css pixels. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth} + */ +'videoWidth', + +/** + * Get the value of `videoHeight` from the video element. `videoHeigth` indicates + * the current height of the video in css pixels. + * + * @method Html5#videoHeight + * @return {number} + * The value of `videoHeight` from the video element. This will be a number + * in css pixels. + * + * @see [Spec] {@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth} + */ +'videoHeight'].forEach(function (prop) { + Html5.prototype[prop] = function () { + return this.el_[prop]; + }; +}); + +// Wrap native properties with a setter in this format: +// set + toTitleCase(name) +[ +/** + * Set the value of `volume` on the media element. `volume` indicates the current + * audio level as a percentage in decimal form. This means that 1 is 100%, 0.5 is 50%, and + * so on. + * + * @method Html5#setVolume + * @param {number} percentAsDecimal + * The volume percent as a decimal. Valid range is from 0-1. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-a-volume} + */ +'volume', + +/** + * Set the value of `muted` on the media element. `muted` indicates that the current + * audio level should be silent. + * + * @method Html5#setMuted + * @param {boolean} muted + * - True if the audio should be set to silent + * - False otherwise + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-muted} + */ +'muted', + +/** + * Set the value of `defaultMuted` on the media element. `defaultMuted` indicates that the current + * audio level should be silent, but will only effect the muted level on intial playback.. + * + * @method Html5.prototype.setDefaultMuted + * @param {boolean} defaultMuted + * - True if the audio should be set to silent + * - False otherwise + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultmuted} + */ +'defaultMuted', + +/** + * Set the value of `src` on the media element. `src` indicates the current + * {@link Tech~SourceObject} for the media. + * + * @method Html5#setSrc + * @param {Tech~SourceObject} src + * The source object to set as the current source. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-src} + */ +'src', + +/** + * Set the value of `poster` on the media element. `poster` is the url to + * an image file that can/will be shown when no media data is available. + * + * @method Html5#setPoster + * @param {string} poster + * The url to an image that should be used as the `poster` for the media + * element. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-poster} + */ +'poster', + +/** + * Set the value of `preload` on the media element. `preload` indicates + * what should download before the media is interacted with. It can have the following + * values: + * - none: nothing should be downloaded + * - metadata: poster and the first few frames of the media may be downloaded to get + * media dimensions and other metadata + * - auto: allow the media and metadata for the media to be downloaded before + * interaction + * + * @method Html5#setPreload + * @param {string} preload + * The value of `preload` to set on the media element. Must be 'none', 'metadata', + * or 'auto'. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-preload} + */ +'preload', + +/** + * Set the value of `autoplay` on the media element. `autoplay` indicates + * that the media should start to play as soon as the page is ready. + * + * @method Html5#setAutoplay + * @param {boolean} autoplay + * - True indicates that the media should start as soon as the page loads. + * - False indicates that the media should not start as soon as the page loads. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-autoplay} + */ +'autoplay', + +/** + * Set the value of `loop` on the media element. `loop` indicates + * that the media should return to the start of the media and continue playing once + * it reaches the end. + * + * @method Html5#setLoop + * @param {boolean} loop + * - True indicates that playback should seek back to start once + * the end of a media is reached. + * - False indicates that playback should not loop back to the start when the + * end of the media is reached. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#attr-media-loop} + */ +'loop', + +/** + * Set the value of `playbackRate` on the media element. `playbackRate` indicates + * the rate at which the media should play back. Examples: + * - if playbackRate is set to 2, media will play twice as fast. + * - if playbackRate is set to 0.5, media will play half as fast. + * + * @method Html5#setPlaybackRate + * @return {number} + * The value of `playbackRate` from the media element. A number indicating + * the current playback speed of the media, where 1 is normal speed. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-playbackrate} + */ +'playbackRate', + +/** + * Set the value of `defaultPlaybackRate` on the media element. `defaultPlaybackRate` indicates + * the rate at which the media should play back upon initial startup. Changing this value + * after a video has started will do nothing. Instead you should used {@link Html5#setPlaybackRate}. + * + * Example Values: + * - if playbackRate is set to 2, media will play twice as fast. + * - if playbackRate is set to 0.5, media will play half as fast. + * + * @method Html5.prototype.setDefaultPlaybackRate + * @return {number} + * The value of `defaultPlaybackRate` from the media element. A number indicating + * the current playback speed of the media, where 1 is normal speed. + * + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-defaultplaybackrate} + */ +'defaultPlaybackRate'].forEach(function (prop) { + Html5.prototype['set' + (0, _toTitleCase2['default'])(prop)] = function (v) { + this.el_[prop] = v; + }; +}); + +// wrap native functions with a function +[ +/** + * A wrapper around the media elements `pause` function. This will call the `HTML5` + * media elements `pause` function. + * + * @method Html5#pause + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-pause} + */ +'pause', + +/** + * A wrapper around the media elements `load` function. This will call the `HTML5`s + * media element `load` function. + * + * @method Html5#load + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-load} + */ +'load', + +/** + * A wrapper around the media elements `play` function. This will call the `HTML5`s + * media element `play` function. + * + * @method Html5#play + * @see [Spec]{@link https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-play} + */ +'play'].forEach(function (prop) { + Html5.prototype[prop] = function () { + return this.el_[prop](); + }; +}); + +_tech2['default'].withSourceHandlers(Html5); + +/** + * Native source handler for Html5, simply passes the source to the media element. + * + * @proprety {Tech~SourceObject} source + * The source object + * + * @proprety {Html5} tech + * The instance of the HTML5 tech. + */ +Html5.nativeSourceHandler = {}; + +/** + * Check if the media element can play the given mime type. + * + * @param {string} type + * The mimetype to check + * + * @return {string} + * 'probably', 'maybe', or '' (empty string) + */ +Html5.nativeSourceHandler.canPlayType = function (type) { + // IE9 on Windows 7 without MediaPlayer throws an error here + // https://github.com/videojs/video.js/issues/519 + try { + return Html5.TEST_VID.canPlayType(type); + } catch (e) { + return ''; + } +}; + +/** + * Check if the media element can handle a source natively. + * + * @param {Tech~SourceObject} source + * The source object + * + * @param {Object} [options] + * Options to be passed to the tech. + * + * @return {string} + * 'probably', 'maybe', or '' (empty string). + */ +Html5.nativeSourceHandler.canHandleSource = function (source, options) { + + // If a type was provided we should rely on that + if (source.type) { + return Html5.nativeSourceHandler.canPlayType(source.type); + + // If no type, fall back to checking 'video/[EXTENSION]' + } else if (source.src) { + var ext = Url.getFileExtension(source.src); + + return Html5.nativeSourceHandler.canPlayType('video/' + ext); + } + + return ''; +}; + +/** + * Pass the source to the native media element. + * + * @param {Tech~SourceObject} source + * The source object + * + * @param {Html5} tech + * The instance of the Html5 tech + * + * @param {Object} [options] + * The options to pass to the source + */ +Html5.nativeSourceHandler.handleSource = function (source, tech, options) { + tech.setSrc(source.src); +}; + +/** + * A noop for the native dispose function, as cleanup is not needed. + */ +Html5.nativeSourceHandler.dispose = function () {}; + +// Register the native source handler +Html5.registerSourceHandler(Html5.nativeSourceHandler); + +_tech2['default'].registerTech('Html5', Html5); +exports['default'] = Html5; + +},{"100":100,"103":103,"64":64,"77":77,"81":81,"85":85,"91":91,"92":92,"93":93,"96":96,"97":97,"99":99}],62:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _tech = _dereq_(64); + +var _tech2 = _interopRequireDefault(_tech); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +var _mergeOptions = _dereq_(92); + +var _mergeOptions2 = _interopRequireDefault(_mergeOptions); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file loader.js + */ + + +/** + * The `MediaLoader` is the `Component` that decides which playback technology to load + * when a player is initialized. + * + * @extends Component + */ +var MediaLoader = function (_Component) { + _inherits(MediaLoader, _Component); + + /** + * Create an instance of this class. + * + * @param {Player} player + * The `Player` that this class should attach to. + * + * @param {Object} [options] + * The key/value stroe of player options. + * + * @param {Component~ReadyCallback} [ready] + * The function that is run when this component is ready. + */ + function MediaLoader(player, options, ready) { + _classCallCheck(this, MediaLoader); + + // MediaLoader has no element + var options_ = (0, _mergeOptions2['default'])({ createEl: false }, options); + + // If there are no sources when the player is initialized, + // load the first supported playback technology. + + var _this = _possibleConstructorReturn(this, _Component.call(this, player, options_, ready)); + + if (!options.playerOptions.sources || options.playerOptions.sources.length === 0) { + for (var i = 0, j = options.playerOptions.techOrder; i < j.length; i++) { + var techName = (0, _toTitleCase2['default'])(j[i]); + var tech = _tech2['default'].getTech(techName); + + // Support old behavior of techs being registered as components. + // Remove once that deprecated behavior is removed. + if (!techName) { + tech = _component2['default'].getComponent(techName); + } + + // Check if the browser supports this technology + if (tech && tech.isSupported()) { + player.loadTech_(techName); + break; + } + } + } else { + // Loop through playback technologies (HTML5, Flash) and check for support. + // Then load the best source. + // A few assumptions here: + // All playback technologies respect preload false. + player.src(options.playerOptions.sources); + } + return _this; + } + + return MediaLoader; +}(_component2['default']); + +_component2['default'].registerComponent('MediaLoader', MediaLoader); +exports['default'] = MediaLoader; + +},{"5":5,"64":64,"92":92,"96":96}],63:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; +exports.allowedSetters = exports.allowedGetters = undefined; +exports.use = use; +exports.getMiddleware = getMiddleware; +exports.setSource = setSource; +exports.setTech = setTech; +exports.get = get; +exports.set = set; + +var _obj = _dereq_(93); + +var middlewares = {}; + +function use(type, middleware) { + middlewares[type] = middlewares[type] || []; + middlewares[type].push(middleware); +} + +function getMiddleware(type) { + if (type) { + return middlewares[type]; + } + + return middlewares; +} + +function setSource(player, src, next) { + player.setTimeout(function () { + return setSourceHelper(src, middlewares[src.type], next, player); + }, 1); +} + +function setTech(middleware, tech) { + middleware.forEach(function (mw) { + return mw.setTech && mw.setTech(tech); + }); +} + +function get(middleware, tech, method) { + return middleware.reduceRight(middlewareIterator(method), tech[method]()); +} + +function set(middleware, tech, method, arg) { + return tech[method](middleware.reduce(middlewareIterator(method), arg)); +} + +var allowedGetters = exports.allowedGetters = { + buffered: 1, + currentTime: 1, + duration: 1, + seekable: 1, + played: 1 +}; + +var allowedSetters = exports.allowedSetters = { + setCurrentTime: 1 +}; + +function middlewareIterator(method) { + return function (value, mw) { + if (mw[method]) { + return mw[method](value); + } + + return value; + }; +} + +function setSourceHelper() { + var src = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var middleware = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var next = arguments[2]; + var player = arguments[3]; + var acc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : []; + var lastRun = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; + var mwFactory = middleware[0], + mwrest = middleware.slice(1); + + // if mwFactory is a string, then we're at a fork in the road + + if (typeof mwFactory === 'string') { + setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun); + + // if we have an mwFactory, call it with the player to get the mw, + // then call the mw's setSource method + } else if (mwFactory) { + var mw = mwFactory(player); + + mw.setSource((0, _obj.assign)({}, src), function (err, _src) { + + // something happened, try the next middleware on the current level + // make sure to use the old src + if (err) { + return setSourceHelper(src, mwrest, next, player, acc, lastRun); + } + + // we've succeeded, now we need to go deeper + acc.push(mw); + + // if it's the same time, continue does the current chain + // otherwise, we want to go down the new chain + setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun); + }); + } else if (mwrest.length) { + setSourceHelper(src, mwrest, next, player, acc, lastRun); + } else if (lastRun) { + next(src, acc); + } else { + setSourceHelper(src, middlewares['*'], next, player, acc, true); + } +} + +},{"93":93}],64:[function(_dereq_,module,exports){ +'use strict'; + +exports.__esModule = true; + +var _component = _dereq_(5); + +var _component2 = _interopRequireDefault(_component); + +var _mergeOptions = _dereq_(92); + +var _mergeOptions2 = _interopRequireDefault(_mergeOptions); + +var _fn = _dereq_(88); + +var Fn = _interopRequireWildcard(_fn); + +var _log = _dereq_(91); + +var _log2 = _interopRequireDefault(_log); + +var _timeRanges = _dereq_(95); + +var _buffer = _dereq_(82); + +var _mediaError = _dereq_(49); + +var _mediaError2 = _interopRequireDefault(_mediaError); + +var _window = _dereq_(100); + +var _window2 = _interopRequireDefault(_window); + +var _document = _dereq_(99); + +var _document2 = _interopRequireDefault(_document); + +var _obj = _dereq_(93); + +var _trackTypes = _dereq_(77); + +var TRACK_TYPES = _interopRequireWildcard(_trackTypes); + +var _toTitleCase = _dereq_(96); + +var _toTitleCase2 = _interopRequireDefault(_toTitleCase); + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @file tech.js + */ + +/** + * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string + * that just contains the src url alone. + * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};` + * `var SourceString = 'http://example.com/some-video.mp4';` + * + * @typedef {Object|string} Tech~SourceObject + * + * @property {string} src + * The url to the source + * + * @property {string} type + * The mime type of the source + */ + +/** + * A function used by {@link Tech} to create a new {@link TextTrack}. + * + * @private + * + * @param {Tech} self + * An instance of the Tech class. + * + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @param {Object} [options={}] + * An object with additional text track options + * + * @return {TextTrack} + * The text track that was created. + */ +function createTrackHelper(self, kind, label, language) { + var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; + + var tracks = self.textTracks(); + + options.kind = kind; + + if (label) { + options.label = label; + } + if (language) { + options.language = language; + } + options.tech = self; + + var track = new TRACK_TYPES.ALL.text.TrackClass(options); + + tracks.addTrack(track); + + return track; +} + +/** + * This is the base class for media playback technology controllers, such as + * {@link Flash} and {@link HTML5} + * + * @extends Component + */ + +var Tech = function (_Component) { + _inherits(Tech, _Component); + + /** + * Create an instance of this Tech. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} ready + * Callback function to call when the `HTML5` Tech is ready. + */ + function Tech() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var ready = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + + _classCallCheck(this, Tech); + + // we don't want the tech to report user activity automatically. + // This is done manually in addControlsListeners + options.reportTouchActivity = false; + + // keep track of whether the current source has played at all to + // implement a very limited played() + var _this = _possibleConstructorReturn(this, _Component.call(this, null, options, ready)); + + _this.hasStarted_ = false; + _this.on('playing', function () { + this.hasStarted_ = true; + }); + _this.on('loadstart', function () { + this.hasStarted_ = false; + }); + + TRACK_TYPES.ALL.names.forEach(function (name) { + var props = TRACK_TYPES.ALL[name]; + + if (options && options[props.getterName]) { + _this[props.privateName] = options[props.getterName]; + } + }); + + // Manually track progress in cases where the browser/flash player doesn't report it. + if (!_this.featuresProgressEvents) { + _this.manualProgressOn(); + } + + // Manually track timeupdates in cases where the browser/flash player doesn't report it. + if (!_this.featuresTimeupdateEvents) { + _this.manualTimeUpdatesOn(); + } + + ['Text', 'Audio', 'Video'].forEach(function (track) { + if (options['native' + track + 'Tracks'] === false) { + _this['featuresNative' + track + 'Tracks'] = false; + } + }); + + if (options.nativeCaptions === false || options.nativeTextTracks === false) { + _this.featuresNativeTextTracks = false; + } else if (options.nativeCaptions === true || options.nativeTextTracks === true) { + _this.featuresNativeTextTracks = true; + } + + if (!_this.featuresNativeTextTracks) { + _this.emulateTextTracks(); + } + + _this.autoRemoteTextTracks_ = new TRACK_TYPES.ALL.text.ListClass(); + + _this.initTrackListeners(); + + // Turn on component tap events only if not using native controls + if (!options.nativeControlsForTouch) { + _this.emitTapEvents(); + } + + if (_this.constructor) { + _this.name_ = _this.constructor.name || 'Unknown Tech'; + } + return _this; + } + + /* Fallbacks for unsupported event types + ================================================================================ */ + + /** + * Polyfill the `progress` event for browsers that don't support it natively. + * + * @see {@link Tech#trackProgress} + */ + + + Tech.prototype.manualProgressOn = function manualProgressOn() { + this.on('durationchange', this.onDurationChange); + + this.manualProgress = true; + + // Trigger progress watching when a source begins loading + this.one('ready', this.trackProgress); + }; + + /** + * Turn off the polyfill for `progress` events that was created in + * {@link Tech#manualProgressOn} + */ + + + Tech.prototype.manualProgressOff = function manualProgressOff() { + this.manualProgress = false; + this.stopTrackingProgress(); + + this.off('durationchange', this.onDurationChange); + }; + + /** + * This is used to trigger a `progress` event when the buffered percent changes. It + * sets an interval function that will be called every 500 milliseconds to check if the + * buffer end percent has changed. + * + * > This function is called by {@link Tech#manualProgressOn} + * + * @param {EventTarget~Event} event + * The `ready` event that caused this to run. + * + * @listens Tech#ready + * @fires Tech#progress + */ + + + Tech.prototype.trackProgress = function trackProgress(event) { + this.stopTrackingProgress(); + this.progressInterval = this.setInterval(Fn.bind(this, function () { + // Don't trigger unless buffered amount is greater than last time + + var numBufferedPercent = this.bufferedPercent(); + + if (this.bufferedPercent_ !== numBufferedPercent) { + /** + * See {@link Player#progress} + * + * @event Tech#progress + * @type {EventTarget~Event} + */ + this.trigger('progress'); + } + + this.bufferedPercent_ = numBufferedPercent; + + if (numBufferedPercent === 1) { + this.stopTrackingProgress(); + } + }), 500); + }; + + /** + * Update our internal duration on a `durationchange` event by calling + * {@link Tech#duration}. + * + * @param {EventTarget~Event} event + * The `durationchange` event that caused this to run. + * + * @listens Tech#durationchange + */ + + + Tech.prototype.onDurationChange = function onDurationChange(event) { + this.duration_ = this.duration(); + }; + + /** + * Get and create a `TimeRange` object for buffering. + * + * @return {TimeRange} + * The time range object that was created. + */ + + + Tech.prototype.buffered = function buffered() { + return (0, _timeRanges.createTimeRange)(0, 0); + }; + + /** + * Get the percentage of the current video that is currently buffered. + * + * @return {number} + * A number from 0 to 1 that represents the decimal percentage of the + * video that is buffered. + * + */ + + + Tech.prototype.bufferedPercent = function bufferedPercent() { + return (0, _buffer.bufferedPercent)(this.buffered(), this.duration_); + }; + + /** + * Turn off the polyfill for `progress` events that was created in + * {@link Tech#manualProgressOn} + * Stop manually tracking progress events by clearing the interval that was set in + * {@link Tech#trackProgress}. + */ + + + Tech.prototype.stopTrackingProgress = function stopTrackingProgress() { + this.clearInterval(this.progressInterval); + }; + + /** + * Polyfill the `timeupdate` event for browsers that don't support it. + * + * @see {@link Tech#trackCurrentTime} + */ + + + Tech.prototype.manualTimeUpdatesOn = function manualTimeUpdatesOn() { + this.manualTimeUpdates = true; + + this.on('play', this.trackCurrentTime); + this.on('pause', this.stopTrackingCurrentTime); + }; + + /** + * Turn off the polyfill for `timeupdate` events that was created in + * {@link Tech#manualTimeUpdatesOn} + */ + + + Tech.prototype.manualTimeUpdatesOff = function manualTimeUpdatesOff() { + this.manualTimeUpdates = false; + this.stopTrackingCurrentTime(); + this.off('play', this.trackCurrentTime); + this.off('pause', this.stopTrackingCurrentTime); + }; + + /** + * Sets up an interval function to track current time and trigger `timeupdate` every + * 250 milliseconds. + * + * @listens Tech#play + * @triggers Tech#timeupdate + */ + + + Tech.prototype.trackCurrentTime = function trackCurrentTime() { + if (this.currentTimeInterval) { + this.stopTrackingCurrentTime(); + } + this.currentTimeInterval = this.setInterval(function () { + /** + * Triggered at an interval of 250ms to indicated that time is passing in the video. + * + * @event Tech#timeupdate + * @type {EventTarget~Event} + */ + this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); + + // 42 = 24 fps // 250 is what Webkit uses // FF uses 15 + }, 250); + }; + + /** + * Stop the interval function created in {@link Tech#trackCurrentTime} so that the + * `timeupdate` event is no longer triggered. + * + * @listens {Tech#pause} + */ + + + Tech.prototype.stopTrackingCurrentTime = function stopTrackingCurrentTime() { + this.clearInterval(this.currentTimeInterval); + + // #1002 - if the video ends right before the next timeupdate would happen, + // the progress bar won't make it all the way to the end + this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); + }; + + /** + * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList}, + * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech. + * + * @fires Component#dispose + */ + + + Tech.prototype.dispose = function dispose() { + + // clear out all tracks because we can't reuse them between techs + this.clearTracks(TRACK_TYPES.NORMAL.names); + + // Turn off any manual progress or timeupdate tracking + if (this.manualProgress) { + this.manualProgressOff(); + } + + if (this.manualTimeUpdates) { + this.manualTimeUpdatesOff(); + } + + _Component.prototype.dispose.call(this); + }; + + /** + * Clear out a single `TrackList` or an array of `TrackLists` given their names. + * + * > Note: Techs without source handlers should call this between sources for `video` + * & `audio` tracks. You don't want to use them between tracks! + * + * @param {string[]|string} types + * TrackList names to clear, valid names are `video`, `audio`, and + * `text`. + */ + + + Tech.prototype.clearTracks = function clearTracks(types) { + var _this2 = this; + + types = [].concat(types); + // clear out all tracks because we can't reuse them between techs + types.forEach(function (type) { + var list = _this2[type + 'Tracks']() || []; + var i = list.length; + + while (i--) { + var track = list[i]; + + if (type === 'text') { + _this2.removeRemoteTextTrack(track); + } + list.removeTrack(track); + } + }); + }; + + /** + * Remove any TextTracks added via addRemoteTextTrack that are + * flagged for automatic garbage collection + */ + + + Tech.prototype.cleanupAutoTextTracks = function cleanupAutoTextTracks() { + var list = this.autoRemoteTextTracks_ || []; + var i = list.length; + + while (i--) { + var track = list[i]; + + this.removeRemoteTextTrack(track); + } + }; + + /** + * Reset the tech, which will removes all sources and reset the internal readyState. + * + * @abstract + */ + + + Tech.prototype.reset = function reset() {}; + + /** + * Get or set an error on the Tech. + * + * @param {MediaError} [err] + * Error to set on the Tech + * + * @return {MediaError|null} + * The current error object on the tech, or null if there isn't one. + */ + + + Tech.prototype.error = function error(err) { + if (err !== undefined) { + this.error_ = new _mediaError2['default'](err); + this.trigger('error'); + } + return this.error_; + }; + + /** + * Returns the `TimeRange`s that have been played through for the current source. + * + * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`. + * It only checks wether the source has played at all or not. + * + * @return {TimeRange} + * - A single time range if this video has played + * - An empty set of ranges if not. + */ + + + Tech.prototype.played = function played() { + if (this.hasStarted_) { + return (0, _timeRanges.createTimeRange)(0, 0); + } + return (0, _timeRanges.createTimeRange)(); + }; + + /** + * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was + * previously called. + * + * @fires Tech#timeupdate + */ + + + Tech.prototype.setCurrentTime = function setCurrentTime() { + // improve the accuracy of manual timeupdates + if (this.manualTimeUpdates) { + /** + * A manual `timeupdate` event. + * + * @event Tech#timeupdate + * @type {EventTarget~Event} + */ + this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: true }); + } + }; + + /** + * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and + * {@link TextTrackList} events. + * + * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`. + * + * @fires Tech#audiotrackchange + * @fires Tech#videotrackchange + * @fires Tech#texttrackchange + */ + + + Tech.prototype.initTrackListeners = function initTrackListeners() { + var _this3 = this; + + /** + * Triggered when tracks are added or removed on the Tech {@link AudioTrackList} + * + * @event Tech#audiotrackchange + * @type {EventTarget~Event} + */ + + /** + * Triggered when tracks are added or removed on the Tech {@link VideoTrackList} + * + * @event Tech#videotrackchange + * @type {EventTarget~Event} + */ + + /** + * Triggered when tracks are added or removed on the Tech {@link TextTrackList} + * + * @event Tech#texttrackchange + * @type {EventTarget~Event} + */ + TRACK_TYPES.NORMAL.names.forEach(function (name) { + var props = TRACK_TYPES.NORMAL[name]; + var trackListChanges = function trackListChanges() { + _this3.trigger(name + 'trackchange'); + }; + + var tracks = _this3[props.getterName](); + + tracks.addEventListener('removetrack', trackListChanges); + tracks.addEventListener('addtrack', trackListChanges); + + _this3.on('dispose', function () { + tracks.removeEventListener('removetrack', trackListChanges); + tracks.removeEventListener('addtrack', trackListChanges); + }); + }); + }; + + /** + * Emulate TextTracks using vtt.js if necessary + * + * @fires Tech#vttjsloaded + * @fires Tech#vttjserror + */ + + + Tech.prototype.addWebVttScript_ = function addWebVttScript_() { + var _this4 = this; + + if (_window2['default'].WebVTT) { + return; + } + + // Initially, Tech.el_ is a child of a dummy-div wait until the Component system + // signals that the Tech is ready at which point Tech.el_ is part of the DOM + // before inserting the WebVTT script + if (_document2['default'].body.contains(this.el())) { + var vtt = _dereq_(104); + + // load via require if available and vtt.js script location was not passed in + // as an option. novtt builds will turn the above require call into an empty object + // which will cause this if check to always fail. + if (!this.options_['vtt.js'] && (0, _obj.isPlain)(vtt) && Object.keys(vtt).length > 0) { + this.trigger('vttjsloaded'); + return; + } + + // load vtt.js via the script location option or the cdn of no location was + // passed in + var script = _document2['default'].createElement('script'); + + script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.12.3/vtt.min.js'; + script.onload = function () { + /** + * Fired when vtt.js is loaded. + * + * @event Tech#vttjsloaded + * @type {EventTarget~Event} + */ + _this4.trigger('vttjsloaded'); + }; + script.onerror = function () { + /** + * Fired when vtt.js was not loaded due to an error + * + * @event Tech#vttjsloaded + * @type {EventTarget~Event} + */ + _this4.trigger('vttjserror'); + }; + this.on('dispose', function () { + script.onload = null; + script.onerror = null; + }); + // but have not loaded yet and we set it to true before the inject so that + // we don't overwrite the injected window.WebVTT if it loads right away + _window2['default'].WebVTT = true; + this.el().parentNode.appendChild(script); + } else { + this.ready(this.addWebVttScript_); + } + }; + + /** + * Emulate texttracks + * + */ + + + Tech.prototype.emulateTextTracks = function emulateTextTracks() { + var _this5 = this; + + var tracks = this.textTracks(); + var remoteTracks = this.remoteTextTracks(); + var handleAddTrack = function handleAddTrack(e) { + return tracks.addTrack(e.track); + }; + var handleRemoveTrack = function handleRemoveTrack(e) { + return tracks.removeTrack(e.track); + }; + + remoteTracks.on('addtrack', handleAddTrack); + remoteTracks.on('removetrack', handleRemoveTrack); + + this.addWebVttScript_(); + + var updateDisplay = function updateDisplay() { + return _this5.trigger('texttrackchange'); + }; + + var textTracksChanges = function textTracksChanges() { + updateDisplay(); + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + track.removeEventListener('cuechange', updateDisplay); + if (track.mode === 'showing') { + track.addEventListener('cuechange', updateDisplay); + } + } + }; + + textTracksChanges(); + tracks.addEventListener('change', textTracksChanges); + tracks.addEventListener('addtrack', textTracksChanges); + tracks.addEventListener('removetrack', textTracksChanges); + + this.on('dispose', function () { + remoteTracks.off('addtrack', handleAddTrack); + remoteTracks.off('removetrack', handleRemoveTrack); + tracks.removeEventListener('change', textTracksChanges); + tracks.removeEventListener('addtrack', textTracksChanges); + tracks.removeEventListener('removetrack', textTracksChanges); + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + + track.removeEventListener('cuechange', updateDisplay); + } + }); + }; + + /** + * Create and returns a remote {@link TextTrack} object. + * + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @return {TextTrack} + * The TextTrack that gets created. + */ + + + Tech.prototype.addTextTrack = function addTextTrack(kind, label, language) { + if (!kind) { + throw new Error('TextTrack kind is required but was not provided'); + } + + return createTrackHelper(this, kind, label, language); + }; + + /** + * Create an emulated TextTrack for use by addRemoteTextTrack + * + * This is intended to be overridden by classes that inherit from + * Tech in order to create native or custom TextTracks. + * + * @param {Object} options + * The object should contain the options to initialize the TextTrack with. + * + * @param {string} [options.kind] + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata). + * + * @param {string} [options.label]. + * Label to identify the text track + * + * @param {string} [options.language] + * Two letter language abbreviation. + * + * @return {HTMLTrackElement} + * The track element that gets created. + */ + + + Tech.prototype.createRemoteTextTrack = function createRemoteTextTrack(options) { + var track = (0, _mergeOptions2['default'])(options, { + tech: this + }); + + return new TRACK_TYPES.REMOTE.remoteTextEl.TrackClass(track); + }; + + /** + * Creates a remote text track object and returns an html track element. + * + * > Note: This can be an emulated {@link HTMLTrackElement} or a native one. + * + * @param {Object} options + * See {@link Tech#createRemoteTextTrack} for more detailed properties. + * + * @param {boolean} [manualCleanup=true] + * - When false: the TextTrack will be automatically removed from the video + * element whenever the source changes + * - When True: The TextTrack will have to be cleaned up manually + * + * @return {HTMLTrackElement} + * An Html Track Element. + * + * @deprecated The default functionality for this function will be equivalent + * to "manualCleanup=false" in the future. The manualCleanup parameter will + * also be removed. + */ + + + Tech.prototype.addRemoteTextTrack = function addRemoteTextTrack() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var manualCleanup = arguments[1]; + + var htmlTrackElement = this.createRemoteTextTrack(options); + + if (manualCleanup !== true && manualCleanup !== false) { + // deprecation warning + _log2['default'].warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'); + manualCleanup = true; + } + + // store HTMLTrackElement and TextTrack to remote list + this.remoteTextTrackEls().addTrackElement_(htmlTrackElement); + this.remoteTextTracks().addTrack(htmlTrackElement.track); + + if (manualCleanup !== true) { + // create the TextTrackList if it doesn't exist + this.autoRemoteTextTracks_.addTrack(htmlTrackElement.track); + } + + return htmlTrackElement; + }; + + /** + * Remove a remote text track from the remote `TextTrackList`. + * + * @param {TextTrack} track + * `TextTrack` to remove from the `TextTrackList` + */ + + + Tech.prototype.removeRemoteTextTrack = function removeRemoteTextTrack(track) { + var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); + + // remove HTMLTrackElement and TextTrack from remote list + this.remoteTextTrackEls().removeTrackElement_(trackElement); + this.remoteTextTracks().removeTrack(track); + this.autoRemoteTextTracks_.removeTrack(track); + }; + + /** + * Gets available media playback quality metrics as specified by the W3C's Media + * Playback Quality API. + * + * @see [Spec]{@link https://wicg.github.io/media-playback-quality} + * + * @return {Object} + * An object with supported media playback quality metrics + * + * @abstract + */ + + + Tech.prototype.getVideoPlaybackQuality = function getVideoPlaybackQuality() { + return {}; + }; + + /** + * A method to set a poster from a `Tech`. + * + * @abstract + */ + + + Tech.prototype.setPoster = function setPoster() {}; + + /** + * A method to check for the presence of the 'playsinine'