Skip to content

Commit

Permalink
Releases version 0.0.2, add the config out of src
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjfs committed Apr 8, 2020
1 parent 9f42d0c commit f0008a6
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 40 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/src/properties/config_db.properties
/src/properties/config_querys.properties
/src/properties/config_pool.properties
/config/config_db.properties
/config/config_pool.properties
6 changes: 3 additions & 3 deletions build/classes/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/helpers/
/servlet/
/bussinessObjects/
/properties/
/dbComponent/
/bussinessObjects/
/servlet/
Binary file added build/classes/helpers/ConfigComponent.class
Binary file not shown.
Binary file added build/classes/helpers/HashPassword.class
Binary file not shown.
Binary file added build/classes/helpers/JSONManage.class
Binary file not shown.
Binary file added build/classes/helpers/Query.class
Binary file not shown.
Binary file added build/classes/helpers/QueryHandler.class
Binary file not shown.
Binary file added build/classes/helpers/Security.class
Binary file not shown.
Binary file added build/classes/helpers/User.class
Binary file not shown.
Binary file modified build/classes/servlet/Dispatcher.class
Binary file not shown.
21 changes: 21 additions & 0 deletions config/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PLEASE CREATE config_db.properties and config_pool.properties with this format!!

EXAMPLES:

//////////////////// config_pool.properties ////////////////////////////////////////

maxconnections=50;
hops=5;

///////////////////////////////////////////////////////////////////////////////////

/////////////////// config_db.properties ////////////////////////////////////////

db.driver=org.postgresql.Driver;
db.url=jdbc:postgresql://localhost:5432/MyGoodDB;
db.username=UserofMyGoodDB;
db.password=PassofMyGoodDB;

///////////////////////////////////////////////////////////////////////////////////


18 changes: 18 additions & 0 deletions config/config_querys.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
insert.object= INSERT INTO object (name_object) VALUES (?);
insert.method= INSERT INTO method (name_method, id_object_method) VALUES (?, ?);
insert.users = INSERT INTO users (name_users, surname_users, email_users, password_users, creationtime_users) VALUES (?, ?, ?, ?, ?);
select.where.name_object=SELECT *FROM object WHERE name_object=?;
select.where.name_method=SELECT *FROM method WHERE name_method=?;
select.where.id_profile=SELECT *FROM profile WHERE id_profile=?;
select.profile=SELECT *FROM profile;
select.permissions=SELECT *FROM permissions;
select.where.id_profile_permissions=SELECT *FROM permissions WHERE id_profile_permissions=?;
select.where.id_method=SELECT *FROM method WHERE id_method=?;
select.where.id_object=SELECT *FROM object WHERE id_object=?;
innerjoin.object.method=SELECT method.id_method, method.name_method, object.name_object FROM method INNER JOIN object ON method.id_object_method = object.id_object;
select.users.where.email_users=SELECT *FROM users where email_users=?;
select.users.where.id_users=SELECT *FROM users where id_users=?;
insert.profile = INSERT INTO profile (username_profile) VALUES (?);
insert.users_profile = INSERT INTO users_profile (id_profile, id_users) VALUES (?, ?);
select.profile.where.username_profile = SELECT *FROM profile where username_profile=?;
select.users_profile.where.id_profile= SELECT *FROM users_profile WHERE id_profile=?;
File renamed without changes.
19 changes: 0 additions & 19 deletions src/properties/EXAMPLE.properties

This file was deleted.

9 changes: 0 additions & 9 deletions src/properties/LEEME

This file was deleted.

11 changes: 6 additions & 5 deletions src/properties/Properties.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package properties;


public class Properties {
public static String URI = "/home/mdjfs/the_workspace/backend_java/";

public static String NameProject = Properties.class.getProtectionDomain().getCodeSource().getLocation().getPath().split("/WEB-INF")[0].split("apps/")[1];
public static String URI = Properties.class.getProtectionDomain().getCodeSource().getLocation().getPath().split(".metadata")[0] + NameProject + "/";
public static String BussinesObjectsURI = URI + "src/bussinessObjects";
public static String QuerysURI = URI + "src/properties/config_querys.properties";
public static String DBConfigURI = URI + "src/properties/config_db.properties";
public static String POOLConfigURI = URI + "src/properties/config_pool.properties";
public static String QuerysURI = URI + "config/config_querys.properties";
public static String DBConfigURI = URI + "config/config_db.properties";
public static String POOLConfigURI = URI + "config/config_pool.properties";

}
2 changes: 1 addition & 1 deletion src/servlet/Dispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
int id = session_user.getIDProfile();
String object = object_reflection.getobjName();
String method = object_reflection.getmethodName();
System.out.println(id);
if(security.isHavePermissions(id, method, object)) {
Execute run = new Execute();
out.println(run.invoke(object_reflection));
Expand All @@ -247,7 +248,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
if(is_all_keys) {
JsonObject Gson = check.getAsJsonObject();
String action = Gson.get("action").getAsString();
System.out.println(action);
if(action.equals("register")) {
register(jsonText, Gson);
}
Expand Down

0 comments on commit f0008a6

Please sign in to comment.