Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions .run/Tomcat 9.0.40.run.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Tomcat 9.0.40" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 9.0.40" ALTERNATIVE_JRE_ENABLED="false" nameIsGenerated="true">
<configuration default="false" name="Tomcat 9.0.40" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 9.0.40" ALTERNATIVE_JRE_ENABLED="false" ALTERNATIVE_JRE_PATH="$USER_HOME$/Downloads/apache-maven-3.6.3-src/apache-maven-3.6.3/maven-core/src/test/projects/project-builder/it0063/jdk/jre" nameIsGenerated="true">
<option name="OPEN_IN_BROWSER_URL" value="http://localhost:8080/employee_management_front_war" />
<option name="UPDATING_POLICY" value="restart-server" />
<deployment>
<artifact name="EmployeeAppFront:war">
<artifact name="proiectcolectiv">
<settings>
<option name="CONTEXT_PATH" value="/EmployeeAppFront_war" />
<option name="CONTEXT_PATH" value="/proiectcolectiv" />
</settings>
</artifact>
</deployment>
Expand Down Expand Up @@ -49,6 +50,21 @@
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Profile">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
Expand All @@ -68,6 +84,7 @@
<option name="Make" enabled="true" />
<option name="BuildArtifacts" enabled="true">
<artifact name="EmployeeAppFront:war" />
<artifact name="proiectcolectiv" />
</option>
</method>
</configuration>
Expand Down
Binary file added .vs/ProiectColectiv/v16/.suo
Binary file not shown.
16 changes: 16 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ExpandedNodes": [
"",
"\\EmployeeManagementApp",
"\\EmployeeManagementApp\\EmployeeAppPersistence",
"\\EmployeeManagementApp\\EmployeeAppPersistence\\src",
"\\EmployeeManagementApp\\EmployeeAppPersistence\\src\\main",
"\\EmployeeManagementApp\\EmployeeAppPersistence\\src\\main\\java",
"\\EmployeeManagementApp\\EmployeeAppPersistence\\src\\main\\java\\ro",
"\\EmployeeManagementApp\\EmployeeAppPersistence\\src\\main\\java\\ro\\ubb",
"\\EmployeeManagementApp\\EmployeeAppPersistence\\src\\main\\java\\ro\\ubb\\constants",
"\\EmployeeManagementApp\\EmployeeAppPersistence\\src\\main\\java\\ro\\ubb\\exceptions"
],
"SelectedNode": "\\EmployeeManagementApp\\EmployeeAppPersistence\\src\\main\\java\\ro\\ubb\\interfaces\\TechnologiesAreasDao.java",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package ro.ubb.interfaces;

import ro.ubb.exceptions.DbException;

import java.util.List;

public interface TechnologiesService {

List<String> findAll() throws DbException;


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ro.ubb.services;

import ro.ubb.exceptions.DbException;
import ro.ubb.implementations.TechnologiesDaoImpl;
import ro.ubb.interfaces.TechnologiesDao;
import ro.ubb.interfaces.TechnologiesService;

import java.util.List;

public class TechnologiesServiceImpl implements TechnologiesService {

@Override
public List<String> findAll() throws DbException {
TechnologiesDao technologiesDao=new TechnologiesDaoImpl();

return (technologiesDao).findAll();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ro.ubb.controllers;

import ro.ubb.exceptions.DbException;
import ro.ubb.services.TechnologiesServiceImpl;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Path("/technologies")
public class TechnologiesController {

@GET
@Path("/technologies")
@Produces(MediaType.APPLICATION_JSON)
public List<String> getAllTechnologies() throws DbException {
return new TechnologiesServiceImpl().findAll();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ro.ubb.constants;

public enum Technologies {
DATABASES("Databases"),
FRAMEWORKS("Frameworks"),
PROGRAMMING_LANGUAGE("Programming language");

private final String Technologies;

Technologies(String Technologies) {
this.Technologies = Technologies;
}

public String getTechnologies() {
return Technologies;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package ro.ubb.implementations;

import ro.ubb.constants.TechnologyArea;
import ro.ubb.exceptions.DbException;
import ro.ubb.interfaces.GenericDao;
import ro.ubb.interfaces.TechnologiesDao;
import ro.ubb.models.Technologies;
import ro.ubb.utilities.DatabaseConnection;

import java.sql.*;
import java.util.ArrayList;
import java.util.List;

public class TechnologiesDaoImpl implements GenericDao, TechnologiesDao {
@Override
public List<String> findAll() throws DbException {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}

try {
DatabaseConnection databaseConnection = new DatabaseConnection();
Connection connection = databaseConnection.getConnection();

String querySelect = "SELECT Technologies_Area FROM skills " ;
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery(querySelect);


String technologyAreaName;

List<String> names=new ArrayList<>();

if (resultSet.next()) {

technologyAreaName = resultSet.getString("Technologies_Area");
TechnologyArea[] technologyAreas = TechnologyArea.values();
for (TechnologyArea area : technologyAreas) {
if (area.getTechnologyArea().equals(technologyAreaName)) {
names.add(area.name());
}
}
} else
return null;

return names;
} catch (SQLException sqlException) {
throw new DbException("Something went wrong with the database");
}
}

@Override
public Object find(int id) throws DbException {
return null;
}

@Override
public Object save(Object entity) throws DbException {
return null;
}

@Override
public Object delete(int id) throws DbException {
return null;
}


@Override
public Technologies update(Object entity) throws DbException {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package ro.ubb.interfaces;

import ro.ubb.exceptions.DbException;

import java.util.List;

public interface TechnologiesDao {
List<String> findAll() throws DbException;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package ro.ubb.models;

public class Technologies {
private int idTech;
private String techName;

public Technologies(int idTech, String techName) {
this.idTech = idTech;
this.techName = techName;
}

public int getIdTech() {
return idTech;
}

public void setIdTech(int idTech) {
this.idTech = idTech;
}

public String getTechName() {
return techName;
}

public void setTechName(String techName) {
this.techName = techName;
}
}