Skip to content

Commit

Permalink
Delete old Bibliography models and created a new TransportStation mod…
Browse files Browse the repository at this point in the history
…el. Added JAXB parser annotations
  • Loading branch information
alexm98 committed Jan 14, 2021
1 parent 6633dfb commit 6ece9d1
Show file tree
Hide file tree
Showing 24 changed files with 888 additions and 930 deletions.
2 changes: 2 additions & 0 deletions data/statii-ratt.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<TransportStations>
<TransportStation>
<LineID>1207</LineID>
<LineName>3</LineName>
Expand Down Expand Up @@ -27170,4 +27171,5 @@
<GMapsLink>http://maps.google.com/maps?q=Calea%[email protected],21.220171</GMapsLink>
<InfoComments>0</InfoComments>
</TransportStation>
</TransportStations>
</root>
211 changes: 104 additions & 107 deletions src/CamelComponents/CamelREST.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package CamelComponents;

import bibliography.Affiliation;
import bibliography.Article;
import bibliography.Author;
import core.XMLInteractor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.rest.RestBindingMode;
Expand All @@ -20,7 +17,7 @@ public class CamelREST extends RouteBuilder {

public CamelREST() throws JAXBException, ParserConfigurationException, SAXException {
this.xml_interactor = new XMLInteractor("doc.xml");
this.putils = new ParserUtils();
this.putils = new ParserUtils("doc.xml");
}

@Override
Expand All @@ -30,108 +27,108 @@ public void configure() throws Exception {
.port("9091")
.bindingMode(RestBindingMode.auto);

rest("/api")
.get("/authors")
.produces("application/xml")
.route()
.bean(xml_interactor, "getAllAuthors")
.endRest()

.get("/publications")
.produces("application/xml")
.route()
.bean(xml_interactor, "getAllPublications")
.endRest()

.get("/affiliations")
.produces("application/xml")
.route()
.bean(xml_interactor, "getAllAffiliations")
.endRest()

.get("/author/{id}")
.produces("application/xml")
.route()
.bean(xml_interactor, "getAuthor(${header.id})")
.endRest()

.put("/author/{id}")
.type(Author.class)
.consumes("application/xml")
.produces("application/xml")
.route()
.to("log:mylogger?showAll=true")
.bean(xml_interactor, "replaceAuthor(${header.id}, ${body})")
.endRest()

.delete("/author/{id}")
.produces("application/xml")
.route()
.bean(xml_interactor, "deleteAuthor(${header.id})")
.endRest()

.post("/author/{name}")
.produces("application/xml")
.route()
.bean(xml_interactor, "createAuthor(${header.name})")
.endRest()

// affiliations

.get("/affiliation/{rid}")
.produces("application/xml")
.route()
.bean(xml_interactor, "getAffiliation(${header.rid})")
.endRest()

.put("/affiliation/{rid}")
.type(Affiliation.class)
.produces("application/xml")
.consumes("application/xml")
.route()
.to("log:mylogger?showAll=true")
.bean(xml_interactor, "replaceAffiliation(${header.rid}, ${body})")
.endRest()

.delete("/affiliation/{rid}")
.produces("application/xml")
.route()
.bean(xml_interactor, "deleteAffiliation(${header.rid})")
.endRest()

.post("/affiliation/{rid}/{institution_name}")
.produces("application/xml")
.route()
.bean(xml_interactor, "createAffiliation(${header.rid}, ${header.institution_name})")
.endRest()

// Publications

.get("/publication?doi={doi}")
.produces("application/xml")
.route()
.bean(xml_interactor, "getPublication(${header.doi})")
.endRest()

.put("/publication?doi={doi}")
.type(Article.class)
.produces("application/xml")
.consumes("application/xml")
.route()
.bean(xml_interactor, "replacePublication(${body})")
.endRest()

.delete("/publication?doi={doi}")
.produces("application/xml")
.route()
.bean(xml_interactor, "deletePublication(${header.doi})")
.endRest()

.post("/publication?doi={doi}")
.type(Article.class)
.produces("application/xml")
.route()
.bean(xml_interactor, "createPublication(${body})")
.endRest();
// rest("/api")
// .get("/authors")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "getAllAuthors")
// .endRest()
//
// .get("/publications")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "getAllPublications")
// .endRest()
//
// .get("/affiliations")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "getAllAffiliations")
// .endRest()
//
// .get("/author/{id}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "getAuthor(${header.id})")
// .endRest()
//
// .put("/author/{id}")
// .type(Author.class)
// .consumes("application/xml")
// .produces("application/xml")
// .route()
// .to("log:mylogger?showAll=true")
// .bean(xml_interactor, "replaceAuthor(${header.id}, ${body})")
// .endRest()
//
// .delete("/author/{id}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "deleteAuthor(${header.id})")
// .endRest()
//
// .post("/author/{name}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "createAuthor(${header.name})")
// .endRest()
//
// // affiliations
//
// .get("/affiliation/{rid}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "getAffiliation(${header.rid})")
// .endRest()
//
// .put("/affiliation/{rid}")
// .type(Affiliation.class)
// .produces("application/xml")
// .consumes("application/xml")
// .route()
// .to("log:mylogger?showAll=true")
// .bean(xml_interactor, "replaceAffiliation(${header.rid}, ${body})")
// .endRest()
//
// .delete("/affiliation/{rid}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "deleteAffiliation(${header.rid})")
// .endRest()
//
// .post("/affiliation/{rid}/{institution_name}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "createAffiliation(${header.rid}, ${header.institution_name})")
// .endRest()
//
// // Publications
//
// .get("/publication?doi={doi}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "getPublication(${header.doi})")
// .endRest()
//
// .put("/publication?doi={doi}")
// .type(Article.class)
// .produces("application/xml")
// .consumes("application/xml")
// .route()
// .bean(xml_interactor, "replacePublication(${body})")
// .endRest()
//
// .delete("/publication?doi={doi}")
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "deletePublication(${header.doi})")
// .endRest()
//
// .post("/publication?doi={doi}")
// .type(Article.class)
// .produces("application/xml")
// .route()
// .bean(xml_interactor, "createPublication(${body})")
// .endRest();
}
};
64 changes: 0 additions & 64 deletions src/CamelComponents/CamelRoutes.java

This file was deleted.

13 changes: 0 additions & 13 deletions src/CamelComponents/CamelValidatorRoute.java

This file was deleted.

69 changes: 0 additions & 69 deletions src/CamelComponents/CamelXSLT.java

This file was deleted.

Loading

0 comments on commit 6ece9d1

Please sign in to comment.