Skip to content
Snippets Groups Projects
Commit d6eca7d1 authored by Eike Cochu's avatar Eike Cochu
Browse files

updated projects to java 1.8

added patch method + empty method stubs
added example topic editing (not completely working)
changed ui template structure and routes for more nesting
parent 249c9d73
Branches
No related tags found
No related merge requests found
Showing
with 132 additions and 226 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> <attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>
</attributes> </attributes>
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name> <name>org.eclipse.wst.validation.validationbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
......
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding/<project>=UTF-8 encoding/<project>=UTF-8
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
<fixed facet="java"/> <fixed facet="java"/>
<fixed facet="jst.utility"/> <fixed facet="jst.utility"/>
<installed facet="jst.utility" version="1.0"/> <installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.7"/> <installed facet="java" version="1.8"/>
</faceted-project> </faceted-project>
disabled=06target
eclipse.preferences.version=1
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<log4jVersion>2.4.1</log4jVersion> <log4jVersion>2.4.1</log4jVersion>
</properties> </properties>
......
...@@ -275,38 +275,6 @@ ...@@ -275,38 +275,6 @@
}, },
"buffers": "buffers":
[ [
{
"file": "vipra-ui/app/templates/topics/show.hbs",
"settings":
{
"buffer_size": 196,
"line_ending": "Unix"
}
},
{
"file": "vipra-ui/app/routes/articles/show.js",
"settings":
{
"buffer_size": 646,
"line_ending": "Unix"
}
},
{
"file": "vipra-ui/app/styles/app.css",
"settings":
{
"buffer_size": 81,
"line_ending": "Unix"
}
},
{
"file": "vipra-ui/app/models/topic.js",
"settings":
{
"buffer_size": 244,
"line_ending": "Unix"
}
}
], ],
"build_system": "", "build_system": "",
"build_system_choices": "build_system_choices":
...@@ -315,10 +283,14 @@ ...@@ -315,10 +283,14 @@
"build_varint": "", "build_varint": "",
"command_palette": "command_palette":
{ {
"height": 148.0, "height": 102.0,
"last_filter": "insta", "last_filter": "remove",
"selected_items": "selected_items":
[ [
[
"remove",
"Package Control: Remove Package"
],
[ [
"insta", "insta",
"Package Control: Install Package" "Package Control: Install Package"
...@@ -347,10 +319,6 @@ ...@@ -347,10 +319,6 @@
"install", "install",
"Package Control: Install Package" "Package Control: Install Package"
], ],
[
"remove",
"Package Control: Remove Package"
],
[ [
"pyth", "pyth",
"Set Syntax: Python" "Set Syntax: Python"
...@@ -488,44 +456,59 @@ ...@@ -488,44 +456,59 @@
"/home/eike/repos/master/ma-impl", "/home/eike/repos/master/ma-impl",
"/home/eike/repos/master/ma-impl/vipra-ui", "/home/eike/repos/master/ma-impl/vipra-ui",
"/home/eike/repos/master/ma-impl/vipra-ui/app", "/home/eike/repos/master/ma-impl/vipra-ui/app",
"/home/eike/repos/master/ma-impl/vipra-ui/app/adapters",
"/home/eike/repos/master/ma-impl/vipra-ui/app/components", "/home/eike/repos/master/ma-impl/vipra-ui/app/components",
"/home/eike/repos/master/ma-impl/vipra-ui/app/controllers",
"/home/eike/repos/master/ma-impl/vipra-ui/app/helpers",
"/home/eike/repos/master/ma-impl/vipra-ui/app/models", "/home/eike/repos/master/ma-impl/vipra-ui/app/models",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes", "/home/eike/repos/master/ma-impl/vipra-ui/app/routes",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/articles", "/home/eike/repos/master/ma-impl/vipra-ui/app/routes/articles",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics", "/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/show",
"/home/eike/repos/master/ma-impl/vipra-ui/app/styles", "/home/eike/repos/master/ma-impl/vipra-ui/app/styles",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/components", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics" "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/show"
], ],
"file_history": "file_history":
[ [
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/show.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/adapters/application.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/list.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/components/topic-link.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles.hbs", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics.hbs", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/index.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/models/topic.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/show/edit.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/components/topics-list.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/index.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/router.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/show/index.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/index.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/show.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/show/edit.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/show.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/helpers/topic-share.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/styles/app.css",
"/home/eike/repos/master/ma-impl/vipra-ui/app/components/topic-link.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/components/topic-link.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/edit.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles/show.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/articles/show.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles/edit.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/edit.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/articles/edit.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/topics/list.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/components/topics-list.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/components/topics-list.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/components/articles-list.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/components/articles-list.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles/list.hbs", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles/list.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/components/articles-list.hbs", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/components/articles-list.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/list.hbs", "/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/list.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/components/topics-list.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/models/article.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/models/article.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/models/topic.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/components/filter-list.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/components/filter-list.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/articles/show.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/helpers/topic-numi.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/helpers/topic-numi.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/components/topic-link.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/routes/articles/show.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/helpers/topicname.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/helpers/topicname.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/helpers/topic-name.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/helpers/topic-name.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/styles/app.css",
"/home/eike/repos/master/ma-impl/vm/bootstrap.sh", "/home/eike/repos/master/ma-impl/vm/bootstrap.sh",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/topics/show.hbs",
"/home/eike/repos/master/ma-impl/vipra-ui/app/router.js",
"/home/eike/repos/master/ma-impl/vipra-ui/app/templates/index.hbs",
"/home/eike/.config/sublime-text-3/Packages/User/Preferences.sublime-settings", "/home/eike/.config/sublime-text-3/Packages/User/Preferences.sublime-settings",
"/home/eike/.config/sublime-text-3/Packages/Default/Preferences.sublime-settings", "/home/eike/.config/sublime-text-3/Packages/Default/Preferences.sublime-settings",
"/home/eike/repos/master/ma-impl/vipra-ui/app/components/dynamic-high-charts.js", "/home/eike/repos/master/ma-impl/vipra-ui/app/components/dynamic-high-charts.js",
...@@ -617,18 +600,7 @@ ...@@ -617,18 +600,7 @@
"/home/eike/Repositories/fu/ss15/ma/impl/vm/rc.sh", "/home/eike/Repositories/fu/ss15/ma/impl/vm/rc.sh",
"/home/eike/Repositories/fu/ss15/ma/impl/vm/config/rc.local", "/home/eike/Repositories/fu/ss15/ma/impl/vm/config/rc.local",
"/home/eike/Repositories/fu/ss15/ma/impl/vm/env.sh", "/home/eike/Repositories/fu/ss15/ma/impl/vm/env.sh",
"/home/eike/Repositories/fu/ss15/ma/impl/ui/backend/pom.xml", "/home/eike/Repositories/fu/ss15/ma/impl/ui/backend/pom.xml"
"/home/eike/Repositories/fu/ss15/ma/impl/vm/config/mongo-express.config.js",
"/home/eike/Repositories/fu/ss15/ma/impl/data/data.json",
"/home/eike/Repositories/fu/ss15/ma/impl/vm/Vagrantfile",
"/home/eike/Repositories/fu/ss15/ma/impl/data/data.sql",
"/home/eike/Repositories/fu/ws1415/ntdb/Vagrantfile",
"/home/eike/Repositories/fu/ws1415/ntdb/puppet/manifests/default.pp",
"/home/eike/Repositories/fu/ss15/ma/impl/vm/manifests/default.pp",
"/home/eike/Repositories/niels_website/web/src/index.html",
"/home/eike/Repositories/niels_website/web/src/intergeo-2015.html",
"/home/eike/Repositories/niels_website/web/src/less/main.less",
"/home/eike/Downloads/intellij/idea-IU-141.2735.5/Install-Linux-tar.txt"
], ],
"find": "find":
{ {
...@@ -950,123 +922,8 @@ ...@@ -950,123 +922,8 @@
"groups": "groups":
[ [
{ {
"selected": 1,
"sheets": "sheets":
[ [
{
"buffer": 0,
"file": "vipra-ui/app/templates/topics/show.hbs",
"semi_transient": false,
"settings":
{
"buffer_size": 196,
"regions":
{
},
"selection":
[
[
196,
196
]
],
"settings":
{
"syntax": "Packages/Handlebars/grammars/Handlebars.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 1,
"type": "text"
},
{
"buffer": 1,
"file": "vipra-ui/app/routes/articles/show.js",
"semi_transient": false,
"settings":
{
"buffer_size": 646,
"regions":
{
},
"selection":
[
[
395,
395
]
],
"settings":
{
"syntax": "Packages/JavaScript/JavaScript.tmLanguage",
"tab_size": 2,
"translate_tabs_to_spaces": true
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 0,
"type": "text"
},
{
"buffer": 2,
"file": "vipra-ui/app/styles/app.css",
"semi_transient": false,
"settings":
{
"buffer_size": 81,
"regions":
{
},
"selection":
[
[
79,
79
]
],
"settings":
{
"syntax": "Packages/CSS/CSS.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 2,
"type": "text"
},
{
"buffer": 3,
"file": "vipra-ui/app/models/topic.js",
"semi_transient": false,
"settings":
{
"buffer_size": 244,
"regions":
{
},
"selection":
[
[
121,
121
]
],
"settings":
{
"syntax": "Packages/JavaScript/JavaScript.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 3,
"type": "text"
}
] ]
} }
], ],
...@@ -1233,7 +1090,7 @@ ...@@ -1233,7 +1090,7 @@
"show_open_files": true, "show_open_files": true,
"show_tabs": true, "show_tabs": true,
"side_bar_visible": true, "side_bar_visible": true,
"side_bar_width": 254.0, "side_bar_width": 295.0,
"status_bar_visible": true, "status_bar_visible": true,
"template_settings": "template_settings":
{ {
......
...@@ -22,14 +22,20 @@ ...@@ -22,14 +22,20 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> <classpathentry combineaccessrules="false" kind="src" path="/JGibbLDA">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes> <attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/JGibbLDA"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="owner.project.facets" value="java"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
......
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
......
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
<fixed facet="java"/> <fixed facet="java"/>
<fixed facet="jst.utility"/> <fixed facet="jst.utility"/>
<installed facet="jst.utility" version="1.0"/> <installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.7"/> <installed facet="java" version="1.8"/>
</faceted-project> </faceted-project>
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<log4jVersion>2.4.1</log4jVersion> <log4jVersion>2.4.1</log4jVersion>
<luceneVersion>5.4.0</luceneVersion> <luceneVersion>5.4.0</luceneVersion>
</properties> </properties>
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes> <attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="owner.project.facets" value="java"/>
<attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
......
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
......
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
<installed facet="wst.jsdt.web" version="1.0"/> <installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="jst.jaxrs" version="2.0"/> <installed facet="jst.jaxrs" version="2.0"/>
<installed facet="jst.web" version="3.1"/> <installed facet="jst.web" version="3.1"/>
<installed facet="java" version="1.7"/> <installed facet="java" version="1.8"/>
</faceted-project> </faceted-project>
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<jerseyVersion>2.22.1</jerseyVersion> <jerseyVersion>2.22.1</jerseyVersion>
<jettyVersion>9.3.6.v20151106</jettyVersion> <jettyVersion>9.3.6.v20151106</jettyVersion>
<servletVersion>3.1.0</servletVersion> <servletVersion>3.1.0</servletVersion>
......
package de.vipra.rest;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.NameBinding;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("PATCH")
@Documented
@NameBinding
public @interface PATCH {}
\ No newline at end of file
...@@ -3,19 +3,19 @@ package de.vipra.rest.model; ...@@ -3,19 +3,19 @@ package de.vipra.rest.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ResponseWrapper<T> { public class Wrapper<T> {
private T data; private T data;
private List<APIError> errors; private List<APIError> errors;
private final APIVersion jsonapi = new APIVersion(); private final APIVersion jsonapi = new APIVersion();
public ResponseWrapper() {} public Wrapper() {}
public ResponseWrapper(T data) { public Wrapper(T data) {
setData(data); setData(data);
} }
public ResponseWrapper(APIError error) { public Wrapper(APIError error) {
addError(error); addError(error);
} }
......
...@@ -24,6 +24,6 @@ public class CORSResponseFilter implements ContainerResponseFilter { ...@@ -24,6 +24,6 @@ public class CORSResponseFilter implements ContainerResponseFilter {
response.getHeaders().add("Access-Control-Allow-Origin", "*"); response.getHeaders().add("Access-Control-Allow-Origin", "*");
response.getHeaders().add("Access-Control-Allow-Headers", "origin, content-type, accept, authorization"); response.getHeaders().add("Access-Control-Allow-Headers", "origin, content-type, accept, authorization");
response.getHeaders().add("Access-Control-Allow-Credentials", "true"); response.getHeaders().add("Access-Control-Allow-Credentials", "true");
response.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD"); response.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD");
} }
} }
\ No newline at end of file
...@@ -20,8 +20,9 @@ import javax.ws.rs.core.UriInfo; ...@@ -20,8 +20,9 @@ import javax.ws.rs.core.UriInfo;
import de.vipra.rest.APIMediaType; import de.vipra.rest.APIMediaType;
import de.vipra.rest.Messages; import de.vipra.rest.Messages;
import de.vipra.rest.PATCH;
import de.vipra.rest.model.APIError; import de.vipra.rest.model.APIError;
import de.vipra.rest.model.ResponseWrapper; import de.vipra.rest.model.Wrapper;
import de.vipra.rest.service.ArticleService; import de.vipra.rest.service.ArticleService;
import de.vipra.util.Config; import de.vipra.util.Config;
import de.vipra.util.Mongo; import de.vipra.util.Mongo;
...@@ -49,7 +50,7 @@ public class ArticleResource { ...@@ -49,7 +50,7 @@ public class ArticleResource {
@QueryParam("limit") @DefaultValue("0") int limit, @QueryParam("limit") @DefaultValue("0") int limit,
@QueryParam("sort") @DefaultValue("date") String sortBy) { @QueryParam("sort") @DefaultValue("date") String sortBy) {
List<Article> articles = service.getMultiple(uri.getAbsolutePath(), skip, limit, sortBy); List<Article> articles = service.getMultiple(uri.getAbsolutePath(), skip, limit, sortBy);
ResponseWrapper<List<Article>> res = new ResponseWrapper<>(articles); Wrapper<List<Article>> res = new Wrapper<>(articles);
return Response.ok().entity(res).tag(res.tag()).build(); return Response.ok().entity(res).tag(res.tag()).build();
} }
...@@ -58,7 +59,7 @@ public class ArticleResource { ...@@ -58,7 +59,7 @@ public class ArticleResource {
@Consumes(APIMediaType.APPLICATION_JSONAPI) @Consumes(APIMediaType.APPLICATION_JSONAPI)
@Path("{id}") @Path("{id}")
public Response getArticle(@PathParam("id") String id) { public Response getArticle(@PathParam("id") String id) {
ResponseWrapper<Article> res = new ResponseWrapper<>(); Wrapper<Article> res = new Wrapper<>();
if (id == null || id.trim().length() == 0) { if (id == null || id.trim().length() == 0) {
res.addError(new APIError(Response.Status.BAD_REQUEST, "ID is empty", res.addError(new APIError(Response.Status.BAD_REQUEST, "ID is empty",
String.format(Messages.BAD_REQUEST, "id cannot be empty"))); String.format(Messages.BAD_REQUEST, "id cannot be empty")));
...@@ -79,13 +80,13 @@ public class ArticleResource { ...@@ -79,13 +80,13 @@ public class ArticleResource {
@Consumes(APIMediaType.APPLICATION_JSONAPI) @Consumes(APIMediaType.APPLICATION_JSONAPI)
@Produces(APIMediaType.APPLICATION_JSONAPI) @Produces(APIMediaType.APPLICATION_JSONAPI)
public Response createArticle(Article article) { public Response createArticle(Article article) {
ResponseWrapper<Article> res; Wrapper<Article> res;
try { try {
article = service.createSingle(article); article = service.createSingle(article);
res = new ResponseWrapper<>(article); res = new Wrapper<>(article);
return Response.created(article.uri(uri.getAbsolutePath())).entity(res).tag(res.tag()).build(); return Response.created(article.uri(uri.getAbsolutePath())).entity(res).tag(res.tag()).build();
} catch (DatabaseException e) { } catch (DatabaseException e) {
res = new ResponseWrapper<>(new APIError(Response.Status.INTERNAL_SERVER_ERROR, "item could not be created", res = new Wrapper<>(new APIError(Response.Status.INTERNAL_SERVER_ERROR, "item could not be created",
"item could not be created due to an internal server error")); "item could not be created due to an internal server error"));
return Response.serverError().entity(res).build(); return Response.serverError().entity(res).build();
} }
...@@ -94,12 +95,12 @@ public class ArticleResource { ...@@ -94,12 +95,12 @@ public class ArticleResource {
@DELETE @DELETE
@Path("{id}") @Path("{id}")
public Response deleteArticle(@PathParam("id") String id) { public Response deleteArticle(@PathParam("id") String id) {
ResponseWrapper<Article> res = new ResponseWrapper<>(); Wrapper<Article> res = new Wrapper<>();
long deleted; long deleted;
try { try {
deleted = service.deleteSingle(id); deleted = service.deleteSingle(id);
} catch (DatabaseException e) { } catch (DatabaseException e) {
res = new ResponseWrapper<>(new APIError(Response.Status.INTERNAL_SERVER_ERROR, "item could not be deleted", res = new Wrapper<>(new APIError(Response.Status.INTERNAL_SERVER_ERROR, "item could not be deleted",
"item could not be created due to an internal server error")); "item could not be created due to an internal server error"));
return Response.serverError().entity(res).build(); return Response.serverError().entity(res).build();
} }
...@@ -120,8 +121,9 @@ public class ArticleResource { ...@@ -120,8 +121,9 @@ public class ArticleResource {
@Consumes(APIMediaType.APPLICATION_JSONAPI) @Consumes(APIMediaType.APPLICATION_JSONAPI)
@Produces(APIMediaType.APPLICATION_JSONAPI) @Produces(APIMediaType.APPLICATION_JSONAPI)
@Path("{id}") @Path("{id}")
public Response updateArticle(@PathParam("id") String id, Article article) { public Response replaceArticle(@PathParam("id") String id, Wrapper<Article> wrapper) {
ResponseWrapper<Article> res = new ResponseWrapper<>(); Article article = wrapper.getData();
Wrapper<Article> res = new Wrapper<>();
try { try {
long updated = service.updateSingle(article); long updated = service.updateSingle(article);
int updatedInt = updated > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) updated; int updatedInt = updated > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) updated;
...@@ -137,10 +139,20 @@ public class ArticleResource { ...@@ -137,10 +139,20 @@ public class ArticleResource {
return Response.serverError().build(); return Response.serverError().build();
} }
} catch (DatabaseException e) { } catch (DatabaseException e) {
res = new ResponseWrapper<>(new APIError(Response.Status.INTERNAL_SERVER_ERROR, "item could not be updated", res = new Wrapper<>(new APIError(Response.Status.INTERNAL_SERVER_ERROR, "item could not be updated",
"item could not be updated due to an internal server error")); "item could not be updated due to an internal server error"));
return Response.serverError().entity(res).build(); return Response.serverError().entity(res).build();
} }
} }
@PATCH
@Consumes(APIMediaType.APPLICATION_JSONAPI)
@Produces(APIMediaType.APPLICATION_JSONAPI)
@Path("{id}")
public Response updateArticle(@PathParam("id") String id, Wrapper<Article> wrapper) {
Article article = wrapper.getData();
// TODO implement
return null;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment