diff --git a/Doc/Sd1/arrays.xml b/Doc/Sd1/arrays.xml index 8e4832c1c72aececc44a9a6de50cce23fefd633f..3a87a180f9f5a23db1615febee513ddfbd1d209c 100644 --- a/Doc/Sd1/arrays.xml +++ b/Doc/Sd1/arrays.xml @@ -77,7 +77,7 @@ <answer> <annotation role="make"> - <para role="eclipse">P/Sd1/Array/StringArray2Html</para> + <para role="eclipse">Sd1/Array/StringArray2Html</para> </annotation> </answer> </qandaentry> diff --git a/Doc/Sd1/coreClasses.xml b/Doc/Sd1/coreClasses.xml index 147612ccd92cc2ccc1e58354279d3eb058686d74..649f40c10a0e5f7085ad73253f7b2838adef673c 100644 --- a/Doc/Sd1/coreClasses.xml +++ b/Doc/Sd1/coreClasses.xml @@ -334,7 +334,7 @@ public class CircleAreaCalculator { <para>Representing the above string in a <xref linkend="glo_Java"/> program may be cumbersome due to its excessive length discouraging a single line representation. - You may favor decomposing it to a set of smaller string + You may favor assembling it from smaller string literals:</para> <programlisting language="java">final String input = "731671765 ... 94934" @@ -377,30 +377,28 @@ public class CircleAreaCalculator { substrings of 13 adjacent digits:</para> <programlisting language="java"> public static void main(String[] args) { - final String - input = "73167176531330624919225119674426574742355349194934" - + "96983520312774506326239578318016984801869478851843" - + "85861560789112949495459501737958331952853208805511" - + "12540698747158523863050715693290963295227443043557" - + "66896648950445244523161731856403098711121722383113" - + "62229893423380308135336276614282806444486645238749" - + "30358907296290491560440772390713810515859307960866" - + "70172427121883998797908792274921901699720888093776" - + "65727333001053367881220235421809751254540594752243" - + "52584907711670556013604839586446706324415722155397" - + "53697817977846174064955149290862569321978468622482" - + "83972241375657056057490261407972968652414535100474" - + "82166370484403199890008895243450658541227588666881" - + "16427171479924442928230863465674813919123162824586" - + "17866458359124566529476545682848912883142607690042" - + "24219022671055626321111109370544217506941658960408" - + "07198403850962455444362981230987879927244284909188" - + "84580156166097919133875499200524063689912560717606" - + "05886116467109405077541002256983155200055935729725" - + "71636269561882670428252483600823257530420752963450"; - - final int numOfDigits = 13; // The intended number of adjacent digits + input = "73167176531330624919225119674426574742355349194934" + + "96983520312774506326239578318016984801869478851843" + + "85861560789112949495459501737958331952853208805511" + + "12540698747158523863050715693290963295227443043557" + + "66896648950445244523161731856403098711121722383113" + + "62229893423380308135336276614282806444486645238749" + + "30358907296290491560440772390713810515859307960866" + + "70172427121883998797908792274921901699720888093776" + + "65727333001053367881220235421809751254540594752243" + + "52584907711670556013604839586446706324415722155397" + + "53697817977846174064955149290862569321978468622482" + + "83972241375657056057490261407972968652414535100474" + + "82166370484403199890008895243450658541227588666881" + + "16427171479924442928230863465674813919123162824586" + + "17866458359124566529476545682848912883142607690042" + + "24219022671055626321111109370544217506941658960408" + + "07198403850962455444362981230987879927244284909188" + + "84580156166097919133875499200524063689912560717606" + + "05886116467109405077541002256983155200055935729725"; + + final int numOfDigits = 13; // The intended number of adjacent digits for (int i = 0; i < input.length() - numOfDigits + 1; i++) { final String fourDigitWord = input.substring(i, i + numOfDigits); @@ -446,29 +444,6 @@ public class CircleAreaCalculator { } }</programlisting> - <para>Remark: Since both Unicode and <xref linkend="glo_ASCII"/> - represent digits by 10 successive integer values we may as well - choose the following implementation:</para> - - <programlisting language="java"> private static int getDigitValue (final char digit) { - switch(digit) { - case '0': return 0; - case '1': return 1; - case '2': return 2; - case '3': return 3; - case '4': return 4; - case '5': return 5; - case '6': return 6; - case '7': return 7; - case '8': return 8; - case '9': return 9; - default: - System.err.println("Character '" + digit + "' is no digit, exiting"); - System.exit(1); - return 0; - } - }</programlisting> - <para>Next we must compute a given string's product of digits. Taking the first value <code>7316717653133</code> from above we are looking for 7 × 3 ×1 × 6 ×7 × 1 ×7 × 6 × 5 × 3 × 1 × 3 × 3 = @@ -482,7 +457,7 @@ public class CircleAreaCalculator { return product; }</programlisting> - <para>Unfortunately the method sometimes returns weird results. + <para>Unfortunately this method sometimes returns weird results: The argument <code>"5397536978179"</code> for example returns -1594459696. This negative value is due to an arithmetic overflow: The product 5 × 3 × 9 × 7 × 5 × 3 × 6 × 9 × 7 × 8 × 1 × 7 × 9 is @@ -509,47 +484,48 @@ public class CircleAreaCalculator { return product; }</programlisting> - <para>Putting these pieces together leaves us with the following + <para>Assembling these pieces leaves us with the following <code>main(...)</code> method:</para> <programlisting language="java"> public static void main(String[] args) { - String input = "73167176531330624919225119674426574742355349194934" - + "96983520312774506326239578318016984801869478851843" - + "85861560789112949495459501737958331952853208805511" - + "12540698747158523863050715693290963295227443043<emphasis - role="bold">557</emphasis>" <co + final String + input = "73167176531330624919225119674426574742355349194934" + + "96983520312774506326239578318016984801869478851843" + + "85861560789112949495459501737958331952853208805511" + + "12540698747158523863050715693290963295227443043<emphasis + role="bold">557</emphasis>" + + "<emphasis role="bold">6689664895</emphasis>0445244523161731856403098711121722383113" <co xml:id="sd1CoMaxProductSequence"/> - + "<emphasis role="bold">6689664895</emphasis>0445244523161731856403098711121722383113" - + "62229893423380308135336276614282806444486645238749" - + "30358907296290491560440772390713810515859307960866" - + "70172427121883998797908792274921901699720888093776" - + "65727333001053367881220235421809751254540594752243" - + "52584907711670556013604839586446706324415722155397" - + "53697817977846174064955149290862569321978468622482" - + "83972241375657056057490261407972968652414535100474" - + "82166370484403199890008895243450658541227588666881" - + "16427171479924442928230863465674813919123162824586" - + "17866458359124566529476545682848912883142607690042" - + "24219022671055626321111109370544217506941658960408" - + "07198403850962455444362981230987879927244284909188" - + "84580156166097919133875499200524063689912560717606" - + "05886116467109405077541002256983155200055935729725" - + "71636269561882670428252483600823257530420752963450"; - + + "62229893423380308135336276614282806444486645238749" + + "30358907296290491560440772390713810515859307960866" + + "70172427121883998797908792274921901699720888093776" + + "65727333001053367881220235421809751254540594752243" + + "52584907711670556013604839586446706324415722155397" + + "53697817977846174064955149290862569321978468622482" + + "83972241375657056057490261407972968652414535100474" + + "82166370484403199890008895243450658541227588666881" + + "16427171479924442928230863465674813919123162824586" + + "17866458359124566529476545682848912883142607690042" + + "24219022671055626321111109370544217506941658960408" + + "07198403850962455444362981230987879927244284909188" + + "84580156166097919133875499200524063689912560717606" + + "05886116467109405077541002256983155200055935729725"; + final int numOfDigits = 13; // The intended number of adjacent digits long maximumDigitProduct = 0; - + String maxDigitString = null; for (int i = 0; i < input.length() - numOfDigits + 1; i++) { - final String fourDigitWord = input.substring(i, i + numOfDigits); - final long productOfDigits = getDigitProduct(fourDigitWord); + final String digitWord = input.substring(i, i + numOfDigits); + final long productOfDigits = getDigitProduct(digitWord); if (maximumDigitProduct < productOfDigits) { maximumDigitProduct = productOfDigits; + maxDigitString = digitWord; } } - System.out.println("The largest product of " + numOfDigits + " digits in - succession is " + maximumDigitProduct + "."); + System.out.println("The substring '" + maxDigitString + + "' yields the largest product value " + getDigitProduct(maxDigitString) + "."); }</programlisting> <para>The largest product of 13 successive digits stems from the @@ -558,7 +534,7 @@ public class CircleAreaCalculator { digits in the fourth definition line of <code>String input = ...</code>.</para> - <programlisting language="none">The largest product of 13 digits in succession is 23514624000.</programlisting> + <programlisting language="none">The substring '5576689664895' yields the largest product value 23514624000.</programlisting> </answer> </qandaentry> </qandadiv> diff --git a/Doc/Sda1/jdbc.xml b/Doc/Sda1/jdbc.xml index 4d399da829eefd6d2edf0e61da7c3d185bdd7717..a9bba2538685d31e4e3820737053bb7b110abfd1 100644 --- a/Doc/Sda1/jdbc.xml +++ b/Doc/Sda1/jdbc.xml @@ -1220,7 +1220,7 @@ public class SimpleInsert { <answer> <annotation role="make"> - <para role="eclipse">P/Sda1/InsertGui/V2</para> + <para role="eclipse">Sda1/InsertGui/V2</para> </annotation> <para>The included README.md contains hints with respect to @@ -1307,7 +1307,7 @@ public class SimpleInsert { <answer> <annotation role="make"> - <para role="eclipse">P/Sda1/InsertGui/V4</para> + <para role="eclipse">Sda1/InsertGui/V4</para> </annotation> <para>Detecting primary key violations this way will only work diff --git a/P/Sda1/InsertGui/V6/.gitignore b/P/Sda1/InsertGui/V6/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..c761c2a942224cfaf1bb828ca7fe53c6def3f153 --- /dev/null +++ b/P/Sda1/InsertGui/V6/.gitignore @@ -0,0 +1,6 @@ +/target/ +/.settings/ +src/main/webapp/VAADIN/themes/mytheme/styles.scss.cache +A1.log +.classpath +.project diff --git a/P/Sda1/InsertGui/V6/README.md b/P/Sda1/InsertGui/V6/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9c49b3ff962cf92d5198bb8f8eb0394ac2e8454d --- /dev/null +++ b/P/Sda1/InsertGui/V6/README.md @@ -0,0 +1,37 @@ +addressinsert +============== + +Inserting address records into a relational database. + +Workflow +======== + +To compile the entire project, run "mvn install". +To run the application, run "mvn jetty:run" and open http://localhost:8080/ . + +To develop the theme, simply update the relevant theme files and reload the application. +Pre-compiling a theme eliminates automatic theme updates at runtime - see below for more information. + +Debugging client side code + - run "mvn vaadin:run-codeserver" on a separate console while the application is running + - activate Super Dev Mode in the debug window of the application + +To produce a deployable production mode WAR: +- change productionMode to true in the servlet class configuration (nested in the UI class) +- run "mvn clean vaadin:compile-theme package" + - See below for more information. Running "mvn clean" removes the pre-compiled theme. +- test with "mvn jetty:run-war + +Using a precompiled theme +------------------------- + +When developing the application, Vaadin can compile the theme on the fly when needed, +or the theme can be precompiled to speed up page loads. + +To precompile the theme run "mvn vaadin:compile-theme". Note, though, that once +the theme has been precompiled, any theme changes will not be visible until the +next theme compilation or running the "mvn clean" target. + +When developing the theme, running the application in the "run" mode (rather than +in "debug") in the IDE can speed up consecutive on-the-fly theme compilations +significantly. diff --git a/P/Sda1/InsertGui/V6/Schema/schema.sql b/P/Sda1/InsertGui/V6/Schema/schema.sql new file mode 100644 index 0000000000000000000000000000000000000000..455914cbbe45876124933c0888574a1d57c80eb5 --- /dev/null +++ b/P/Sda1/InsertGui/V6/Schema/schema.sql @@ -0,0 +1,9 @@ +CREATE TABLE Person ( + name CHAR(20) NOT NULL, + email CHAR(20) PRIMARY KEY + +); + +DELETE FROM Person; + +SELECT * FROM Person; \ No newline at end of file diff --git a/P/Sda1/InsertGui/V6/pom.xml b/P/Sda1/InsertGui/V6/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..c94b30a48c68d1bd19e51d37716544ab050757cf --- /dev/null +++ b/P/Sda1/InsertGui/V6/pom.xml @@ -0,0 +1,215 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>de.hdm-stuttgart.mi</groupId> + <artifactId>lecturenotes-pom</artifactId> + <version>1.0</version> + <relativePath>../../../pom.xml</relativePath> + </parent> + + <groupId>de.hdm_stuttgart.mi</groupId> + <artifactId>addressinsert</artifactId> + <packaging>war</packaging> + <version>6.0</version> + <name>addressinsert</name> + + <properties> + <vaadin.version>7.5.7</vaadin.version> + <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version> + <jetty.plugin.version>9.2.3.v20140905</jetty.plugin.version> + <project.source.version>1.8</project.source.version> + <project.target.version>1.8</project.target.version> + <project.encoding>UTF-8</project.encoding> + </properties> + + <repositories> + <repository> + <id>vaadin-addons</id> + <url>http://maven.vaadin.com/vaadin-addons</url> + </repository> + <repository> + <id>vaadin-snapshots</id> + <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-bom</artifactId> + <version>${vaadin.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>javax.servlet-api</artifactId> + <version>3.0.1</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-server</artifactId> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-push</artifactId> + </dependency> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-client</artifactId> + <scope>provided</scope> + </dependency> + <!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory). + For widgetset compilation, vaadin-client-compiler is automatically added + on the compilation classpath by vaadin-maven-plugin so normally there is + no need for an explicit dependency. --> + <!-- <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-client-compiler</artifactId> + <scope>provided</scope> </dependency> --> + <dependency> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-themes</artifactId> + </dependency> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + <version>5.1.35</version> + </dependency> + + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.6</version> + <configuration> + <encoding>${project.encoding}</encoding> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>2.3</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + <!-- Exclude some unnecessary files generated by the GWT compiler. --> + <packagingExcludes>WEB-INF/classes/VAADIN/gwt-unitCache/**, + WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes> + </configuration> + </plugin> + <plugin> + <groupId>com.vaadin</groupId> + <artifactId>vaadin-maven-plugin</artifactId> + <version>${vaadin.plugin.version}</version> + <configuration> + <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs> + <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory> + <draftCompile>false</draftCompile> + <compileReport>false</compileReport> + <style>OBF</style> + <strict>true</strict> + </configuration> + <executions> + <execution> + <goals> + <goal>update-theme</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + <!-- disabled by default to use on-the-fly theme compilation --> + <!-- <goal>compile-theme</goal> --> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>2.4</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>2.6.1</version> + <!-- Clean up also any pre-compiled themes --> + <configuration> + <filesets> + <fileset> + <directory>src/main/webapp/VAADIN/themes</directory> + <includes> + <include>**/styles.css</include> + <include>**/styles.scss.cache</include> + </includes> + </fileset> + </filesets> + </configuration> + </plugin> + + <!-- The Jetty plugin allows us to easily test the development build by + running jetty:run on the command line. --> + <plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty.plugin.version}</version> + <configuration> + <scanIntervalSeconds>2</scanIntervalSeconds> + </configuration> + </plugin> + </plugins> + + <pluginManagement> + <plugins> + <!--This plugin's configuration is used to store Eclipse m2e settings + only. It has no influence on the Maven build itself. --> + <!-- TODO Remove when http://dev.vaadin.com/ticket/14924 is resolved --> + <plugin> + <groupId>org.eclipse.m2e</groupId> + <artifactId>lifecycle-mapping</artifactId> + <version>1.0.0</version> + <configuration> + <lifecycleMappingMetadata> + <pluginExecutions> + <pluginExecution> + <pluginExecutionFilter> + <groupId>com.vaadin</groupId> + <artifactId> + vaadin-maven-plugin + </artifactId> + <versionRange>[7.1.11,)</versionRange> + <goals> + <goal>resources</goal> + <goal>update-widgetset</goal> + <goal>compile</goal> + <goal>compile-theme</goal> + <goal>update-theme</goal> + </goals> + </pluginExecutionFilter> + <action> + <ignore></ignore> + </action> + </pluginExecution> + </pluginExecutions> + </lifecycleMappingMetadata> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + </build> + +</project> diff --git a/P/Sda1/InsertGui/V6/src/main/java/de/hdm_stuttgart/mi/LoginUI.java b/P/Sda1/InsertGui/V6/src/main/java/de/hdm_stuttgart/mi/LoginUI.java new file mode 100644 index 0000000000000000000000000000000000000000..a81e57eab3a29c2a70fba1cd230876c45444be1b --- /dev/null +++ b/P/Sda1/InsertGui/V6/src/main/java/de/hdm_stuttgart/mi/LoginUI.java @@ -0,0 +1,134 @@ +package de.hdm_stuttgart.mi; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.servlet.annotation.WebServlet; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException; +import com.vaadin.annotations.Theme; +import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.annotations.Widgetset; +import com.vaadin.data.validator.EmailValidator; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinServlet; +import com.vaadin.server.ClientConnector.DetachListener; +import com.vaadin.ui.Button; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; +import com.vaadin.ui.TextField; +import com.vaadin.ui.UI; + +@Theme("mytheme") +@Widgetset("de.hdm_stuttgart.mi.MyAppWidgetset") +public class LoginUI extends UI implements DetachListener { + + private static final long serialVersionUID = 9013400739498375365L; + + private static Logger log = LogManager.getLogger(LoginUI.class); + + Statement stmt; + + private final TextField + nameField = new TextField(), + emailField = new TextField(); + + private Button + insertButton = new Button("Insert"); + + public LoginUI () { + final String jdbcUrl = "jdbc:mysql://localhost:3306/hdm"; + try { + final Connection conn = DriverManager.getConnection( + jdbcUrl, "hdmuser", "XYZ"); + stmt = conn.createStatement(); + } catch (SQLException ex) { + log.error("Unable to connect to database using '" + jdbcUrl + "':", ex); + stmt = null; + } + } + + @Override + public void detach(DetachEvent event) { + if (null != stmt) { + try { + stmt.getConnection().close(); + } catch (final SQLException ex) { + log.error("Unable to disconnect from database:", ex); + } + stmt = null; + } + } + + void conditionallyActivateInsertButton() { + final boolean isValid = + 0 < nameField.getValue().trim().length() && + 0 < emailField.getValue().trim().length() && + emailField.isValid(); + + insertButton.setEnabled(isValid); + } + + @Override + protected void init(final VaadinRequest vaadinRequest) { + + final GridLayout layout = new GridLayout(2, 3); + layout.setMargin(true); + setContent(layout); + + + if (null == stmt) { // Database access failed? No hope ... + layout.addComponent(new Label("Unable to connect to database server, see log for details"), 0, 0); + return; + } + // Assembling GUI components + layout.addComponent(new Label("Name:"), 0, 0); + layout.addComponent(nameField, 1, 0); + + layout.addComponent(new Label("Email:"), 0, 1); + layout.addComponent(emailField, 1, 1); + + layout.addComponent(insertButton, 1, 2); + + // Inserting requires valid user input. + insertButton.setEnabled(false); + + // Caveat: Vaadin's validator will refuse e.g. "domainregistry@de" + // and may generally be non-RFC compliant. + emailField.addValidator(new EmailValidator("Not a valid email")); + + // Check for global user input validity + nameField.addValueChangeListener(event -> conditionallyActivateInsertButton()); + emailField.addValueChangeListener(event -> conditionallyActivateInsertButton()); + + insertButton.addClickListener(event -> { + final String sql = "INSERT INTO Person VALUES('" + nameField.getValue() + "', '" + + emailField.getValue() + "')"; + try { + final int updateCount = stmt.executeUpdate(sql); + emailField.clear(); + nameField.clear(); + Notification.show("Successfully executed \n'" + sql + "'\ninserting " + + updateCount + " dataset"); + + } catch (final MySQLIntegrityConstraintViolationException ex) {// Duplicate email? + Notification.show("E-Mail already in database", Notification.Type.ERROR_MESSAGE); + } catch(final SQLException ex) {// Other SQL problems + Notification.show("Failed to insert record, see log for details", Notification.Type.ERROR_MESSAGE); + log.error("JDBC exception on data insert:", ex); + } + }); + } + + @WebServlet(urlPatterns = "/*", name = "LoginUIServlet", asyncSupported = true) + @VaadinServletConfiguration(ui = LoginUI.class, productionMode = false) + public static class LoginUIServlet extends VaadinServlet { + private static final long serialVersionUID = -8657597788907698974L; + } +} diff --git a/P/Sda1/InsertGui/V6/src/main/resources/de/hdm_stuttgart/mi/MyAppWidgetset.gwt.xml b/P/Sda1/InsertGui/V6/src/main/resources/de/hdm_stuttgart/mi/MyAppWidgetset.gwt.xml new file mode 100644 index 0000000000000000000000000000000000000000..763aa41e875c8cb9f06805d0de49ee09e2c72cdf --- /dev/null +++ b/P/Sda1/InsertGui/V6/src/main/resources/de/hdm_stuttgart/mi/MyAppWidgetset.gwt.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" + "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd"> +<module> + <inherits name="com.vaadin.DefaultWidgetSet"/> +</module> diff --git a/P/Sda1/InsertGui/V6/src/main/resources/log4j2.xml b/P/Sda1/InsertGui/V6/src/main/resources/log4j2.xml new file mode 100644 index 0000000000000000000000000000000000000000..436cd31a91ff33f1d6088b9cb32e478558a969f7 --- /dev/null +++ b/P/Sda1/InsertGui/V6/src/main/resources/log4j2.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration> + + <Appenders> + + <File name="A1" fileName="A1.log" append="false"> + <PatternLayout pattern="%t %-5p %c{2} - %m%n"/> + </File> + <Console name="STDOUT" target="SYSTEM_OUT"> + <PatternLayout pattern="%C{2} (%F:%L) - %m%n"/> + </Console> + </Appenders> + <Loggers> + + <!-- You my want to define class or package level per-logger rules --> + <Logger name="de.hdm_stuttgart.mi.sda1.xmlstatistics.App" level="info"> + <AppenderRef ref="STDOUT"/> + </Logger> + <Root level="info"> + <AppenderRef ref="STDOUT"/> + <AppenderRef ref="A1"/> + </Root> + </Loggers> +</Configuration> \ No newline at end of file diff --git a/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/addons.scss b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/addons.scss new file mode 100644 index 0000000000000000000000000000000000000000..a5670b70c7eabbe8cf233f10dc9bfeb2fac29f41 --- /dev/null +++ b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/addons.scss @@ -0,0 +1,7 @@ +/* This file is automatically managed and will be overwritten from time to time. */ +/* Do not manually edit this file. */ + +/* Import and include this mixin into your project theme to include the addon themes */ +@mixin addons { +} + diff --git a/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/favicon.ico b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..ffb34a65c73eb1b3d59dcbb8f18ec78a8b0fc767 Binary files /dev/null and b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/favicon.ico differ diff --git a/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/mytheme.scss b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/mytheme.scss new file mode 100644 index 0000000000000000000000000000000000000000..c6aa865f29e4eefba17a1b5e5735c665d4ba87c2 --- /dev/null +++ b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/mytheme.scss @@ -0,0 +1,36 @@ +// Global variable overrides. Must be declared before importing Valo. + +// Defines the plaintext font size, weight and family. Font size affects general component sizing. +//$v-font-size: 16px; +//$v-font-weight: 300; +//$v-font-family: "Open Sans", sans-serif; + +// Defines the border used by all components. +//$v-border: 1px solid (v-shade 0.7); +//$v-border-radius: 4px; + +// Affects the color of some component elements, e.g Button, Panel title, etc +//$v-background-color: hsl(210, 0%, 98%); +// Affects the color of content areas, e.g Panel and Window content, TextField input etc +//$v-app-background-color: $v-background-color; + +// Affects the visual appearance of all components +//$v-gradient: v-linear 8%; +//$v-bevel-depth: 30%; +//$v-shadow-opacity: 5%; + +// Defines colors for indicating status (focus, success, failure) +//$v-focus-color: valo-focus-color(); // Calculates a suitable color automatically +//$v-friendly-color: #2c9720; +//$v-error-indicator-color: #ed473b; + +// For more information, see: https://vaadin.com/book/-/page/themes.valo.html +// Example variants can be copy/pasted from https://vaadin.com/wiki/-/wiki/Main/Valo+Examples + +@import "../valo/valo.scss"; + +@mixin mytheme { + @include valo; + + // Insert your own theme rules here +} diff --git a/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/styles.scss b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/styles.scss new file mode 100644 index 0000000000000000000000000000000000000000..bba1d493c0c0dad0be8dae040a2007535c8720ad --- /dev/null +++ b/P/Sda1/InsertGui/V6/src/main/webapp/VAADIN/themes/mytheme/styles.scss @@ -0,0 +1,11 @@ +@import "mytheme.scss"; +@import "addons.scss"; + +// This file prefixes all rules with the theme name to avoid causing conflicts with other themes. +// The actual styles should be defined in mytheme.scss + +.mytheme { + @include addons; + @include mytheme; + +} diff --git a/P/pom.xml b/P/pom.xml index d3f4d4382689880990dabe9e8ece0584280d1a05..a93e94cd8869c92dcc6ca330f4304f96b118aa04 100644 --- a/P/pom.xml +++ b/P/pom.xml @@ -120,6 +120,7 @@ <module>Sda1/InsertGui/V2</module> <module>Sda1/InsertGui/V4</module> + <module>Sda1/InsertGui/V6</module> <module>Sda1/Streams/Solution</module> <module>Sda1/Streams/Template</module>