Skip to content

Commit 6c17677

Browse files
dchkang83yaginuma.takuya
authored andcommitted
first commit
0 parents  commit 6c17677

140 files changed

Lines changed: 6949 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.metadata/.lock

Whitespace-only changes.

.metadata/.log

Lines changed: 1278 additions & 0 deletions
Large diffs are not rendered by default.
20 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.

.metadata/.mylyn/.tasks.xml.zip

250 Bytes
Binary file not shown.
435 Bytes
Binary file not shown.

.metadata/.mylyn/tasks.xml.zip

250 Bytes
Binary file not shown.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
package Sample;
2+
3+
import java.io.IOException;
4+
import java.io.PrintWriter;
5+
import java.util.HashMap;
6+
7+
import javax.servlet.ServletException;
8+
import javax.servlet.http.*;
9+
10+
import jp.nextengine.api.sdk.*;
11+
12+
import java.util.List;
13+
14+
public class SampleServlet extends HttpServlet {
15+
16+
protected static final String CLIENT_ID = "NPhnUwMY61OuQV";
17+
protected static final String CLIENT_SECRET = "qgMRu4GsxmV1JLF8hjkft3UYrePiWXB9Q7DzAlwd";
18+
19+
public void doGet(HttpServletRequest request, HttpServletResponse response)
20+
throws ServletException, IOException {
21+
22+
response.setContentType("text/html; charset=UTF-8");
23+
24+
/* HTML �o�͗p PrintWriter */
25+
PrintWriter out = response.getWriter();
26+
27+
HashMap<String, Object> result = null;
28+
List<HashMap<String, String>> companies = null;
29+
HashMap<String, String> company = null;
30+
List<HashMap<String, String>> rows = null;
31+
32+
try {
33+
NeApiClient client = new NeApiClient(request, response,
34+
SampleServlet.CLIENT_ID, SampleServlet.CLIENT_SECRET,
35+
"https://localhost:8443/Sample/SampleServlet");
36+
result = client.apiExecute("/api_v1_login_company/info");
37+
companies = (List<HashMap<String, String>>) result.get("data");
38+
company = companies.get(0);
39+
result = client.apiExecuteNoRequiredLogin("/api_app/company");
40+
41+
HashMap<String, String> params = new HashMap();
42+
params.put(
43+
"placeholder_sql",
44+
"SELECT '__kigyo_code__' AS kigyo_code,t_mst_syohin_kihon.* FROM ne_userXXX.t_mst_syohin_kihon LIMIT 1");
45+
params.put("is_select", "1");
46+
params.put("is_need_csv_header", "1");
47+
params.put("data_type", "csv");
48+
result = client.apiExecute("/api_v1_internal_sql/execute", params);
49+
rows = (List<HashMap<String, String>>) result.get("data");
50+
result = client.apiExecute("/api_v1_internal_sql/execute", params);
51+
rows = (List<HashMap<String, String>>) result.get("data");
52+
} catch (Exception e) {
53+
// TODO Auto-generated catch block
54+
e.printStackTrace();
55+
}
56+
/* HTML�o�� */
57+
out.println("<html>");
58+
out.println("<head>");
59+
out.println("<title>Hello!</title>");
60+
out.println("</head>");
61+
out.println("<body>");
62+
out.println("<H1>");
63+
out.println("Hello!");
64+
out.println(company.get("company_id"));
65+
out.println(result.get("access_token"));
66+
out.println("<H1>");
67+
out.println("</body>");
68+
out.println("</html>");
69+
out.close();
70+
71+
}
72+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package Sample;
2+
3+
import java.io.IOException;
4+
import java.io.PrintWriter;
5+
import java.util.HashMap;
6+
7+
import javax.servlet.ServletException;
8+
import javax.servlet.http.*;
9+
10+
import jp.nextengine.api.sdk.*;
11+
12+
import java.util.List;
13+
14+
public class SampleServlet extends HttpServlet {
15+
16+
protected static final String CLIENT_ID = "NPhnUwMY61OuQV";
17+
protected static final String CLIENT_SECRET = "qgMRu4GsxmV1JLF8hjkft3UYrePiWXB9Q7DzAlwd";
18+
19+
public void doGet(HttpServletRequest request, HttpServletResponse response)
20+
throws ServletException, IOException {
21+
22+
response.setContentType("text/html; charset=UTF-8");
23+
24+
/* HTML �o�͗p PrintWriter */
25+
PrintWriter out = response.getWriter();
26+
27+
HashMap<String, Object> result = null;
28+
List<HashMap<String, String>> companies = null;
29+
HashMap<String, String> company = null;
30+
List<HashMap<String, String>> rows = null;
31+
32+
try {
33+
NeApiClient client = new NeApiClient(request, response,
34+
SampleServlet.CLIENT_ID, SampleServlet.CLIENT_SECRET,
35+
"https://localhost:8443/Sample/SampleServlet");
36+
result = client.apiExecute("/api_v1_login_company/info");
37+
companies = (List<HashMap<String, String>>) result.get("data");
38+
company = companies.get(0);
39+
result = client.apiExecuteNoRequiredLogin("/api_app/company");
40+
41+
HashMap<String, String> params = new HashMap();
42+
params.put(
43+
"placeholder_sql",
44+
"SELECT '__kigyo_code__' AS kigyo_code,t_mst_syohin_kihon.* FROM ne_userXXX.t_mst_syohin_kihon LIMIT 1");
45+
params.put("is_select", "1");
46+
params.put("is_need_csv_header", "1");
47+
params.put("data_type", "csv");
48+
result = client.apiExecute("/api_v1_internal_sql/execute", params);
49+
rows = (List<HashMap<String, String>>) result.get("data");
50+
} catch (Exception e) {
51+
// TODO Auto-generated catch block
52+
e.printStackTrace();
53+
}
54+
/* HTML�o�� */
55+
out.println("<html>");
56+
out.println("<head>");
57+
out.println("<title>Hello!</title>");
58+
out.println("</head>");
59+
out.println("<body>");
60+
out.println("<H1>");
61+
out.println("Hello!");
62+
out.println("Hello!");
63+
out.println(company.get("company_id"));
64+
65+
out.println("<H1>");
66+
out.println("</body>");
67+
out.println("</html>");
68+
out.close();
69+
70+
}
71+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package Sample;
2+
3+
import java.io.IOException;
4+
import java.io.PrintWriter;
5+
import java.util.HashMap;
6+
7+
import javax.servlet.ServletException;
8+
import javax.servlet.http.*;
9+
10+
import jp.nextengine.api.sdk.*;
11+
12+
import java.util.List;
13+
14+
public class SampleServlet extends HttpServlet {
15+
16+
protected static final String CLIENT_ID = "NPhnUwMY61OuQV";
17+
protected static final String CLIENT_SECRET = "qgMRu4GsxmV1JLF8hjkft3UYrePiWXB9Q7DzAlwd";
18+
19+
public void doGet(HttpServletRequest request, HttpServletResponse response)
20+
throws ServletException, IOException {
21+
22+
response.setContentType("text/html; charset=UTF-8");
23+
24+
/* HTML �o�͗p PrintWriter */
25+
PrintWriter out = response.getWriter();
26+
27+
HashMap<String, Object> result = null;
28+
List<HashMap<String, String>> companies = null;
29+
HashMap<String, String> company = null;
30+
List<HashMap<String, String>> rows = null;
31+
32+
try {
33+
NeApiClient client = new NeApiClient(request, response,
34+
SampleServlet.CLIENT_ID, SampleServlet.CLIENT_SECRET,
35+
"https://localhost:8443/Sample/SampleServlet");
36+
result = client.apiExecute("/api_v1_login_company/info");
37+
companies = (List<HashMap<String, String>>) result.get("data");
38+
company = companies.get(0);
39+
result = client.apiExecuteNoRequiredLogin("/api_app/company");
40+
41+
HashMap<String, String> params = new HashMap();
42+
params.put(
43+
"placeholder_sql",
44+
"SELECT '__kigyo_code__' AS kigyo_code,t_mst_syohin_kihon.* FROM ne_userXXX.t_mst_syohin_kihon LIMIT 1");
45+
params.put("is_select", "1");
46+
params.put("is_need_csv_header", "1");
47+
params.put("data_type", "csv");
48+
result = client.apiExecute("/api_v1_internal_sql/execute", params);
49+
rows = (List<HashMap<String, String>>) result.get("data");
50+
result = client.apiExecute("/api_v1_internal_sql/execute", params);
51+
rows = (List<HashMap<String, String>>) result.get("data");
52+
} catch (Exception e) {
53+
// TODO Auto-generated catch block
54+
e.printStackTrace();
55+
}
56+
/* HTML�o�� */
57+
out.println("<html>");
58+
out.println("<head>");
59+
out.println("<title>Hello!</title>");
60+
out.println("</head>");
61+
out.println("<body>");
62+
out.println("<H1>");
63+
out.println("Hello!");
64+
out.println(company.get("company_id"));
65+
out.println("<H1>");
66+
out.println("</body>");
67+
out.println("</html>");
68+
out.close();
69+
70+
}
71+
}

0 commit comments

Comments
 (0)