├── target
├── .gitignore
└── m2e-jee
│ └── web-resources
│ └── .gitignore
├── .settings
├── org.eclipse.wst.jsdt.ui.superType.name
├── org.eclipse.wst.jsdt.ui.superType.container
├── org.eclipse.wst.common.project.facet.core.prefs.xml
├── com.genuitec.eclipse.migration.prefs
├── org.eclipse.wst.common.project.facet.core.xml
├── org.eclipse.jdt.core.prefs
├── org.eclipse.wst.common.component
└── .jsdtscope
├── README.md
├── .tern-project
├── WebRoot
├── META-INF
│ └── MANIFEST.MF
├── apidocs
│ ├── images
│ │ ├── throbber.gif
│ │ ├── logo_small.png
│ │ ├── wordnik_api.png
│ │ ├── pet_store_api.png
│ │ └── explorer_icons.png
│ ├── lib
│ │ ├── jquery.slideto.min.js
│ │ ├── jquery.wiggle.min.js
│ │ ├── jquery.ba-bbq.min.js
│ │ ├── highlight.7.3.pack.js
│ │ ├── swagger-oauth.js
│ │ └── shred
│ │ │ └── content.js
│ ├── o2c.html
│ ├── css
│ │ └── reset.css
│ └── index.html
├── index.jsp
├── WEB-INF
│ └── web.xml
└── dbscript
│ └── createdb_script.sql
├── src
├── com
│ ├── macys
│ │ ├── rest
│ │ │ ├── BaseRestController.java
│ │ │ └── filters
│ │ │ │ ├── UserAuthenticator.java
│ │ │ │ ├── UserAuthResponseFilter.java
│ │ │ │ └── UserAuthRequestFilter.java
│ │ ├── utils
│ │ │ ├── EmailTemplateEnum.java
│ │ │ ├── Constants.java
│ │ │ ├── ServiceUtils.java
│ │ │ ├── EncryptionUtils.java
│ │ │ ├── PropertiesUtils.java
│ │ │ ├── JsonUtils.java
│ │ │ ├── AppUtils.java
│ │ │ └── EmailUtils.java
│ │ ├── dao
│ │ │ ├── database
│ │ │ │ ├── DBAbstractBase.java
│ │ │ │ ├── pk
│ │ │ │ │ ├── DBObjectMetadataJsonPK.java
│ │ │ │ │ ├── DBObjectACLPK.java
│ │ │ │ │ ├── DBObjectContentStorePK.java
│ │ │ │ │ ├── DBObjectMetadataPK.java
│ │ │ │ │ ├── DBQueuePK.java
│ │ │ │ │ ├── DBObjectRelationshipPK.java
│ │ │ │ │ └── DBObjectRelationshipMetadataPK.java
│ │ │ │ ├── DBObjectRelationshipMetadata.java
│ │ │ │ ├── DBObjectACL.java
│ │ │ │ ├── DBObjectContentStore.java
│ │ │ │ ├── DBObjectRelationship.java
│ │ │ │ ├── DBObjectMetadata.java
│ │ │ │ ├── DBObjectMetadataJson.java
│ │ │ │ └── DBObject.java
│ │ │ ├── DAOUtils.java
│ │ │ ├── repository
│ │ │ │ ├── DBObjectRepository.java
│ │ │ │ ├── DBObjectMetadataRepository.java
│ │ │ │ ├── DBObjectRelationshipRepository.java
│ │ │ │ └── JdbcTemplateRepostiory.java
│ │ │ ├── DAO.java
│ │ │ ├── BaseDAOImpl.java
│ │ │ └── ReflectionUtils.java
│ │ ├── valuesobjects
│ │ │ ├── containers
│ │ │ │ ├── BaseContainerVo.java
│ │ │ │ ├── UserContainerVo.java
│ │ │ │ ├── LabContainerVo.java
│ │ │ │ ├── ReleaseContainerVo.java
│ │ │ │ ├── ReleaseCupContainerVo.java
│ │ │ │ └── SystemComponentContainerVo.java
│ │ │ ├── ReleaseVo.java
│ │ │ ├── SystemComponentVo.java
│ │ │ ├── LabVo.java
│ │ │ ├── ReleaseCupVo.java
│ │ │ ├── IPMTreeVo.java
│ │ │ ├── MetaVo.java
│ │ │ ├── BaseDTO.java
│ │ │ ├── UserVo.java
│ │ │ └── MatrixVo.java
│ │ ├── domain
│ │ │ ├── SystemComponent.java
│ │ │ ├── business
│ │ │ │ ├── common
│ │ │ │ │ ├── annotations
│ │ │ │ │ │ ├── PersistentMetadata.java
│ │ │ │ │ │ ├── PersistentMetadataJson.java
│ │ │ │ │ │ └── PersistentBusinessObject.java
│ │ │ │ │ ├── RelationshipTypeEnum.java
│ │ │ │ │ ├── Relationship.java
│ │ │ │ │ └── BusinessObjectTypeEnum.java
│ │ │ │ ├── BusinessObject.java
│ │ │ │ └── BusinessObjectImpl.java
│ │ │ ├── Lab.java
│ │ │ ├── Release.java
│ │ │ ├── User.java
│ │ │ ├── ReleaseCup.java
│ │ │ └── impl
│ │ │ │ ├── SystemComponentImpl.java
│ │ │ │ ├── LabImpl.java
│ │ │ │ ├── ReleaseImpl.java
│ │ │ │ ├── ReleaseCupImpl.java
│ │ │ │ └── UserImpl.java
│ │ ├── exceptions
│ │ │ ├── ServiceException.java
│ │ │ ├── GeneralExceptionMapper.java
│ │ │ └── ErrorCodeEnum.java
│ │ └── services
│ │ │ ├── BaseService.java
│ │ │ └── UserService.java
│ └── main
│ │ ├── HibernateTest.java
│ │ └── Test.java
├── readme.txt
├── log4j.properties
├── application.properties
└── applicationContext.xml
├── .classpath
├── .project
└── pom.xml
/target/.gitignore:
--------------------------------------------------------------------------------
1 | /classes/
2 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.wst.jsdt.ui.superType.name:
--------------------------------------------------------------------------------
1 | Window
--------------------------------------------------------------------------------
/target/m2e-jee/web-resources/.gitignore:
--------------------------------------------------------------------------------
1 | /META-INF/
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # fillthecupserver
2 | server to handle labs data
3 |
--------------------------------------------------------------------------------
/.tern-project:
--------------------------------------------------------------------------------
1 | {"ide":{},"libs":["ecma5","browser"],"plugins":{"guess-types":{}}}
--------------------------------------------------------------------------------
/WebRoot/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.wst.jsdt.ui.superType.container:
--------------------------------------------------------------------------------
1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary
--------------------------------------------------------------------------------
/WebRoot/apidocs/images/throbber.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbasikov/fillthecupserver/HEAD/WebRoot/apidocs/images/throbber.gif
--------------------------------------------------------------------------------
/src/com/macys/rest/BaseRestController.java:
--------------------------------------------------------------------------------
1 | package com.macys.rest;
2 |
3 | public abstract class BaseRestController {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/WebRoot/apidocs/images/logo_small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbasikov/fillthecupserver/HEAD/WebRoot/apidocs/images/logo_small.png
--------------------------------------------------------------------------------
/WebRoot/apidocs/images/wordnik_api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbasikov/fillthecupserver/HEAD/WebRoot/apidocs/images/wordnik_api.png
--------------------------------------------------------------------------------
/WebRoot/apidocs/images/pet_store_api.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbasikov/fillthecupserver/HEAD/WebRoot/apidocs/images/pet_store_api.png
--------------------------------------------------------------------------------
/WebRoot/apidocs/images/explorer_icons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abbasikov/fillthecupserver/HEAD/WebRoot/apidocs/images/explorer_icons.png
--------------------------------------------------------------------------------
/src/com/macys/utils/EmailTemplateEnum.java:
--------------------------------------------------------------------------------
1 | package com.macys.utils;
2 |
3 | public enum EmailTemplateEnum {
4 | NEW_REGISTRATION,
5 | PASSWORD_RESET,
6 | PASSWORD_CHANGE
7 | }
8 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.settings/com.genuitec.eclipse.migration.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | performed.operation.install.java=1.0
3 | performed.operation.me.configure.js=1.0
4 | performed.operation.me.install.mavenfacet=1.0
5 | performed.operation.me.migrate.jsnature=1.0
6 |
--------------------------------------------------------------------------------
/src/com/macys/dao/database/DBAbstractBase.java:
--------------------------------------------------------------------------------
1 | package com.macys.dao.database;
2 |
3 | import java.io.Serializable;
4 |
5 | public class DBAbstractBase implements Serializable {
6 |
7 | private static final long serialVersionUID = 1L;
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/readme.txt:
--------------------------------------------------------------------------------
1 | before deploying this application to server please change following path.
2 |
3 | 1-base path in applicationContext.xml for swagger.
4 | 2-db credentials in application.properties file
5 | 3-change logs path in log4j.properties
6 | 4-base path in index.html in apidocs for swagger
7 |
8 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/containers/BaseContainerVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects.containers;
2 |
3 | import org.codehaus.jackson.annotate.JsonProperty;
4 |
5 | import com.macys.valuesobjects.MetaVo;
6 |
7 | public class BaseContainerVo {
8 |
9 | @JsonProperty("meta")
10 | public MetaVo meta = new MetaVo();
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WebRoot/apidocs/lib/jquery.slideto.min.js:
--------------------------------------------------------------------------------
1 | (function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery);
2 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4 | org.eclipse.jdt.core.compiler.compliance=1.7
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 | org.eclipse.jdt.core.compiler.source=1.7
8 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/ReleaseVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects;
2 |
3 | public class ReleaseVo extends BaseDTO{
4 |
5 | public String branchCutDate;
6 |
7 | public String branchHardLockDate;
8 |
9 | public String mcomDate;
10 |
11 | public String bcomDate;
12 |
13 | public String branchFreezeDate;
14 |
15 | public String branchProductionDate;
16 |
17 | public String isActivated;
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/WebRoot/apidocs/o2c.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/com/macys/domain/SystemComponent.java:
--------------------------------------------------------------------------------
1 | package com.macys.domain;
2 |
3 | import com.macys.domain.business.BusinessObject;
4 |
5 | public interface SystemComponent extends BusinessObject{
6 |
7 | public abstract void setDescription(String description);
8 |
9 | public abstract String getDescription();
10 |
11 | public abstract void setDisplayName(String displayName);
12 |
13 | public abstract String getDisplayName();
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/containers/UserContainerVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects.containers;
2 |
3 | import java.util.List;
4 |
5 | import org.codehaus.jackson.annotate.JsonProperty;
6 |
7 | import com.macys.valuesobjects.UserVo;
8 |
9 | public class UserContainerVo extends BaseContainerVo{
10 |
11 | @JsonProperty("data")
12 | public UserVo data;
13 |
14 | @JsonProperty("dataList")
15 | public List dataList;
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/src/com/macys/domain/business/common/annotations/PersistentMetadata.java:
--------------------------------------------------------------------------------
1 | package com.macys.domain.business.common.annotations;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(value = { ElementType.FIELD })
10 | public @interface PersistentMetadata {
11 |
12 |
13 |
14 | }
--------------------------------------------------------------------------------
/src/com/macys/utils/Constants.java:
--------------------------------------------------------------------------------
1 | package com.macys.utils;
2 |
3 | public class Constants {
4 |
5 | public static int SUCCESS = 200;
6 | public static String KEY_COMPANY_TYPES = "company_types";
7 | public static String KEY_REGISTRATION_ALERT = "boolean.registration_alert";
8 | public static String DATE_FORMAT_ISO8601 = "yyyy-MM-dd'T'HH:mm:ss.SSZZ";
9 | public static String SYSTEM_USER = "FillTheCup";
10 |
11 |
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/src/com/macys/domain/business/common/annotations/PersistentMetadataJson.java:
--------------------------------------------------------------------------------
1 | package com.macys.domain.business.common.annotations;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(value = { ElementType.FIELD })
10 | public @interface PersistentMetadataJson {
11 |
12 |
13 |
14 | }
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/SystemComponentVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects;
2 |
3 | public class SystemComponentVo extends BaseDTO{
4 |
5 | public SystemComponentVo(){
6 |
7 | }
8 |
9 | public SystemComponentVo(String uuid,String name,String type){
10 | super.uuid = uuid;
11 | super.name = name;
12 | super.type = type;
13 | this.displayName = name;
14 | }
15 |
16 | public String displayName;
17 | public String description;
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/LabVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects;
2 |
3 | import java.util.List;
4 |
5 | public class LabVo extends BaseDTO{
6 |
7 | public String pdmName;
8 |
9 | public String managerName;
10 |
11 | public String description;
12 |
13 | public String location;
14 |
15 | public String lastClicked;
16 |
17 | public String isActivated;
18 |
19 | public List users;
20 |
21 | public List releaseCups;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/com/macys/dao/DAOUtils.java:
--------------------------------------------------------------------------------
1 | package com.macys.dao;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class DAOUtils {
7 |
8 | @SafeVarargs
9 | public static List asListOfStrings(T... a) {
10 |
11 | if(a == null) {
12 | return null;
13 | }
14 |
15 | List list = new ArrayList(a.length);
16 |
17 | for (int i = 0; i < a.length; i++) {
18 | list.add(a[i].toString());
19 | }
20 |
21 | return list;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/ReleaseCupVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects;
2 |
3 | import java.util.List;
4 |
5 | public class ReleaseCupVo extends BaseDTO {
6 |
7 | public ReleaseVo release;
8 |
9 | public LabVo lab;
10 |
11 | public String availableDevDays;
12 |
13 | public String devDays;
14 |
15 | public String regressionDays;
16 |
17 | public List sysComponents;
18 |
19 | public String matrix;
20 |
21 | public String lastClicked;
22 |
23 | public String ipmTree;
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/macys/utils/ServiceUtils.java:
--------------------------------------------------------------------------------
1 | package com.macys.utils;
2 |
3 | import org.apache.commons.lang3.StringUtils;
4 |
5 | import com.macys.exceptions.ErrorCodeEnum;
6 | import com.macys.exceptions.ServiceException;
7 |
8 | public class ServiceUtils {
9 |
10 | public static void verifyNotBlank(String value, String fieldName) throws ServiceException {
11 |
12 | if(StringUtils.isBlank(value)) {
13 | throw new ServiceException(fieldName + " must not be blank", ErrorCodeEnum.BLANK_FIELD);
14 | }
15 |
16 | }
17 |
18 |
19 |
20 | }
--------------------------------------------------------------------------------
/.settings/org.eclipse.wst.common.component:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/com/macys/domain/business/common/annotations/PersistentBusinessObject.java:
--------------------------------------------------------------------------------
1 | package com.macys.domain.business.common.annotations;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | import com.macys.domain.business.common.BusinessObjectTypeEnum;
9 |
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Target(ElementType.TYPE)
12 | public @interface PersistentBusinessObject {
13 |
14 | BusinessObjectTypeEnum type();
15 |
16 | }
--------------------------------------------------------------------------------
/.settings/.jsdtscope:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/IPMTreeVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import flexjson.JSON;
7 |
8 | public class IPMTreeVo {
9 |
10 | Map ipms = null;
11 |
12 | public IPMTreeVo() {
13 | ipms = new HashMap();
14 | ipms.put("IPM1", null);
15 | ipms.put("IPM2", null);
16 | ipms.put("IPM3", null);
17 | ipms.put("IPM4", null);
18 | }
19 |
20 | @JSON(include=true)
21 | public Map getIpms() {
22 | return ipms;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/MetaVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects;
2 |
3 | import org.codehaus.jackson.annotate.JsonProperty;
4 | import org.codehaus.jackson.map.annotate.JsonSerialize;
5 | import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
6 |
7 | public class MetaVo {
8 |
9 | @JsonProperty("code")
10 | public int code;
11 |
12 | @JsonProperty("error")
13 | @JsonSerialize(include=Inclusion.NON_NULL)
14 | public String error;
15 |
16 | @JsonProperty("details")
17 | @JsonSerialize(include=Inclusion.NON_NULL)
18 | public String details;
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/BaseDTO.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects;
2 |
3 | import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
4 | import org.apache.commons.lang3.builder.ToStringStyle;
5 |
6 | public abstract class BaseDTO {
7 |
8 | public String uuid;
9 |
10 | public String type;
11 |
12 | public String name;
13 |
14 | public String createdOnISO8601;
15 |
16 | public String createdBy;
17 |
18 | @Override
19 | public String toString() {
20 | return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/log4j.properties:
--------------------------------------------------------------------------------
1 | # Root logger option
2 | log4j.rootLogger=ERROR, file
3 |
4 | # Direct log messages to a log file
5 | log4j.appender.file=org.apache.log4j.RollingFileAppender
6 |
7 |
8 | #log4j.appender.file.File=/var/lib/openshift/5497788a5973ca3ce20000e0/jbossews/logs/rolling.log
9 | log4j.appender.file.File=/Users/umairabbasi/Tools/apache-tomcat-8.0.11/webapps/quoteshare/logs/rolling.log
10 | log4j.appender.file.MaxFileSize=10MB
11 | log4j.appender.file.MaxBackupIndex=10
12 | log4j.appender.file.layout=org.apache.log4j.PatternLayout
13 | log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} %-5p %c{1}\:%L - %m%n
--------------------------------------------------------------------------------
/src/application.properties:
--------------------------------------------------------------------------------
1 | #MACYS DB Properties
2 | #db.driver=com.mysql.jdbc.Driver
3 | #db.url=jdbc:mysql://172.17.0.44:3306/objectdb
4 | #db.username=root
5 | #db.password=4OjhqNvNNBbMNYia
6 |
7 | #Local DB Properties
8 | db.driver=com.mysql.jdbc.Driver
9 | db.url=jdbc:mysql://localhost:3306/objectdb
10 | db.username=root
11 | db.password=root
12 |
13 | #Cloud DB Properties
14 | #db.driver=com.mysql.jdbc.Driver
15 | #db.url=jdbc:mysql://127.13.32.130:3306/objectdb
16 | #db.username=admina2USMU1
17 | #db.password=fKI_jZJBuhzB
18 |
19 | swagger.base.path=https://jbossews-abbasikov.rhcloud.com/fillthecupserver
20 |
21 |
--------------------------------------------------------------------------------
/src/com/macys/exceptions/ServiceException.java:
--------------------------------------------------------------------------------
1 | package com.macys.exceptions;
2 |
3 | public class ServiceException extends Exception{
4 |
5 | private static final long serialVersionUID = 1L;
6 |
7 | private ErrorCodeEnum errorCodeEnum;
8 |
9 | public ServiceException(String message, ErrorCodeEnum code) {
10 | super(message);
11 | this.errorCodeEnum = code;
12 | }
13 |
14 | public ServiceException(String message, Throwable cause,ErrorCodeEnum code) {
15 | super(message, cause);
16 | this.errorCodeEnum = code;
17 | }
18 |
19 | public ErrorCodeEnum getErrorCodeEnum(){
20 | return errorCodeEnum;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/com/macys/utils/EncryptionUtils.java:
--------------------------------------------------------------------------------
1 | package com.macys.utils;
2 |
3 | import org.jasypt.util.password.*;
4 |
5 | public class EncryptionUtils {
6 |
7 |
8 | public static String encryptPassword(String plainPassword){
9 | StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
10 | return passwordEncryptor.encryptPassword(plainPassword);
11 | }
12 |
13 | public static Boolean checkPassword(String plainPassword, String encryptedPassword){
14 | StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
15 | return passwordEncryptor.checkPassword(plainPassword, encryptedPassword);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/containers/LabContainerVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects.containers;
2 |
3 | import java.util.List;
4 |
5 | import org.codehaus.jackson.annotate.JsonProperty;
6 | import org.codehaus.jackson.map.annotate.JsonSerialize;
7 | import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
8 |
9 | import com.macys.valuesobjects.LabVo;
10 |
11 | public class LabContainerVo extends BaseContainerVo{
12 |
13 | @JsonProperty("data")
14 | @JsonSerialize(include=Inclusion.NON_NULL)
15 | public LabVo data;
16 |
17 | @JsonProperty("dataList")
18 | @JsonSerialize(include=Inclusion.NON_NULL)
19 | public List dataList;
20 | }
21 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/containers/ReleaseContainerVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects.containers;
2 |
3 | import java.util.List;
4 | import org.codehaus.jackson.annotate.JsonProperty;
5 | import org.codehaus.jackson.map.annotate.JsonSerialize;
6 | import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
7 | import com.macys.valuesobjects.ReleaseVo;
8 |
9 | public class ReleaseContainerVo extends BaseContainerVo{
10 |
11 | @JsonProperty("data")
12 | @JsonSerialize(include=Inclusion.NON_NULL)
13 | public ReleaseVo data;
14 |
15 | @JsonProperty("dataList")
16 | @JsonSerialize(include=Inclusion.NON_NULL)
17 | public List dataList;
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/containers/ReleaseCupContainerVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects.containers;
2 |
3 | import java.util.List;
4 |
5 | import org.codehaus.jackson.annotate.JsonProperty;
6 | import org.codehaus.jackson.map.annotate.JsonSerialize;
7 | import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
8 | import com.macys.valuesobjects.ReleaseCupVo;
9 |
10 | public class ReleaseCupContainerVo extends BaseContainerVo{
11 |
12 | @JsonProperty("data")
13 | @JsonSerialize(include=Inclusion.NON_NULL)
14 | public ReleaseCupVo data;
15 |
16 | @JsonProperty("dataList")
17 | @JsonSerialize(include=Inclusion.NON_NULL)
18 | public List dataList;
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/macys/valuesobjects/containers/SystemComponentContainerVo.java:
--------------------------------------------------------------------------------
1 | package com.macys.valuesobjects.containers;
2 |
3 | import java.util.List;
4 | import org.codehaus.jackson.annotate.JsonProperty;
5 | import org.codehaus.jackson.map.annotate.JsonSerialize;
6 | import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
7 | import com.macys.valuesobjects.SystemComponentVo;
8 |
9 | public class SystemComponentContainerVo extends BaseContainerVo{
10 |
11 | @JsonProperty("data")
12 | @JsonSerialize(include=Inclusion.NON_NULL)
13 | public SystemComponentVo data;
14 |
15 | @JsonProperty("dataList")
16 | @JsonSerialize(include=Inclusion.NON_NULL)
17 | public List dataList;
18 | }
19 |
--------------------------------------------------------------------------------
/src/com/macys/rest/filters/UserAuthenticator.java:
--------------------------------------------------------------------------------
1 | package com.macys.rest.filters;
2 |
3 |
4 | public final class UserAuthenticator {
5 |
6 | // public EmployeeSessionService employeeSessionService;
7 |
8 | // public EmployeeSession isSessionIdValid( String sessionId ) throws GeneralSecurityException {
9 | // try{
10 | // return employeeSessionService.fetchSessionById(sessionId);
11 | // }
12 | // catch(ServiceException exc){
13 | // throw new GeneralSecurityException(exc.getMessage(),exc);
14 | // }
15 | // }
16 |
17 | // public void setEmployeeSessionService(
18 | // EmployeeSessionService employeeSessionService) {
19 | // this.employeeSessionService = employeeSessionService;
20 | // }
21 | //
22 | }
23 |
--------------------------------------------------------------------------------
/WebRoot/apidocs/lib/jquery.wiggle.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | jQuery Wiggle
3 | Author: WonderGroup, Jordan Thomas
4 | URL: http://labs.wondergroup.com/demos/mini-ui/index.html
5 | License: MIT (http://en.wikipedia.org/wiki/MIT_License)
6 | */
7 | jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
8 | if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
--------------------------------------------------------------------------------
/src/com/macys/exceptions/GeneralExceptionMapper.java:
--------------------------------------------------------------------------------
1 | package com.macys.exceptions;
2 |
3 | import javax.ws.rs.ClientErrorException;
4 | import javax.ws.rs.core.Response;
5 | import javax.ws.rs.ext.ExceptionMapper;
6 |
7 | public class GeneralExceptionMapper implements ExceptionMapper{
8 |
9 | @Override
10 | public Response toResponse(ClientErrorException exception) {
11 | String jsonString = "{meta:{"+
12 | "code:"+ErrorCodeEnum.INVALID_REQUEST.getCode()+","+
13 | "error:"+ErrorCodeEnum.INVALID_REQUEST.getMessage()+","+
14 | "details:"+exception.getMessage()+
15 | "}"+
16 | "}";
17 |
18 | Response response = Response.status(Response.Status.BAD_REQUEST) .entity(jsonString) .build();
19 | return response;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/com/macys/domain/Lab.java:
--------------------------------------------------------------------------------
1 | package com.macys.domain;
2 |
3 | import com.macys.domain.business.BusinessObject;
4 |
5 | public interface Lab extends BusinessObject{
6 |
7 | public abstract void setLocation(String location);
8 |
9 | public abstract String getLocation();
10 |
11 | public abstract void setDescription(String description);
12 |
13 | public abstract String getDescription();
14 |
15 | public abstract void setPdmName(String pdmName);
16 |
17 | public abstract String getPdmName();
18 |
19 | public abstract void setManagerName(String managerName);
20 |
21 | public abstract String getManagerName();
22 |
23 | public abstract void setLastClicked(String lastClicked);
24 |
25 | public abstract String getLastClicked();
26 |
27 | public abstract void setIsActivated(String isActivated);
28 |
29 | public abstract String getIsActivated();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/com/macys/dao/repository/DBObjectRepository.java:
--------------------------------------------------------------------------------
1 | package com.macys.dao.repository;
2 |
3 | import java.util.List;
4 |
5 | import javax.transaction.Transactional;
6 |
7 | import org.springframework.data.jpa.repository.Query;
8 | import org.springframework.data.repository.CrudRepository;
9 | import org.springframework.stereotype.Repository;
10 |
11 | import com.macys.dao.database.DBObject;
12 |
13 | @Repository
14 | @Transactional
15 | public interface DBObjectRepository extends CrudRepository {
16 |
17 | DBObject findByUuid(String uuid);
18 |
19 | List findByTypeAndName(String type, String name);
20 |
21 | @Query("select u from DBObject u where u.uuid = ?1")
22 | DBObject findUsingPK(String uuid);
23 |
24 | @Query("select u from DBObject u where u.uuid in ?1")
25 | List findUsingUuids(List uuids);
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/macys/domain/business/common/RelationshipTypeEnum.java:
--------------------------------------------------------------------------------
1 | package com.macys.domain.business.common;
2 |
3 | public enum RelationshipTypeEnum {
4 |
5 | LAB_USER("Lab_User",0),
6 | LAB_SYSTEMCOMPONENT("Lab_SystemComponent",1),
7 | RELEASECUP_IPM("RELEASECUP_IPM",2),
8 | USER_ROLE("USER_ROLE",3);
9 |
10 | String relationshipName;
11 | int code;
12 |
13 | RelationshipTypeEnum(String relationshipName, int code) {
14 | this.relationshipName = relationshipName;
15 | this.code = code;
16 | }
17 |
18 | public String getRelationshipName() {
19 | return relationshipName;
20 | }
21 |
22 | public static RelationshipTypeEnum enumFromName(String name) {
23 |
24 | for(RelationshipTypeEnum enum1:RelationshipTypeEnum.values()) {
25 | if(enum1.relationshipName.equals(name)) {
26 | return enum1;
27 | }
28 | }
29 |
30 | return null;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/com/macys/utils/PropertiesUtils.java:
--------------------------------------------------------------------------------
1 | package com.macys.utils;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 | import java.util.Properties;
6 |
7 | public class PropertiesUtils {
8 |
9 |
10 | private Properties props;
11 | private static PropertiesUtils instance = new PropertiesUtils();
12 |
13 |
14 | private PropertiesUtils(){
15 | InputStream is = null;
16 | try {
17 | props = new Properties();
18 | is = this.getClass().getResourceAsStream("/application.properties");
19 | props.load(is);
20 | System.err.println("===Properties File loaded===");
21 | System.out.println(props);
22 |
23 | } catch (IOException e) {
24 | e.printStackTrace();
25 | }
26 |
27 |
28 | }
29 |
30 | public static PropertiesUtils getInstance(){
31 | return instance;
32 | }
33 |
34 | public String getProperty(String key){
35 | return props.getProperty(key);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/WebRoot/index.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" import="java.util.*" pageEncoding="US-ASCII"%>
2 | <%
3 | String path = request.getContextPath();
4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
5 | %>
6 |
7 |
8 |
9 |
10 |
11 |
12 | My JSP 'index.jsp' starting page
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 | This is my JSP page.
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/com/macys/utils/JsonUtils.java:
--------------------------------------------------------------------------------
1 | package com.macys.utils;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 | import com.google.gson.Gson;
6 | import flexjson.JSONDeserializer;
7 | import flexjson.JSONSerializer;
8 |
9 | public class JsonUtils {
10 |
11 | public static String toJson(Object object) {
12 | String json = new JSONSerializer().serialize(object);
13 | return json;
14 | }
15 |
16 | public static Map mapFromJson(String json) {
17 | Map jsonMap = new JSONDeserializer