diff --git a/karma.conf.js b/karma.conf.js index 40fe6117..6d37fe35 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -75,8 +75,6 @@ module.exports = function(config) { "./src/main/webapp/scripts/pm/conversation/add-user-modal.controller.js", - "./src/main/webapp/scripts/common/header/zfgc-header.directive.js", - "./src/main/webapp/scripts/directives/whos-online/whos-online.directive.js", "./src/main/webapp/scripts/directives/user-name-icon/user-name-icon.directive.js", @@ -85,10 +83,14 @@ module.exports = function(config) { "./src/main/webapp/scripts/directives/paginator/paginator.directive.js", + "./src/main/webapp/scripts/directives/list-view/list-view.directive.js", + "./src/main/webapp/scripts/directives/collapsible-widget/collapsible-widget.directive.js", "./src/main/webapp/scripts/directives/avatar-gallery/avatar-gallery.directive.js", + "./src/main/webapp/scripts/common/header/zfgc-header.directive.js", + "./src/main/webapp/scripts/users/users.service.js", "./src/main/webapp/scripts/users/users.controller.js", @@ -99,14 +101,14 @@ module.exports = function(config) { "./src/main/webapp/scripts/users/activation.controller.js", + "./src/main/webapp/scripts/sockets/web-socket.service.js", + "./src/main/webapp/scripts/searches/userSearches.service.js", "./src/main/webapp/scripts/searches/searches.controller.js", "./src/main/webapp/scripts/potm/potm.module.js", - "./src/main/webapp/scripts/sockets/web-socket.service.js", - "./src/main/webapp/scripts/pm/pmSend.controller.js", "./src/main/webapp/scripts/pm/pmComparator.service.js", @@ -119,12 +121,12 @@ module.exports = function(config) { "./src/main/webapp/scripts/notifications/notifications.controller.js", - "./src/main/webapp/scripts/lookups/lookups.service.js", - "./src/main/webapp/scripts/modal/modal.service.js", "./src/main/webapp/scripts/modal/modal.controller.js", + "./src/main/webapp/scripts/lookups/lookups.service.js", + "./src/main/webapp/scripts/interceptor/interceptor.service.js", "./src/main/webapp/scripts/forum/forum.service.js", @@ -135,9 +137,13 @@ module.exports = function(config) { "./src/main/webapp/scripts/forms/forms.controller.js", + "./src/main/webapp/scripts/filters/range.filter.js", + "./src/main/webapp/scripts/error/error.module.js", - "./src/main/webapp/scripts/filters/range.filter.js", + "./src/main/webapp/scripts/common/server-config.service.js", + + "./src/main/webapp/scripts/ui-bootstrap-tpls.js", "./src/main/webapp/scripts/app.js", @@ -157,10 +163,14 @@ module.exports = function(config) { "./src/main/webapp/scripts/users/users.html", + "./src/main/webapp/scripts/common/header/zfgc-header.html", + "./src/main/webapp/scripts/directives/avatar-gallery/avatar-gallery.html", "./src/main/webapp/scripts/directives/collapsible-widget/collapsible-widget.html", + "./src/main/webapp/scripts/directives/list-view/list-view.directive.html", + "./src/main/webapp/scripts/directives/paginator/paginator.html", "./src/main/webapp/scripts/directives/user-details/user-details.directive.html", @@ -169,8 +179,6 @@ module.exports = function(config) { "./src/main/webapp/scripts/directives/whos-online/whos-online.directive.html", - "./src/main/webapp/scripts/common/header/zfgc-header.html", - "./src/main/webapp/scripts/modal/templates/modalAddUserToConvo.html", "./src/main/webapp/scripts/modal/templates/modalAvatarGallery.html", @@ -187,13 +195,9 @@ module.exports = function(config) { "./src/main/webapp/scripts/modal/templates/modalValidationError.html", - "./src/main/webapp/scripts/pm/conversation/conversation.html", - "./src/main/webapp/scripts/notifications/templates/alert-template.html", - "./src/main/webapp/scripts/popover/templates/popoverMemberGroups.html", - - "./src/main/webapp/scripts/popover/templates/popoverUserDetails.html", + "./src/main/webapp/scripts/pm/conversation/conversation.html", "./src/main/webapp/scripts/pm/convobox/convoBox.html", @@ -201,6 +205,10 @@ module.exports = function(config) { "./src/main/webapp/scripts/pm/pmTwoFactor/pmTwoFactor.html", + "./src/main/webapp/scripts/popover/templates/popoverMemberGroups.html", + + "./src/main/webapp/scripts/popover/templates/popoverUserDetails.html", + "./src/main/webapp/scripts/users/member-search/member-listing.html", "./src/main/webapp/scripts/users/user-profile/account-settings.html", diff --git a/pom.xml b/pom.xml index e032b813..631d84b0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.zfgc forum - 1.1.1-LINK + 1.1.2-LINK war forum diff --git a/src/main/database/tables/SYSTEM_SETTINGS.sql b/src/main/database/tables/SYSTEM_SETTINGS.sql new file mode 100644 index 00000000..3de1a035 --- /dev/null +++ b/src/main/database/tables/SYSTEM_SETTINGS.sql @@ -0,0 +1,12 @@ +CREATE TABLE `SYSTEM_SETTINGS` ( + `SYSTEM_SETTING_ID` INT(11) NOT NULL AUTO_INCREMENT, + `VALUE` VARCHAR(50) NOT NULL, + `CODE` VARCHAR(50) NOT NULL, + `CREATED_TS` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `UPDATED_TS` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`SYSTEM_SETTING_ID`) +) +COLLATE='latin1_swedish_ci' +ENGINE=InnoDB +AUTO_INCREMENT=2 +; diff --git a/src/main/java/com/zfgc/ForumApplication.java b/src/main/java/com/zfgc/ForumApplication.java index be5c3107..ff980675 100644 --- a/src/main/java/com/zfgc/ForumApplication.java +++ b/src/main/java/com/zfgc/ForumApplication.java @@ -170,8 +170,6 @@ public void configure(ServiceProviderBuilder serviceProvider) throws Exception { .metadataManager() .refreshCheckInterval(0) .metadataTrustCheck(false) - - //.localMetadataLocation("classpath:/sp-metadata.xml") .and() .extendedMetadata() @@ -211,6 +209,7 @@ public void configure(ServiceProviderBuilder serviceProvider) throws Exception { "/lookups/**", "/contentstream/**", "/subscriptions/threads/**", + "/config/**", "/users/profile/{{\\d+}}", "/users/navigation", "/users/loggedInUser", diff --git a/src/main/java/com/zfgc/config/ZfgcSamlConfig.java b/src/main/java/com/zfgc/config/ZfgcSamlConfig.java index 6478c8dd..50abbd56 100644 --- a/src/main/java/com/zfgc/config/ZfgcSamlConfig.java +++ b/src/main/java/com/zfgc/config/ZfgcSamlConfig.java @@ -15,6 +15,7 @@ public class ZfgcSamlConfig { private String defaultSuccessUrl; private String defaultFailureUrl; private String idpSelectionPageUrl; + private String localMetaData; public String getDefaultSuccessUrl() { return defaultSuccessUrl; @@ -91,4 +92,12 @@ public void setEntityId(String entityId) { public String getEntityBaseUrl(){ return scheme + "://" + serverName + ":" + serverPort + contextPath; } + + public String getLocalMetaData() { + return localMetaData; + } + + public void setLocalMetaData(String localMetaData) { + this.localMetaData = localMetaData; + } } diff --git a/src/main/java/com/zfgc/controller/BaseController.java b/src/main/java/com/zfgc/controller/BaseController.java index a8719609..3c9c957e 100644 --- a/src/main/java/com/zfgc/controller/BaseController.java +++ b/src/main/java/com/zfgc/controller/BaseController.java @@ -8,12 +8,16 @@ import org.springframework.messaging.simp.SimpMessagingTemplate; import org.springframework.security.core.Authentication; +import com.zfgc.config.ZfgcSamlConfig; import com.zfgc.model.users.Users; public abstract class BaseController { @Autowired HttpServletRequest request; + @Autowired + ZfgcSamlConfig zfgcSamlConfig; + protected Users zfgcUser(){ Principal userPrincipal = request.getUserPrincipal(); return zfgcUser(userPrincipal); diff --git a/src/main/java/com/zfgc/controller/ConfigController.java b/src/main/java/com/zfgc/controller/ConfigController.java new file mode 100644 index 00000000..1307ca9e --- /dev/null +++ b/src/main/java/com/zfgc/controller/ConfigController.java @@ -0,0 +1,24 @@ +package com.zfgc.controller; + +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.zfgc.model.config.ServerConfig; + +@Controller +@RequestMapping(value="/config") +public class ConfigController extends BaseController { + + @RequestMapping(value="", method=RequestMethod.GET, produces="application/json") + @ResponseBody + public ResponseEntity getServerSideConfig(){ + ServerConfig config = new ServerConfig(); + config.setIdpEntityId(zfgcSamlConfig.getEntityId()); + + return ResponseEntity.ok(config); + } + +} diff --git a/src/main/java/com/zfgc/dao/SystemSettingsDao.java b/src/main/java/com/zfgc/dao/SystemSettingsDao.java new file mode 100644 index 00000000..75e7dd51 --- /dev/null +++ b/src/main/java/com/zfgc/dao/SystemSettingsDao.java @@ -0,0 +1,54 @@ +package com.zfgc.dao; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.zfgc.dbobj.SystemSettingsDbObj; +import com.zfgc.dbobj.SystemSettingsDbObjExample; +import com.zfgc.mappers.SystemSettingsDbObjMapper; +import com.zfgc.model.system.SystemSettings; + +@Component +public class SystemSettingsDao extends AbstractDao{ + + @Autowired + private SystemSettingsDbObjMapper systemSettingsDbObjMapper; + + @Override + public List get(SystemSettingsDbObjExample ex) throws RuntimeException { + return systemSettingsDbObjMapper.selectByExample(ex); + } + + @Override + public void hardDelete(SystemSettings obj) throws RuntimeException { + // TODO Auto-generated method stub + + } + + @Override + public void updateOrInsert(SystemSettings obj) throws RuntimeException { + // TODO Auto-generated method stub + + } + + @Override + public void updateByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException { + // TODO Auto-generated method stub + + } + + @Override + public Integer deleteByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException { + // TODO Auto-generated method stub + return null; + } + + @Override + public Long countByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException { + // TODO Auto-generated method stub + return null; + } + +} \ No newline at end of file diff --git a/src/main/java/com/zfgc/dataprovider/SystemSettingsDataProvider.java b/src/main/java/com/zfgc/dataprovider/SystemSettingsDataProvider.java new file mode 100644 index 00000000..56616d3a --- /dev/null +++ b/src/main/java/com/zfgc/dataprovider/SystemSettingsDataProvider.java @@ -0,0 +1,34 @@ +package com.zfgc.dataprovider; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.zfgc.dao.SystemSettingsDao; +import com.zfgc.dbobj.SystemSettingsDbObj; +import com.zfgc.dbobj.SystemSettingsDbObjExample; +import com.zfgc.exception.ZfgcNotFoundException; +import com.zfgc.model.system.SystemSettings; + +@Component +public class SystemSettingsDataProvider extends AbstractDataProvider { + + @Autowired + private SystemSettingsDao systemSettingsDao; + + public String getSystemValue(String settingName) { + SystemSettingsDbObjExample ex = systemSettingsDao.getExample(); + ex.createCriteria().andCodeEqualTo(settingName); + + List dbObj = systemSettingsDao.get(ex); + + if(dbObj.size() > 0) { + return mapper.map(dbObj.get(0), SystemSettings.class).getValue(); + } + else { + throw new ZfgcNotFoundException("The system value " + settingName + " was not found."); + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/zfgc/dataprovider/UserProfileDataProvider.java b/src/main/java/com/zfgc/dataprovider/UserProfileDataProvider.java index 80c1547b..7eb7a793 100644 --- a/src/main/java/com/zfgc/dataprovider/UserProfileDataProvider.java +++ b/src/main/java/com/zfgc/dataprovider/UserProfileDataProvider.java @@ -11,8 +11,10 @@ import com.zfgc.dao.UserPersonalInfoDao; import com.zfgc.dao.UserProfileDao; import com.zfgc.dao.UserSecuritySettingsDao; +import com.zfgc.dao.UsersDao; import com.zfgc.dbobj.BrMemberGroupUserDbObjExample; import com.zfgc.dbobj.UserProfileViewDbObj; +import com.zfgc.dbobj.UsersDbObjExample; import com.zfgc.exception.ZfgcNotFoundException; import com.zfgc.model.avatar.Avatar; import com.zfgc.model.bridge.BrMemberGroupUser; @@ -59,6 +61,9 @@ public class UserProfileDataProvider extends AbstractDataProvider { @Autowired BrMemberGroupUserDao brMemberGroupUserDao; + @Autowired + UsersDao usersDao; + public UserProfileView getUserProfile(Integer userId) throws Exception{ UserProfileViewDbObj userProfileViewDbObj = null; try{ @@ -112,6 +117,12 @@ public void saveAccountSettings(Users accountSettings) throws RuntimeException { brMemberGroupUserDao.updateOrInsert(memberGroupUser); } + Users user = new Users(); + user.setPrimaryMemberGroupId(accountSettings.getPrimaryMemberGroupId()); + UsersDbObjExample example = usersDao.getExample(); + ex.createCriteria().andUsersIdEqualTo(accountSettings.getUsersId()); + usersDao.updateByExample(user, example); + } private void updateEmailAddress(Integer usersId, String email) throws Exception { diff --git a/src/main/java/com/zfgc/dbobj/SystemSettingsDbObj.java b/src/main/java/com/zfgc/dbobj/SystemSettingsDbObj.java new file mode 100644 index 00000000..56a87d10 --- /dev/null +++ b/src/main/java/com/zfgc/dbobj/SystemSettingsDbObj.java @@ -0,0 +1,122 @@ +package com.zfgc.dbobj; + +import java.util.Date; + +public class SystemSettingsDbObj { + + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column SYSTEM_SETTINGS.SYSTEM_SETTING_ID + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + private Integer systemSettingId; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column SYSTEM_SETTINGS.VALUE + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + private String value; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column SYSTEM_SETTINGS.CODE + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + private String code; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column SYSTEM_SETTINGS.CREATED_TS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + private Date createdTs; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database column SYSTEM_SETTINGS.UPDATED_TS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + private Date updatedTs; + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column SYSTEM_SETTINGS.SYSTEM_SETTING_ID + * @return the value of SYSTEM_SETTINGS.SYSTEM_SETTING_ID + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public Integer getSystemSettingId() { + return systemSettingId; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column SYSTEM_SETTINGS.SYSTEM_SETTING_ID + * @param systemSettingId the value for SYSTEM_SETTINGS.SYSTEM_SETTING_ID + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void setSystemSettingId(Integer systemSettingId) { + this.systemSettingId = systemSettingId; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column SYSTEM_SETTINGS.VALUE + * @return the value of SYSTEM_SETTINGS.VALUE + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public String getValue() { + return value; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column SYSTEM_SETTINGS.VALUE + * @param value the value for SYSTEM_SETTINGS.VALUE + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void setValue(String value) { + this.value = value; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column SYSTEM_SETTINGS.CODE + * @return the value of SYSTEM_SETTINGS.CODE + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public String getCode() { + return code; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column SYSTEM_SETTINGS.CODE + * @param code the value for SYSTEM_SETTINGS.CODE + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void setCode(String code) { + this.code = code; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column SYSTEM_SETTINGS.CREATED_TS + * @return the value of SYSTEM_SETTINGS.CREATED_TS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public Date getCreatedTs() { + return createdTs; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column SYSTEM_SETTINGS.CREATED_TS + * @param createdTs the value for SYSTEM_SETTINGS.CREATED_TS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void setCreatedTs(Date createdTs) { + this.createdTs = createdTs; + } + + /** + * This method was generated by MyBatis Generator. This method returns the value of the database column SYSTEM_SETTINGS.UPDATED_TS + * @return the value of SYSTEM_SETTINGS.UPDATED_TS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public Date getUpdatedTs() { + return updatedTs; + } + + /** + * This method was generated by MyBatis Generator. This method sets the value of the database column SYSTEM_SETTINGS.UPDATED_TS + * @param updatedTs the value for SYSTEM_SETTINGS.UPDATED_TS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void setUpdatedTs(Date updatedTs) { + this.updatedTs = updatedTs; + } +} \ No newline at end of file diff --git a/src/main/java/com/zfgc/dbobj/SystemSettingsDbObjExample.java b/src/main/java/com/zfgc/dbobj/SystemSettingsDbObjExample.java new file mode 100644 index 00000000..a86ca1db --- /dev/null +++ b/src/main/java/com/zfgc/dbobj/SystemSettingsDbObjExample.java @@ -0,0 +1,582 @@ +package com.zfgc.dbobj; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SystemSettingsDbObjExample { + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + protected String orderByClause; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + protected boolean distinct; + /** + * This field was generated by MyBatis Generator. This field corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public SystemSettingsDbObjExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andSystemSettingIdIsNull() { + addCriterion("SYSTEM_SETTING_ID is null"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdIsNotNull() { + addCriterion("SYSTEM_SETTING_ID is not null"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdEqualTo(Integer value) { + addCriterion("SYSTEM_SETTING_ID =", value, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdNotEqualTo(Integer value) { + addCriterion("SYSTEM_SETTING_ID <>", value, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdGreaterThan(Integer value) { + addCriterion("SYSTEM_SETTING_ID >", value, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdGreaterThanOrEqualTo(Integer value) { + addCriterion("SYSTEM_SETTING_ID >=", value, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdLessThan(Integer value) { + addCriterion("SYSTEM_SETTING_ID <", value, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdLessThanOrEqualTo(Integer value) { + addCriterion("SYSTEM_SETTING_ID <=", value, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdIn(List values) { + addCriterion("SYSTEM_SETTING_ID in", values, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdNotIn(List values) { + addCriterion("SYSTEM_SETTING_ID not in", values, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdBetween(Integer value1, Integer value2) { + addCriterion("SYSTEM_SETTING_ID between", value1, value2, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andSystemSettingIdNotBetween(Integer value1, Integer value2) { + addCriterion("SYSTEM_SETTING_ID not between", value1, value2, "systemSettingId"); + return (Criteria) this; + } + + public Criteria andValueIsNull() { + addCriterion("VALUE is null"); + return (Criteria) this; + } + + public Criteria andValueIsNotNull() { + addCriterion("VALUE is not null"); + return (Criteria) this; + } + + public Criteria andValueEqualTo(String value) { + addCriterion("VALUE =", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotEqualTo(String value) { + addCriterion("VALUE <>", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThan(String value) { + addCriterion("VALUE >", value, "value"); + return (Criteria) this; + } + + public Criteria andValueGreaterThanOrEqualTo(String value) { + addCriterion("VALUE >=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThan(String value) { + addCriterion("VALUE <", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLessThanOrEqualTo(String value) { + addCriterion("VALUE <=", value, "value"); + return (Criteria) this; + } + + public Criteria andValueLike(String value) { + addCriterion("VALUE like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueNotLike(String value) { + addCriterion("VALUE not like", value, "value"); + return (Criteria) this; + } + + public Criteria andValueIn(List values) { + addCriterion("VALUE in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueNotIn(List values) { + addCriterion("VALUE not in", values, "value"); + return (Criteria) this; + } + + public Criteria andValueBetween(String value1, String value2) { + addCriterion("VALUE between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andValueNotBetween(String value1, String value2) { + addCriterion("VALUE not between", value1, value2, "value"); + return (Criteria) this; + } + + public Criteria andCodeIsNull() { + addCriterion("CODE is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("CODE is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("CODE =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("CODE <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("CODE >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("CODE >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("CODE <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("CODE <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("CODE like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("CODE not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("CODE in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("CODE not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("CODE between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("CODE not between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCreatedTsIsNull() { + addCriterion("CREATED_TS is null"); + return (Criteria) this; + } + + public Criteria andCreatedTsIsNotNull() { + addCriterion("CREATED_TS is not null"); + return (Criteria) this; + } + + public Criteria andCreatedTsEqualTo(Date value) { + addCriterion("CREATED_TS =", value, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsNotEqualTo(Date value) { + addCriterion("CREATED_TS <>", value, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsGreaterThan(Date value) { + addCriterion("CREATED_TS >", value, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsGreaterThanOrEqualTo(Date value) { + addCriterion("CREATED_TS >=", value, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsLessThan(Date value) { + addCriterion("CREATED_TS <", value, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsLessThanOrEqualTo(Date value) { + addCriterion("CREATED_TS <=", value, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsIn(List values) { + addCriterion("CREATED_TS in", values, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsNotIn(List values) { + addCriterion("CREATED_TS not in", values, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsBetween(Date value1, Date value2) { + addCriterion("CREATED_TS between", value1, value2, "createdTs"); + return (Criteria) this; + } + + public Criteria andCreatedTsNotBetween(Date value1, Date value2) { + addCriterion("CREATED_TS not between", value1, value2, "createdTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsIsNull() { + addCriterion("UPDATED_TS is null"); + return (Criteria) this; + } + + public Criteria andUpdatedTsIsNotNull() { + addCriterion("UPDATED_TS is not null"); + return (Criteria) this; + } + + public Criteria andUpdatedTsEqualTo(Date value) { + addCriterion("UPDATED_TS =", value, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsNotEqualTo(Date value) { + addCriterion("UPDATED_TS <>", value, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsGreaterThan(Date value) { + addCriterion("UPDATED_TS >", value, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsGreaterThanOrEqualTo(Date value) { + addCriterion("UPDATED_TS >=", value, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsLessThan(Date value) { + addCriterion("UPDATED_TS <", value, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsLessThanOrEqualTo(Date value) { + addCriterion("UPDATED_TS <=", value, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsIn(List values) { + addCriterion("UPDATED_TS in", values, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsNotIn(List values) { + addCriterion("UPDATED_TS not in", values, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsBetween(Date value1, Date value2) { + addCriterion("UPDATED_TS between", value1, value2, "updatedTs"); + return (Criteria) this; + } + + public Criteria andUpdatedTsNotBetween(Date value1, Date value2) { + addCriterion("UPDATED_TS not between", value1, value2, "updatedTs"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. This class corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + public static class Criterion { + private String condition; + private Object value; + private Object secondValue; + private boolean noValue; + private boolean singleValue; + private boolean betweenValue; + private boolean listValue; + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table SYSTEM_SETTINGS + * + * @mbg.generated do_not_delete_during_merge Mon May 27 13:25:36 EDT 2019 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/zfgc/mappers/SystemSettingsDbObjMapper.java b/src/main/java/com/zfgc/mappers/SystemSettingsDbObjMapper.java new file mode 100644 index 00000000..1c7c6968 --- /dev/null +++ b/src/main/java/com/zfgc/mappers/SystemSettingsDbObjMapper.java @@ -0,0 +1,77 @@ +package com.zfgc.mappers; + +import com.zfgc.dbobj.SystemSettingsDbObj; +import com.zfgc.dbobj.SystemSettingsDbObjExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface SystemSettingsDbObjMapper { + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + long countByExample(SystemSettingsDbObjExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int deleteByExample(SystemSettingsDbObjExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int deleteByPrimaryKey(Integer systemSettingId); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int insert(SystemSettingsDbObj record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int insertSelective(SystemSettingsDbObj record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + List selectByExample(SystemSettingsDbObjExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + SystemSettingsDbObj selectByPrimaryKey(Integer systemSettingId); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int updateByExampleSelective(@Param("record") SystemSettingsDbObj record, + @Param("example") SystemSettingsDbObjExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int updateByExample(@Param("record") SystemSettingsDbObj record, + @Param("example") SystemSettingsDbObjExample example); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int updateByPrimaryKeySelective(SystemSettingsDbObj record); + + /** + * This method was generated by MyBatis Generator. This method corresponds to the database table SYSTEM_SETTINGS + * @mbg.generated Mon May 27 13:46:15 EDT 2019 + */ + int updateByPrimaryKey(SystemSettingsDbObj record); +} \ No newline at end of file diff --git a/src/main/java/com/zfgc/mappers/SystemSettingsDbObjMapper.xml b/src/main/java/com/zfgc/mappers/SystemSettingsDbObjMapper.xml new file mode 100644 index 00000000..a83cbddc --- /dev/null +++ b/src/main/java/com/zfgc/mappers/SystemSettingsDbObjMapper.xml @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + SYSTEM_SETTING_ID, VALUE, CODE, CREATED_TS, UPDATED_TS + + + + + + delete from SYSTEM_SETTINGS + where SYSTEM_SETTING_ID = #{systemSettingId,jdbcType=INTEGER} + + + + delete from SYSTEM_SETTINGS + + + + + + + + SELECT MAX(SYSTEM_SETTING_ID) + 1 FROM SYSTEM_SETTINGS + + insert into SYSTEM_SETTINGS (SYSTEM_SETTING_ID, VALUE, CODE, + CREATED_TS, UPDATED_TS) + values (#{systemSettingId,jdbcType=INTEGER}, #{value,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, + #{createdTs,jdbcType=TIMESTAMP}, #{updatedTs,jdbcType=TIMESTAMP}) + + + + + SELECT MAX(SYSTEM_SETTING_ID) + 1 FROM SYSTEM_SETTINGS + + insert into SYSTEM_SETTINGS + + SYSTEM_SETTING_ID, + + VALUE, + + + CODE, + + + CREATED_TS, + + + UPDATED_TS, + + + + #{systemSettingId,jdbcType=INTEGER}, + + #{value,jdbcType=VARCHAR}, + + + #{code,jdbcType=VARCHAR}, + + + #{createdTs,jdbcType=TIMESTAMP}, + + + #{updatedTs,jdbcType=TIMESTAMP}, + + + + + + + update SYSTEM_SETTINGS + + + SYSTEM_SETTING_ID = #{record.systemSettingId,jdbcType=INTEGER}, + + + VALUE = #{record.value,jdbcType=VARCHAR}, + + + CODE = #{record.code,jdbcType=VARCHAR}, + + + CREATED_TS = #{record.createdTs,jdbcType=TIMESTAMP}, + + + UPDATED_TS = #{record.updatedTs,jdbcType=TIMESTAMP}, + + + + + + + + + update SYSTEM_SETTINGS + set SYSTEM_SETTING_ID = #{record.systemSettingId,jdbcType=INTEGER}, + VALUE = #{record.value,jdbcType=VARCHAR}, + CODE = #{record.code,jdbcType=VARCHAR}, + CREATED_TS = #{record.createdTs,jdbcType=TIMESTAMP}, + UPDATED_TS = #{record.updatedTs,jdbcType=TIMESTAMP} + + + + + + + update SYSTEM_SETTINGS + + + VALUE = #{value,jdbcType=VARCHAR}, + + + CODE = #{code,jdbcType=VARCHAR}, + + + CREATED_TS = #{createdTs,jdbcType=TIMESTAMP}, + + + UPDATED_TS = #{updatedTs,jdbcType=TIMESTAMP}, + + + where SYSTEM_SETTING_ID = #{systemSettingId,jdbcType=INTEGER} + + + + update SYSTEM_SETTINGS + set VALUE = #{value,jdbcType=VARCHAR}, + CODE = #{code,jdbcType=VARCHAR}, + CREATED_TS = #{createdTs,jdbcType=TIMESTAMP}, + UPDATED_TS = #{updatedTs,jdbcType=TIMESTAMP} + where SYSTEM_SETTING_ID = #{systemSettingId,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/java/com/zfgc/model/config/ServerConfig.java b/src/main/java/com/zfgc/model/config/ServerConfig.java new file mode 100644 index 00000000..05f3b540 --- /dev/null +++ b/src/main/java/com/zfgc/model/config/ServerConfig.java @@ -0,0 +1,21 @@ +package com.zfgc.model.config; + +import com.zfgc.model.BaseZfgcModel; + +public class ServerConfig extends BaseZfgcModel { + private String idpEntityId; + + @Override + public String getHMAC() throws Exception { + // TODO Auto-generated method stub + return null; + } + + public String getIdpEntityId() { + return idpEntityId; + } + + public void setIdpEntityId(String idpEntityId) { + this.idpEntityId = idpEntityId; + } +} diff --git a/src/main/java/com/zfgc/model/system/SystemSettings.java b/src/main/java/com/zfgc/model/system/SystemSettings.java new file mode 100644 index 00000000..ea78fbea --- /dev/null +++ b/src/main/java/com/zfgc/model/system/SystemSettings.java @@ -0,0 +1,61 @@ +package com.zfgc.model.system; + +import java.util.Date; + +import com.zfgc.model.BaseZfgcModel; + +public class SystemSettings extends BaseZfgcModel { + + private Integer systemSettingId; + private String value; + private String code; + private Date createdTs; + private Date updatedTs; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Integer getSystemSettingId() { + return systemSettingId; + } + + public void setSystemSettingId(Integer systemSettingId) { + this.systemSettingId = systemSettingId; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Date getCreatedTs() { + return createdTs; + } + + public void setCreatedTs(Date createdTs) { + this.createdTs = createdTs; + } + + public Date getUpdatedTs() { + return updatedTs; + } + + public void setUpdatedTs(Date updatedTs) { + this.updatedTs = updatedTs; + } + + @Override + public String getHMAC() throws Exception { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/java/com/zfgc/services/system/SystemService.java b/src/main/java/com/zfgc/services/system/SystemService.java new file mode 100644 index 00000000..9c23c1be --- /dev/null +++ b/src/main/java/com/zfgc/services/system/SystemService.java @@ -0,0 +1,28 @@ +package com.zfgc.services.system; + +import javax.annotation.PostConstruct; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.zfgc.dataprovider.SystemSettingsDataProvider; +import com.zfgc.services.AbstractService; +import com.zfgc.services.lookups.LookupService; + +@Component +public class SystemService extends AbstractService{ + + @Autowired + private LookupService lookups; + + @Autowired + private SystemSettingsDataProvider systemSettingsDataProvider; + + public static String TIME_ZONE = ""; + + @PostConstruct + public void initializeSystemSettings() { + TIME_ZONE = lookups.getLkupValue("TIMEZONE", Integer.parseInt(systemSettingsDataProvider.getSystemValue("TIME_ZONE"))); + } + +} diff --git a/src/main/java/com/zfgc/util/time/ZfgcTimeUtils.java b/src/main/java/com/zfgc/util/time/ZfgcTimeUtils.java index 7d7ca3b2..785b85ee 100644 --- a/src/main/java/com/zfgc/util/time/ZfgcTimeUtils.java +++ b/src/main/java/com/zfgc/util/time/ZfgcTimeUtils.java @@ -6,11 +6,17 @@ import java.util.TimeZone; import org.apache.commons.lang3.time.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import com.zfgc.services.system.SystemService; + public class ZfgcTimeUtils extends DateUtils { public static final long MILIS_PER_YEAR = 31540000000L; + @Autowired + private static SystemService systemService; + public static String createDateAsString(String timeInMs){ Long result = Long.parseLong(timeInMs); SimpleDateFormat sdf = ZfgcTimeUtils.getZfgcSimpleDateTimeFormat(); @@ -20,7 +26,7 @@ public static String createDateAsString(String timeInMs){ public static SimpleDateFormat getZfgcSimpleDateTimeFormat(){ SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss"); - sdf.setTimeZone(TimeZone.getTimeZone("GMT")); + sdf.setTimeZone(TimeZone.getTimeZone(SystemService.TIME_ZONE)); return sdf; } @@ -34,7 +40,7 @@ public static SimpleDateFormat getZfgcSimpleDateTimeFormat(String timezone){ public static SimpleDateFormat getZfgcSimpleDateFormat(){ SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); - sdf.setTimeZone(TimeZone.getTimeZone("GMT")); + sdf.setTimeZone(TimeZone.getTimeZone(SystemService.TIME_ZONE)); return sdf; } diff --git a/src/main/resources/dbmappers/EmailAddressDbObjMapper.xml b/src/main/resources/dbmappers/EmailAddressDbObjMapper.xml index 58240f7a..6076678a 100644 --- a/src/main/resources/dbmappers/EmailAddressDbObjMapper.xml +++ b/src/main/resources/dbmappers/EmailAddressDbObjMapper.xml @@ -207,4 +207,4 @@ - + \ No newline at end of file diff --git a/src/main/resources/dbmappers/SystemSettingsDbObjMapper.xml b/src/main/resources/dbmappers/SystemSettingsDbObjMapper.xml new file mode 100644 index 00000000..a83cbddc --- /dev/null +++ b/src/main/resources/dbmappers/SystemSettingsDbObjMapper.xml @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + SYSTEM_SETTING_ID, VALUE, CODE, CREATED_TS, UPDATED_TS + + + + + + delete from SYSTEM_SETTINGS + where SYSTEM_SETTING_ID = #{systemSettingId,jdbcType=INTEGER} + + + + delete from SYSTEM_SETTINGS + + + + + + + + SELECT MAX(SYSTEM_SETTING_ID) + 1 FROM SYSTEM_SETTINGS + + insert into SYSTEM_SETTINGS (SYSTEM_SETTING_ID, VALUE, CODE, + CREATED_TS, UPDATED_TS) + values (#{systemSettingId,jdbcType=INTEGER}, #{value,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, + #{createdTs,jdbcType=TIMESTAMP}, #{updatedTs,jdbcType=TIMESTAMP}) + + + + + SELECT MAX(SYSTEM_SETTING_ID) + 1 FROM SYSTEM_SETTINGS + + insert into SYSTEM_SETTINGS + + SYSTEM_SETTING_ID, + + VALUE, + + + CODE, + + + CREATED_TS, + + + UPDATED_TS, + + + + #{systemSettingId,jdbcType=INTEGER}, + + #{value,jdbcType=VARCHAR}, + + + #{code,jdbcType=VARCHAR}, + + + #{createdTs,jdbcType=TIMESTAMP}, + + + #{updatedTs,jdbcType=TIMESTAMP}, + + + + + + + update SYSTEM_SETTINGS + + + SYSTEM_SETTING_ID = #{record.systemSettingId,jdbcType=INTEGER}, + + + VALUE = #{record.value,jdbcType=VARCHAR}, + + + CODE = #{record.code,jdbcType=VARCHAR}, + + + CREATED_TS = #{record.createdTs,jdbcType=TIMESTAMP}, + + + UPDATED_TS = #{record.updatedTs,jdbcType=TIMESTAMP}, + + + + + + + + + update SYSTEM_SETTINGS + set SYSTEM_SETTING_ID = #{record.systemSettingId,jdbcType=INTEGER}, + VALUE = #{record.value,jdbcType=VARCHAR}, + CODE = #{record.code,jdbcType=VARCHAR}, + CREATED_TS = #{record.createdTs,jdbcType=TIMESTAMP}, + UPDATED_TS = #{record.updatedTs,jdbcType=TIMESTAMP} + + + + + + + update SYSTEM_SETTINGS + + + VALUE = #{value,jdbcType=VARCHAR}, + + + CODE = #{code,jdbcType=VARCHAR}, + + + CREATED_TS = #{createdTs,jdbcType=TIMESTAMP}, + + + UPDATED_TS = #{updatedTs,jdbcType=TIMESTAMP}, + + + where SYSTEM_SETTING_ID = #{systemSettingId,jdbcType=INTEGER} + + + + update SYSTEM_SETTINGS + set VALUE = #{value,jdbcType=VARCHAR}, + CODE = #{code,jdbcType=VARCHAR}, + CREATED_TS = #{createdTs,jdbcType=TIMESTAMP}, + UPDATED_TS = #{updatedTs,jdbcType=TIMESTAMP} + where SYSTEM_SETTING_ID = #{systemSettingId,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml index 08901d9a..43fc1a63 100644 --- a/src/main/resources/generatorConfig.xml +++ b/src/main/resources/generatorConfig.xml @@ -22,11 +22,15 @@ - +
+ +
+ + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -73,71 +74,74 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/scripts/common/header/zfgc-header.directive.js b/src/main/webapp/scripts/common/header/zfgc-header.directive.js index 475674c1..ca86d3b5 100644 --- a/src/main/webapp/scripts/common/header/zfgc-header.directive.js +++ b/src/main/webapp/scripts/common/header/zfgc-header.directive.js @@ -1,7 +1,7 @@ (function(){ 'use strict'; - function zfgcHeader($rootScope, UserService, $q, $window, $location, $resource, $state, $timeout, WebsocketService, WhosOnlineService) { + function zfgcHeader($rootScope, UserService, $q, $window, $location, $resource, $state, $timeout, ServerConfigService, WebsocketService, WhosOnlineService) { return { restrict: 'E', transclude: true, @@ -29,7 +29,7 @@ scope.goToIdp = function(){ var returnTo = $location.absUrl(); - $window.location = "http://devidp.zfgc.com/saml2/idp/SSOService.php?spentityid=zfgc-sp&target=" + returnTo; + $window.location = "http://devidp.zfgc.com/saml2/idp/SSOService.php?spentityid=" + ServerConfigService.config.idpEntityId + "&target=" + returnTo; }; scope.startListener = function() { @@ -51,5 +51,5 @@ angular .module("zfgc.forum") - .directive("zfgcHeader", ['$rootScope','UserService', '$q', '$window', '$location', '$resource', '$state', '$timeout', 'WebsocketService', 'WhosOnlineService', zfgcHeader]); + .directive("zfgcHeader", ['$rootScope','UserService', '$q', '$window', '$location', '$resource', '$state', '$timeout', 'ServerConfigService', 'WebsocketService', 'WhosOnlineService', zfgcHeader]); })(); \ No newline at end of file diff --git a/src/main/webapp/scripts/common/server-config.service.js b/src/main/webapp/scripts/common/server-config.service.js new file mode 100644 index 00000000..2a2f57a5 --- /dev/null +++ b/src/main/webapp/scripts/common/server-config.service.js @@ -0,0 +1,16 @@ +(function(){ + + function ServerConfigService($resource){ + var service = {}; + + service.config = $resource('/forum/config',{}).get(); + + return service; + + + } + + angular.module('zfgc.forum') + .service('ServerConfigService',['$resource',ServerConfigService]); + +})(); \ No newline at end of file diff --git a/src/main/webapp/scripts/modal/modal.service.js b/src/main/webapp/scripts/modal/modal.service.js index f4c4c117..b01752a1 100644 --- a/src/main/webapp/scripts/modal/modal.service.js +++ b/src/main/webapp/scripts/modal/modal.service.js @@ -71,7 +71,11 @@ ModalService.currentDialog = $uibModal.open({ templateUrl: 'scripts/modal/templates/modalValidationError.html', windowClass: 'ngdialog-theme-default', - controller: 'ModalCtrl as vm'}); + controller: 'ModalCtrl as vm', + resolve : { + params: null + } + }); } ModalService.closeValidationErrors = function(){ diff --git a/src/main/webapp/scripts/modal/templates/modalValidationError.html b/src/main/webapp/scripts/modal/templates/modalValidationError.html index f3a12eb2..07c11057 100644 --- a/src/main/webapp/scripts/modal/templates/modalValidationError.html +++ b/src/main/webapp/scripts/modal/templates/modalValidationError.html @@ -1,25 +1,28 @@