├── LICENSE ├── README.md └── main └── resources ├── META-INF └── maven │ └── archetype-metadata.xml └── archetype-resources ├── __rootArtifactId__-app ├── pom.xml └── src │ └── main │ └── java │ ├── component │ ├── AdminComponent.java │ ├── BaseComponent.java │ └── UserComponent.java │ ├── exception │ ├── AppException.java │ └── ComponentException.java │ ├── hibernate │ ├── connection │ │ └── SessionFactoryUtil.java │ ├── dao │ │ ├── AbstractBaseDao.java │ │ ├── DaoInterface.java │ │ ├── GenericDao.java │ │ ├── GenericGenDao.java │ │ └── UserDao.java │ └── generators │ │ ├── AbstractDBDataGenerator.java │ │ ├── RandomGenerator.java │ │ └── UserIdGenerator.java │ ├── text │ ├── Messages.java │ └── Texts.java │ └── util │ ├── AppUtil.java │ ├── Crypt.java │ └── SystemSettingsUtil.java ├── __rootArtifactId__-beans ├── pom.xml └── src │ └── main │ └── java │ └── hibernate │ └── beans │ ├── base │ ├── BaseEntity.java │ ├── BaseImage.java │ └── BaseUser.java │ ├── data │ ├── images │ │ ├── JPEGImage.java │ │ └── PNGImage.java │ └── users │ │ ├── Admin.java │ │ ├── Member.java │ │ └── Root.java │ ├── enumeration │ ├── EnumInterface.java │ ├── FileType.java │ └── UserType.java │ └── extension │ └── SystemSettings.java ├── __rootArtifactId__-formbeans ├── pom.xml └── src │ └── main │ └── java │ ├── constants │ ├── GlobalStatusCodes.java │ ├── MessageTypes.java │ └── ServiceErrorStatus.java │ ├── formbeans │ ├── ResponseFormBean.java │ ├── RootFormBean.java │ ├── SystemSettingsFormBean.java │ ├── ToastMessageFormBean.java │ ├── UserFormBean.java │ ├── UserPhotoFormBean.java │ └── UserProfileFormBean.java │ └── formdatas │ ├── SystemSettingsFormData.java │ ├── UserPhotoFormData.java │ └── UserProfileFormData.java ├── __rootArtifactId__-ui ├── pom.xml └── src │ └── main │ ├── java │ ├── text │ │ ├── Labels.java │ │ ├── Paths.java │ │ ├── Tags.java │ │ └── ToolTips.java │ └── ui │ │ ├── config │ │ └── log4j2.xml │ │ ├── constants │ │ └── WebConst.java │ │ ├── rest │ │ ├── AbstractBaseResource.java │ │ ├── AuthFilter.java │ │ └── WebApplication.java │ │ ├── servlet │ │ ├── common │ │ │ ├── AbstractBaseSvt.java │ │ │ ├── AbstractWebController.java │ │ │ ├── DataModel.java │ │ │ ├── Request.java │ │ │ ├── ServletSettings.java │ │ │ ├── Session.java │ │ │ └── XSSRequestWrapper.java │ │ ├── controller │ │ │ ├── admin │ │ │ │ ├── AdminBaseController.java │ │ │ │ ├── SystemSettingsController.java │ │ │ │ └── SystemSettingsEditController.java │ │ │ ├── main │ │ │ │ ├── HomeController.java │ │ │ │ ├── LogoutController.java │ │ │ │ ├── nologin │ │ │ │ │ ├── ErrorController.java │ │ │ │ │ ├── IndexController.java │ │ │ │ │ ├── LoginController.java │ │ │ │ │ ├── NoLoginBaseController.java │ │ │ │ │ └── RegisterController.java │ │ │ │ └── settings │ │ │ │ │ ├── AccountSettingController.java │ │ │ │ │ ├── SettingsController.java │ │ │ │ │ ├── UserDeleteController.java │ │ │ │ │ ├── UserPhotoController.java │ │ │ │ │ └── UserProfileController.java │ │ │ └── root │ │ │ │ └── RootBaseController.java │ │ ├── filter │ │ │ ├── Log4jFilter.java │ │ │ └── PageFilter.java │ │ └── listener │ │ │ ├── ContextListener.java │ │ │ └── Log4jContextListener.java │ │ ├── taglib │ │ ├── CurrentDateTag.java │ │ ├── LabelTag.java │ │ ├── MessageTag.java │ │ ├── TooltipTag.java │ │ ├── UserMenuItem.java │ │ ├── UserTag.java │ │ ├── beans │ │ │ └── PageParameter.java │ │ └── templates │ │ │ ├── GetTag.java │ │ │ ├── InsertTag.java │ │ │ └── PutTag.java │ │ └── util │ │ ├── MenuAccessUtil.java │ │ └── WebUtil.java │ ├── resources │ ├── log4j.properties │ ├── sql │ │ └── __rootArtifactId__.sql │ └── text │ │ ├── labels.properties │ │ ├── messages.properties │ │ ├── paths.properties │ │ ├── tags.properties │ │ └── tooltips.properties │ └── webapp │ ├── WEB-INF │ ├── tlds │ │ ├── __parentArtifactId__.tld │ │ └── template.tld │ └── web.xml │ ├── assets │ └── vendor │ │ ├── bootstrap │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ ├── jquery.min.map │ │ ├── jquery.slim.js │ │ ├── jquery.slim.min.js │ │ └── jquery.slim.min.map │ │ └── simple-sidebar │ │ └── css │ │ └── simple-sidebar.css │ ├── favicon.ico │ ├── fonts │ ├── Ge Body.ttf │ ├── OpenSans-Bold.ttf │ ├── OpenSans-BoldItalic.ttf │ ├── OpenSans-ExtraBold.ttf │ ├── OpenSans-ExtraBoldItalic.ttf │ ├── OpenSans-Italic.ttf │ ├── OpenSans-Light.ttf │ ├── OpenSans-LightItalic.ttf │ ├── OpenSans-Regular.ttf │ ├── OpenSans-SemiBold.ttf │ └── OpenSans-SemiBoldItalic.ttf │ ├── images │ ├── user-large.png │ └── user.png │ ├── pages │ ├── ajaxcontenttemplate.jsp │ ├── contentonlytemplate.jsp │ ├── contents │ │ ├── error.jsp │ │ ├── home.jsp │ │ ├── index.jsp │ │ ├── login.jsp │ │ ├── modalconfirmation.jsp │ │ ├── register.jsp │ │ ├── settings.jsp │ │ ├── settingsaction.jsp │ │ ├── systemsettings.jsp │ │ ├── systemsettingsedit.jsp │ │ ├── useraccount.jsp │ │ ├── userdelete.jsp │ │ ├── userphoto.jsp │ │ └── userprofile.jsp │ ├── headers │ │ └── commonheader.jsp │ ├── pagetemplate.jsp │ ├── scripts │ │ ├── common.jsp │ │ ├── error.jsp │ │ ├── home.jsp │ │ ├── index.jsp │ │ ├── login.jsp │ │ ├── register.jsp │ │ ├── settings.jsp │ │ ├── systemsettings.jsp │ │ ├── systemsettingsedit.jsp │ │ ├── useraccount.jsp │ │ ├── userdelete.jsp │ │ ├── userphoto.jsp │ │ └── userprofile.jsp │ └── styles │ │ ├── error.jsp │ │ ├── home.jsp │ │ ├── index.jsp │ │ ├── login.jsp │ │ ├── register.jsp │ │ ├── settings.jsp │ │ ├── systemsettings.jsp │ │ ├── systemsettingsedit.jsp │ │ ├── useraccount.jsp │ │ ├── userdelete.jsp │ │ ├── userphoto.jsp │ │ └── userprofile.jsp │ ├── scripts │ ├── __parentArtifactId__.js │ ├── common.js │ ├── commonheader.js │ ├── error.js │ ├── home.js │ ├── index.js │ ├── login.js │ ├── register.js │ ├── settings.js │ ├── sidebar.js │ ├── systemsettings.js │ ├── systemsettingsedit.js │ ├── useraccount.js │ ├── userdelete.js │ ├── userphoto.js │ └── userprofile.js │ ├── styles │ ├── __parentArtifactId__.css │ ├── common.css │ ├── commonheader.css │ ├── commonsidebar.css │ ├── error.css │ ├── home.css │ ├── index.css │ ├── login.css │ ├── register.css │ ├── settings.css │ ├── systemsettings.css │ ├── systemsettingsedit.css │ ├── useraccount.css │ ├── userdelete.css │ ├── userphoto.css │ └── userprofile.css │ └── templates │ ├── ajaxcontenttemplate.jsp │ ├── contentonlytemplate.jsp │ └── maintemplate.jsp ├── checkstyle.xml ├── pom.xml └── suppression.xml /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/exception/AppException.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.exception; 5 | 6 | import ${package}.constants.GlobalStatusCodes; 7 | import ${package}.constants.ServiceErrorStatus; 8 | 9 | /** 10 | * @author ${author} 11 | * 12 | */ 13 | public class AppException extends Exception { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /***/ 18 | private final int m_globalStatus; 19 | 20 | /***/ 21 | private int m_internalStatus = ServiceErrorStatus.INTERNAL_ERROR; 22 | 23 | /** 24 | * @param message String 25 | */ 26 | public AppException(final String message) { 27 | this(message, GlobalStatusCodes.INTERNAL_SERVER_ERROR); 28 | } 29 | 30 | /** 31 | * @param message String 32 | * @param globalStatus int 33 | */ 34 | public AppException(final String message, 35 | final int globalStatus) { 36 | super(message); 37 | this.m_globalStatus = globalStatus; 38 | } 39 | 40 | /** 41 | * @param message String 42 | * @param globalStatus int 43 | * @param internalStatus int 44 | */ 45 | public AppException(final String message, 46 | final int globalStatus, 47 | final int internalStatus) { 48 | super(message); 49 | this.m_globalStatus = globalStatus; 50 | this.m_internalStatus = internalStatus; 51 | } 52 | 53 | /** 54 | * @return int 55 | */ 56 | public int getGlobalStatus() { 57 | return m_globalStatus; 58 | } 59 | 60 | /** 61 | * @return int 62 | */ 63 | public int getInternalStatus() { 64 | return m_internalStatus; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/exception/ComponentException.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.exception; 5 | 6 | /** 7 | * @author ${author} 8 | * 9 | */ 10 | public class ComponentException extends AppException { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | 15 | /** 16 | * @param message String 17 | */ 18 | public ComponentException(final String message) { 19 | super(message); 20 | } 21 | 22 | /** 23 | * @param message String 24 | * @param globalStatus int 25 | */ 26 | public ComponentException(final String message, 27 | final int globalStatus) { 28 | super(message, globalStatus); 29 | } 30 | 31 | /** 32 | * @param message String 33 | * @param globalStatus int 34 | * @param internalStatus int 35 | */ 36 | public ComponentException(final String message, 37 | final int globalStatus, 38 | final int internalStatus) { 39 | super(message, globalStatus, internalStatus); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/hibernate/dao/DaoInterface.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.dao; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | * @param 13 | * @param 14 | */ 15 | public interface DaoInterface { 16 | 17 | /** 18 | * Insert and Update Entity data. 19 | * @param entity Bean 20 | * @return Serializable 21 | */ 22 | Serializable save(Bean entity); 23 | 24 | /** 25 | * Insert and Update Entity data. 26 | * @param entity Bean 27 | */ 28 | void persist(Bean entity); 29 | 30 | /** 31 | * Search by Id. 32 | * @param id BeanPk 33 | * @return Bean 34 | */ 35 | Bean findById(BeanPk id); 36 | 37 | /** 38 | * Remove Entity data. 39 | * @param entity Bean 40 | */ 41 | void delete(Bean entity); 42 | } 43 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/hibernate/dao/GenericGenDao.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.dao; 5 | 6 | import java.io.Serializable; 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | import javax.persistence.criteria.CriteriaBuilder; 11 | import javax.persistence.criteria.CriteriaQuery; 12 | import javax.persistence.criteria.Root; 13 | 14 | import org.hibernate.query.Query; 15 | 16 | import ${package}.hibernate.beans.base.BaseEntity; 17 | 18 | /** 19 | * @author ${author} 20 | * @param 21 | * 22 | */ 23 | class GenericGenDao extends AbstractBaseDao { 24 | 25 | /***/ 26 | private Class m_entityClass; 27 | 28 | /** 29 | * @param clazz Class< ? extends GenericGenDao> 30 | * @param entityClass class of T 31 | */ 32 | @SuppressWarnings("rawtypes") 33 | protected GenericGenDao(final Class< ? extends GenericGenDao> clazz, 34 | final Class entityClass) { 35 | super(clazz, null); 36 | this.m_entityClass = entityClass; 37 | } 38 | 39 | /** 40 | * @param clazz Class< ? extends GenericGenDao> 41 | * @param entityClass class of T 42 | * @param dao GenericGenDao of ? that extends GenericGenDao 43 | */ 44 | @SuppressWarnings({ "rawtypes", "unchecked" }) 45 | protected GenericGenDao(final Class< ? extends GenericGenDao> clazz, 46 | final Class entityClass, 47 | final GenericGenDao dao) { 48 | super(clazz, dao); 49 | this.m_entityClass = entityClass; 50 | } 51 | 52 | /** 53 | * @return the m_entityClass 54 | */ 55 | public Class getEntityClass() { 56 | return m_entityClass; 57 | } 58 | 59 | /** 60 | * 61 | * @param entity Object 62 | * @return T 63 | */ 64 | public T save(final T entity) { 65 | return super.saveEntity(entity); 66 | } 67 | 68 | /** 69 | * 70 | * @param entity Object 71 | */ 72 | @SuppressWarnings("rawtypes") 73 | public void persist(final T entity) { 74 | if (entity instanceof BaseEntity) { 75 | final BaseEntity bEntity = (BaseEntity) entity; 76 | bEntity.setLastModifiedDate(bEntity.getUpdateDate()); 77 | bEntity.setUpdateDate(new Date()); 78 | } 79 | super.persistEntity(entity); 80 | } 81 | 82 | /** 83 | * 84 | * @param id String 85 | * @return Object 86 | */ 87 | public T findById(final String id) { 88 | return super.findEntityById(m_entityClass, id); 89 | } 90 | 91 | /** 92 | * 93 | * @param id long 94 | * @return Object 95 | */ 96 | public T findById(final long id) { 97 | return super.findEntityById(m_entityClass, id); 98 | } 99 | 100 | /** 101 | * 102 | * @param id long 103 | * @return Object 104 | */ 105 | public T findById(final int id) { 106 | return super.findEntityById(m_entityClass, id); 107 | } 108 | 109 | /** 110 | * 111 | * @param id Serializable 112 | * @return Object 113 | */ 114 | public T findById(final Serializable id) { 115 | return super.findEntityById(m_entityClass, id); 116 | } 117 | 118 | /** 119 | * 120 | * @param entity Object 121 | */ 122 | public void delete(final T entity) { 123 | super.deleteEntity(entity); 124 | } 125 | 126 | /** 127 | * 128 | * @return List of objects 129 | */ 130 | @SuppressWarnings({ "unchecked", "rawtypes" }) 131 | public List getAll() { 132 | final CriteriaBuilder builder = getCurrentSession().getCriteriaBuilder(); 133 | final CriteriaQuery query = builder.createQuery(m_entityClass); 134 | final Root root = query.from(getEntityClass()); 135 | query.select(root) 136 | .where(builder.isFalse(root.get(BaseEntity.CLM_RETIRED))); 137 | final Query q = getCurrentSession().createQuery(query); 138 | return q.getResultList(); 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/hibernate/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.dao; 5 | 6 | import java.util.List; 7 | 8 | import javax.persistence.criteria.CriteriaBuilder; 9 | import javax.persistence.criteria.CriteriaQuery; 10 | import javax.persistence.criteria.Predicate; 11 | import javax.persistence.criteria.Root; 12 | 13 | import org.hibernate.query.Query; 14 | 15 | import ${package}.hibernate.beans.base.BaseEntity; 16 | import ${package}.hibernate.beans.base.BaseUser; 17 | 18 | /** 19 | * @author ${author} 20 | * @param 21 | * 22 | */ 23 | @SuppressWarnings("rawtypes") 24 | public class UserDao extends GenericDao { 25 | 26 | /** 27 | * 28 | * @param entityClass Class of T 29 | */ 30 | public UserDao(final Class entityClass) { 31 | this(entityClass, null); 32 | } 33 | 34 | /** 35 | * @param entityClass Class of T 36 | * @param dao GenericDao 37 | */ 38 | public UserDao(final Class entityClass, 39 | final GenericDao dao) { 40 | super(UserDao.class, entityClass, dao); 41 | } 42 | 43 | /** 44 | * 45 | * @param column String 46 | * @param value String 47 | * @return Object 48 | */ 49 | public T findUserByColumnName(final String column, final String value) { 50 | return findUserByColumnName(column, value, true, false); 51 | } 52 | 53 | /** 54 | * 55 | * @param column String 56 | * @param value String 57 | * @param keySensitive boolean 58 | * @return Object 59 | */ 60 | public T findUserByColumnName(final String column, final String value, final boolean keySensitive) { 61 | return findUserByColumnName(column, value, keySensitive, false); 62 | } 63 | 64 | /** 65 | * 66 | * @param column String 67 | * @param value String 68 | * @param keySensitive boolean 69 | * @param includeRetired boolean 70 | * @return Object 71 | */ 72 | @SuppressWarnings({ "unchecked" }) 73 | public T findUserByColumnName(final String column, final String value, final boolean keySensitive, final boolean includeRetired) { 74 | final CriteriaBuilder builder = getCurrentSession().getCriteriaBuilder(); 75 | final CriteriaQuery query = builder.createQuery(getEntityClass()); 76 | final Root root = query.from(getEntityClass()); 77 | query.select(root); 78 | if (includeRetired) { // remove retired filter when addRetire is true 79 | query.where(builder.equal(root.get(column), value)); 80 | } else { 81 | Predicate predicate = builder.equal(root.get(column), value); 82 | if (!keySensitive) { 83 | predicate = builder.like(builder.upper(root.get(column)), value.toUpperCase()); 84 | } 85 | 86 | query.where(builder.and( 87 | builder.isFalse(root.get(BaseEntity.CLM_RETIRED)), 88 | predicate 89 | )); 90 | } 91 | final Query q = getCurrentSession().createQuery(query); 92 | final List results = q.getResultList(); 93 | if (null != results && !results.isEmpty()) { 94 | return results.get(0); 95 | } 96 | return null; 97 | } 98 | 99 | 100 | 101 | } 102 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/hibernate/generators/AbstractDBDataGenerator.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.generators; 5 | 6 | import java.io.Serializable; 7 | import java.sql.Connection; 8 | import java.sql.PreparedStatement; 9 | import java.sql.ResultSet; 10 | import java.sql.SQLException; 11 | 12 | import org.apache.log4j.LogManager; 13 | import org.apache.log4j.Logger; 14 | import org.hibernate.HibernateException; 15 | import org.hibernate.engine.spi.SharedSessionContractImplementor; 16 | import org.hibernate.id.IdentifierGenerator; 17 | 18 | /** 19 | * @author ${author} 20 | * 21 | */ 22 | public abstract class AbstractDBDataGenerator implements IdentifierGenerator { 23 | 24 | /***/ 25 | private final Logger m_logger; 26 | 27 | protected AbstractDBDataGenerator(final Class< ? extends AbstractDBDataGenerator> clazz) { 28 | this.m_logger = LogManager.getLogger(clazz); 29 | } 30 | 31 | @Override 32 | public final Serializable generate(final SharedSessionContractImplementor session, final Object arg1) throws HibernateException { 33 | final Connection con = session.connection(); 34 | try { 35 | return getKey(con); 36 | } catch (final SQLException e) { 37 | m_logger.error("Failed to generate key.", e); 38 | } 39 | return newRandomKey(); 40 | } 41 | 42 | /** 43 | * 44 | * @param con Connection 45 | * @return String 46 | * @throws SQLException - sql runtime exception 47 | */ 48 | private String getKey(final Connection con) throws SQLException { 49 | final String newKey = newRandomKey(); 50 | final PreparedStatement pst = con.prepareStatement("select " + getColumnName() + " from " + getTableName() + " where " + getColumnName() + " = ?"); 51 | pst.setString(1, newKey); 52 | final ResultSet rs = pst.executeQuery(); 53 | if (rs != null && rs.next()) { 54 | return getKey(con); 55 | } else { 56 | return newKey; 57 | } 58 | } 59 | 60 | /** 61 | * 62 | * @return table name 63 | */ 64 | protected abstract String getTableName(); 65 | 66 | /** 67 | * 68 | * @return column name 69 | */ 70 | protected abstract String getColumnName(); 71 | 72 | /** 73 | * 74 | * @return key 75 | */ 76 | protected abstract String newRandomKey(); 77 | 78 | } 79 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/hibernate/generators/RandomGenerator.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.generators; 5 | 6 | import java.util.Random; 7 | import java.util.UUID; 8 | 9 | /** 10 | * 11 | * @author ${author} 12 | * 13 | */ 14 | public final class RandomGenerator { 15 | 16 | /***/ 17 | private RandomGenerator() { 18 | } 19 | 20 | /** 21 | * 22 | * @return String 23 | */ 24 | public static String getRandString() { 25 | return UUID.randomUUID().toString().toUpperCase(); 26 | } 27 | 28 | /** 29 | * 30 | * @param num int 31 | * @return String 32 | */ 33 | public static String randNChar(final int num) { 34 | String randVal = getRandString(); 35 | while (randVal.length() < num) { 36 | randVal = randVal + getRandString(); 37 | } 38 | return randVal.substring(0, num - 1); 39 | } 40 | 41 | /** 42 | * 43 | * @return String 44 | */ 45 | public static String rand12Char() { 46 | final String randVal = getRandString(); 47 | return randVal.substring(0, 11); 48 | } 49 | 50 | /** 51 | * 52 | * @return String 53 | */ 54 | public static String rand14Char() { 55 | final String randVal = getRandString(); 56 | return randVal.substring(0, 13); 57 | } 58 | 59 | /** 60 | * 61 | * @return String 62 | */ 63 | public static String rand8Char() { 64 | final String randVal = getRandString(); 65 | return randVal.substring(0, 7); 66 | } 67 | 68 | /** 69 | * 70 | * @return String 71 | */ 72 | public static String rand2Char() { 73 | final String randVal = getRandString(); 74 | return randVal.substring(0, 1); 75 | } 76 | 77 | /** 78 | * 79 | * @return String 80 | */ 81 | public static long rand8Number() { 82 | final Random rand = new Random(); 83 | return 10000000 + rand.nextInt(89999999); 84 | } 85 | 86 | /** 87 | * 88 | * @return String 89 | */ 90 | public static long rand3Number() { 91 | final Random rand = new Random(); 92 | return 100 + rand.nextInt(899); 93 | } 94 | 95 | /** 96 | * 97 | * @return String 98 | */ 99 | public static long rand4Number() { 100 | final Random rand = new Random(); 101 | return 1000 + rand.nextInt(8999); 102 | } 103 | 104 | /** 105 | * 106 | * @return String 107 | */ 108 | public static long rand5Number() { 109 | final Random rand = new Random(); 110 | return 10000 + rand.nextInt(89999); 111 | } 112 | 113 | /** 114 | * 115 | * @return String 116 | */ 117 | public static long rand6Number() { 118 | final Random rand = new Random(); 119 | return 100000 + rand.nextInt(899999); 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/hibernate/generators/UserIdGenerator.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.generators; 5 | 6 | /** 7 | * 8 | * @author ${author} 9 | * 10 | */ 11 | public class UserIdGenerator extends AbstractDBDataGenerator { 12 | 13 | /***/ 14 | public UserIdGenerator() { 15 | super(UserIdGenerator.class); 16 | } 17 | 18 | @Override 19 | public final String newRandomKey() { 20 | return RandomGenerator.rand4Number() + "-" + RandomGenerator.rand4Number(); 21 | } 22 | 23 | @Override 24 | public final String getTableName() { 25 | return "dp_user"; 26 | } 27 | 28 | @Override 29 | public final String getColumnName() { 30 | return "_id"; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/text/Messages.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.text; 5 | 6 | import java.util.ResourceBundle; 7 | 8 | /** 9 | * @author ${author} 10 | */ 11 | public final class Messages { 12 | 13 | /***/ 14 | private static final String BUNDLE_NAME = "messages"; 15 | 16 | /***/ 17 | private static final ResourceBundle BUNDLE = Texts.getBundle(BUNDLE_NAME); 18 | 19 | /***/ 20 | private Messages() { 21 | } 22 | 23 | /** 24 | * @param key String 25 | * @return String 26 | */ 27 | public static String getString(final String key) { 28 | return Texts.getString(BUNDLE, key); 29 | } 30 | 31 | /** 32 | * @param key String 33 | * @param arg Object 34 | * @return String 35 | */ 36 | public static String getString(final String key, final Object arg) { 37 | return Texts.getString(BUNDLE, key, arg); 38 | } 39 | 40 | /** 41 | * @param key String 42 | * @param args String[] 43 | * @return String 44 | */ 45 | public static String getString(final String key, final String[] args) { 46 | return Texts.getString(BUNDLE, key, args); 47 | } 48 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/text/Texts.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.text; 5 | 6 | import java.text.MessageFormat; 7 | import java.util.Locale; 8 | import java.util.MissingResourceException; 9 | import java.util.ResourceBundle; 10 | 11 | import org.apache.log4j.LogManager; 12 | import org.apache.log4j.Logger; 13 | 14 | /** 15 | * @author ${author} 16 | */ 17 | public final class Texts { 18 | 19 | /***/ 20 | private static final Logger LOGGER = LogManager.getLogger(Texts.class); 21 | 22 | /***/ 23 | private Texts() { 24 | } 25 | 26 | /** 27 | * @param bundleName String 28 | * @return ResourceBundle 29 | */ 30 | static ResourceBundle getBundle(final String bundleName) { 31 | try { 32 | final ResourceBundle bundle = ResourceBundle.getBundle(Texts.class.getPackage().getName() + "." + 33 | bundleName, 34 | Locale.getDefault()); 35 | 36 | LOGGER.debug("Using resource bundle " + bundleName + ", locale=" + Locale.getDefault()); 37 | 38 | return bundle; 39 | } catch (final MissingResourceException e) { 40 | LOGGER.warn("No resource bundle available for " + bundleName); 41 | 42 | return null; 43 | } 44 | } 45 | 46 | /** 47 | * @param bundle ResourceBundle 48 | * @param key String 49 | * @return String 50 | */ 51 | public static String getString(final ResourceBundle bundle, final String key) { 52 | try { 53 | return bundle.getString(key); 54 | } catch (final MissingResourceException e) { 55 | return "!" + key + "!"; 56 | } 57 | } 58 | 59 | /** 60 | * @param bundle ResourceBundle 61 | * @param key String 62 | * @param arg Object 63 | * @return String 64 | */ 65 | static String getString(final ResourceBundle bundle, final String key, final Object arg) { 66 | try { 67 | final String format = bundle.getString(key); 68 | if (arg == null) { 69 | return MessageFormat.format(format, new Object[] { "" }); 70 | } 71 | 72 | return MessageFormat.format(format, new Object[] { arg }); 73 | } catch (final MissingResourceException e) { 74 | return "!" + key + "!"; //${symbol_dollar}NON-NLS-2${symbol_dollar} //${symbol_dollar}NON-NLS-1${symbol_dollar} 75 | } 76 | } 77 | 78 | /** 79 | * @param bundle ResourceBundle 80 | * @param key String 81 | * @param args String[] 82 | * @return String 83 | */ 84 | static String getString(final ResourceBundle bundle, final String key, final String[] args) { 85 | try { 86 | return MessageFormat.format(bundle.getString(key), (Object[]) args); 87 | } catch (final MissingResourceException e) { 88 | return "!" + key + "!"; //${symbol_dollar}NON-NLS-2${symbol_dollar} //${symbol_dollar}NON-NLS-1${symbol_dollar} 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-app/src/main/java/util/SystemSettingsUtil.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.util; 5 | 6 | import java.util.List; 7 | 8 | import org.apache.log4j.LogManager; 9 | import org.apache.log4j.Logger; 10 | 11 | import ${package}.constants.GlobalStatusCodes; 12 | import ${package}.constants.ServiceErrorStatus; 13 | import ${package}.exception.AppException; 14 | import ${package}.hibernate.beans.extension.SystemSettings; 15 | import ${package}.hibernate.dao.GenericDao; 16 | 17 | /** 18 | * @author ${author} 19 | * 20 | */ 21 | public final class SystemSettingsUtil { 22 | 23 | /***/ 24 | private static final Logger LOGGER = LogManager.getLogger(SystemSettingsUtil.class); 25 | 26 | private SystemSettingsUtil() {} 27 | 28 | /** 29 | * @throws AppException 30 | **/ 31 | public static void loadSystemSettings() throws AppException { 32 | final GenericDao dao = new GenericDao<>(SystemSettings.class); 33 | try { 34 | final List list = dao.getAll(); 35 | if (list == null || list.isEmpty()) { 36 | LOGGER.error("Failed to load initial data into the database..."); 37 | } else if (!"Y".equals(System.getProperty("DB_CREATED", "N"))) { // only show for create database 38 | LOGGER.info("Initial data successfully loaded..."); 39 | } 40 | for (final SystemSettings systemSetting : list) { 41 | if (systemSetting.isEncrypted()) { 42 | System.setProperty(systemSetting.getName(), Crypt.decryptHexString(systemSetting.getValue())); 43 | } else { 44 | System.setProperty(systemSetting.getName(), systemSetting.getValue()); 45 | } 46 | } 47 | } catch (final Exception e) { 48 | LOGGER.error("Failed to load system settings.", e); 49 | throw new AppException("Failed to load system settings.", GlobalStatusCodes.INTERNAL_SERVER_ERROR, ServiceErrorStatus.INTERNAL_ERROR); 50 | } finally { 51 | dao.closeCurrentSession(); 52 | } 53 | } 54 | 55 | public static int getSettingAsInt(final String name) { 56 | return getSettingAsInt(name, -1); 57 | } 58 | 59 | public static int getSettingAsInt(final String name, final int defaultValue) { 60 | try { 61 | final String val = System.getProperty(name); 62 | if (null == val) { 63 | return defaultValue; 64 | } else { 65 | return Integer.parseInt(val); 66 | } 67 | } catch (final Exception e) { 68 | return defaultValue; 69 | } 70 | } 71 | 72 | public static boolean getSettingAsBool(final String name) { 73 | return getSettingAsBool(name, false); 74 | } 75 | 76 | public static boolean getSettingAsBool(final String name, final boolean defaultValue) { 77 | try { 78 | final String val = System.getProperty(name); 79 | if (null == val || !"true".equalsIgnoreCase(val)) { 80 | return defaultValue; 81 | } 82 | return true; 83 | } catch (final Exception e) { 84 | return defaultValue; 85 | } 86 | } 87 | 88 | public static String getSetting(final String name) { 89 | return getSetting(name, null); 90 | } 91 | 92 | public static String getSetting(final String name, final String defaultValue) { 93 | return System.getProperty(name, defaultValue); 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | ${groupId} 6 | ${rootArtifactId} 7 | ${version} 8 | 9 | 10 | ${artifactId} 11 | ${name} Data Model 12 | ${name} Data Object Hibernate Models 13 | 14 | 15 | 16 | 17 | org.hibernate 18 | hibernate-core 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | org.apache.maven.plugins 27 | maven-compiler-plugin 28 | 3.6.0 29 | 30 | 11 31 | 11 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/base/BaseEntity.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.base; 5 | 6 | import java.util.Date; 7 | 8 | import javax.persistence.Column; 9 | import javax.persistence.MappedSuperclass; 10 | 11 | /** 12 | * 13 | * @author ${author} 14 | * @param T 15 | * 16 | */ 17 | @SuppressWarnings("rawtypes") 18 | @MappedSuperclass 19 | public class BaseEntity { 20 | 21 | /***/ 22 | public static final String CLM_RETIRED = "m_retired"; 23 | 24 | /***/ 25 | @Column(name = "retired", columnDefinition = "boolean default false", updatable = true) 26 | private boolean m_retired; 27 | 28 | /***/ 29 | public static final String CLM_CREATEDATE = "m_createDate"; 30 | 31 | /***/ 32 | @Column(name = "create_date", updatable = false) 33 | private Date m_createDate; 34 | 35 | /***/ 36 | public static final String CLM_LASTMODIFIEDDATE = "m_lastModifiedDate"; 37 | 38 | /***/ 39 | @Column(name = "last_modified_date", updatable = true) 40 | private Date m_lastModifiedDate; 41 | 42 | /***/ 43 | public static final String CLM_UPDATEDATE = "m_updateDate"; 44 | 45 | /***/ 46 | @Column(name = "update_date", updatable = true) 47 | private Date m_updateDate; 48 | 49 | /***/ 50 | protected BaseEntity() { 51 | final Date date = new Date(); 52 | m_createDate = date; 53 | m_lastModifiedDate = date; 54 | m_updateDate = date; 55 | } 56 | 57 | /** 58 | * @return the retired 59 | */ 60 | public boolean getRetired() { 61 | return m_retired; 62 | } 63 | 64 | /** 65 | * @param retired the retired to set 66 | * @return T 67 | */ 68 | @SuppressWarnings("unchecked") 69 | public T setRetired(final boolean retired) { 70 | this.m_retired = retired; 71 | return (T) this; 72 | } 73 | 74 | /** 75 | * 76 | * @return Date 77 | */ 78 | public Date getCreateDate() { 79 | return m_createDate; 80 | } 81 | 82 | /** 83 | * 84 | * @return Date 85 | */ 86 | public Date getUpdateDate() { 87 | return m_updateDate; 88 | } 89 | 90 | /** 91 | * 92 | * @return Date 93 | */ 94 | public Date getLastModifiedDate() { 95 | return m_lastModifiedDate; 96 | } 97 | 98 | /** 99 | * 100 | * @param lastModifiedDate Date 101 | * @return T 102 | */ 103 | @SuppressWarnings("unchecked") 104 | public T setLastModifiedDate(final Date lastModifiedDate) { 105 | this.m_lastModifiedDate = lastModifiedDate; 106 | return (T) this; 107 | } 108 | 109 | /** 110 | * 111 | * @param updateDate Date 112 | * @return T 113 | */ 114 | @SuppressWarnings("unchecked") 115 | public T setUpdateDate(final Date updateDate) { 116 | this.m_updateDate = updateDate; 117 | return (T) this; 118 | } 119 | 120 | /** 121 | * 122 | * @param createDate Date 123 | * @return T 124 | */ 125 | @SuppressWarnings("unchecked") 126 | public T setCreateDate(final Date createDate) { 127 | this.m_createDate = createDate; 128 | return (T) this; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/base/BaseImage.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.base; 5 | 6 | import java.io.Serializable; 7 | 8 | import javax.persistence.Basic; 9 | import javax.persistence.Column; 10 | import javax.persistence.DiscriminatorColumn; 11 | import javax.persistence.DiscriminatorType; 12 | import javax.persistence.Entity; 13 | import javax.persistence.FetchType; 14 | import javax.persistence.GeneratedValue; 15 | import javax.persistence.GenerationType; 16 | import javax.persistence.Id; 17 | import javax.persistence.Inheritance; 18 | import javax.persistence.InheritanceType; 19 | import javax.persistence.Table; 20 | 21 | /** 22 | * 23 | * @author ${author} 24 | * @param 25 | * 26 | */ 27 | @SuppressWarnings("rawtypes") 28 | @Entity 29 | @Table( 30 | name = "dp_image" 31 | ) 32 | @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 33 | @DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.STRING) 34 | public class BaseImage extends BaseEntity implements Serializable { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | /***/ 39 | public static final String CLM_ID = "m_id"; 40 | 41 | /***/ 42 | @Id 43 | @GeneratedValue(strategy = GenerationType.IDENTITY) 44 | @Column(name = "_id") 45 | private long m_id; 46 | 47 | /***/ 48 | public static final String CLM_VALUE = "m_value"; 49 | 50 | /***/ 51 | @Basic(fetch = FetchType.LAZY) 52 | @Column(name = "data", columnDefinition = "bytea") 53 | private byte[] m_data; 54 | 55 | /***/ 56 | public BaseImage() { 57 | } 58 | 59 | /** 60 | * 61 | * @return long 62 | */ 63 | public long getId() { 64 | return m_id; 65 | } 66 | 67 | /** 68 | * 69 | * @param id long 70 | * @return T 71 | */ 72 | @SuppressWarnings("unchecked") 73 | public T setId(final long id) { 74 | this.m_id = id; 75 | return (T) this; 76 | } 77 | 78 | /** 79 | * @return the data 80 | */ 81 | public byte[] getData() { 82 | return m_data; 83 | } 84 | 85 | /** 86 | * @param data the data to set 87 | * @return T 88 | */ 89 | @SuppressWarnings("unchecked") 90 | public T setData(final byte[] data) { 91 | this.m_data = data; 92 | return (T) this; 93 | } 94 | 95 | @Override 96 | public final String toString() { 97 | if (null == m_data) { 98 | return ""; 99 | } 100 | return new String(m_data); 101 | } 102 | 103 | } 104 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/data/images/JPEGImage.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.data.images; 5 | 6 | import java.io.Serializable; 7 | 8 | import javax.persistence.DiscriminatorValue; 9 | import javax.persistence.Entity; 10 | 11 | import ${package}.hibernate.beans.base.BaseImage; 12 | import ${package}.hibernate.beans.enumeration.FileType; 13 | 14 | /** 15 | * @author ${author} 16 | * 17 | */ 18 | @Entity 19 | @DiscriminatorValue(FileType.FileTypeConst.JPEG_VALUE) 20 | public class JPEGImage extends BaseImage implements Serializable { 21 | 22 | /** 23 | * 24 | */ 25 | private static final long serialVersionUID = 1L; 26 | 27 | public JPEGImage() { 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/data/images/PNGImage.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.data.images; 5 | 6 | import java.io.Serializable; 7 | 8 | import javax.persistence.DiscriminatorValue; 9 | import javax.persistence.Entity; 10 | 11 | import ${package}.hibernate.beans.base.BaseImage; 12 | import ${package}.hibernate.beans.enumeration.FileType; 13 | 14 | /** 15 | * @author ${author} 16 | * 17 | */ 18 | @Entity 19 | @DiscriminatorValue(FileType.FileTypeConst.PNG_VALUE) 20 | public class PNGImage extends BaseImage implements Serializable { 21 | 22 | /** 23 | * 24 | */ 25 | private static final long serialVersionUID = 1L; 26 | 27 | public PNGImage() { 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/data/users/Admin.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.data.users; 5 | 6 | import java.io.Serializable; 7 | 8 | import javax.persistence.DiscriminatorValue; 9 | import javax.persistence.Entity; 10 | 11 | import ${package}.hibernate.beans.base.BaseUser; 12 | import ${package}.hibernate.beans.enumeration.UserType; 13 | 14 | /** 15 | * @author ${author} 16 | * 17 | */ 18 | @Entity 19 | @DiscriminatorValue(UserType.UserTypeConst.ADMIN_VALUE) 20 | public class Admin extends BaseUser implements Serializable { 21 | 22 | /** 23 | * 24 | */ 25 | private static final long serialVersionUID = 1L; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/data/users/Member.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.data.users; 5 | 6 | import java.io.Serializable; 7 | 8 | import javax.persistence.ConstraintMode; 9 | import javax.persistence.DiscriminatorValue; 10 | import javax.persistence.Entity; 11 | import javax.persistence.ForeignKey; 12 | import javax.persistence.JoinColumn; 13 | import javax.persistence.ManyToOne; 14 | 15 | import ${package}.hibernate.beans.base.BaseUser; 16 | import ${package}.hibernate.beans.enumeration.UserType; 17 | 18 | /** 19 | * @author ${author} 20 | * 21 | */ 22 | @Entity 23 | @DiscriminatorValue(UserType.UserTypeConst.MEMBER_VALUE) 24 | public class Member extends BaseUser implements Serializable { 25 | 26 | /** 27 | * 28 | */ 29 | private static final long serialVersionUID = 1L; 30 | 31 | /***/ 32 | public static final String CLM_ROOT = "m_admin"; 33 | 34 | /***/ 35 | @ManyToOne(optional = true) 36 | @JoinColumn(name = "admin_id", foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT), nullable = true) 37 | private Root m_admin; 38 | 39 | public Member() { 40 | } 41 | 42 | /** 43 | * @return the admin 44 | */ 45 | public Root getAdmin() { 46 | return m_admin; 47 | } 48 | 49 | /** 50 | * @param admin the admin to set 51 | * @return Member 52 | */ 53 | public Member setAdmin(final Root admin) { 54 | this.m_admin = admin; 55 | return this; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/data/users/Root.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.data.users; 5 | 6 | import java.io.Serializable; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | import javax.persistence.DiscriminatorValue; 11 | import javax.persistence.Entity; 12 | import javax.persistence.FetchType; 13 | import javax.persistence.OneToMany; 14 | 15 | import org.hibernate.annotations.Where; 16 | 17 | import ${package}.hibernate.beans.base.BaseUser; 18 | import ${package}.hibernate.beans.enumeration.UserType; 19 | 20 | /** 21 | * @author ${author} 22 | * 23 | */ 24 | @Entity 25 | @DiscriminatorValue(UserType.UserTypeConst.ROOT_VALUE) 26 | public class Root extends BaseUser implements Serializable { 27 | 28 | /** 29 | * 30 | */ 31 | private static final long serialVersionUID = 1L; 32 | 33 | /***/ 34 | @OneToMany(mappedBy = "m_admin", fetch = FetchType.LAZY) 35 | @Where(clause = "retired = false") 36 | private List m_members = new ArrayList<>(); 37 | 38 | public Root() { 39 | } 40 | 41 | /** 42 | * @return the members 43 | */ 44 | public List getMembers() { 45 | return m_members; 46 | } 47 | 48 | /** 49 | * @param members the members to set 50 | * @return Root 51 | */ 52 | public Root setMembers(final List members) { 53 | this.m_members = members; 54 | return this; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/enumeration/EnumInterface.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.enumeration; 5 | 6 | /** 7 | * @author ${author} 8 | * 9 | */ 10 | public interface EnumInterface { 11 | 12 | String getType(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/enumeration/FileType.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.enumeration; 5 | 6 | /** 7 | * @author ${author} 8 | * 9 | */ 10 | public enum FileType implements EnumInterface { 11 | 12 | /** 13 | * JPEG. 14 | */ 15 | JPEG(FileTypeConst.JPEG_VALUE), 16 | 17 | /** 18 | * PNG. 19 | */ 20 | PNG(FileTypeConst.PNG_VALUE), 21 | 22 | /** 23 | * UNKNOWN. 24 | */ 25 | UNKNOWN(FileTypeConst.UNKNOWN_VALUE); 26 | 27 | /***/ 28 | private final String m_type; 29 | 30 | /** 31 | * 32 | * @param type String 33 | */ 34 | FileType(final String type) { 35 | this.m_type = type; 36 | } 37 | 38 | @Override 39 | public String getType() { 40 | return m_type; 41 | } 42 | 43 | public static FileType getAnnotationType(final String type) { 44 | switch (type) { 45 | case FileTypeConst.JPEG_VALUE: 46 | return JPEG; 47 | case FileTypeConst.PNG_VALUE: 48 | return PNG; 49 | 50 | default: 51 | return UNKNOWN; 52 | } 53 | } 54 | 55 | public final class FileTypeConst { 56 | /** 57 | * JPEG. 58 | */ 59 | public static final String JPEG_VALUE = ".jpeg"; 60 | 61 | /** 62 | * PNG. 63 | */ 64 | public static final String PNG_VALUE = ".png"; 65 | 66 | /** 67 | * UNKNOWN. 68 | */ 69 | public static final String UNKNOWN_VALUE = "Unknown"; 70 | 71 | private FileTypeConst() { 72 | 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/enumeration/UserType.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.enumeration; 5 | 6 | /** 7 | * @author ${author} 8 | * 9 | */ 10 | public enum UserType implements EnumInterface { 11 | 12 | /** 13 | * System administrator. 14 | */ 15 | ADMIN(UserTypeConst.ROOT_VALUE), 16 | 17 | /** 18 | * Root user for the company administrator. 19 | */ 20 | ROOT(UserTypeConst.ROOT_VALUE), 21 | 22 | /** 23 | * Root member the co-manage the company. 24 | */ 25 | MEMBER(UserTypeConst.MEMBER_VALUE), 26 | 27 | /** 28 | * UNKNOWN user. 29 | */ 30 | UNKNOWN(UserTypeConst.UNKNOWN_VALUE); 31 | 32 | /***/ 33 | private final String m_type; 34 | 35 | /** 36 | * 37 | * @param type String 38 | */ 39 | UserType(final String type) { 40 | this.m_type = type; 41 | } 42 | 43 | @Override 44 | public String getType() { 45 | return m_type; 46 | } 47 | 48 | public static UserType getAnnotationType(final String type) { 49 | switch (type) { 50 | case UserTypeConst.ADMIN_VALUE: 51 | return ADMIN; 52 | case UserTypeConst.ROOT_VALUE: 53 | return ROOT; 54 | case UserTypeConst.MEMBER_VALUE: 55 | return MEMBER; 56 | 57 | default: 58 | return UNKNOWN; 59 | } 60 | } 61 | 62 | public final class UserTypeConst { 63 | /** 64 | * System administrator. 65 | */ 66 | public static final String ADMIN_VALUE = "ADMIN"; 67 | 68 | /** 69 | * Root user for the company administrator. 70 | */ 71 | public static final String ROOT_VALUE = "ROOT"; 72 | 73 | /** 74 | * Root member the co-manage the company. 75 | */ 76 | public static final String MEMBER_VALUE = "MEMBER"; 77 | 78 | /** 79 | * UNKNOWN user. 80 | */ 81 | public static final String UNKNOWN_VALUE = "UNKNOWN"; 82 | 83 | private UserTypeConst() { 84 | 85 | } 86 | 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-beans/src/main/java/hibernate/beans/extension/SystemSettings.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.hibernate.beans.extension; 5 | 6 | import java.io.Serializable; 7 | 8 | import javax.persistence.Column; 9 | import javax.persistence.Entity; 10 | import javax.persistence.GeneratedValue; 11 | import javax.persistence.GenerationType; 12 | import javax.persistence.Id; 13 | import javax.persistence.Table; 14 | 15 | import org.hibernate.annotations.NaturalId; 16 | 17 | import ${package}.hibernate.beans.base.BaseEntity; 18 | 19 | /** 20 | * 21 | * @author ${author} 22 | * 23 | */ 24 | 25 | @Entity 26 | @Table(name = "dpx_system_setting") 27 | public class SystemSettings extends BaseEntity implements Serializable { 28 | 29 | private static final long serialVersionUID = 1L; 30 | 31 | /***/ 32 | public static final String CLM_ID = "m_id"; 33 | 34 | /***/ 35 | @Id 36 | @GeneratedValue(strategy = GenerationType.IDENTITY) 37 | @Column(name = "_id") 38 | private long m_id; 39 | 40 | /***/ 41 | public static final String CLM_NAME = "m_name"; 42 | 43 | /***/ 44 | @NaturalId(mutable = false) 45 | @Column(name = "name", nullable = false, unique = true) 46 | private String m_name; 47 | 48 | /***/ 49 | public static final String CLM_VALUE = "m_value"; 50 | 51 | /***/ 52 | @Column(name = "value") 53 | private String m_value; 54 | 55 | /***/ 56 | public static final String CLM_ENCRYPTED = "m_encypted"; 57 | 58 | /***/ 59 | @Column(name = "encrypted", columnDefinition = "boolean default false", updatable = true) 60 | private boolean m_encrypted; 61 | 62 | /***/ 63 | public SystemSettings() { 64 | } 65 | 66 | /** 67 | * @return the id 68 | */ 69 | public long getId() { 70 | return m_id; 71 | } 72 | 73 | /** 74 | * @param id the id to set 75 | * @return SystemSettings 76 | */ 77 | public SystemSettings setId(final long id) { 78 | this.m_id = id; 79 | return this; 80 | } 81 | 82 | /** 83 | * @return the name 84 | */ 85 | public String getName() { 86 | return m_name; 87 | } 88 | 89 | /** 90 | * @param name the name to set 91 | * @return SystemSettings 92 | */ 93 | public SystemSettings setName(final String name) { 94 | this.m_name = name; 95 | return this; 96 | } 97 | 98 | /** 99 | * @return the value 100 | */ 101 | public String getValue() { 102 | return m_value; 103 | } 104 | 105 | /** 106 | * @param value the value to set 107 | * @return SystemSettings 108 | */ 109 | public SystemSettings setValue(final String value) { 110 | this.m_value = value; 111 | return this; 112 | } 113 | 114 | /** 115 | * @return the encrypted 116 | */ 117 | public boolean isEncrypted() { 118 | return m_encrypted; 119 | } 120 | 121 | /** 122 | * @param encrypted the encrypted to set 123 | * @return SystemSettings 124 | */ 125 | public SystemSettings setEncrypted(final boolean encrypted) { 126 | this.m_encrypted = encrypted; 127 | return this; 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | ${groupId} 6 | ${rootArtifactId} 7 | ${version} 8 | 9 | ${artifactId} 10 | ${name} Form Beans 11 | ${name} 3rd Party Client Library Beans 12 | 13 | 14 | 15 | 16 | org.apache.maven.plugins 17 | maven-compiler-plugin 18 | 3.6.0 19 | 20 | 11 21 | 11 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/constants/GlobalStatusCodes.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.constants; 5 | 6 | /** 7 | * @author ${author} 8 | * 9 | */ 10 | public final class GlobalStatusCodes { 11 | 12 | /***/ 13 | private GlobalStatusCodes() { 14 | 15 | } 16 | 17 | /***/ 18 | public static final int OK = 200; 19 | 20 | /***/ 21 | public static final int CREATED = 201; 22 | 23 | /***/ 24 | public static final int ACCEPTED = 202; 25 | 26 | /***/ 27 | public static final int NO_CONTENT = 204; 28 | 29 | 30 | /***/ 31 | public static final int BAD_REQUEST = 400; 32 | 33 | /***/ 34 | public static final int UNAUTHORIZED = 401; 35 | 36 | /***/ 37 | public static final int FORBIDDEN = 403; 38 | 39 | /***/ 40 | public static final int NOT_FOUND = 404; 41 | 42 | /***/ 43 | public static final int METHOD_NOT_ALLOWED = 405; 44 | 45 | /***/ 46 | public static final int NOT_ACCEPTABLE = 406; 47 | 48 | /***/ 49 | public static final int REQUEST_TIMEOUT = 408; 50 | 51 | 52 | /***/ 53 | public static final int INTERNAL_SERVER_ERROR = 500; 54 | 55 | /***/ 56 | public static final int NOT_IMPLEMENTED = 501; 57 | 58 | /***/ 59 | public static final int BAD_GATEWAY = 502; 60 | 61 | /***/ 62 | public static final int SERVICE_UNAVAILABLE = 503; 63 | 64 | /***/ 65 | public static final String NOT_FOUND_MESSAGE = "Page not found."; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/constants/MessageTypes.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.constants; 5 | 6 | /** 7 | * @author ${author} 8 | * 9 | */ 10 | public final class MessageTypes { 11 | 12 | /***/ 13 | private MessageTypes() {} 14 | 15 | /***/ 16 | public static final int DEFAULT = 0; 17 | 18 | /***/ 19 | public static final int WARNING = 1; 20 | 21 | /***/ 22 | public static final int DANGER = 2; 23 | 24 | /***/ 25 | public static final int SUCCESS = 3; 26 | } 27 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/constants/ServiceErrorStatus.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.constants; 5 | 6 | /** 7 | * Created by denmark.hinagpis on 2/6/2017. 8 | */ 9 | public final class ServiceErrorStatus { 10 | 11 | /***/ 12 | private ServiceErrorStatus() { 13 | 14 | } 15 | 16 | /***/ 17 | public static final int NETWORK_ERROR = -0x00000001; 18 | 19 | /***/ 20 | public static final int SYSTEM_ERROR = -0x00000002; 21 | 22 | /***/ 23 | public static final int INTERNAL_ERROR = -0x00000003; 24 | 25 | /***/ 26 | public static final int TIMEOUT_ERROR = -0x00000004; 27 | 28 | /***/ 29 | public static final int DATA_ERROR = -0x00000005; 30 | 31 | /***/ 32 | public static final int GUEST_USER = -0x00000006; 33 | } 34 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formbeans/ResponseFormBean.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formbeans; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | */ 13 | public class ResponseFormBean implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /***/ 18 | private int m_status; 19 | 20 | /***/ 21 | private String m_message; 22 | 23 | /***/ 24 | private Object m_data; 25 | 26 | /***/ 27 | public ResponseFormBean() { 28 | } 29 | 30 | /** 31 | * @param status int 32 | * @param message String 33 | * @param data Serializable 34 | */ 35 | public ResponseFormBean(final int status, final String message, final Object data) { 36 | this.m_status = status; 37 | this.m_message = message; 38 | this.m_data = data; 39 | } 40 | 41 | /** 42 | * 43 | * @param status int 44 | */ 45 | public void setStatus(final int status) { 46 | this.m_status = status; 47 | } 48 | 49 | /** 50 | * 51 | * @param message String 52 | */ 53 | public void setMessage(final String message) { 54 | this.m_message = message; 55 | } 56 | 57 | /** 58 | * 59 | * @return int 60 | */ 61 | public int getStatus() { 62 | return m_status; 63 | } 64 | 65 | /** 66 | * 67 | * @return String 68 | */ 69 | public String getMessage() { 70 | return m_message; 71 | } 72 | 73 | /** 74 | * 75 | * @return Object 76 | */ 77 | public Object getData() { 78 | return m_data; 79 | } 80 | 81 | /** 82 | * 83 | * @param data Object 84 | */ 85 | public void setData(final Object data) { 86 | this.m_data = data; 87 | } 88 | 89 | @Override 90 | public final String toString() { 91 | return m_status + ", " + m_message + ", " + m_data; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formbeans/RootFormBean.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formbeans; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | */ 13 | public class RootFormBean implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /***/ 18 | private String m_id; 19 | 20 | /***/ 21 | private String m_rootNumber; 22 | 23 | /***/ 24 | private String m_userName; 25 | 26 | /***/ 27 | private String m_email; 28 | 29 | /***/ 30 | private String m_firstName; 31 | 32 | /***/ 33 | private String m_lastName; 34 | 35 | /***/ 36 | private String m_phoneNumber; 37 | 38 | /** 39 | * 40 | * @return String 41 | */ 42 | public String getId() { 43 | return m_id; 44 | } 45 | 46 | /** 47 | * 48 | * @param id String 49 | * @return RootFormBean 50 | */ 51 | public RootFormBean setId(final String id) { 52 | this.m_id = id; 53 | return this; 54 | } 55 | 56 | 57 | /** 58 | * @return the rootNumber 59 | */ 60 | public String getRootNumber() { 61 | return m_rootNumber; 62 | } 63 | 64 | /** 65 | * @param rootNumber the rootNumber to set 66 | * @return RootFormBean 67 | */ 68 | public RootFormBean setRootNumber(final String rootNumber) { 69 | this.m_rootNumber = rootNumber; 70 | return this; 71 | } 72 | 73 | /** 74 | * 75 | * @return String 76 | */ 77 | public String getUserName() { 78 | return m_userName; 79 | } 80 | 81 | /** 82 | * 83 | * @param userName String 84 | * @return RootFormBean 85 | */ 86 | public RootFormBean setUserName(final String userName) { 87 | this.m_userName = userName; 88 | return this; 89 | } 90 | 91 | /** 92 | * 93 | * @return String 94 | */ 95 | public String getEmail() { 96 | return m_email; 97 | } 98 | 99 | /** 100 | * 101 | * @param email String 102 | * @return RootFormBean 103 | */ 104 | public RootFormBean setEmail(final String email) { 105 | this.m_email = email; 106 | return this; 107 | } 108 | 109 | /** 110 | * 111 | * @return String 112 | */ 113 | public String getFirstName() { 114 | return m_firstName; 115 | } 116 | 117 | /** 118 | * 119 | * @param firstName String 120 | * @return RootFormBean 121 | */ 122 | public RootFormBean setFirstName(final String firstName) { 123 | this.m_firstName = firstName; 124 | return this; 125 | } 126 | 127 | /** 128 | * 129 | * @return String 130 | */ 131 | public String getLastName() { 132 | return m_lastName; 133 | } 134 | 135 | /** 136 | * 137 | * @param lastName String 138 | * @return RootFormBean 139 | */ 140 | public RootFormBean setLastName(final String lastName) { 141 | this.m_lastName = lastName; 142 | return this; 143 | } 144 | 145 | /** 146 | * 147 | * @return String 148 | */ 149 | public String getPhoneNumber() { 150 | return m_phoneNumber; 151 | } 152 | 153 | /** 154 | * 155 | * @param phoneNumber String 156 | * @return RootFormBean 157 | */ 158 | public RootFormBean setPhoneNumber(final String phoneNumber) { 159 | this.m_phoneNumber = phoneNumber; 160 | return this; 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formbeans/SystemSettingsFormBean.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formbeans; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | */ 13 | 14 | public class SystemSettingsFormBean implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | /***/ 19 | private long m_id; 20 | 21 | /***/ 22 | private String m_name; 23 | 24 | /***/ 25 | private String m_value; 26 | 27 | /***/ 28 | private boolean m_encrypted; 29 | 30 | /***/ 31 | public SystemSettingsFormBean() { 32 | } 33 | 34 | /** 35 | * @return the id 36 | */ 37 | public long getId() { 38 | return m_id; 39 | } 40 | 41 | /** 42 | * @param id the id to set 43 | * @return SystemSettings 44 | */ 45 | public SystemSettingsFormBean setId(final long id) { 46 | this.m_id = id; 47 | return this; 48 | } 49 | 50 | /** 51 | * @return the name 52 | */ 53 | public String getName() { 54 | return m_name; 55 | } 56 | 57 | /** 58 | * @param name the name to set 59 | * @return SystemSettings 60 | */ 61 | public SystemSettingsFormBean setName(final String name) { 62 | this.m_name = name; 63 | return this; 64 | } 65 | 66 | /** 67 | * @return the value 68 | */ 69 | public String getValue() { 70 | return m_value; 71 | } 72 | 73 | /** 74 | * @param value the value to set 75 | * @return SystemSettings 76 | */ 77 | public SystemSettingsFormBean setValue(final String value) { 78 | this.m_value = value; 79 | return this; 80 | } 81 | 82 | /** 83 | * @return the encrypted 84 | */ 85 | public boolean isEncrypted() { 86 | return m_encrypted; 87 | } 88 | 89 | /** 90 | * @param encrypted the encrypted to set 91 | * @return SystemSettings 92 | */ 93 | public SystemSettingsFormBean setEncrypted(final boolean encrypted) { 94 | this.m_encrypted = encrypted; 95 | return this; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formbeans/ToastMessageFormBean.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formbeans; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * @author ${author} 10 | * 11 | */ 12 | public class ToastMessageFormBean implements Serializable { 13 | 14 | /** 15 | * 16 | */ 17 | private static final long serialVersionUID = 1L; 18 | 19 | /***/ 20 | private int m_type; 21 | 22 | /***/ 23 | private String m_message; 24 | 25 | /** 26 | * @param type int 27 | * @param message String 28 | */ 29 | public ToastMessageFormBean(final int type, final String message) { 30 | this.m_type = type; 31 | this.m_message = message; 32 | } 33 | 34 | /** 35 | * @return the type 36 | */ 37 | public int getType() { 38 | return m_type; 39 | } 40 | 41 | /** 42 | * @param type the type to set 43 | * @return {@link ToastMessageFormBean} 44 | */ 45 | public ToastMessageFormBean setType(final int type) { 46 | this.m_type = type; 47 | return this; 48 | } 49 | 50 | /** 51 | * @return the message 52 | */ 53 | public String getMessage() { 54 | return m_message; 55 | } 56 | 57 | /** 58 | * @param message the message to set 59 | * @return {@link ToastMessageFormBean} 60 | */ 61 | public ToastMessageFormBean setMessage(final String message) { 62 | this.m_message = message; 63 | return this; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formbeans/UserFormBean.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formbeans; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | */ 13 | public class UserFormBean implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /***/ 18 | private String m_id; 19 | 20 | /***/ 21 | private String m_type; 22 | 23 | /***/ 24 | private String m_image; 25 | 26 | /***/ 27 | private String m_userName; 28 | 29 | /***/ 30 | private String m_displayName; 31 | 32 | /***/ 33 | private boolean m_systemUser; 34 | 35 | /***/ 36 | private boolean m_hasPassword; 37 | 38 | 39 | /** 40 | * 41 | * @return String 42 | */ 43 | public String getId() { 44 | return this.m_id; 45 | } 46 | 47 | /** 48 | * 49 | * @param id String 50 | * @return UserFormBean 51 | */ 52 | public UserFormBean setId(final String id) { 53 | this.m_id = id; 54 | return this; 55 | } 56 | 57 | /** 58 | * 59 | * @return String 60 | */ 61 | public String getUserName() { 62 | return this.m_userName; 63 | } 64 | 65 | /** 66 | * 67 | * @param userName String 68 | * @return UserFormBean 69 | */ 70 | public UserFormBean setUserName(final String userName) { 71 | this.m_userName = userName; 72 | return this; 73 | } 74 | 75 | /** 76 | * @return the displayName 77 | */ 78 | public String getDisplayName() { 79 | return this.m_displayName; 80 | } 81 | 82 | /** 83 | * @param displayName the displayName to set 84 | * @return UserFormBean 85 | */ 86 | public UserFormBean setDisplayName(final String displayName) { 87 | this.m_displayName = displayName; 88 | return this; 89 | } 90 | 91 | /** 92 | * @return the type 93 | */ 94 | public String getType() { 95 | return this.m_type; 96 | } 97 | 98 | /** 99 | * @param type the type to set 100 | * @return UserFormBean 101 | */ 102 | public UserFormBean setType(final String type) { 103 | this.m_type = type; 104 | return this; 105 | } 106 | 107 | /** 108 | * @return the image 109 | */ 110 | public String getImage() { 111 | return this.m_image; 112 | } 113 | 114 | /** 115 | * @param image the image to set 116 | * @return UserFormBean 117 | */ 118 | public UserFormBean setImage(final String image) { 119 | this.m_image = image; 120 | return this; 121 | } 122 | 123 | /** 124 | * @return the systemUser 125 | */ 126 | public boolean isSystemUser() { 127 | return this.m_systemUser; 128 | } 129 | 130 | /** 131 | * @param systemUser the systemUser to set 132 | * @return UserFormBean 133 | */ 134 | public UserFormBean setSystemUser(final boolean systemUser) { 135 | this.m_systemUser = systemUser; 136 | return this; 137 | } 138 | 139 | /** 140 | * @return the hasPassword 141 | */ 142 | public boolean isHasPassword() { 143 | return this.m_hasPassword; 144 | } 145 | 146 | /** 147 | * @param hasPassword the hasPassword to set 148 | * @return UserFormBean 149 | */ 150 | public UserFormBean setHasPassword(final boolean hasPassword) { 151 | this.m_hasPassword = hasPassword; 152 | return this; 153 | } 154 | 155 | 156 | } 157 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formbeans/UserPhotoFormBean.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formbeans; 5 | 6 | /** 7 | * 8 | * @author ${author} 9 | * 10 | */ 11 | public class UserPhotoFormBean extends UserFormBean { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | /***/ 16 | private String m_id; 17 | 18 | /***/ 19 | private String m_image; 20 | 21 | /** 22 | * @return the id 23 | */ 24 | @Override 25 | public String getId() { 26 | return this.m_id; 27 | } 28 | 29 | /** 30 | * @param id the id to set 31 | * @return UserFormBean 32 | */ 33 | @Override 34 | public UserFormBean setId(final String id) { 35 | this.m_id = id; 36 | return this; 37 | } 38 | 39 | /** 40 | * @return the image 41 | */ 42 | @Override 43 | public String getImage() { 44 | return this.m_image; 45 | } 46 | 47 | /** 48 | * @param image the image to set 49 | * @return UserFormBean 50 | */ 51 | @Override 52 | public UserFormBean setImage(final String image) { 53 | this.m_image = image; 54 | return this; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formbeans/UserProfileFormBean.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formbeans; 5 | 6 | /** 7 | * 8 | * @author ${author} 9 | * 10 | */ 11 | public class UserProfileFormBean extends UserFormBean { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | /***/ 16 | private String m_email; 17 | 18 | /***/ 19 | private String m_fullName; 20 | 21 | /***/ 22 | private String m_firstName; 23 | 24 | /***/ 25 | private String m_lastName; 26 | 27 | public UserProfileFormBean(final UserFormBean user) { 28 | setId(user.getId()). 29 | setType(user.getType()). 30 | setUserName(user.getUserName()). 31 | setImage(user.getImage()). 32 | setDisplayName(user.getDisplayName()); 33 | setSystemUser(user.isSystemUser()); 34 | setHasPassword(user.isHasPassword()); 35 | } 36 | 37 | /** 38 | * 39 | * @return String 40 | */ 41 | public String getEmail() { 42 | return this.m_email; 43 | } 44 | 45 | /** 46 | * 47 | * @param email String 48 | * @return UserProfileFormBean 49 | */ 50 | public UserProfileFormBean setEmail(final String email) { 51 | this.m_email = email; 52 | return this; 53 | } 54 | 55 | /** 56 | * @return the fullName 57 | */ 58 | public String getFullName() { 59 | return m_fullName; 60 | } 61 | 62 | /** 63 | * @param fullName the fullName to set 64 | * @return UserProfileFormBean 65 | */ 66 | public UserProfileFormBean setFullName(final String fullName) { 67 | this.m_fullName = fullName; 68 | return this; 69 | } 70 | 71 | /** 72 | * 73 | * @return String 74 | */ 75 | public String getFirstName() { 76 | return this.m_firstName; 77 | } 78 | 79 | /** 80 | * 81 | * @param firstName String 82 | * @return UserProfileFormBean 83 | */ 84 | public UserProfileFormBean setFirstName(final String firstName) { 85 | this.m_firstName = firstName; 86 | return this; 87 | } 88 | 89 | /** 90 | * 91 | * @return String 92 | */ 93 | public String getLastName() { 94 | return this.m_lastName; 95 | } 96 | 97 | /** 98 | * 99 | * @param lastName String 100 | * @return UserProfileFormBean 101 | */ 102 | public UserProfileFormBean setLastName(final String lastName) { 103 | this.m_lastName = lastName; 104 | return this; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formdatas/SystemSettingsFormData.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formdatas; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | */ 13 | 14 | public class SystemSettingsFormData implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | /***/ 19 | private long id; 20 | 21 | /***/ 22 | private String name; 23 | 24 | /***/ 25 | private String value; 26 | 27 | /***/ 28 | private boolean encrypted; 29 | 30 | /** 31 | * @return the id 32 | */ 33 | public long getId() { 34 | return id; 35 | } 36 | 37 | /** 38 | * @param id the id to set 39 | */ 40 | public void setId(final long id) { 41 | this.id = id; 42 | } 43 | 44 | /** 45 | * @return the name 46 | */ 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | /** 52 | * @param name the name to set 53 | */ 54 | public void setName(final String name) { 55 | this.name = name; 56 | } 57 | 58 | /** 59 | * @return the value 60 | */ 61 | public String getValue() { 62 | return value; 63 | } 64 | 65 | /** 66 | * @param value the value to set 67 | */ 68 | public void setValue(final String value) { 69 | this.value = value; 70 | } 71 | 72 | /** 73 | * @return the encrypted 74 | */ 75 | public boolean isEncrypted() { 76 | return encrypted; 77 | } 78 | 79 | /** 80 | * @param encrypted the encrypted to set 81 | */ 82 | public void setEncrypted(final boolean encrypted) { 83 | this.encrypted = encrypted; 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formdatas/UserPhotoFormData.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formdatas; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | */ 13 | public class UserPhotoFormData implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /***/ 18 | private String m_id; 19 | 20 | /***/ 21 | private String m_image; 22 | 23 | /** 24 | * @return the id 25 | */ 26 | public String getId() { 27 | return this.m_id; 28 | } 29 | 30 | /** 31 | * @param id the id to set 32 | */ 33 | public void setId(final String id) { 34 | this.m_id = id; 35 | } 36 | 37 | /** 38 | * @return the image 39 | */ 40 | public String getImage() { 41 | return this.m_image; 42 | } 43 | 44 | /** 45 | * @param image the image to set 46 | */ 47 | public void setImage(final String image) { 48 | this.m_image = image; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-formbeans/src/main/java/formdatas/UserProfileFormData.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.formdatas; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * 10 | * @author ${author} 11 | * 12 | */ 13 | public class UserProfileFormData implements Serializable { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /***/ 18 | private String m_id; 19 | 20 | /***/ 21 | private String m_firstName; 22 | 23 | /***/ 24 | private String m_lastName; 25 | 26 | /** 27 | * 28 | * @return String 29 | */ 30 | public String getId() { 31 | return m_id; 32 | } 33 | 34 | /** 35 | * 36 | * @param id String 37 | */ 38 | public void setId(final String id) { 39 | this.m_id = id; 40 | } 41 | 42 | /** 43 | * 44 | * @return String 45 | */ 46 | public String getFirstName() { 47 | return m_firstName; 48 | } 49 | 50 | /** 51 | * 52 | * @param firstName String 53 | */ 54 | public void setFirstName(final String firstName) { 55 | this.m_firstName = firstName; 56 | } 57 | 58 | /** 59 | * 60 | * @return String 61 | */ 62 | public String getLastName() { 63 | return m_lastName; 64 | } 65 | 66 | /** 67 | * 68 | * @param lastName String 69 | */ 70 | public void setLastName(final String lastName) { 71 | this.m_lastName = lastName; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/text/Labels.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.text; 5 | 6 | import java.util.ResourceBundle; 7 | 8 | /** 9 | * @author ${author} 10 | */ 11 | public final class Labels { 12 | 13 | /***/ 14 | private static final String BUNDLE_NAME = "labels"; //${symbol_dollar}NON-NLS-1${symbol_dollar} 15 | 16 | /***/ 17 | private static final ResourceBundle BUNDLE; 18 | 19 | static { 20 | BUNDLE = Texts.getBundle(BUNDLE_NAME); 21 | } 22 | 23 | /***/ 24 | private Labels() { 25 | } 26 | 27 | /** 28 | * @param key String 29 | * @return String 30 | */ 31 | public static String getString(final String key) { 32 | return Texts.getString(BUNDLE, key); 33 | } 34 | 35 | /** 36 | * @param key String 37 | * @param arg Object 38 | * @return String 39 | */ 40 | public static String getString(final String key, final Object arg) { 41 | return Texts.getString(BUNDLE, key, arg); 42 | } 43 | 44 | /** 45 | * @param key String 46 | * @param args String[] 47 | * @return String 48 | */ 49 | public static String getString(final String key, final String[] args) { 50 | return Texts.getString(BUNDLE, key, args); 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/text/Paths.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.text; 5 | 6 | import java.util.ArrayList; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | import java.util.ResourceBundle; 11 | import java.util.Set; 12 | 13 | /** 14 | * @author ${author} 15 | */ 16 | public final class Paths { 17 | 18 | /***/ 19 | private static final String BUNDLE_NAME = "paths"; //${symbol_dollar}NON-NLS-1${symbol_dollar} 20 | 21 | /***/ 22 | private static final ResourceBundle BUNDLE; 23 | 24 | /***/ 25 | private static final List EXACT_PATHS = new ArrayList<>(); 26 | 27 | /***/ 28 | private static final List STARTS_WITH_PATHS = new ArrayList<>(); 29 | 30 | /***/ 31 | private static final Map PATHS = new HashMap<>(); 32 | 33 | static { 34 | BUNDLE = Texts.getBundle(BUNDLE_NAME); 35 | setAllPaths(); 36 | } 37 | 38 | /***/ 39 | private Paths() { 40 | } 41 | 42 | /** 43 | * 44 | */ 45 | private static void setAllPaths() { 46 | final Set keys = BUNDLE.keySet(); 47 | for (final String key : keys) { 48 | final String path = BUNDLE.getString(key); 49 | String pathName = key; 50 | if (key.endsWith("Start")) { 51 | pathName = pathName.replace(".Start", ""); 52 | STARTS_WITH_PATHS.add(path); 53 | } else if (key.endsWith("Exact")) { 54 | pathName = pathName.replace(".Exact", ""); 55 | EXACT_PATHS.add(path); 56 | } 57 | PATHS.put(pathName, path); 58 | } 59 | } 60 | 61 | /** 62 | * @param key String 63 | * @return String 64 | */ 65 | public static String getPath(final String key) { 66 | return PATHS.get(key); 67 | } 68 | 69 | /** 70 | * @return List 71 | */ 72 | public static List getAllExactPaths() { 73 | return EXACT_PATHS; 74 | } 75 | 76 | /** 77 | * @return List 78 | */ 79 | public static List getAllStartsWithPaths() { 80 | return STARTS_WITH_PATHS; 81 | } 82 | 83 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/text/Tags.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.text; 5 | 6 | import java.util.ResourceBundle; 7 | 8 | /** 9 | * @author ${author} 10 | */ 11 | public final class Tags { 12 | 13 | /***/ 14 | private static final String BUNDLE_NAME = "tags"; 15 | 16 | /***/ 17 | private static final ResourceBundle BUNDLE; 18 | 19 | static { 20 | BUNDLE = Texts.getBundle(BUNDLE_NAME); 21 | } 22 | 23 | /***/ 24 | private Tags() { 25 | } 26 | 27 | /** 28 | * @param key String 29 | * @return String 30 | */ 31 | public static String getString(final String key) { 32 | return Texts.getString(BUNDLE, key); 33 | } 34 | 35 | /** 36 | * @param key String 37 | * @param arg Object 38 | * @return String 39 | */ 40 | public static String getString(final String key, final Object arg) { 41 | return Texts.getString(BUNDLE, key, arg); 42 | } 43 | 44 | /** 45 | * @param key String 46 | * @param args String[] 47 | * @return String 48 | */ 49 | public static String getString(final String key, final String[] args) { 50 | return Texts.getString(BUNDLE, key, args); 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/text/ToolTips.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.text; 5 | 6 | import java.util.ResourceBundle; 7 | 8 | /** 9 | * @author ${author} 10 | */ 11 | public final class ToolTips { 12 | /** 13 | */ 14 | private static final String BUNDLE_NAME = "tooltips"; 15 | 16 | /** 17 | */ 18 | private static final ResourceBundle BUNDLE; 19 | 20 | static { 21 | BUNDLE = Texts.getBundle(BUNDLE_NAME); 22 | } 23 | 24 | /***/ 25 | private ToolTips() { 26 | } 27 | 28 | /** 29 | * @param key String 30 | * @return String 31 | */ 32 | public static String getString(final String key) { 33 | return Texts.getString(BUNDLE, key); 34 | } 35 | 36 | /** 37 | * @param key String 38 | * @param arg Object 39 | * @return String 40 | */ 41 | public static String getString(final String key, final Object arg) { 42 | return Texts.getString(BUNDLE, key, arg); 43 | } 44 | 45 | /** 46 | * @param key String 47 | * @param args String[] 48 | * @return String 49 | */ 50 | public static String getString(final String key, final String[] args) { 51 | return Texts.getString(BUNDLE, key, args); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/config/log4j2.xml: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/rest/AbstractBaseResource.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.rest; 5 | 6 | import java.lang.reflect.Type; 7 | import java.util.List; 8 | 9 | import javax.ws.rs.core.Response; 10 | 11 | import org.apache.logging.log4j.LogManager; 12 | import org.apache.logging.log4j.Logger; 13 | 14 | import com.google.gson.Gson; 15 | import ${package}.constants.GlobalStatusCodes; 16 | import ${package}.constants.ServiceErrorStatus; 17 | import ${package}.exception.AppException; 18 | import ${package}.formbeans.ResponseFormBean; 19 | 20 | /** 21 | * @author ${author} 22 | * 23 | */ 24 | public abstract class AbstractBaseResource { 25 | 26 | /***/ 27 | private final Logger m_logger; 28 | 29 | /** 30 | * @param clazz Class< ? extends AbstractBaseResource> 31 | */ 32 | protected AbstractBaseResource(final Class< ? extends AbstractBaseResource> clazz) { 33 | m_logger = LogManager.getLogger(clazz); 34 | } 35 | 36 | /** 37 | * @return Logger 38 | */ 39 | protected Logger getLogger() { 40 | return m_logger; 41 | } 42 | 43 | /** 44 | * 45 | * @param collection ArrayList 46 | * @param type Type 47 | * @return Response 48 | */ 49 | @SuppressWarnings("rawtypes") 50 | protected String createListResponse(final List collection, final Type type) { 51 | final Gson gson = new Gson(); 52 | final String data = gson.toJson(collection, type); 53 | return data; 54 | } 55 | 56 | /** 57 | * @param image byte[] 58 | * @return Reponse 59 | */ 60 | protected Response okResponse(final byte[] image) { 61 | return Response.status(GlobalStatusCodes.OK).entity(image).build(); 62 | } 63 | 64 | /** 65 | * @param status int 66 | * @param data Serializable 67 | * @return Reponse 68 | */ 69 | protected Response okResponse(final int status, final Object data) { 70 | final ResponseFormBean bean = new ResponseFormBean(status, null, data); 71 | final Gson gson = new Gson(); 72 | return Response.status(GlobalStatusCodes.OK).entity(gson.toJson(bean)).build(); 73 | } 74 | 75 | /** 76 | * @param status int 77 | * @return Reponse 78 | */ 79 | protected Response okResponse(final int status) { 80 | final ResponseFormBean bean = new ResponseFormBean(status, null, null); 81 | final Gson gson = new Gson(); 82 | return Response.status(GlobalStatusCodes.OK).entity(gson.toJson(bean)).build(); 83 | } 84 | 85 | /** 86 | * @param ex AppException 87 | * @return Response 88 | */ 89 | protected Response toResponse(final AppException ex) { 90 | m_logger.error(ex.getMessage(), ex); 91 | final ResponseFormBean bean = new ResponseFormBean(ex.getInternalStatus(), ex.getMessage(), null); 92 | final Gson gson = new Gson(); 93 | return Response.status(ex.getGlobalStatus()).entity(gson.toJson(bean)).build(); 94 | } 95 | 96 | /** 97 | * @param ex Exception 98 | * @return Response 99 | */ 100 | protected Response toResponse(final Exception ex) { 101 | m_logger.error(ex.getMessage(), ex); 102 | final ResponseFormBean bean = new ResponseFormBean(ServiceErrorStatus.SYSTEM_ERROR, 103 | "Internal system error occured...", 104 | null); 105 | final Gson gson = new Gson(); 106 | return Response.status(GlobalStatusCodes.INTERNAL_SERVER_ERROR).entity(gson.toJson(bean)).build(); 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/rest/AuthFilter.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.rest; 5 | 6 | import java.io.IOException; 7 | import java.lang.reflect.Method; 8 | 9 | import javax.annotation.security.DenyAll; 10 | import javax.annotation.security.PermitAll; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.ws.rs.container.ContainerRequestContext; 13 | import javax.ws.rs.container.ContainerRequestFilter; 14 | import javax.ws.rs.container.ResourceInfo; 15 | import javax.ws.rs.core.Context; 16 | import javax.ws.rs.core.Response; 17 | import javax.ws.rs.ext.Provider; 18 | 19 | import com.google.gson.Gson; 20 | import ${package}.constants.GlobalStatusCodes; 21 | import ${package}.constants.ServiceErrorStatus; 22 | import ${package}.formbeans.ResponseFormBean; 23 | import ${package}.ui.util.WebUtil; 24 | 25 | /** 26 | * @author ${author} 27 | * 28 | */ 29 | @Provider 30 | public class AuthFilter implements ContainerRequestFilter { 31 | 32 | /***/ 33 | @Context 34 | private ResourceInfo m_resourceInfo; 35 | 36 | /***/ 37 | @Context 38 | private HttpServletRequest m_request; 39 | 40 | /** 41 | * @param requestContext 42 | * @throws IOException 43 | */ 44 | @Override 45 | public void filter(final ContainerRequestContext requestContext) throws IOException { 46 | final Method method = m_resourceInfo.getResourceMethod(); 47 | 48 | if (!method.isAnnotationPresent(PermitAll.class)) { 49 | if (method.isAnnotationPresent(DenyAll.class)) { 50 | requestContext.abortWith(accessForbidden()); 51 | return; 52 | } 53 | 54 | if (!WebUtil.isAuthenticatedWeb(m_request)) { 55 | requestContext.abortWith(accessUnauthorized()); 56 | } 57 | } 58 | 59 | } 60 | 61 | /** 62 | * @return Response 63 | */ 64 | private Response accessUnauthorized() { 65 | return toResponse(GlobalStatusCodes.FORBIDDEN, 66 | ServiceErrorStatus.SYSTEM_ERROR, 67 | "You cannot access this resource"); 68 | } 69 | 70 | /** 71 | * @return Response 72 | */ 73 | private Response accessForbidden() { 74 | return toResponse(GlobalStatusCodes.FORBIDDEN, 75 | ServiceErrorStatus.SYSTEM_ERROR, 76 | "You cannot access this resource"); 77 | } 78 | 79 | 80 | 81 | /** 82 | * @param globalStatus int 83 | * @param internalStatus int 84 | * @param message String 85 | * @return Response 86 | */ 87 | protected Response toResponse(final int globalStatus, final int internalStatus, final String message) { 88 | final ResponseFormBean bean = new ResponseFormBean(internalStatus, message, null); 89 | final Gson gson = new Gson(); 90 | return Response.status(globalStatus).entity(gson.toJson(bean)).build(); 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/rest/WebApplication.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.rest; 5 | 6 | import javax.ws.rs.ApplicationPath; 7 | 8 | import org.glassfish.jersey.server.ResourceConfig; 9 | 10 | /** 11 | * @author ${author} 12 | * 13 | */ 14 | @ApplicationPath("rest") 15 | public class WebApplication extends ResourceConfig { 16 | 17 | /***/ 18 | public WebApplication() { 19 | packages(false, "${package}.ui.services"); 20 | register(AuthFilter.class); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/common/ServletSettings.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.common; 5 | 6 | import java.io.Serializable; 7 | 8 | import javax.servlet.ServletContext; 9 | 10 | import ${package}.util.SystemSettingsUtil; 11 | 12 | /** 13 | * @author ${author} 14 | */ 15 | public final class ServletSettings implements Serializable { 16 | 17 | private static final long serialVersionUID = 8161950760514433245L; 18 | 19 | /***/ 20 | private ServletContext m_servletContext; 21 | 22 | /***/ 23 | private String m_outputEncoding; 24 | 25 | /***/ 26 | private int m_sessionTimeout; 27 | 28 | /** 29 | * @param servletContext ServletContext 30 | */ 31 | public ServletSettings(final ServletContext servletContext) { 32 | m_servletContext = servletContext; 33 | init(); 34 | } 35 | 36 | /** 37 | * @return ServletContext 38 | */ 39 | public ServletContext getServletContext() { 40 | return m_servletContext; 41 | } 42 | 43 | /** 44 | * @return String 45 | */ 46 | public String getOutputEncoding() { 47 | return m_outputEncoding; 48 | } 49 | 50 | /** 51 | * @return int 52 | */ 53 | public int getSessionTimeout() { 54 | return m_sessionTimeout; 55 | } 56 | 57 | /***/ 58 | private void init() { 59 | setDefaultEncoding(); 60 | setDefaultTimeout(); 61 | } 62 | 63 | /** 64 | * @param key String 65 | * @param defaultValue String 66 | * @return String 67 | */ 68 | public String getApplicationProperty(final String key, final String defaultValue) { 69 | final String value = m_servletContext.getInitParameter(key); 70 | if (value != null) { 71 | return value; 72 | } else { 73 | return defaultValue; 74 | } 75 | } 76 | 77 | /** 78 | * @param key String 79 | * @param defaultValue int 80 | * @return int 81 | */ 82 | public int getApplicationProperty(final String key, final int defaultValue) { 83 | final String value = m_servletContext.getInitParameter(key); 84 | if (value != null) { 85 | try { 86 | return Integer.parseInt(value); 87 | } catch (final NumberFormatException e) { 88 | // Do nothing 89 | } 90 | } 91 | return defaultValue; 92 | } 93 | 94 | /***/ 95 | private void setDefaultEncoding() { 96 | m_outputEncoding = getApplicationProperty("output-encoding", "UTF-8"); 97 | } 98 | 99 | /***/ 100 | private void setDefaultTimeout() { 101 | m_sessionTimeout = getApplicationProperty("session-timeout", SystemSettingsUtil.getSettingAsInt("system.session.timeout", 2) * 60); 102 | } 103 | 104 | } 105 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/admin/AdminBaseController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.admin; 5 | 6 | import ${package}.hibernate.beans.enumeration.UserType; 7 | import ${package}.ui.servlet.common.AbstractWebController; 8 | 9 | /** 10 | * @author ${author} 11 | * 12 | */ 13 | public class AdminBaseController extends AbstractWebController { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /** 18 | * @param clazz Class< ? extends AdminBaseController> 19 | */ 20 | protected AdminBaseController(final Class< ? extends AdminBaseController> clazz) { 21 | super(clazz); 22 | } 23 | 24 | /** 25 | * @param method String 26 | * @param userType String 27 | * @return boolean 28 | */ 29 | @Override 30 | protected boolean allowedUserType(final String method, final String userType) { 31 | switch (UserType.getAnnotationType(userType)) { 32 | case ADMIN: // only admin can access this page. 33 | return true; 34 | default: 35 | return false; 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/admin/SystemSettingsController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.admin; 5 | 6 | import java.lang.reflect.InvocationTargetException; 7 | 8 | import javax.servlet.annotation.MultipartConfig; 9 | import javax.servlet.annotation.WebServlet; 10 | 11 | import org.apache.commons.beanutils.BeanUtils; 12 | 13 | import ${package}.component.AdminComponent; 14 | import ${package}.constants.GlobalStatusCodes; 15 | import ${package}.constants.MessageTypes; 16 | import ${package}.constants.ServiceErrorStatus; 17 | import ${package}.exception.AppException; 18 | import ${package}.formbeans.ToastMessageFormBean; 19 | import ${package}.formdatas.SystemSettingsFormData; 20 | import ${package}.ui.constants.WebConst; 21 | import ${package}.ui.servlet.common.DataModel; 22 | import ${package}.ui.util.WebUtil; 23 | 24 | /** 25 | * @author ${author} 26 | * 27 | */ 28 | @WebServlet(name = "SystemSettings", urlPatterns = {"/systemsettings"}) 29 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 30 | public final class SystemSettingsController extends AdminBaseController { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | /***/ 35 | public SystemSettingsController() { 36 | super(SystemSettingsController.class); 37 | } 38 | 39 | @Override 40 | protected void processGet(final DataModel model) throws AppException { 41 | final AdminComponent comp = new AdminComponent(); 42 | model.getRequest().put("settings", comp.getAllSystemSettings()); 43 | //set the current page on every request 44 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "systemsettings"); 45 | model.setRedirectCommonJsp("systemsettings"); 46 | } 47 | 48 | @Override 49 | protected void processPost(final DataModel model) throws AppException { 50 | final SystemSettingsFormData data = new SystemSettingsFormData(); 51 | 52 | try { 53 | BeanUtils.populate(data, model.getRequest().getParams()); 54 | if (!WebUtil.requireFieldCheck( 55 | data.getName(), 56 | data.getValue())) { 57 | throw new AppException("Invalid access...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 58 | } 59 | 60 | final AdminComponent comp = new AdminComponent(); 61 | comp.addSystemSetting(data); 62 | 63 | model.getRequest().addMessage(new ToastMessageFormBean(MessageTypes.SUCCESS, String.format("%s was added successfully.", data.getName()))); 64 | model.setRedirectController("SystemSettings"); 65 | } catch (final IllegalAccessException e) { 66 | throw new AppException("Internal error...", GlobalStatusCodes.INTERNAL_SERVER_ERROR, ServiceErrorStatus.INTERNAL_ERROR); 67 | } catch (final InvocationTargetException e) { 68 | throw new AppException("Internal error...", GlobalStatusCodes.INTERNAL_SERVER_ERROR, ServiceErrorStatus.INTERNAL_ERROR); 69 | } 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/admin/SystemSettingsEditController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.admin; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.component.AdminComponent; 10 | import ${package}.constants.GlobalStatusCodes; 11 | import ${package}.constants.MessageTypes; 12 | import ${package}.constants.ServiceErrorStatus; 13 | import ${package}.exception.AppException; 14 | import ${package}.formbeans.ToastMessageFormBean; 15 | import ${package}.ui.constants.WebConst; 16 | import ${package}.ui.servlet.common.DataModel; 17 | import ${package}.ui.util.WebUtil; 18 | 19 | /** 20 | * @author ${author} 21 | * 22 | */ 23 | @WebServlet(name = "SystemSettingsEdit", urlPatterns = {"/systemsettings/edit"}) 24 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 25 | public final class SystemSettingsEditController extends AdminBaseController { 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | /***/ 30 | public SystemSettingsEditController() { 31 | super(SystemSettingsEditController.class); 32 | } 33 | 34 | @Override 35 | protected void processGet(final DataModel model) throws AppException { 36 | final int id = model.getRequest().getParameterAsInt(WebConst.ATTR_ID, 0); 37 | final boolean encrypted = model.getRequest().getParameterAsBoolean(WebConst.ATTR_ENCRYPTED, false); 38 | final boolean edit = model.getRequest().getParameterAsBoolean(WebConst.ATTR_EDIT, false); 39 | 40 | final AdminComponent comp = new AdminComponent(); 41 | model.getRequest().put("setting", comp.getSystemSetting(id, encrypted)); 42 | model.getRequest().put("edit", edit); 43 | 44 | //set the current page on every request 45 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "systemsettings"); 46 | model.setRedirectCommonJsp("systemsettingsedit"); 47 | } 48 | 49 | @Override 50 | protected void processPost(final DataModel model) throws AppException { 51 | final int id = model.getRequest().getParameterAsInt(WebConst.ATTR_ID, 0); 52 | final String value = model.getRequest().getParameterAsString(WebConst.ATTR_VALUE, null); 53 | final boolean encrypted = model.getRequest().getParameterAsBoolean(WebConst.ATTR_ENCRYPTED, false); 54 | 55 | // Check required fields 56 | if (id == 0) { 57 | throw new AppException("Invalid access...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 58 | } 59 | 60 | final AdminComponent comp = new AdminComponent(); 61 | if (!WebUtil.requireFieldCheck(value)) { 62 | throw new AppException("Invalid access...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 63 | } 64 | 65 | model.getRequest().put("setting", comp.editSystemSetting(id, value, encrypted)); 66 | model.getRequest().put("edit", false); 67 | 68 | model.getRequest().addMessage(new ToastMessageFormBean(MessageTypes.SUCCESS, String.format("System Setting ID: %s was successfully updated.", id))); 69 | 70 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "systemsettings"); 71 | model.setRedirectCommonJsp("systemsettingsedit"); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/HomeController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.component.UserComponent; 10 | import ${package}.exception.AppException; 11 | import ${package}.formbeans.UserFormBean; 12 | import ${package}.hibernate.beans.enumeration.UserType; 13 | import ${package}.ui.constants.WebConst; 14 | import ${package}.ui.servlet.common.AbstractWebController; 15 | import ${package}.ui.servlet.common.DataModel; 16 | 17 | /** 18 | * @author ${author} 19 | * 20 | */ 21 | @WebServlet(name = "Home", urlPatterns = {"/home"}) 22 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 23 | public final class HomeController extends AbstractWebController { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /***/ 28 | public HomeController() { 29 | super(HomeController.class); 30 | } 31 | 32 | @Override 33 | protected void processGet(final DataModel model) throws AppException { 34 | 35 | final UserComponent userComponent = new UserComponent(); 36 | switch (UserType.getAnnotationType(model.getUserType())) { 37 | case ADMIN: 38 | //set the current page on every request 39 | model.setRedirectController("SystemSettings", true); 40 | break; 41 | case ROOT: 42 | case MEMBER: 43 | //set the current page on every request 44 | model.setRedirectController("Settings", true); 45 | break; 46 | 47 | default: 48 | final UserFormBean user = userComponent.getUserInfo(model.getUserId()); 49 | model.getRequest().put(WebConst.ATTR_USER, user); 50 | 51 | //set the current page on every request 52 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "home"); 53 | model.setRedirectCommonJsp("home"); 54 | } 55 | } 56 | 57 | @Override 58 | protected boolean allowedUserType(final String method, final String userType) { 59 | switch (UserType.getAnnotationType(userType)) { 60 | case ADMIN: 61 | case ROOT: 62 | case MEMBER: 63 | return true; 64 | default: 65 | return false; 66 | } 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/LogoutController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.exception.AppException; 10 | import ${package}.ui.constants.WebConst; 11 | import ${package}.ui.servlet.common.AbstractWebController; 12 | import ${package}.ui.servlet.common.DataModel; 13 | 14 | /** 15 | * @author ${author} 16 | * 17 | */ 18 | @WebServlet(name = "Logout", urlPatterns = {"/logout"}) 19 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 20 | public final class LogoutController extends AbstractWebController { 21 | 22 | private static final long serialVersionUID = 1L; 23 | 24 | /***/ 25 | public LogoutController() { 26 | super(LogoutController.class); 27 | } 28 | 29 | @Override 30 | protected void processGet(final DataModel model) throws AppException { 31 | //set the current page on every request 32 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "logout"); 33 | logout(model); 34 | } 35 | 36 | /** 37 | * 38 | * @param model DataModel 39 | * @throws AppException e 40 | */ 41 | private void logout(final DataModel model) throws AppException { 42 | model.getSession().setInvalidate(true); 43 | model.setRedirectController("Root", true); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/nologin/ErrorController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.nologin; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.exception.AppException; 10 | import ${package}.ui.constants.WebConst; 11 | import ${package}.ui.servlet.common.DataModel; 12 | 13 | /** 14 | * @author ${author} 15 | * 16 | */ 17 | @WebServlet(name = "Error", urlPatterns = {"/error"}) 18 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 19 | public final class ErrorController extends NoLoginBaseController { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /***/ 24 | public ErrorController() { 25 | super(ErrorController.class); 26 | } 27 | 28 | @Override 29 | protected void processGet(final DataModel model) throws AppException { 30 | final int errorCode = model.getRequest().getParameterAsInt("code", -1); 31 | if (errorCode > 0) { 32 | model.getSession().put(WebConst.ATTR_STATUS, errorCode); 33 | } 34 | 35 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "error"); 36 | if (!model.getSession().isUserLoggedIn()) { 37 | model.setRedirectContentJsp("error"); 38 | } else { 39 | model.setRedirectCommonJsp("error"); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/nologin/IndexController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.nologin; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.exception.AppException; 10 | import ${package}.ui.constants.WebConst; 11 | import ${package}.ui.servlet.common.DataModel; 12 | 13 | /** 14 | * @author ${author} 15 | * 16 | */ 17 | @WebServlet(name = "Index", urlPatterns = {"/index"}) 18 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 19 | public final class IndexController extends NoLoginBaseController { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /***/ 24 | public IndexController() { 25 | super(IndexController.class); 26 | } 27 | 28 | @Override 29 | protected void processGet(final DataModel model) throws AppException { 30 | 31 | if (null != model.getSession() && null != model.getSession().getAttributeAsString(WebConst.ATTR_USER_USERID)) { 32 | model.setRedirectController("Home", false); 33 | return; 34 | } else { 35 | model.getSession().setInvalidate(true); 36 | } 37 | 38 | model.setRedirectContentJsp("index"); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/nologin/NoLoginBaseController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.nologin; 5 | 6 | import ${package}.ui.servlet.common.AbstractWebController; 7 | 8 | /** 9 | * @author ${author} 10 | * 11 | */ 12 | public class NoLoginBaseController extends AbstractWebController { 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | /** 17 | * @param clazz Class< ? extends NoLoginBaseController> 18 | */ 19 | protected NoLoginBaseController(final Class< ? extends NoLoginBaseController> clazz) { 20 | super(clazz); 21 | } 22 | 23 | /** 24 | * @param method 25 | * @return boolean 26 | */ 27 | @Override 28 | protected boolean byPassLogin(final String method) { 29 | return true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/nologin/RegisterController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.nologin; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.component.UserComponent; 10 | import ${package}.constants.GlobalStatusCodes; 11 | import ${package}.constants.ServiceErrorStatus; 12 | import ${package}.exception.AppException; 13 | import ${package}.ui.constants.WebConst; 14 | import ${package}.ui.servlet.common.DataModel; 15 | import ${package}.ui.util.WebUtil; 16 | 17 | /** 18 | * @author ${author} 19 | * 20 | */ 21 | @WebServlet(name = "Register", urlPatterns = {"/register"}) 22 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 23 | public final class RegisterController extends NoLoginBaseController { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /***/ 28 | public RegisterController() { 29 | super(RegisterController.class); 30 | } 31 | 32 | @Override 33 | protected void processGet(final DataModel model) throws AppException { 34 | // Remove all error messages in the session 35 | model.getSession().remove(WebConst.ATTR_ERROR_CODE); 36 | model.getSession().remove(WebConst.ATTR_ERROR_MESSAGE); 37 | 38 | //set the current page on every request 39 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "register"); 40 | model.setRedirectContentJsp("register"); 41 | } 42 | 43 | @Override 44 | protected void processPost(final DataModel model) throws AppException { 45 | final String firstName = model.getRequest().getParameterAsString(WebConst.ATTR_USER_FIRSTNAME, ""); 46 | final String lastName = model.getRequest().getParameterAsString(WebConst.ATTR_USER_LASTNAME, ""); 47 | final String email = model.getRequest().getParameterAsString(WebConst.ATTR_USER_EMAIL, ""); 48 | final String password = model.getRequest().getParameterAsString(WebConst.ATTR_USER_PASSWORD, ""); 49 | 50 | try { 51 | // Check required fields 52 | if (!WebUtil.requireFieldCheck(firstName, lastName, email, password)) { 53 | throw new AppException("Missing required parameter...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 54 | } 55 | 56 | if (!WebUtil.isValidEmailAddress(email)) { 57 | throw new AppException("Email not valid...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 58 | } 59 | 60 | final UserComponent component = new UserComponent(); 61 | component.signupRoot(firstName, lastName, email, password); 62 | model.setRedirectController("Login", true, "email=" + email); 63 | 64 | } catch (final AppException e) { 65 | model.getRequest().put(WebConst.ATTR_USER_FIRSTNAME, firstName); 66 | model.getRequest().put(WebConst.ATTR_USER_LASTNAME, lastName); 67 | model.getRequest().put(WebConst.ATTR_USER_EMAIL, email); 68 | 69 | model.getRequest().put(WebConst.ATTR_ERROR_MESSAGE, e.getMessage()); 70 | model.setRedirectContentJsp("register"); 71 | throw e; 72 | } 73 | } 74 | 75 | @Override 76 | protected boolean byPassLogin(final String method) { 77 | if ("BETA".equals(System.getProperty("RUN_ENV", "DEV"))) { 78 | return false; 79 | } 80 | return true; 81 | } 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/settings/AccountSettingController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.settings; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.component.UserComponent; 10 | import ${package}.exception.AppException; 11 | import ${package}.formbeans.UserProfileFormBean; 12 | import ${package}.ui.constants.WebConst; 13 | import ${package}.ui.servlet.common.AbstractWebController; 14 | import ${package}.ui.servlet.common.DataModel; 15 | import ${package}.ui.util.WebUtil; 16 | 17 | /** 18 | * @author ${author} 19 | * 20 | */ 21 | @WebServlet(name = "AccountSetting", urlPatterns = {"/settings/user/account"}) 22 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 23 | public final class AccountSettingController extends AbstractWebController { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | /***/ 28 | public AccountSettingController() { 29 | super(AccountSettingController.class); 30 | } 31 | 32 | @Override 33 | protected void processGet(final DataModel model) throws AppException { 34 | openAccountPage(model, new UserComponent()); 35 | } 36 | 37 | @Override 38 | protected void processPost(final DataModel model) throws AppException { 39 | final String email = model.getRequest().getParameterAsString(WebConst.ATTR_USER_EMAIL, ""); 40 | final String newPassword = model.getRequest().getParameterAsString(WebConst.ATTR_USER_NEW_PASSWORD, ""); 41 | final String currentPassword = model.getRequest().getParameterAsString(WebConst.ATTR_USER_PASSWORD, ""); 42 | final String confirmResetPassword = model.getRequest().getParameterAsString(WebConst.ATTR_USER_CONFIRM_PASSWORD, ""); 43 | 44 | final UserComponent comp = new UserComponent(); 45 | 46 | // Check required fields 47 | if (!WebUtil.requireFieldCheck(email, newPassword, currentPassword)) { 48 | model.getRequest().put(WebConst.ATTR_ERROR_MESSAGE, "Invalid Parameter."); 49 | openAccountPage(model, comp); 50 | return; 51 | } 52 | 53 | if (!newPassword.equals(confirmResetPassword)) { 54 | model.getRequest().put(WebConst.ATTR_ERROR_MESSAGE, "Password does not match."); 55 | openAccountPage(model, comp); 56 | return; 57 | } 58 | 59 | if (newPassword.equals(currentPassword)) { 60 | model.getRequest().put(WebConst.ATTR_ERROR_MESSAGE, "Please enter a different password from the previous ones."); 61 | openAccountPage(model, comp); 62 | return; 63 | } 64 | 65 | try { 66 | 67 | final boolean updated = comp.updateAccount(model.getUserId(), email, newPassword, currentPassword); 68 | 69 | model.getRequest().put("isPasswordUpdated", updated); 70 | model.getRequest().put(WebConst.ATTR_MESSAGE, "Password has been changed. Please login with your new password"); 71 | } catch (final AppException e) { 72 | model.getRequest().put(WebConst.ATTR_ERROR_MESSAGE, e.getMessage()); 73 | } 74 | 75 | openAccountPage(model, comp); 76 | } 77 | 78 | /** 79 | * 80 | * @param model DataModel 81 | * @param comp UserComponent 82 | * @throws AppException 83 | */ 84 | private void openAccountPage(final DataModel model, final UserComponent comp) throws AppException { 85 | final UserProfileFormBean bean = comp.getUserProfile(model.getUserId()); 86 | model.getRequest().put("user", bean); 87 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "settings"); 88 | model.setRedirectCommonJsp("useraccount"); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/settings/SettingsController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.settings; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.component.UserComponent; 10 | import ${package}.exception.AppException; 11 | import ${package}.formbeans.UserProfileFormBean; 12 | import ${package}.ui.constants.WebConst; 13 | import ${package}.ui.servlet.common.AbstractWebController; 14 | import ${package}.ui.servlet.common.DataModel; 15 | 16 | /** 17 | * @author ${author} 18 | * 19 | */ 20 | @WebServlet(name = "Settings", urlPatterns = {"/settings"}) 21 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 22 | public final class SettingsController extends AbstractWebController { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | /***/ 27 | public SettingsController() { 28 | super(SettingsController.class); 29 | } 30 | 31 | @Override 32 | protected void processGet(final DataModel model) throws AppException { 33 | final UserComponent comp = new UserComponent(); 34 | final UserProfileFormBean bean = comp.getUserProfile(model.getUserId()); 35 | 36 | model.getRequest().put("user", bean); 37 | 38 | //set the current page on every request 39 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "settings"); 40 | model.setRedirectCommonJsp("settings"); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/settings/UserDeleteController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.settings; 5 | 6 | import javax.servlet.annotation.MultipartConfig; 7 | import javax.servlet.annotation.WebServlet; 8 | 9 | import ${package}.component.UserComponent; 10 | import ${package}.constants.GlobalStatusCodes; 11 | import ${package}.exception.AppException; 12 | import ${package}.formbeans.ResponseFormBean; 13 | import ${package}.formbeans.UserProfileFormBean; 14 | import ${package}.ui.constants.WebConst; 15 | import ${package}.ui.servlet.common.AbstractWebController; 16 | import ${package}.ui.servlet.common.DataModel; 17 | 18 | /** 19 | * @author ${author} 20 | * 21 | */ 22 | @WebServlet(name = "UserDelete", urlPatterns = {"/settings/user/delete"}) 23 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 24 | public final class UserDeleteController extends AbstractWebController { 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | /***/ 29 | public UserDeleteController() { 30 | super(UserDeleteController.class); 31 | } 32 | 33 | @Override 34 | protected void processGet(final DataModel model) throws AppException { 35 | final UserComponent comp = new UserComponent(); 36 | final UserProfileFormBean bean = comp.getUserProfile(model.getUserId()); 37 | 38 | model.getRequest().put("user", bean); 39 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "settings"); 40 | model.setRedirectCommonJsp("userdelete"); 41 | } 42 | 43 | @Override 44 | protected void processPost(final DataModel model) throws AppException { 45 | final UserComponent comp = new UserComponent(); 46 | final boolean deleted = comp.deleteUser(model.getUserId()); 47 | final UserProfileFormBean bean = comp.getUserProfile(model.getUserId()); 48 | 49 | model.getRequest().put("user", bean); 50 | model.out(new ResponseFormBean(GlobalStatusCodes.CREATED, null, deleted)); 51 | 52 | model.setRedirectController("Logout", true); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/settings/UserPhotoController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.settings; 5 | 6 | import java.lang.reflect.InvocationTargetException; 7 | 8 | import javax.servlet.annotation.MultipartConfig; 9 | import javax.servlet.annotation.WebServlet; 10 | 11 | import org.apache.commons.beanutils.BeanUtils; 12 | 13 | import ${package}.component.UserComponent; 14 | import ${package}.constants.GlobalStatusCodes; 15 | import ${package}.constants.ServiceErrorStatus; 16 | import ${package}.exception.AppException; 17 | import ${package}.formbeans.UserPhotoFormBean; 18 | import ${package}.formbeans.UserProfileFormBean; 19 | import ${package}.formdatas.UserPhotoFormData; 20 | import ${package}.ui.constants.WebConst; 21 | import ${package}.ui.servlet.common.AbstractWebController; 22 | import ${package}.ui.servlet.common.DataModel; 23 | 24 | /** 25 | * @author ${author} 26 | * 27 | */ 28 | @WebServlet(name = "UserPhoto", urlPatterns = {"/settings/user/photo"}) 29 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 30 | public final class UserPhotoController extends AbstractWebController { 31 | 32 | private static final long serialVersionUID = 1L; 33 | 34 | /***/ 35 | public UserPhotoController() { 36 | super(UserPhotoController.class); 37 | } 38 | 39 | @Override 40 | protected void processGet(final DataModel model) throws AppException { 41 | final UserComponent comp = new UserComponent(); 42 | final UserProfileFormBean bean = comp.getUserProfile(model.getUserId()); 43 | 44 | model.getRequest().put("user", bean); 45 | 46 | //set the current page on every request 47 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "settings"); 48 | model.setRedirectCommonJsp("userphoto"); 49 | } 50 | 51 | 52 | @Override 53 | protected void processPost(final DataModel model) throws AppException { 54 | final UserPhotoFormData data = new UserPhotoFormData(); 55 | 56 | try { 57 | BeanUtils.populate(data, model.getRequest().getParams()); 58 | data.setId(model.getUserId()); 59 | 60 | final UserComponent comp = new UserComponent(); 61 | final UserPhotoFormBean bean = comp.updateProfilePhoto(data); 62 | 63 | model.getRequest().put("user", bean); // set the user info in the request 64 | model.getSession().put(WebConst.ATTR_USER_IMAGE, bean.getImage()); // update the new image in the session 65 | 66 | model.setRedirectController("UserPhoto", true); // redirect to controller 67 | } catch (final IllegalAccessException e) { 68 | throw new AppException("Invalid access...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 69 | } catch (final InvocationTargetException e) { 70 | throw new AppException("Invalid access...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 71 | } 72 | 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/main/settings/UserProfileController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.main.settings; 5 | 6 | import java.lang.reflect.InvocationTargetException; 7 | 8 | import javax.servlet.annotation.MultipartConfig; 9 | import javax.servlet.annotation.WebServlet; 10 | 11 | import org.apache.commons.beanutils.BeanUtils; 12 | 13 | import ${package}.component.UserComponent; 14 | import ${package}.constants.GlobalStatusCodes; 15 | import ${package}.constants.ServiceErrorStatus; 16 | import ${package}.exception.AppException; 17 | import ${package}.formbeans.UserProfileFormBean; 18 | import ${package}.formdatas.UserProfileFormData; 19 | import ${package}.ui.constants.WebConst; 20 | import ${package}.ui.servlet.common.AbstractWebController; 21 | import ${package}.ui.servlet.common.DataModel; 22 | 23 | /** 24 | * @author ${author} 25 | * 26 | */ 27 | @WebServlet(name = "UserProfile", urlPatterns = {"/settings/user/profile"}) 28 | @MultipartConfig(fileSizeThreshold = 0, maxFileSize = 209715200, maxRequestSize = 209715200) 29 | public final class UserProfileController extends AbstractWebController { 30 | 31 | private static final long serialVersionUID = 1L; 32 | 33 | /***/ 34 | public UserProfileController() { 35 | super(UserProfileController.class); 36 | } 37 | 38 | @Override 39 | protected void processGet(final DataModel model) throws AppException { 40 | final UserComponent comp = new UserComponent(); 41 | final UserProfileFormBean bean = comp.getUserProfile(model.getUserId()); 42 | 43 | model.getRequest().put("user", bean); 44 | 45 | //set the current page on every request 46 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "settings"); 47 | model.setRedirectCommonJsp("userprofile"); 48 | } 49 | 50 | @Override 51 | protected void processPost(final DataModel model) throws AppException { 52 | final UserProfileFormData data = new UserProfileFormData(); 53 | 54 | try { 55 | BeanUtils.populate(data, model.getRequest().getParams()); 56 | data.setId(model.getUserId()); 57 | 58 | final UserComponent comp = new UserComponent(); 59 | final UserProfileFormBean bean = comp.updateProfileInfo(data); 60 | 61 | model.getRequest().put("user", bean); 62 | model.getRequest().put(WebConst.ATTR_CURRENT_PAGE, "settings"); 63 | model.setRedirectCommonJsp("userprofile"); 64 | } catch (final IllegalAccessException e) { 65 | throw new AppException("Invalid access...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 66 | } catch (final InvocationTargetException e) { 67 | throw new AppException("Invalid access...", GlobalStatusCodes.BAD_REQUEST, ServiceErrorStatus.DATA_ERROR); 68 | } 69 | 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/controller/root/RootBaseController.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.controller.root; 5 | 6 | import ${package}.hibernate.beans.enumeration.UserType; 7 | import ${package}.ui.servlet.common.AbstractWebController; 8 | 9 | /** 10 | * @author ${author} 11 | * 12 | */ 13 | public class RootBaseController extends AbstractWebController { 14 | 15 | private static final long serialVersionUID = 1L; 16 | 17 | /** 18 | * @param clazz Class< ? extends RootBaseController> 19 | */ 20 | protected RootBaseController(final Class< ? extends RootBaseController> clazz) { 21 | super(clazz); 22 | } 23 | 24 | /** 25 | * @param method String 26 | * @param userType String 27 | * @return boolean 28 | */ 29 | @Override 30 | protected boolean allowedUserType(final String method, final String userType) { 31 | switch (UserType.getAnnotationType(userType)) { 32 | case ROOT: // only root and members can access this page. 33 | case MEMBER: 34 | return true; 35 | default: 36 | return false; 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/filter/Log4jFilter.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.filter; 5 | 6 | import javax.servlet.DispatcherType; 7 | import javax.servlet.annotation.WebFilter; 8 | 9 | import org.apache.logging.log4j.web.Log4jServletFilter; 10 | 11 | /** 12 | * @author ${author} 13 | */ 14 | @WebFilter(filterName = "log4jServletFilter", 15 | urlPatterns = {"/*"}, 16 | dispatcherTypes = { 17 | DispatcherType.REQUEST, 18 | DispatcherType.FORWARD, 19 | DispatcherType.INCLUDE, 20 | DispatcherType.ERROR 21 | }) 22 | public final class Log4jFilter extends Log4jServletFilter { 23 | } 24 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/listener/ContextListener.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.listener; 5 | 6 | import javax.servlet.ServletContext; 7 | import javax.servlet.ServletContextEvent; 8 | import javax.servlet.ServletContextListener; 9 | import javax.servlet.annotation.WebListener; 10 | import javax.servlet.http.HttpSessionEvent; 11 | import javax.servlet.http.HttpSessionListener; 12 | 13 | import org.apache.log4j.LogManager; 14 | import org.apache.log4j.Logger; 15 | 16 | import ${package}.exception.AppException; 17 | import ${package}.hibernate.connection.SessionFactoryUtil; 18 | import ${package}.ui.servlet.common.ServletSettings; 19 | import ${package}.util.SystemSettingsUtil; 20 | 21 | /** 22 | * 23 | * @author ${author} 24 | * 25 | */ 26 | @WebListener 27 | public class ContextListener implements ServletContextListener, HttpSessionListener { 28 | 29 | /***/ 30 | private static final Logger LOGGER = LogManager.getLogger(ContextListener.class); 31 | 32 | @Override 33 | public final void contextInitialized(final ServletContextEvent event) { 34 | final ServletContext servletContext = event.getServletContext(); 35 | final ServletSettings settings = new ServletSettings(servletContext); 36 | servletContext.setAttribute("settings", settings); 37 | servletContext.setAttribute("system", System.getProperties()); 38 | 39 | final String env = System.getProperty("RUN_ENV", "DEV"); 40 | try { 41 | if (!"BETA".equals(env)) { 42 | //final Initialize Database Connection 43 | if (!"Y".equals(System.getProperty("DB_CREATED", "Y"))) { 44 | LOGGER.info("Creating the database..."); 45 | SessionFactoryUtil.initSessionFactory(SessionFactoryUtil.CFG_CREATE); 46 | SessionFactoryUtil.close(); 47 | } else { 48 | LOGGER.info("Updating the database..."); 49 | SessionFactoryUtil.initSessionFactory(SessionFactoryUtil.CFG_UPDATE); 50 | } 51 | 52 | SystemSettingsUtil.loadSystemSettings(); 53 | } 54 | LOGGER.info("Context initialized..."); 55 | } catch (final AppException e) { 56 | LOGGER.error(e); 57 | } 58 | 59 | } 60 | 61 | @Override 62 | public final void contextDestroyed(final ServletContextEvent event) { 63 | //Close Dataase Connection 64 | SessionFactoryUtil.close(); 65 | LOGGER.info("Context destroid..."); 66 | } 67 | 68 | /** 69 | * 70 | */ 71 | @Override 72 | public final void sessionCreated(final HttpSessionEvent event) { 73 | event.getSession().setMaxInactiveInterval(SystemSettingsUtil.getSettingAsInt("system.session.timeout", 2) * 60); // in seconds 74 | } 75 | 76 | /** 77 | * 78 | */ 79 | @Override 80 | public final void sessionDestroyed(final HttpSessionEvent event) { 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/servlet/listener/Log4jContextListener.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.servlet.listener; 5 | 6 | import javax.servlet.annotation.WebListener; 7 | 8 | import org.apache.logging.log4j.web.Log4jServletContextListener; 9 | 10 | /** 11 | * 12 | * @author ${author} 13 | * 14 | */ 15 | @WebListener 16 | public class Log4jContextListener extends Log4jServletContextListener { 17 | //No Content 18 | } 19 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/CurrentDateTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib; 5 | 6 | import java.io.IOException; 7 | import java.text.SimpleDateFormat; 8 | import java.util.Date; 9 | import java.util.GregorianCalendar; 10 | 11 | import javax.servlet.jsp.JspException; 12 | import javax.servlet.jsp.tagext.SimpleTagSupport; 13 | 14 | /** 15 | * @author ${author} 16 | */ 17 | public class CurrentDateTag extends SimpleTagSupport { 18 | 19 | /***/ 20 | private static final SimpleDateFormat SDF = new SimpleDateFormat("MMddyyyyHHmmss"); 21 | 22 | @Override 23 | public final void doTag() throws JspException, IOException { 24 | final Date date = GregorianCalendar.getInstance().getTime(); 25 | getJspContext().getOut().print(SDF.format(date)); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/LabelTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib; 5 | 6 | import java.io.IOException; 7 | 8 | import javax.servlet.jsp.JspException; 9 | import javax.servlet.jsp.tagext.SimpleTagSupport; 10 | 11 | import ${package}.text.Labels; 12 | 13 | /** 14 | * @author ${author} 15 | */ 16 | public class LabelTag extends SimpleTagSupport { 17 | 18 | /***/ 19 | private String m_key; 20 | 21 | @Override 22 | public final void doTag() throws JspException, IOException { 23 | getJspContext().getOut().print(Labels.getString(m_key)); 24 | } 25 | 26 | /** 27 | * @param key String 28 | */ 29 | public void setKey(final String key) { 30 | m_key = key; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/MessageTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib; 5 | 6 | import java.io.IOException; 7 | 8 | import javax.servlet.jsp.JspException; 9 | import javax.servlet.jsp.tagext.SimpleTagSupport; 10 | 11 | import ${package}.text.Messages; 12 | 13 | 14 | /** 15 | * @author ${author} 16 | */ 17 | public class MessageTag extends SimpleTagSupport { 18 | 19 | /***/ 20 | private String m_key; 21 | 22 | @Override 23 | public final void doTag() throws JspException, IOException { 24 | getJspContext().getOut().print(Messages.getString(m_key)); 25 | } 26 | 27 | /** 28 | * @param key String 29 | */ 30 | public void setKey(final String key) { 31 | m_key = key; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/TooltipTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib; 5 | 6 | import java.io.IOException; 7 | 8 | import javax.servlet.jsp.JspException; 9 | import javax.servlet.jsp.tagext.SimpleTagSupport; 10 | 11 | import ${package}.text.ToolTips; 12 | 13 | /** 14 | * @author ${author} 15 | */ 16 | public class TooltipTag extends SimpleTagSupport { 17 | 18 | /***/ 19 | private String m_key; 20 | 21 | @Override 22 | public final void doTag() throws JspException, IOException { 23 | getJspContext().getOut().print(ToolTips.getString(m_key)); 24 | } 25 | 26 | /** 27 | * @param key String 28 | */ 29 | public void setKey(final String key) { 30 | m_key = key; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/UserMenuItem.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib; 5 | 6 | import java.io.IOException; 7 | 8 | import javax.servlet.ServletContext; 9 | import javax.servlet.jsp.JspException; 10 | import javax.servlet.jsp.PageContext; 11 | import javax.servlet.jsp.tagext.SimpleTagSupport; 12 | 13 | import ${package}.hibernate.beans.enumeration.UserType; 14 | import ${package}.ui.util.MenuAccessUtil; 15 | import ${package}.ui.constants.WebConst; 16 | 17 | /** 18 | * @author ${author} 19 | * 20 | */ 21 | public class UserMenuItem extends SimpleTagSupport { 22 | 23 | @Override 24 | public final void doTag() throws JspException, IOException { 25 | final String userType = (String) getJspContext().getAttribute(WebConst.ATTR_USER_TYPE, PageContext.SESSION_SCOPE); 26 | final String currentPage = (String) getJspContext().getAttribute(WebConst.ATTR_CURRENT_PAGE, PageContext.REQUEST_SCOPE); 27 | final ServletContext servletContext = ((PageContext) getJspContext()).getServletContext(); 28 | String contextPath = ""; 29 | if (null != servletContext.getContextPath()) { 30 | contextPath = servletContext.getContextPath(); 31 | } 32 | 33 | // For admin users 34 | addSettings(contextPath, currentPage, userType); 35 | } 36 | 37 | /** 38 | * 39 | * @param contextPath String 40 | * @param currentPage String 41 | * @param userType String 42 | * @throws IOException e 43 | */ 44 | private void addSettings(final String contextPath, final String currentPage, final String userType) throws IOException { 45 | if (MenuAccessUtil.userHasAccessToSettings(userType)) { 46 | if (UserType.ADMIN == UserType.getAnnotationType(userType)) { 47 | print("System Settings"); 48 | } else { 49 | print("Settings"); 50 | } 51 | } 52 | } 53 | 54 | /** 55 | * 56 | * @param text String 57 | * @throws IOException 58 | */ 59 | private void print(final String text) throws IOException { 60 | getJspContext().getOut().print(text); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/UserTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib; 5 | 6 | import java.io.IOException; 7 | 8 | import javax.servlet.jsp.JspException; 9 | import javax.servlet.jsp.PageContext; 10 | import javax.servlet.jsp.tagext.SimpleTagSupport; 11 | 12 | import ${package}.ui.constants.WebConst; 13 | 14 | /** 15 | * @author ${author} 16 | * 17 | */ 18 | public class UserTag extends SimpleTagSupport { 19 | 20 | @Override 21 | public final void doTag() throws JspException, IOException { 22 | final String username = (String) getJspContext().getAttribute(WebConst.ATTR_USER_USERID, PageContext.SESSION_SCOPE); 23 | if (username != null) { 24 | getJspContext().getOut().print(username); 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/beans/PageParameter.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib.beans; 5 | 6 | import ${package}.text.Labels; 7 | import ${package}.text.Messages; 8 | import ${package}.text.Tags; 9 | import ${package}.text.ToolTips; 10 | 11 | /** 12 | * @author ${author} 13 | * 14 | */ 15 | public class PageParameter { 16 | 17 | /***/ 18 | private String m_content; 19 | 20 | /***/ 21 | private String m_direct; 22 | 23 | /** 24 | * @param content String 25 | * @param direct String 26 | */ 27 | public PageParameter(final String content, 28 | final String direct) { 29 | this.m_content = content; 30 | this.m_direct = direct; 31 | } 32 | 33 | /** 34 | * @param content String 35 | */ 36 | public void setContent(final String content) { 37 | m_content = content; 38 | } 39 | 40 | /** 41 | * @param direct String 42 | */ 43 | public void setDirect(final String direct) { 44 | m_direct = direct; 45 | } 46 | 47 | /** 48 | * @return String 49 | */ 50 | public String getContent() { 51 | if (isDirect()) { 52 | if (m_content.contains("::")) { 53 | final String[] content = m_content.split("::"); 54 | final String type = content[0]; 55 | final String name = content[1]; 56 | switch (type) { 57 | case "message": 58 | return Messages.getString(name); 59 | case "label": 60 | return Labels.getString(name); 61 | case "tooltip": 62 | return ToolTips.getString(name); 63 | case "tag": 64 | return Tags.getString(name); 65 | default: 66 | break; 67 | } 68 | } 69 | } 70 | return m_content; 71 | } 72 | 73 | /** 74 | * @return boolean 75 | */ 76 | public boolean isDirect() { 77 | return Boolean.valueOf(m_direct).booleanValue(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/templates/GetTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib.templates; 5 | 6 | import java.util.Hashtable; 7 | import java.util.Stack; 8 | 9 | import javax.servlet.jsp.JspException; 10 | import javax.servlet.jsp.PageContext; 11 | import javax.servlet.jsp.tagext.TagSupport; 12 | 13 | import ${package}.ui.taglib.beans.PageParameter; 14 | 15 | /** 16 | * @author ${author} 17 | * 18 | */ 19 | public class GetTag extends TagSupport { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | /***/ 24 | private String m_name; 25 | 26 | /** 27 | * @param name String 28 | */ 29 | public void setName(final String name) { 30 | this.m_name = name; 31 | } 32 | 33 | @SuppressWarnings("unchecked") 34 | @Override 35 | public final int doStartTag() throws JspException { 36 | final Stack> stack = (Stack>) 37 | pageContext.getAttribute("template-stack", PageContext.REQUEST_SCOPE); 38 | if (stack == null) { 39 | throw new JspException("GetTag.doStartTag(): " + "NO STACK"); 40 | } 41 | 42 | final Hashtable params = stack.peek(); 43 | if (params == null) { 44 | throw new JspException("GetTag.doStartTag(): " + "NO HASHTABLE"); 45 | } 46 | 47 | final PageParameter param = (PageParameter) params.get(m_name); 48 | if (param != null) { 49 | final String content = param.getContent(); 50 | if (param.isDirect()) { 51 | try { 52 | pageContext.getOut().print(content); 53 | } catch (final java.io.IOException ex) { 54 | throw new JspException(ex.getMessage()); 55 | } 56 | } else { 57 | try { 58 | pageContext.include(content, true); 59 | } catch (final Exception ex) { 60 | throw new JspException(ex.getMessage()); 61 | } 62 | } 63 | } 64 | return SKIP_BODY; 65 | } 66 | 67 | @Override 68 | public final void release() { 69 | m_name = null; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/templates/InsertTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib.templates; 5 | 6 | import java.util.Hashtable; 7 | import java.util.Stack; 8 | 9 | import javax.servlet.jsp.JspException; 10 | import javax.servlet.jsp.PageContext; 11 | import javax.servlet.jsp.tagext.TagSupport; 12 | 13 | /** 14 | * @author ${author} 15 | * 16 | */ 17 | public class InsertTag extends TagSupport { 18 | 19 | private static final long serialVersionUID = 1L; 20 | 21 | /***/ 22 | private String m_template; 23 | 24 | /***/ 25 | private Stack> m_stack; 26 | 27 | /** 28 | * @param template String 29 | */ 30 | public void setTemplate(final String template) { 31 | this.m_template = template; 32 | } 33 | 34 | @Override 35 | public final int doStartTag() throws JspException { 36 | m_stack = getStack(); // obtain a reference to the template stack 37 | m_stack.push(new Hashtable<>()); // push new hashtable onto stack 38 | return EVAL_BODY_INCLUDE; // pass tag body through unchanged 39 | } 40 | 41 | @Override 42 | public final int doEndTag() throws JspException { 43 | try { 44 | pageContext.include(m_template); // include template 45 | } catch (final Exception ex) { // IOException or ServletException 46 | throw new JspException(ex.getMessage()); // recast exception 47 | } 48 | m_stack.pop(); // pop hashtable off stack 49 | return EVAL_PAGE; // evaluate the rest of the page after the tag 50 | } 51 | 52 | @Override 53 | public final void release() { 54 | m_template = null; 55 | m_stack = null; 56 | } 57 | 58 | /** 59 | * @return Stack 60 | */ 61 | @SuppressWarnings("unchecked") 62 | public Stack> getStack() { 63 | Stack> s = (Stack>) pageContext.getAttribute("template-stack", PageContext.REQUEST_SCOPE); 64 | if (s == null) { 65 | s = new Stack<>(); 66 | pageContext.setAttribute("template-stack", s, PageContext.REQUEST_SCOPE); 67 | } 68 | return s; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/taglib/templates/PutTag.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.taglib.templates; 5 | 6 | import java.util.Hashtable; 7 | import java.util.Stack; 8 | 9 | import javax.servlet.jsp.JspException; 10 | import javax.servlet.jsp.tagext.TagSupport; 11 | 12 | import ${package}.ui.taglib.beans.PageParameter; 13 | 14 | /** 15 | * @author ${author} 16 | * 17 | */ 18 | public class PutTag extends TagSupport { 19 | 20 | private static final long serialVersionUID = 1L; 21 | 22 | /***/ 23 | private String m_name; 24 | 25 | /***/ 26 | private String m_content; 27 | 28 | /***/ 29 | private String m_direct = "false"; 30 | 31 | /** 32 | * @param name String 33 | */ 34 | public void setName(final String name) { 35 | this.m_name = name; 36 | } 37 | 38 | /** 39 | * @param content String 40 | */ 41 | public void setContent(final String content) { 42 | this.m_content = content; 43 | } 44 | 45 | /** 46 | * @param direct String 47 | */ 48 | public void setDirect(final String direct) { 49 | this.m_direct = direct; 50 | } 51 | 52 | @Override 53 | public final int doStartTag() throws JspException { 54 | // obtain a reference to enclosing insert tag 55 | final InsertTag parent = (InsertTag) getAncestor("${package}.ui.taglib.templates.InsertTag"); 56 | // put tags must be enclosed in an insert tag 57 | if (parent == null) { 58 | throw new JspException("PutTag.doStartTag(): " + "No InsertTag ancestor"); 59 | } 60 | // get template stack from insert tag 61 | final Stack> templateStack = parent.getStack(); 62 | // template stack should never be null 63 | if (templateStack == null) { 64 | throw new JspException("PutTag: no template stack"); 65 | } 66 | // peek at hashtable on the stack 67 | final Hashtable params = templateStack.peek(); 68 | // hashtable should never be null either 69 | if (params == null) { 70 | throw new JspException("PutTag: no hashtable"); 71 | } 72 | // put a new PageParameter in the hashtable 73 | params.put(m_name, new PageParameter(m_content, m_direct)); 74 | return SKIP_BODY; // not interested in tag body, if present 75 | } 76 | 77 | @Override 78 | public final void release() { 79 | m_name = null; 80 | m_content = null; 81 | m_direct = null; 82 | } 83 | 84 | /** 85 | * @param className String 86 | * @return TagSupport 87 | * @throws JspException e 88 | */ 89 | private TagSupport getAncestor(final String className) throws JspException { 90 | Class< ? > klass = null; // can't name variable "class" 91 | try { 92 | klass = Class.forName(className); 93 | } catch (final ClassNotFoundException ex) { 94 | throw new JspException(ex.getMessage()); 95 | } 96 | return (TagSupport) findAncestorWithClass(this, klass); 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/java/ui/util/MenuAccessUtil.java: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | package ${package}.ui.util; 5 | 6 | import ${package}.hibernate.beans.enumeration.UserType; 7 | 8 | /** 9 | * @author ${author} 10 | * 11 | */ 12 | public final class MenuAccessUtil { 13 | 14 | private MenuAccessUtil() { 15 | 16 | } 17 | 18 | /** 19 | * 20 | * @param userType String 21 | * @return boolean 22 | */ 23 | public static boolean userHasAccessToSettings(final String userType) { 24 | switch(UserType.getAnnotationType(userType)) { 25 | case ADMIN: 26 | case ROOT: 27 | case MEMBER: 28 | return true; 29 | default: 30 | return false; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | ${symbol_pound} 5 | ${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one 6 | ${symbol_pound} or more contributor license agreements. See the NOTICE file 7 | ${symbol_pound} distributed with this work for additional information 8 | ${symbol_pound} regarding copyright ownership. The ASF licenses this file 9 | ${symbol_pound} to you under the Apache License, Version 2.0 (the 10 | ${symbol_pound} "License"); you may not use this file except in compliance 11 | ${symbol_pound} with the License. You may obtain a copy of the License at 12 | ${symbol_pound} 13 | ${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0 14 | ${symbol_pound} 15 | ${symbol_pound} Unless required by applicable law or agreed to in writing, 16 | ${symbol_pound} software distributed under the License is distributed on an 17 | ${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | ${symbol_pound} KIND, either express or implied. See the License for the 19 | ${symbol_pound} specific language governing permissions and limitations 20 | ${symbol_pound} under the License. 21 | ${symbol_pound} 22 | 23 | ${symbol_pound} Set root category priority to INFO and its only appender to CONSOLE. 24 | ${symbol_pound}log4j.rootCategory=INFO, CONSOLE 25 | log4j.rootCategory=DEBUG, CONSOLE, LOGFILE, ERRORLOG 26 | 27 | ${symbol_pound} Set the enterprise logger priority to FATAL 28 | log4j.logger.org.apache.axis2.enterprise=FATAL 29 | log4j.logger.de.hunsicker.jalopy.io=FATAL 30 | log4j.logger.httpclient.wire.header=FATAL 31 | log4j.logger.org.apache.commons.httpclient=FATAL 32 | log4j.logger.org.apache.commons.httpclient=FATAL 33 | log4j.logger.com.mchange=FATAL 34 | log4j.logger.org.apache.commons.beanutils=FATAL 35 | log4j.logger.com.itextpdf=FATAL 36 | 37 | ${symbol_pound} CONSOLE is set to be a ConsoleAppender using a PatternLayout. 38 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 39 | log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout 40 | log4j.appender.CONSOLE.layout.ConversionPattern=[%p] %m%n 41 | log4j.appender.CONSOLE.threshold=DEBUG 42 | 43 | ${symbol_pound} LOGFILE is set to be a File appender using a PatternLayout. 44 | log4j.appender.LOGFILE=org.apache.log4j.rolling.RollingFileAppender 45 | log4j.appender.LOGFILE.rollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy 46 | log4j.appender.LOGFILE.rollingPolicy.fileNamePattern=${symbol_dollar}{catalina.base}/logs/${parentArtifactId}-%d{yyyy-MM-dd}.log 47 | log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout 48 | log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n 49 | log4j.appender.LOGFILE.threshold=INFO 50 | 51 | ${symbol_pound} LOGFILE is set to be a File appender using a PatternLayout. 52 | log4j.appender.ERRORLOG=org.apache.log4j.rolling.RollingFileAppender 53 | log4j.appender.ERRORLOG.rollingPolicy=org.apache.log4j.rolling.TimeBasedRollingPolicy 54 | log4j.appender.ERRORLOG.rollingPolicy.fileNamePattern=${symbol_dollar}{catalina.base}/logs/${parentArtifactId}-errors-%d{yyyy-MM-dd}.log 55 | log4j.appender.ERRORLOG.layout=org.apache.log4j.PatternLayout 56 | log4j.appender.ERRORLOG.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n 57 | log4j.appender.ERRORLOG.threshold=ERROR -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/sql/__rootArtifactId__.sql: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | -- Default Users 5 | insert into public.dp_user(_id, type, create_date, last_modified_date, update_date, confirmed, confirmed_date, email, first_name, last_name, password, user_name, system_user) values('0000-0001', 'ADMIN', now(), now(), now(), true, now(), null, 'System', 'Admin', 'D39321F4A16D4FC8', 'su', true); 6 | insert into public.dp_user(_id, type, create_date, last_modified_date, update_date, confirmed, confirmed_date, email, first_name, last_name, password, user_name, system_user) values('0000-0002', 'ROOT', now(), now(), now(), true, now(), null, 'System', 'Root', 'D39321F4A16D4FC8', 'root', false); 7 | insert into public.dp_user(_id, type, create_date, last_modified_date, update_date, confirmed, confirmed_date, email, first_name, last_name, password, user_name, system_user, admin_id) values('0000-0003', 'MEMBER', now(), now(), now(), true, now(), null, 'System', 'Member', 'D39321F4A16D4FC8', 'member', false, '0000-0002'); 8 | 9 | -- System Settings 10 | insert into public.dpx_system_setting(name, value, encrypted, create_date, last_modified_date, update_date) values('system.session.timeout', '2700', false, now(), now(), now()); 11 | insert into public.dpx_system_setting(name, value, encrypted, create_date, last_modified_date, update_date) values('system.user.enable', 'true', false, now(), now(), now()); 12 | insert into public.dpx_system_setting(name, value, encrypted, create_date, last_modified_date, update_date) values('system.user.password', 'D39321F4A16D4FC8', true, now(), now(), now()); 13 | 14 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/text/labels.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/text/messages.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/text/messages.properties -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/text/paths.properties: -------------------------------------------------------------------------------- 1 | # Add all servlet path on this file to exclude on auto redirect path. 2 | 3 | ####################### START - Static Pages ################################## 4 | 5 | # 6 | # Pattern: Must Implement! 7 | # Path: .= 8 | # Where: 9 | # - Name of the page 10 | # - Name of the page (Start - starts with | Exact - exact match) 11 | # - URL path 12 | # e.g. Rest.Start=/rest 13 | 14 | # Rest Path 15 | Rest.Start=/rest 16 | 17 | # Pages Path 18 | Pages.Start=/pages 19 | 20 | # Scripts Path 21 | Scripts.Start=/scripts 22 | 23 | # Styles Path 24 | Styles.Start=/styles 25 | 26 | # Styles Path 27 | Icon.Start=/favicon.ico 28 | 29 | # Fonts Path 30 | Fonts.Start=/fonts 31 | 32 | # Fonts Path 33 | Images.Start=/images 34 | 35 | # klorofil template Path 36 | Assets.Start=/assets 37 | 38 | ####################### END - Static Pages ################################## 39 | 40 | # Pattern: Must Implement! 41 | # Path: .Servlet.= 42 | # Where: 43 | # - Name of the page 44 | # - Name of the page (Start - starts with | Exact - exact match) 45 | # - URL path 46 | # e.g. Error.Servlet.Exact=/error 47 | 48 | ########################### UNRESTRICTED #################################### 49 | 50 | # Root Servlet Path 51 | Root.Servlet.Exact=/ 52 | 53 | # Error Servlet Path 54 | Error.Servlet.Exact=/error 55 | 56 | # Index Servlet Path 57 | Index.Servlet.Exact=/index 58 | 59 | # Register Servlet Path 60 | Register.Servlet.Exact=/register 61 | 62 | # Login Servlet Path 63 | Login.Servlet.Exact=/login 64 | 65 | # Logout Servlet Path 66 | Logout.Servlet.Exact=/logout 67 | 68 | ############################# RESTRICTED ################################## 69 | 70 | # Home Servlet Path 71 | Home.Servlet.Exact=/home 72 | 73 | ############## COMMON ############## 74 | 75 | # Settings Servlet Path 76 | Settings.Servlet.Exact=/settings 77 | 78 | # UserProfile Servlet Path 79 | UserProfile.Servlet.Exact=/settings/user/profile 80 | 81 | # UserPhoto Servlet Path 82 | UserPhoto.Servlet.Exact=/settings/user/photo 83 | 84 | # CorporateSetting Servlet Path 85 | CorporateSetting.Servlet.Exact=/settings/user/corporate 86 | 87 | # AccountSetting Servlet Path 88 | AccountSetting.Servlet.Exact=/settings/user/account 89 | 90 | # UserDelete Servlet Path 91 | UserDelete.Servlet.Exact=/settings/user/delete 92 | 93 | ############## ADMIN ############## 94 | 95 | # SystemSettings Servlet Path 96 | SystemSettings.Servlet.Exact=/systemsettings 97 | 98 | # SystemSettingsEdit Servlet Path 99 | SystemSettingsEdit.Servlet.Exact=/systemsettings/edit -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/text/tags.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/text/tooltips.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/resources/text/tooltips.properties -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/WEB-INF/tlds/__parentArtifactId__.tld: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 1.2 9 | ${parentArtifactId}Tag 10 | 11 | 12 | currentDate 13 | to prevent caching of JS and CSS files 14 | ${package}.ui.taglib.CurrentDateTag 15 | empty 16 | 17 | 18 | 19 | message 20 | for i18n of UI messages 21 | ${package}.ui.taglib.MessageTag 22 | empty 23 | 24 | key 25 | true 26 | false 27 | 28 | 29 | 30 | 31 | label 32 | for i18n of UI labels 33 | ${package}.ui.taglib.LabelTag 34 | empty 35 | 36 | key 37 | true 38 | false 39 | 40 | 41 | 42 | 43 | tooltip 44 | for i18n of UI tooltips 45 | ${package}.ui.taglib.TooltipTag 46 | empty 47 | 48 | key 49 | true 50 | false 51 | 52 | 53 | 54 | 55 | user 56 | get username 57 | ${package}.ui.taglib.UserTag 58 | empty 59 | 60 | key 61 | true 62 | false 63 | 64 | 65 | 66 | 67 | menuItems 68 | Print out menu items for user 69 | ${package}.ui.taglib.UserMenuItem 70 | empty 71 | 72 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/WEB-INF/tlds/template.tld: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 1.2 9 | templateTag 10 | 11 | 12 | insert 13 | Insert tag template on JSP page from Main JSP template 14 | ${package}.ui.taglib.templates.InsertTag 15 | JSP 16 | 17 | template 18 | true 19 | true 20 | 21 | 22 | 23 | put 24 | Put tag template on JSP page from parent InsertTag template 25 | ${package}.ui.taglib.templates.PutTag 26 | JSP 27 | 28 | name 29 | true 30 | true 31 | 32 | 33 | 34 | content 35 | true 36 | true 37 | 38 | 39 | 40 | direct 41 | false 42 | false 43 | 44 | 45 | 46 | get 47 | Get tag template on JSP page from parent InsertTag template 48 | ${package}.ui.taglib.templates.GetTag 49 | JSP 50 | 51 | name 52 | true 53 | true 54 | 55 | 56 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 9 | 10 | ADPRIMAS 11 | 12 | 13 | 14 | *.jsp 15 | true 16 | 17 | 18 | 19 | 20 | session-timeout 21 | 14400 22 | 23 | 24 | output-encoding 25 | UTF-8 26 | 27 | 28 | 29 | isLog4jAutoInitializationDisabled 30 | true 31 | 32 | 33 | log4jContextName 34 | ${parentArtifactId} 35 | 36 | 37 | log4jConfiguration 38 | /WEB-INF/classes/${packageInPathFormat}/ui/config/log4j2.xml 39 | 40 | 41 | 42 | java.lang.Throwable 43 | /error 44 | 45 | 46 | 47 | 48 | 401 49 | /error?code=401 50 | 51 | 52 | 53 | 403 54 | /error?code=403 55 | 56 | 57 | 58 | 404 59 | /error?code=404 60 | 61 | 62 | 63 | 500 64 | /error?code=500 65 | 66 | 67 | 68 | 503 69 | /error?code=503 70 | 71 | 72 | 73 | index 74 | 75 | 76 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/assets/vendor/simple-sidebar/css/simple-sidebar.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Start Bootstrap - Simple Sidebar (https://startbootstrap.com/template/simple-sidebar) 3 | * Copyright 2013-2020 Start Bootstrap 4 | * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-simple-sidebar/blob/master/LICENSE) 5 | */ 6 | #wrapper { 7 | overflow-x: hidden; 8 | } 9 | 10 | #sidebar-wrapper { 11 | min-height: 100vh; 12 | margin-left: -15rem; 13 | -webkit-transition: margin .25s ease-out; 14 | -moz-transition: margin .25s ease-out; 15 | -o-transition: margin .25s ease-out; 16 | transition: margin .25s ease-out; 17 | } 18 | 19 | #sidebar-wrapper .sidebar-heading { 20 | padding: 0.875rem 1.25rem; 21 | font-size: 1.2rem; 22 | font-weight: bolder; 23 | } 24 | 25 | #sidebar-wrapper .sidebar-version { 26 | margin-top: -1.25rem; 27 | font-size: 0.6rem; 28 | } 29 | 30 | #sidebar-wrapper .list-group { 31 | width: 15rem; 32 | } 33 | 34 | #page-content-wrapper { 35 | min-width: 100vw; 36 | } 37 | 38 | #wrapper.toggled #sidebar-wrapper { 39 | margin-left: 0; 40 | } 41 | 42 | @media ( min-width : 768px) { 43 | #sidebar-wrapper { 44 | margin-left: 0; 45 | } 46 | #page-content-wrapper { 47 | min-width: 0; 48 | width: 100%; 49 | } 50 | #wrapper.toggled #sidebar-wrapper { 51 | margin-left: -15rem; 52 | } 53 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/favicon.ico -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/Ge Body.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/Ge Body.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-BoldItalic.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-ExtraBold.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Italic.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Light.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-LightItalic.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-SemiBold.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/fonts/OpenSans-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/images/user-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/images/user-large.png -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/images/user.png -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/ajaxcontenttemplate.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> 5 | <%@ taglib prefix="template" uri="templateTag" %> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contentonlytemplate.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> 5 | <%@ taglib prefix="template" uri="templateTag" %> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/error.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 | 8 |
9 |

Error

10 |
11 | 12 | 13 | 14 | 15 | 16 | 500 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | Internal system error. Please contact support@kowdtech.com. 26 | 27 | 28 |
-------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/home.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
8 | 9 |
10 |
11 |
12 |
13 |
-------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/index.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 | 8 |

Welcome to ${name}

-------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/login.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 | 8 |
9 |
10 |
 
11 |
12 |
13 |
 
14 |
15 |
${name}
16 |
17 |
18 |
Login to your account
19 |
20 | 21 |
 
22 | 23 | 24 |
25 | 28 |
29 |
 
30 |
31 | 32 |
33 | 34 | 37 |
38 |
39 | 40 | 42 |
43 |
44 |
45 | 46 | 47 |
48 |
49 | 50 | Oh no! I forgot my password! 51 | 52 |
53 |
54 | 55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
 
63 |
64 |
65 | Haven't registered yet?
Create an account and spread your wings! 66 |
67 |
68 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/modalconfirmation.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/register.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 | 8 |
9 |
10 |
 
11 |
12 |
13 |
 
14 |
15 |
Register
16 |
17 | 18 |
 
19 | 20 | 21 |
22 | 25 |
26 |
 
27 |
28 | 29 |
30 | 31 | 34 |
35 | 36 |
37 | 38 | 41 |
42 | 43 |
44 | 45 | 48 |
49 | 50 |
51 | 52 | 54 |
55 | 56 |
57 | 58 | 60 |
61 | 62 |
63 | 64 | 65 |
66 | 67 |
68 | 69 |
70 |
71 |
72 |
 
73 |
74 |
75 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/settings.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
 
8 |
9 |
10 | 11 |
12 |
 
13 |
14 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/settingsaction.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |

22 |
23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/systemsettings.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
8 | 9 |
10 |
11 |
12 |
13 |
14 |
15 |

System Settings

16 |
17 |
18 |
19 |
20 |
21 |
22 | 25 |
26 |
27 |
 
28 |
29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
${symbol_pound}FieldValueEncrypted
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | 58 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/useraccount.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
 
8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 |
16 |

Account settings

17 |
Change your password here.
18 |
19 |
20 |
 
21 | 22 | 23 |
24 | 27 |
28 |
 
29 |
30 | 31 |
32 | 33 | 36 |
37 | 38 |
39 | 40 | 42 |
43 | 44 |
45 | 46 | 48 |
49 | 50 |
51 | 52 | 54 |
55 | 56 |
 
57 |
58 | 59 |
60 |
61 |
62 |
 
63 |
-------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/userdelete.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
 
8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 |

Delete Account

16 |
Delete your account permanently.
17 |
18 |
19 | 20 |
 
21 |
 
22 | 23 |
24 |
25 |

Delete your Account

26 |
27 |
28 | 29 |
 
30 | 31 |
32 |
33 |

Warning: This action will permanently delete your account in our system

34 |
35 |
36 | 37 |
 
38 | 39 |
40 |
41 |
42 | 43 |
44 |
45 |
46 |
47 |
 
48 |
49 | 50 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/userphoto.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
 
8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 |

Profile Picture

16 |
Add your latest photo. Image size should not be more than 500KB.
17 |
18 |
19 |
20 |
21 |
 
22 |
23 |
24 |
25 |
26 |
27 |
 
28 |
29 |
30 | 31 |
32 |
33 |
34 |
 
35 |
-------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/contents/userprofile.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag"%> 6 | 7 |
 
8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 |
16 |

Profile

17 |
Add or update information about yourself here.
18 |
19 |
20 |
 
21 | 22 | 23 |
24 | 27 |
28 |
 
29 |
30 | 31 |
32 | 33 | 36 |
37 | 38 |
39 | 40 | 43 |
44 | 45 |
 
46 |
47 | 48 |
49 |
50 |
51 |
 
52 |
53 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/headers/commonheader.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/pagetemplate.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> 5 | <%@ taglib prefix="template" uri="templateTag" %> 6 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/common.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 5 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | 28 | 29 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/error.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/home.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/index.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/login.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/register.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/settings.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/systemsettings.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/systemsettingsedit.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/useraccount.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/userdelete.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/userphoto.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/scripts/userprofile.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/error.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/home.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/index.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/login.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/register.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/settings.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/systemsettings.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/systemsettingsedit.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/useraccount.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/userdelete.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/userphoto.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/pages/styles/userprofile.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 5 | 6 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/__parentArtifactId__.js: -------------------------------------------------------------------------------- 1 | /** * START - Check password Strength ** */ 2 | 3 | function checkStrength($strengthLabel,$password){ 4 | var strength = 0; 5 | var minLength = 8; 6 | var number = /([0-9])/; 7 | var alphabets = /([a-zA-Z])/; 8 | var upperCase= new RegExp('[A-Z]'); 9 | var lowerCase= new RegExp('[a-z]'); 10 | var special_characters = /([~,!,@,#,$,%,^,&,*,-,_,+,=,?,>,<])/; 11 | 12 | if ($password.length >= minLength && 13 | $password.match(number) && 14 | $password.match(alphabets) && 15 | $password.match(special_characters) && 16 | $password.match(upperCase) && 17 | $password.match(lowerCase)) { 18 | $strengthLabel.hide(); 19 | return true; 20 | } else { 21 | $strengthLabel.html("Password must be at least 8 characters in length and contain the following characters: (a) uppercase letters, (b) lowercase letters, (c) numbers, and (d) special characters."); 22 | $strengthLabel.show(); 23 | return false; 24 | } 25 | } 26 | /** * END - Check password Strength ** */ -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/commonheader.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/commonheader.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/error.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/error.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/home.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/home.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/index.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/login.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/login.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/register.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/register.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/settings.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/settings.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/sidebar.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/sidebar.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/systemsettings.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/systemsettings.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/systemsettingsedit.js: -------------------------------------------------------------------------------- 1 | $('#encryptToggle').click(function() { 2 | var $id = $(this).find('.active').data("id"); 3 | var $encrypted = $(this).find('.active').data("encrypted"); 4 | window.location = "systemsettings/edit?id=" + $id + "&encrypted=" + !$encrypted; 5 | }); 6 | 7 | $('#editSetting').click(function() { 8 | var $encrypted = $(this).data("encrypted"); 9 | var $id = $(this).data("id"); 10 | window.location = "systemsettings/edit?id=" + $id + "&encrypted=" + $encrypted + "&edit=true"; 11 | }); -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/useraccount.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/useraccount.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/userdelete.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/userdelete.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/userphoto.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/userphoto.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/userprofile.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/scripts/userprofile.js -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/__parentArtifactId__.css: -------------------------------------------------------------------------------- 1 | .heading { 2 | font-weight: bolder; 3 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/common.css: -------------------------------------------------------------------------------- 1 | 2 | /*** START - Custom Image Picker ***/ 3 | .img-upload-btn { 4 | position: relative; 5 | overflow: hidden; 6 | padding-top: 95%; 7 | } 8 | 9 | .img-upload-btn input[type=file] { 10 | position: absolute; 11 | top: 0; 12 | right: 0; 13 | min-width: 100%; 14 | min-height: 100%; 15 | font-size: 100px; 16 | text-align: right; 17 | filter: alpha(opacity=0); 18 | opacity: 0; 19 | outline: none; 20 | background: white; 21 | cursor: inherit; 22 | display: block; 23 | } 24 | 25 | .img-upload-btn img { 26 | position: absolute; 27 | height: 100%; 28 | width: 100%; 29 | top: 0; 30 | left: 0; 31 | } 32 | 33 | .btn-radio { 34 | position: relative; 35 | overflow: hidden; 36 | } 37 | 38 | .btn-radio input[type=radio] { 39 | position: absolute; 40 | top: 0; 41 | right: 0; 42 | min-width: 100%; 43 | min-height: 100%; 44 | font-size: 100px; 45 | text-align: right; 46 | filter: alpha(opacity=0); 47 | opacity: 0; 48 | outline: none; 49 | background: white; 50 | cursor: inherit; 51 | display: block; 52 | } 53 | /*** END - Custom Image Picker ***/ -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/commonheader.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/commonheader.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/commonsidebar.css: -------------------------------------------------------------------------------- 1 | .system-version { 2 | position: absolute; 3 | bottom: 0px; 4 | width: 100%; 5 | } 6 | 7 | .system-version, .system-version h6 { 8 | margin: 0px; 9 | padding: 0px; 10 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/error.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/error.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/home.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/home.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/index.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/login.css: -------------------------------------------------------------------------------- 1 | .login-input { 2 | width: 360px; 3 | color: #646464; 4 | background: transparent; 5 | border: 0; 6 | outline: 0; 7 | background: transparent; 8 | border-bottom: 1px solid black; 9 | font-family: "Open Sans"; 10 | font-size: 16px; 11 | line-height: 35px; 12 | text-align: justify; 13 | margin-bottom: 19px; 14 | width: 100% 15 | } 16 | 17 | .form-label { 18 | text-align: center; 19 | color: #0E2944; 20 | font-family: "Open Sans"; 21 | font-size: 24px; 22 | line-height: 33px; 23 | padding-bottom: 45px; 24 | } 25 | 26 | .form-login-container { 27 | padding: 240px 160px 80px 80px; 28 | } 29 | 30 | @media screen and (max-width: 1200px) { 31 | .form-login-container { 32 | padding: 240px 80px 80px; 33 | } 34 | } 35 | 36 | @media screen and (max-width: 500px) { 37 | .form-login-container { 38 | padding: 240px 15px 80px 39 | } 40 | 41 | } 42 | 43 | .checkbox-label { 44 | font-family: "Open Sans"; 45 | font-style: regular; 46 | font-size: 16px; 47 | } 48 | 49 | .btn-login-adprimas { 50 | margin-top: 15px; 51 | background-color: #F3CF4D; 52 | border: 0.8px solid #F3CF4D; 53 | font-size: 21px; 54 | color: white; 55 | border-radius: 4px; 56 | width: 100% 57 | } 58 | 59 | .image-login { 60 | padding: 200px 0px 40px 0px; 61 | width: 48.95833333333333VW; 62 | } 63 | @media screen and (max-width: 990px) { 64 | .image-contaner { 65 | display: none !important; 66 | } 67 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/register.css: -------------------------------------------------------------------------------- 1 | .register-input { 2 | width: 360px; 3 | color: #646464; 4 | background: transparent; 5 | border: 0; 6 | outline: 0; 7 | background: transparent; 8 | border-bottom: 1px solid black; 9 | font-family: "Open Sans"; 10 | font-size: 16px; 11 | line-height: 35px; 12 | text-align: justify; 13 | margin-bottom: 19px; 14 | width: 100% 15 | } 16 | 17 | .form-label { 18 | text-align: center; 19 | color: #0E2944; 20 | font-family: "Open Sans"; 21 | font-size: 24px; 22 | line-height: 33px; 23 | padding-bottom: 45px; 24 | } 25 | 26 | .form-register-container { 27 | padding: 150px 160px; 28 | } 29 | 30 | @media screen and (max-width: 1200px) { 31 | .form-register-container { 32 | padding: 120px 80px; 33 | } 34 | } 35 | @media screen and (max-width: 1120px) { 36 | .image-container { 37 | display: none; 38 | } 39 | .form-register-container { 40 | width: 100%; 41 | padding: 150px 160px; 42 | } 43 | } 44 | @media screen and (max-width: 768px) { 45 | .image-container { 46 | display: none; 47 | } 48 | .form-register-container { 49 | width: 100%; 50 | padding: 180px 80px; 51 | } 52 | } 53 | @media screen and (max-width: 500px) { 54 | .image-container { 55 | display: none; 56 | } 57 | .form-register-container { 58 | width: 100%; 59 | padding: 180px 20px; 60 | } 61 | } 62 | 63 | .checkbox-label { 64 | font-family: "Open Sans"; 65 | font-style: regular; 66 | font-size: 16px; 67 | } 68 | 69 | .btn-register-adprimas { 70 | margin-top: 15px; 71 | background-color: #F3CF4D; 72 | border: 0.8px solid #F3CF4D; 73 | font-size: 21px; 74 | color: white !important; 75 | border-radius: 4px; 76 | width: 100% 77 | } 78 | 79 | .btn-register-adprimas:hover, .btn-register-adprimas:focus { 80 | background-color: #e7bd47; 81 | border: 0.8px solid #e7bd47; 82 | } 83 | 84 | .image-register { 85 | padding: 180px 80px; 86 | width: 48.95833333333333VW; 87 | } -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/settings.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/settings.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/systemsettings.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/systemsettings.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/systemsettingsedit.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/systemsettingsedit.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/useraccount.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/useraccount.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/userdelete.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/userdelete.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/userphoto.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/userphoto.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/userprofile.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ericpd/MVC-Java-11-Web-Application/c7b26746c6981cfdcc4dcac70c7836cdd8ab2da1/main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/styles/userprofile.css -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/templates/ajaxcontenttemplate.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> 5 | <%@ page isELIgnored="false" %> 6 | <%@ taglib prefix="template" uri="templateTag" %> 7 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 8 | <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 9 | 10 | <%-- Custom page styles --%> 11 | 12 | 13 | <%-- Page Content --%> 14 | 15 | 16 | <%-- Custom page scripts --%> 17 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/__rootArtifactId__-ui/src/main/webapp/templates/contentonlytemplate.jsp: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> 5 | <%@ page isELIgnored="false" %> 6 | <%@ taglib prefix="${parentArtifactId}" uri="${parentArtifactId}Tag" %> 7 | <%@ taglib prefix="template" uri="templateTag" %> 8 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 9 | <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 10 | 11 | 12 | 13 | 14 | 15 | 16 | <${parentArtifactId}:message key="Application.Title"/> 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%-- BOOTSTRAP CSS --%> 24 | 25 | 26 | <%--TODO: add other main styles here--%> 27 | 28 | 29 | <%-- Custom page styles --%> 30 | 31 | 32 | 33 | 34 |
35 | <%-- Page Content --%> 36 | 37 |
38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /main/resources/archetype-resources/suppression.xml: -------------------------------------------------------------------------------- 1 | #set( $symbol_pound = '#' ) 2 | #set( $symbol_dollar = '$' ) 3 | #set( $symbol_escape = '\' ) 4 | 5 | 6 | 9 | 10 | 11 | 12 | --------------------------------------------------------------------------------