Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3175742c
authored
Jun 06, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added variable wrapping for reader rests
1 parent
352e5825
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
6 deletions
code/MoyaWeb/src/fi/codecrew/moya/rest/ReaderRestView.java
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/ReaderEventRestRoot.java
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/ReaderRestRoot.java
code/MoyaWeb/src/fi/codecrew/moya/rest/ReaderRestView.java
View file @
3175742
package
fi
.
codecrew
.
moya
.
rest
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.ws.rs.Consumes
;
...
...
@@ -12,7 +10,9 @@ import javax.ws.rs.core.MediaType;
import
fi.codecrew.moya.beans.ReaderBeanLocal
;
import
fi.codecrew.moya.rest.pojo.ReaderEventRestPojo
;
import
fi.codecrew.moya.rest.pojo.ReaderEventRestRoot
;
import
fi.codecrew.moya.rest.pojo.ReaderRestPojo
;
import
fi.codecrew.moya.rest.pojo.ReaderRestRoot
;
@RequestScoped
@Path
(
"/reader"
)
...
...
@@ -25,15 +25,15 @@ public class ReaderRestView {
@GET
@Path
(
"/List"
)
public
List
<
ReaderRestPojo
>
getReaderList
()
public
ReaderRestRoot
getReaderList
()
{
return
ReaderRestPojo
.
parse
(
readerbean
.
getReaders
(
));
return
new
ReaderRestRoot
(
ReaderRestPojo
.
parse
(
readerbean
.
getReaders
()
));
}
@GET
@Path
(
"/LastEventusers"
)
public
List
<
ReaderEventRestPojo
>
getLastEventusers
()
public
ReaderEventRestRoot
getLastEventusers
()
{
return
ReaderEventRestPojo
.
parse
(
readerbean
.
getLastReaderEvents
(
));
return
new
ReaderEventRestRoot
(
ReaderEventRestPojo
.
parse
(
readerbean
.
getLastReaderEvents
()
));
}
}
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/ReaderEventRestRoot.java
0 → 100644
View file @
3175742
package
fi
.
codecrew
.
moya
.
rest
.
pojo
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlElementWrapper
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
public
class
ReaderEventRestRoot
{
@XmlElementWrapper
(
name
=
"readerEvents"
)
private
List
<
ReaderEventRestPojo
>
readers
;
public
ReaderEventRestRoot
()
{
}
public
ReaderEventRestRoot
(
List
<
ReaderEventRestPojo
>
parsed
)
{
readers
=
parsed
;
}
public
List
<
ReaderEventRestPojo
>
getReaders
()
{
return
readers
;
}
public
void
setReaders
(
List
<
ReaderEventRestPojo
>
readers
)
{
this
.
readers
=
readers
;
}
}
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/ReaderRestRoot.java
0 → 100644
View file @
3175742
package
fi
.
codecrew
.
moya
.
rest
.
pojo
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlElementWrapper
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
public
class
ReaderRestRoot
{
@XmlElementWrapper
(
name
=
"readers"
)
private
List
<
ReaderRestPojo
>
readers
;
public
ReaderRestRoot
()
{
}
public
ReaderRestRoot
(
List
<
ReaderRestPojo
>
parsed
)
{
readers
=
parsed
;
}
public
List
<
ReaderRestPojo
>
getReaders
()
{
return
readers
;
}
public
void
setReaders
(
List
<
ReaderRestPojo
>
readers
)
{
this
.
readers
=
readers
;
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment