Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sally4
sally4-servlet
Commits
7a1c1882
Commit
7a1c1882
authored
Apr 29, 2014
by
Constantin Jucovschi
Browse files
initial commit
parents
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
.classpath
0 → 100644
View file @
7a1c1882
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<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=
"src"
output=
"target/test-classes"
path=
"src/test/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
including=
"**/*.java"
kind=
"src"
path=
"src/main/resources"
/>
<classpathentry
kind=
"con"
path=
"org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
>
<attributes>
<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.6"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"output"
path=
"target/classes"
/>
</classpath>
.gitignore
0 → 100644
View file @
7a1c1882
target/
bin/
*~
*.log
felix-cache
.metadata
.project
0 → 100644
View file @
7a1c1882
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
sally4-servlet
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.m2e.core.maven2Builder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.m2e.core.maven2Nature
</nature>
</natures>
</projectDescription>
.settings/org.eclipse.jdt.core.prefs
0 → 100644
View file @
7a1c1882
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6
.settings/org.eclipse.m2e.core.prefs
0 → 100644
View file @
7a1c1882
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
pom.xml
0 → 100644
View file @
7a1c1882
<?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"
>
<!-- 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. -->
<modelVersion>
4.0.0
</modelVersion>
<packaging>
bundle
</packaging>
<groupId>
info.kwarc.sally4
</groupId>
<artifactId>
sally4-servlet
</artifactId>
<version>
${sally4.version}
</version>
<parent>
<groupId>
info.kwarc.sally
</groupId>
<artifactId>
sally
</artifactId>
<version>
1.0
</version>
<relativePath>
..
</relativePath>
</parent>
<properties>
<maven-bundle-plugin.version>
2.4.0
</maven-bundle-plugin.version>
<osgi.version>
5.0.0
</osgi.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.osgi
</groupId>
<artifactId>
org.osgi.core
</artifactId>
<version>
${osgi.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.osgi
</groupId>
<artifactId>
org.osgi.compendium
</artifactId>
<version>
${osgi.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.camel
</groupId>
<artifactId>
camel-servlet
</artifactId>
<version>
${camel.version}
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
servlet-api
</artifactId>
<version>
2.5
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.apache.felix
</groupId>
<artifactId>
org.apache.felix.ipojo.annotations
</artifactId>
<version>
1.11.2
</version>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
<version>
1.7.7
</version>
</dependency>
<dependency>
<groupId>
info.kwarc.sally4
</groupId>
<artifactId>
sally4-utils
</artifactId>
<version>
${sally4.version}
</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- BND Maven Plugin Configuration -->
<plugin>
<groupId>
org.apache.felix
</groupId>
<artifactId>
maven-bundle-plugin
</artifactId>
<extensions>
true
</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>
${project.artifactId}
</Bundle-SymbolicName>
<Private-Package>
info.kwarc.sally4.servlet.impl
</Private-Package>
<Import-Package>
*;
</Import-Package>
<Export-Package>
info.kwarc.sally4.servlet*
</Export-Package>
</instructions>
</configuration>
</plugin>
<!-- iPOJO Maven Plugin Configuration : nothing to do -->
<plugin>
<groupId>
org.apache.felix
</groupId>
<artifactId>
maven-ipojo-plugin
</artifactId>
<version>
1.6.0
</version>
<executions>
<execution>
<goals>
<goal>
ipojo-bundle
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
src/main/java/info/kwarc/sally4/servlet/SallyServlet.java
0 → 100644
View file @
7a1c1882
package
info.kwarc.sally4.servlet
;
public
interface
SallyServlet
{
}
src/main/java/info/kwarc/sally4/servlet/impl/ServletImpl.java
0 → 100644
View file @
7a1c1882
package
info.kwarc.sally4.servlet.impl
;
import
info.kwarc.sally4.core.CamelContextProvider
;
import
info.kwarc.sally4.servlet.SallyServlet
;
import
javax.servlet.ServletException
;
import
org.apache.camel.component.servlet.CamelHttpTransportServlet
;
import
org.apache.camel.component.servlet.ServletComponent
;
import
org.apache.felix.ipojo.annotations.Component
;
import
org.apache.felix.ipojo.annotations.Instantiate
;
import
org.apache.felix.ipojo.annotations.Invalidate
;
import
org.apache.felix.ipojo.annotations.Provides
;
import
org.apache.felix.ipojo.annotations.Requires
;
import
org.apache.felix.ipojo.annotations.Validate
;
import
org.osgi.service.http.HttpService
;
import
org.osgi.service.http.NamespaceException
;
@Component
@Provides
@Instantiate
public
class
ServletImpl
implements
SallyServlet
{
@Requires
HttpService
httpSevlet
;
@Requires
CamelContextProvider
camelContextProvider
;
@Validate
public
void
start
()
throws
ServletException
,
NamespaceException
{
CamelHttpTransportServlet
srvlet
=
new
CamelHttpTransportServlet
();
httpSevlet
.
registerServlet
(
"/sally"
,
srvlet
,
null
,
null
);
httpSevlet
.
registerResources
(
"/sally/jobad"
,
"/app/jobad"
,
null
);
ServletComponent
servletComponent
=
new
ServletComponent
();
servletComponent
.
setServletName
(
srvlet
.
getServletName
());
camelContextProvider
.
registerGlobalComponent
(
"sallyservlet"
,
servletComponent
);
}
@Invalidate
public
void
stop
()
{
httpSevlet
.
unregister
(
"/sally"
);
camelContextProvider
.
unregisterGlobalComponent
(
"sallyservlet"
);
}
}
src/main/java/info/kwarc/sally4/servlet/utils/QueryParser.java
0 → 100644
View file @
7a1c1882
package
info.kwarc.sally4.servlet.utils
;
import
java.util.HashMap
;
import
java.util.List
;
import
org.apache.camel.Exchange
;
import
org.apache.camel.Processor
;
import
org.apache.commons.httpclient.NameValuePair
;
import
org.apache.commons.httpclient.util.ParameterParser
;
public
class
QueryParser
implements
Processor
{
final
public
static
String
QueryMapHeader
=
"QueryParamMap"
;
ParameterParser
parser
;
public
QueryParser
()
{
this
.
parser
=
new
ParameterParser
();
}
@Override
public
void
process
(
Exchange
exchange
)
throws
Exception
{
HashMap
<
String
,
String
>
result
=
new
HashMap
<
String
,
String
>();
for
(
NameValuePair
pairs
:
(
List
<
NameValuePair
>)
parser
.
parse
(
exchange
.
getIn
().
getHeader
(
Exchange
.
HTTP_QUERY
,
String
.
class
),
'&'
))
{
result
.
put
(
pairs
.
getName
(),
pairs
.
getValue
());
}
exchange
.
getIn
().
setHeader
(
QueryMapHeader
,
result
);
}
}
src/main/resources/app/index.html
0 → 100644
View file @
7a1c1882
<h1>
Welcome to SAlly4
</h1>
\ No newline at end of file
src/main/resources/app/jobad/JOBAD.css
0 → 100644
View file @
7a1c1882
/*
JOBAD CSS File
built: Fri, 22 Nov 2013 11:51:43 +0100
Contains all JOBAD related CSS data
Copyright (C) 2013 KWARC Group <kwarc.info>
This file is part of JOBAD.
JOBAD is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JOBAD is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JOBAD. If not, see <http://www.gnu.org/licenses/>.
*/
/* start <JOBAD.css> */
/*
JOBAD.css
Contains JOBAD Core CSS Data
Copyright (C) 2013 KWARC Group <kwarc.info>
This file is part of JOBAD.
JOBAD is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JOBAD is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JOBAD. If not, see <http://www.gnu.org/licenses/>.
*/
/*
JOBAD Hover
*/
.JOBAD.JOBAD_Hover
{
position
:
fixed
;
z-index
:
101
;
}
/*
JOBAD ContextMenu
*/
.JOBAD.JOBAD_Contextmenu
{
/* nothing here */
}
.JOBAD.JOBAD_Contextmenu.JOBAD_ContextMenu_Radial.JOBAD_ContextMenu_RadialItem
{
position
:
fixed
;
overflow
:
hidden
;
}
.JOBAD.JOBAD_InlineIcon
{
position
:
static
;
float
:
left
;
}
/*
JOBAD Sidebar
*/
/* Sidebar groups */
.JOBAD.JOBAD_Sidebar_right.JOBAD_Sidebar_Group
,
.JOBAD.JOBAD_Sidebar_right.JOBAD_Sidebar_Single
{
position
:
absolute
;
right
:
0px
;
}
.JOBAD.JOBAD_Sidebar_left.JOBAD_Sidebar_Group
,
.JOBAD.JOBAD_Sidebar_left.JOBAD_Sidebar_Single
{
position
:
absolute
;
left
:
0px
;
}
.JOBAD.JOBAD_Sidebar_left.JOBAD_Sidebar_group_element
,
.JOBAD.JOBAD_Sidebar_right.JOBAD_Sidebar_group_element
{
position
:
relative
;
}
.JOBAD.JOBAD_Sidebar_right.JOBAD_Sidebar_Wrapper
{
/* wraps the element that has a sidebar */
width
:
100%
;
float
:
left
;
}
.JOBAD.JOBAD_Sidebar_left.JOBAD_Sidebar_Wrapper
{
/* wraps the element that has a sidebar */
width
:
100%
;
float
:
right
;
}
.JOBAD.JOBAD_Sidebar_right.JOBAD_Sidebar_Container
{
/* Contains all sidebar elements */
height
:
1px
;
/* something positive */
position
:
relative
;
float
:
right
;
}
.JOBAD.JOBAD_Sidebar_left.JOBAD_Sidebar_Container
{
/* Contains all sidebar elements */
height
:
1px
;
/* something positive */
position
:
relative
;
float
:
left
;
}
.JOBAD.JOBAD_Sidebar_left.JOBAD_Sidebar_Notification
,
.JOBAD.JOBAD_Sidebar_right.JOBAD_Sidebar_Notification
{
/* Sidebar Notifications */
-webkit-border-radius
:
5
;
-moz-border-radius
:
5
;
border-radius
:
5
;
}
.JOBAD.JOBAD_Sidebar.JOBAD_Sidebar_Hover
{
position
:
fixed
;
-webkit-border-radius
:
5
;
-moz-border-radius
:
5
;
border-radius
:
5
;
}
/*
JOBAD Folding
*/
/* JOBAD Folding */
.JOBAD.JOBAD_Folding_left
,
.JOBAD.JOBAD_Folding_right
{
/* applied to all sidebar elements (including parent) */
}
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Wrapper
{
/* wraps the element that has a sidebar */
width
:
100%
;
float
:
left
;
margin-top
:
2px
;
}
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Wrapper
{
/* wraps the element that has a sidebar */
width
:
100%
;
float
:
right
;
margin-bottom
:
2px
;
display
:
inline
;
}
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Container
{
/* Folding bracket Right */
position
:
relative
;
float
:
right
;
margin-left
:
5px
;
}
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Container
{
/* Folding bracket Left */
position
:
relative
;
float
:
left
;
margin-right
:
5px
;
}
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Spacing
,
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Spacing
{
/* add some spacing after me */
width
:
1px
;
height
:
1px
;
overflow
:
hidden
;
display
:
block
;
}
.modal.large
{
width
:
80%
;
/* respsonsive width */
margin-left
:
-40%
;
/* width/2) */
}
.wide
{
width
:
150px
!important
;
}
/* end <JOBAD.css> */
/* start <JOBAD.theme.css> */
/*
JOBAD.theme.css
Contains JOBAD CSS Theme
Copyright (C) 2013 KWARC Group <kwarc.info>
This file is part of JOBAD.
JOBAD is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JOBAD is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with JOBAD. If not, see <http://www.gnu.org/licenses/>.
*/
.JOBAD
{
/* applied to all JOBAD related elements */
}
/* inline icon */
.JOBAD.JOBAD_InlineIcon
{
background-size
:
18px
18px
;
width
:
18px
;
height
:
18px
;
}
/*
HoverText
*/
.JOBAD.JOBAD_Hover
{
/* Style for JOBAD Hover Texts */
background-color
:
#ffffca
;
-webkit-border-radius
:
5
;
-moz-border-radius
:
5
;
border-radius
:
5
;
border
:
1px
solid
#000023
;
}
/*
JOBAD ContextMenu
*/
.JOBAD.JOBAD_Contextmenu
{
/* applied to the context menu */
}
.JOBAD.JOBAD_Contextmenu.JOBAD_ContextMenu_Radial.JOBAD_ContextMenu_RadialItem
{
/* a radial context menu item */
}
.JOBAD.JOBAD_Contextmenu.JOBAD_ContextMenu_Radial.JOBAD_ContextMenu_RadialItem
:hover
{
/* a radial context menu item */
-webkit-border-radius
:
20px
;
-moz-border-radius
:
20px
;
border-radius
:
20px
;
border
:
1px
solid
black
;
}
.JOBAD.JOBAD_Contextmenu.JOBAD_ContextMenu_Radial.JOBAD_ContextMenu_RadialItem.JOBAD_ContextMenu_Radial_Disabled
{
-webkit-filter
:
grayscale
(
100%
);
/* we are disabled */
}
.JOBAD.JOBAD_Contextmenu.JOBAD_ContextMenu_Radial.JOBAD_ContextMenu_RadialItem.JOBAD_ContextMenu_Radial_Disabled
:hover
{
border
:
0px
;
}
/*
JOBAD Sidebar
*/
.JOBAD.JOBAD_Sidebar_left
,
.JOBAD.JOBAD_Sidebar_right
{
/* applied to all sidebar elements */
}
.JOBAD.JOBAD_Sidebar.JOBAD_Sidebar_Hover
{
/* applied to JOBAD Sidebar Hover Tooltips. */
}
/* The following are sidebar notification type tooltips */
.JOBAD.JOBAD_Sidebar.JOBAD_Notification_info
{
/* Information */
background-color
:
#0033FF
;
border
:
1px
solid
#0000FF
;
}
.JOBAD.JOBAD_Sidebar.JOBAD_Notification_warning
{
/* Warning */
background-color
:
#FFFF00
;
border
:
1px
solid
#FFAA00
;
}
.JOBAD.JOBAD_Sidebar.JOBAD_Notification_error
{
/* Error */
background-color
:
red
;
border
:
1px
solid
red
;
}
.JOBAD.JOBAD_Sidebar.JOBAD_Notification_none
{
background-color
:
#696969
;
border
:
1px
solid
#000000
;
}
/*
JOBAD Folding
*/
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Container.JOBAD_Folding_folded
,
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Container.JOBAD_Folding_unfolded
,
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Container.JOBAD_Folding_folded
,
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Container.JOBAD_Folding_unfolded
{
width
:
3px
;
box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
border-top
:
1px
solid
black
;
border-bottom
:
1px
solid
black
;
}
/* on hover */
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Container.JOBAD_Folding_folded
:hover
,
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Container.JOBAD_Folding_unfolded
:hover
,
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Container.JOBAD_Folding_folded
:hover
,
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Container.JOBAD_Folding_unfolded
:hover
{
background-color
:
#C0C0C0
;
}
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Container.JOBAD_Folding_folded
{
/* Right Folding Bracket */
border-right
:
1px
solid
black
;
}
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Container.JOBAD_Folding_folded
{
/* Left Folding Bracket */
border-left
:
1px
solid
black
;
}
.JOBAD.JOBAD_Folding_right.JOBAD_Folding_Container.JOBAD_Folding_unfolded
{
/* Right Folding Bracket */
border-right
:
1px
solid
gray
;
border-top
:
1px
solid
gray
;
border-bottom
:
1px
solid
gray
;
}
.JOBAD.JOBAD_Folding_left.JOBAD_Folding_Container.JOBAD_Folding_unfolded
{
/* Left Folding Bracket */
border-left
:
1px
solid
gray
;
border-top
:
1px
solid
gray
;
border-bottom
:
1px
solid
gray
;
}
/*
JOBAD Config UI
*/
.JOBAD.JOBAD_ConfigUI.JOBAD_ConfigUI_tablemain
{
/* Main Table of the confg UI */
font-size
:
150%
;
}
.JOBAD.JOBAD_ConfigUI.JOBAD_ConfigUI_infobox
{