Skip to content

Commit

Permalink
Actualizacion del API
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosvasquez committed Jun 2, 2014
1 parent ee34e5c commit 70ca935
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 19 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.devdom</groupId>
<version>2.1.0</version>
<version>2.2.0</version>
<artifactId>skills-devdom</artifactId>
<packaging>war</packaging>
<name>Dev Dom Skills</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jersey-version>1.17.1</jersey-version>
Expand Down Expand Up @@ -210,5 +211,4 @@
<url>https://oss.sonatype.org/content/repositories/jetty-releases</url>
</repository>
</repositories>
<name>Dev Dom Skills</name>
</project>
5 changes: 5 additions & 0 deletions src/main/java/org/devdom/skills/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ErrorHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.webapp.WebAppContext;
/**
Expand Down Expand Up @@ -42,11 +43,15 @@ public static void main(String[] args) throws Exception{
Server server = new Server(Integer.valueOf(webPort));
WebAppContext root = new WebAppContext();

ServletContextHandler sch = new ServletContextHandler(server, "");
//sch.setSecurityHandler(getSecurityHandler());

root.setContextPath("/");
root.setDescriptor(webappDirLocation + "/WEB-INF/web.xml");
root.setResourceBase(webappDirLocation);
root.setDisplayName("Dev Dom - Skills");
root.setHandler(servletHandler);
root.setSecurityHandler(null);

// Parent loader priority is a class loader setting that Jetty accepts.
// By default Jetty will behave like most web containers in that it will
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/org/devdom/skills/util/IResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ private IResource(){
throw new AssertionError();
}

public static final String API_PATH = "http://skills-devdom.herokuapp.com/";
public static final String API_PATH = "http://50.19.213.136:8080/skills-devdom/";

public static final String[] URI = {
"api/group",
"api/group/by/id/:group-id",
"api/influencer/top/general",
"top/by/group/id/:group-id",
"api/university",
"api/university/page/:page-number",
"api/university/id/:university-id",
Expand All @@ -27,7 +31,6 @@ private IResource(){
"api/skill/where?votes_gt=:votes-gt",
"api/skill/where?category_id=:category-id",
"api/skill/where?limit=:top",

"api/developer",
"api/developer/page/:page-number",
"api/developer/id/:developer-id",
Expand All @@ -44,6 +47,10 @@ private IResource(){
};

public static final String[] DESCRIPTION = {
"Listado de los grupo de Developers DOminicanos",
"Búsqueda de información de un grupo según su ID",
"Top de los 20 developers más influyente tomando como base todos los grupos de desarrolladores del páis",
"Top de los 20 developers más influyentes según el ID del grupo",
"Listado de universidades",
"Listado de universidades mostrando según la página indicada",
"Retorna la información de una universidad según su ID",
Expand Down Expand Up @@ -94,7 +101,8 @@ public static final String finalURL(String url){
.replaceAll(":sorting","asc")
.replaceAll(":top","5")
.replaceAll(":university-id","1411")
.replaceAll(":votes-gt","300");
.replaceAll(":votes-gt","300")
.replaceAll(":group-id", "201514949865358"); //group-id Developers Dominicanos por defecto
}

}
18 changes: 5 additions & 13 deletions src/main/webapp/WEB-INF/faces-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,16 @@
<managed-bean-scope>session</managed-bean-scope>
<managed-bean-name>topSkills</managed-bean-name>
<managed-bean-class>org.devdom.skills.model.bean.Top</managed-bean-class>
<!--
<managed-property>
<property-name>universityId</property-name>
<value>#{param.university-id}</value>
</managed-property>
-->
</managed-bean>

<managed-bean>
<managed-bean-scope>session</managed-bean-scope>
<managed-bean-name>university</managed-bean-name>
<managed-bean-class>org.devdom.skills.model.bean.UniversityController</managed-bean-class>
</managed-bean>
<managed-bean>
<managed-bean-scope>session</managed-bean-scope>
<managed-bean-name>restAPI</managed-bean-name>
<managed-bean-class>org.devdom.skills.model.bean.ServiceResources</managed-bean-class>
<!--
<managed-property>
<property-name>universityId</property-name>
<value>#{param.university-id}</value>
</managed-property>
-->
</managed-bean>

</faces-config>
8 changes: 7 additions & 1 deletion src/main/webapp/javascripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ devdom = (function( $, undefined ){

var skills = {};
skills.JSON = new Array();
skills.service = 'http://skills-devdom.herokuapp.com/api';
skills.service = 'http://50.19.213.136:8080/skills-devdom/api';
skills.resource = '';
skills.type = 'GET';
skills.media = 'json';
Expand Down Expand Up @@ -180,6 +180,10 @@ devdom = (function( $, undefined ){
return createLinks(prev,current,'developer','developer');
}else if(skills.syntax.header==='university'){
return createLinks(prev,current,'university','developer');
}else if(skills.syntax.header==='group'){
return createLinks(prev,current,'group','group');
}else if(skills.syntax.header==='influencer'){
return createLinks(prev,current,'influencer','influencer');
}
return current;
}
Expand All @@ -192,6 +196,8 @@ devdom = (function( $, undefined ){
case '"skills":' : skills.syntax.header='skill';break;
case '"developers":': skills.syntax.header='developers';break;
case '"university":': skills.syntax.header='university';break;
case '"group":': skills.syntax.header='group';break;
case '"influencer":': skills.syntax.header='influencer';break;
}
},
highlight : function(){
Expand Down

0 comments on commit 70ca935

Please sign in to comment.