- *
- * @version 1.1
*/
public interface FusionObject {
+ /**
+ * Inner class provides static constants to any class that implements the
+ * interface.
+ */
public class Parameters {
+
+ private Parameters() {
+ // Static content only
+ }
+
// HashMap parameters passed to the Service and Dao tiers
public static final String PARAM_USERID = "userId";
public static final String PARAM_HTTP_REQUEST = "request";
@@ -67,46 +70,39 @@ public interface FusionObject {
}
/**
- *
- * Title: FusionObject.Utilities
- *
- *
- *
- * Description: Inner class that has some utility functions available for
- * any class that implements it.
- *
- *
- *
- * Copyright: Copyright (c) 2007
- *
- *
- * @version 1.1
+ * Inner class provides static utility functions to any class that implements
+ * the interface.
*/
public class Utilities {
+
+ private Utilities() {
+ // Static content only
+ }
+
/**
* nvl - replaces a string value with an empty string if null.
*
* @param s
* String - the string value that needs to be checked
- * @return String - returns the original string value if not null.
- * Otherwise an empty string ("") is returned.
+ * @return String - returns the original string value if not null. Otherwise an
+ * empty string ("") is returned.
*/
public static String nvl(String s) {
- return (s == null) ? "" : s;
+ return s == null ? "" : s;
}
/**
- * nvl - replaces a string value with a default value if null.
+ * nvl - replaces a string value with a default value if null or empty.
*
* @param s
* String - the string value that needs to be checked
* @param sDefault
* String - the default value
- * @return String - returns the original string value if not null.
+ * @return String - returns the original string value if not null nor empty.
* Otherwise the default value is returned.
*/
public static String nvl(String s, String sDefault) {
- return nvl(s).equals("") ? sDefault : s;
+ return "".equals(nvl(s)) ? sDefault : s;
}
/**
@@ -118,10 +114,7 @@ public interface FusionObject {
* sequence "null" (ignoring case); otherwise false.
*/
public static boolean isNull(String a) {
- if ((a == null) || (a.length() == 0) || a.equalsIgnoreCase("null"))
- return true;
- else
- return false;
+ return a == null || a.length() == 0 || a.equalsIgnoreCase("null");
}
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java
index 7fe4f632..baebac2f 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/auth/LoginStrategy.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,6 +37,7 @@
*/
package org.onap.portalsdk.core.auth;
+import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -71,65 +72,45 @@ public abstract class LoginStrategy {
@Autowired
private LoginService loginService;
-
+
@Autowired
- RoleService roleService;
+ private RoleService roleService;
public abstract ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception;
public abstract String getUserId(HttpServletRequest request) throws PortalAPIException;
- public ModelAndView doExternalLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
-
+ public ModelAndView doExternalLogin(HttpServletRequest request, HttpServletResponse response) throws IOException {
+
invalidateExistingSession(request);
- Map model = new HashMap();
LoginBean commandBean = new LoginBean();
String loginId = request.getParameter("loginId");
String password = request.getParameter("password");
commandBean.setLoginId(loginId);
commandBean.setLoginPwd(password);
- HashMap additionalParamsMap = new HashMap();
-
- // Get the client device type and pass it into LoginService for audit
- // logging.
- /**
- * ClientDeviceType clientDevice = (ClientDeviceType)request.getAttribut
- * (SystemProperties.getProperty(SystemProperties.CLIENT_DEVICE_ATTRIBUTE_NAME));
- * additionalParamsMap.put(Parameters.PARAM_CLIENT_DEVICE,
- * clientDevice);
- **/
commandBean = loginService.findUser(commandBean,
- (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), additionalParamsMap);
- List roleFunctionList= roleService.getRoleFunctions(loginId);
-
-
+ (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), new HashMap());
+ List roleFunctionList = roleService.getRoleFunctions(loginId);
if (commandBean.getUser() == null) {
String loginErrorMessage = (commandBean.getLoginErrorMessage() != null) ? commandBean.getLoginErrorMessage()
: "login.error.external.invalid";
+ Map model = new HashMap<>();
model.put("error", loginErrorMessage);
-
- String[] errorCodes = new String[1];
- errorCodes[0] = loginErrorMessage;
-
return new ModelAndView("login_external", "model", model);
-
} else {
// store the currently logged in user's information in the session
UserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(),
commandBean.getBusinessDirectMenu(),
SystemProperties.getProperty(SystemProperties.LOGIN_METHOD_BACKDOOR), roleFunctionList);
initateSessionMgtHandler(request);
-
// user has been authenticated, now take them to the welcome page
- // return new ModelAndView("redirect:/profile_search");
return new ModelAndView("redirect:welcome.htm");
-
}
}
-
- protected void invalidateExistingSession(HttpServletRequest request){
+
+ protected void invalidateExistingSession(HttpServletRequest request) {
request.getSession().invalidate();
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java
index 0f156bce..dc6806a8 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/LoginBean.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -44,163 +44,170 @@ import org.onap.portalsdk.core.domain.support.FusionCommand;
public class LoginBean extends FusionCommand {
- private String loginId;
- private String loginPwd;
- private String hrid;
- private String userid;
- private String siteAccess;
- private String loginErrorMessage;
-
- private User user;
- @SuppressWarnings("rawtypes")
- private Set menu;
- @SuppressWarnings("rawtypes")
- private Set businessDirectMenu;
-
- /**
- * getLoginId
- *
- * @return String
- */
- public String getLoginId() {
- return loginId;
- }
-
- /**
- * getLoginPwd
- *
- * @return String
- */
- public String getLoginPwd() {
- return loginPwd;
- }
-
- /**
- * getMenu
- *
- * @return Set
- */
- @SuppressWarnings("rawtypes")
- public Set getMenu() {
- return menu;
- }
-
- /**
- * getUser
- *
- * @return User
- */
- public User getUser() {
- return user;
- }
-
- /**
- * getHrid
- *
- * @return String
- */
- public String getHrid() {
- return hrid;
- }
-
- /**
- * getSiteAccess
- *
- * @return String
- */
- public String getSiteAccess() {
- return siteAccess;
- }
-
- /**
- * getBusinessDirectMenu
- *
- * @return Set
- */
- @SuppressWarnings("rawtypes")
- public Set getBusinessDirectMenu() {
- return businessDirectMenu;
- }
-
- /**
- * getLoginErrorMessage
- *
- * @return String
- */
- public String getLoginErrorMessage() {
- return loginErrorMessage;
- }
-
- /**
- * setLoginId
- *
- * @param loginId String
- */
- public void setLoginId(String loginId) {
- this.loginId = loginId;
- }
-
- /**
- * setLoginPwd
- *
- * @param loginPwd String
- */
- public void setLoginPwd(String loginPwd) {
- this.loginPwd = loginPwd;
- }
-
- @SuppressWarnings("rawtypes")
- public void setMenu(Set menu) {
- this.menu = menu;
- }
-
- /**
- * setUser
- *
- * @param user User
- */
- public void setUser(User user) {
- this.user = user;
- }
-
- /**
- * setHrid
- *
- * @param hrid String
- */
- public void setHrid(String hrid) {
- this.hrid = hrid;
- }
-
- /**
- * setSiteAccess
- *
- * @param siteAccess String
- */
- public void setSiteAccess(String siteAccess) {
- this.siteAccess = siteAccess;
- }
-
- /**
- * setBusinessDirectMenu
- *
- * @param businessDirectMenu Set
- */
- @SuppressWarnings("rawtypes")
- public void setBusinessDirectMenu(Set businessDirectMenu) {
- this.businessDirectMenu = businessDirectMenu;
- }
-
- /**
- * setLoginErrorMessage
- *
- * @param loginErrorMessage String
- */
- public void setLoginErrorMessage(String loginErrorMessage) {
- this.loginErrorMessage = loginErrorMessage;
- }
-
- public String getUserid() {
+ private String loginId;
+ private String loginPwd;
+ private String hrid;
+ private String userid;
+ private String siteAccess;
+ private String loginErrorMessage;
+
+ private User user;
+ @SuppressWarnings("rawtypes")
+ private Set menu;
+ @SuppressWarnings("rawtypes")
+ private Set businessDirectMenu;
+
+ /**
+ * getLoginId
+ *
+ * @return String
+ */
+ public String getLoginId() {
+ return loginId;
+ }
+
+ /**
+ * getLoginPwd
+ *
+ * @return String
+ */
+ public String getLoginPwd() {
+ return loginPwd;
+ }
+
+ /**
+ * getMenu
+ *
+ * @return Set
+ */
+ @SuppressWarnings("rawtypes")
+ public Set getMenu() {
+ return menu;
+ }
+
+ /**
+ * getUser
+ *
+ * @return User
+ */
+ public User getUser() {
+ return user;
+ }
+
+ /**
+ * getHrid
+ *
+ * @return String
+ */
+ public String getHrid() {
+ return hrid;
+ }
+
+ /**
+ * getSiteAccess
+ *
+ * @return String
+ */
+ public String getSiteAccess() {
+ return siteAccess;
+ }
+
+ /**
+ * getBusinessDirectMenu
+ *
+ * @return Set
+ */
+ @SuppressWarnings("rawtypes")
+ public Set getBusinessDirectMenu() {
+ return businessDirectMenu;
+ }
+
+ /**
+ * getLoginErrorMessage
+ *
+ * @return String
+ */
+ public String getLoginErrorMessage() {
+ return loginErrorMessage;
+ }
+
+ /**
+ * setLoginId
+ *
+ * @param loginId
+ * String
+ */
+ public void setLoginId(String loginId) {
+ this.loginId = loginId;
+ }
+
+ /**
+ * setLoginPwd
+ *
+ * @param loginPwd
+ * String
+ */
+ public void setLoginPwd(String loginPwd) {
+ this.loginPwd = loginPwd;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public void setMenu(Set menu) {
+ this.menu = menu;
+ }
+
+ /**
+ * setUser
+ *
+ * @param user
+ * User
+ */
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ /**
+ * setHrid
+ *
+ * @param hrid
+ * String
+ */
+ public void setHrid(String hrid) {
+ this.hrid = hrid;
+ }
+
+ /**
+ * setSiteAccess
+ *
+ * @param siteAccess
+ * String
+ */
+ public void setSiteAccess(String siteAccess) {
+ this.siteAccess = siteAccess;
+ }
+
+ /**
+ * setBusinessDirectMenu
+ *
+ * @param businessDirectMenu
+ * Set
+ */
+ @SuppressWarnings("rawtypes")
+ public void setBusinessDirectMenu(Set businessDirectMenu) {
+ this.businessDirectMenu = businessDirectMenu;
+ }
+
+ /**
+ * setLoginErrorMessage
+ *
+ * @param loginErrorMessage
+ * String
+ */
+ public void setLoginErrorMessage(String loginErrorMessage) {
+ this.loginErrorMessage = loginErrorMessage;
+ }
+
+ public String getUserid() {
return userid;
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java
index 89052495..005ecd5e 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostDroolsBean.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -42,28 +42,32 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@JsonSerialize
public class PostDroolsBean {
- private String droolsFile;
- private String className;
- private String selectedRules;
-
+ private String droolsFile;
+ private String className;
+ private String selectedRules;
+
public String getDroolsFile() {
return droolsFile;
}
+
public void setDroolsFile(String droolsFile) {
this.droolsFile = droolsFile;
}
+
public String getSelectedRules() {
return selectedRules;
}
+
public void setSelectedRules(String selectedRules) {
this.selectedRules = selectedRules;
}
+
public String getClassName() {
return className;
}
+
public void setClassName(String className) {
this.className = className;
- }
+ }
-
-}
+}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java
index 3b32364e..b18cfc93 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/PostSearchBean.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -47,271 +47,347 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@JsonSerialize
public class PostSearchBean extends SearchBase {
- private User user = null;
- private User userOrig = null;
- private String[] selected;
- private String[] postHrid;
- private String[] postOrgUserId;
- private String[] postFirstName;
- private String[] postLastName;
- private String[] postOrgCode;
- private String[] postPhone;
- private String[] postEmail;
- private String[] postAddress1;
- private String[] postAddress2;
- private String[] postCity;
- private String[] postState;
- private String[] postZipCode;
- private String[] postLocationClli;
- private String[] postBusinessCountryCode;
- private String[] postBusinessCountryName;
- private String[] postDepartment;
- private String[] postDepartmentName;
- private String[] postBusinessUnit;
- private String[] postBusinessUnitName;
- private String[] postJobTitle;
- private String[] postOrgManagerUserId;
- private String[] postCommandChain;
- private String[] postCompanyCode;
- private String[] postCompany;
- private String[] postCostCenter;
- private String[] postSiloStatus;
- private String[] postFinancialLocCode;
-
-
- @SuppressWarnings("rawtypes")
- public PostSearchBean() {
- this(null);
- } // PostSearchBean
-
- @SuppressWarnings("rawtypes")
- public PostSearchBean(List items) {
- super(items);
-
- user = new User();
- userOrig = new User();
-
- setSortBy1("");
- setSortBy1Orig("");
-
- //setSortByList(...);
- } // PostSearchBean
-
-
- public String getFirstName() { return user.getFirstName(); }
- public String getLastName() { return user.getLastName(); }
- public String getHrid() { return user.getHrid(); }
- public String getOrgUserId() { return user.getOrgUserId(); }
- public String getOrgCode() { return user.getOrgCode(); }
- public String getEmail() { return user.getEmail(); }
- public String getOrgManagerUserId() { return user.getOrgManagerUserId(); }
-
- public String getFirstNameOrig() { return user.getFirstName(); }
- public String getLastNameOrig() { return user.getLastName(); }
- public String getHridOrig() { return user.getHrid(); }
- public String getOrgUserIdOrig() { return user.getOrgUserId(); }
- public String getOrgCodeOrig() { return user.getOrgCode(); }
- public String getEmailOrig() { return user.getEmail(); }
- public String getOrgManagerUserIdOrig() { return user.getOrgManagerUserId(); }
-
-
- public User getUser() { return user; }
-
- public String[] getPostEmail() {
- return postEmail;
- }
-
- public String[] getPostFirstName() {
- return postFirstName;
- }
-
- public String[] getPostHrid() {
- return postHrid;
- }
-
- public String[] getPostLastName() {
- return postLastName;
- }
-
- public String[] getPostOrgCode() {
- return postOrgCode;
- }
-
- public String[] getPostPhone() {
- return postPhone;
- }
-
- public String[] getPostOrgUserId() {
- return postOrgUserId;
- }
-
- public String[] getSelected() {
- return selected;
- }
-
- public String[] getPostAddress1() {
- return postAddress1;
- }
-
- public String[] getPostBusinessCountryCode() {
- return postBusinessCountryCode;
- }
-
- public String[] getPostCity() {
- return postCity;
- }
-
- public String[] getPostCommandChain() {
- return postCommandChain;
- }
-
- public String[] getPostCompany() {
- return postCompany;
- }
-
- public String[] getPostCompanyCode() {
- return postCompanyCode;
- }
-
- public String[] getPostDepartment() {
- return postDepartment;
- }
-
- public String[] getPostDepartmentName() {
- return postDepartmentName;
- }
-
- public String[] getPostBusinessCountryName() {
- return postBusinessCountryName;
- }
-
- public String[] getPostJobTitle() {
- return postJobTitle;
- }
-
- public String[] getPostLocationClli() {
- return postLocationClli;
- }
-
- public String[] getPostOrgManagerUserId() {
- return postOrgManagerUserId;
- }
-
- public String[] getPostState() {
- return postState;
- }
-
- public String[] getPostZipCode() {
- return postZipCode;
- }
-
- public void setFirstName(String value) { user.setFirstName(value); }
- public void setLastName(String value) { user.setLastName(value); }
- public void setHrid(String value) { user.setHrid(value); }
- public void setOrgUserId(String value) { user.setOrgUserId(value); }
- public void setOrgCode(String value) { user.setOrgCode(value); }
- public void setEmail(String value) { user.setEmail(value); }
- public void setOrgManagerUserId(String value) { user.setOrgManagerUserId(value); }
-
- public void setFirstNameOrig(String value) { userOrig.setFirstName(value); }
- public void setLastNameOrig(String value) { userOrig.setLastName(value); }
- public void setHridOrig(String value) { userOrig.setHrid(value); }
- public void setOrgUserIdOrig(String value) { userOrig.setOrgUserId(value); }
- public void setOrgCodeOrig(String value) { userOrig.setOrgCode(value); }
- public void setEmailOrig(String value) { userOrig.setEmail(value); }
- public void setOrgManagerUserIdOrig(String value) { userOrig.setOrgManagerUserId(value); }
-
- public void setUser(User value) { this.user = value; }
-
- public void setPostEmail(String[] postEmail) {
- this.postEmail = postEmail;
- }
-
- public void setPostFirstName(String[] postFirstName) {
- this.postFirstName = postFirstName;
- }
-
- public void setPostHrid(String[] postHrid) {
- this.postHrid = postHrid;
- }
-
- public void setPostLastName(String[] postLastName) {
- this.postLastName = postLastName;
- }
-
- public void setPostOrgCode(String[] postOrgCode) {
- this.postOrgCode = postOrgCode;
- }
-
- public void setPostPhone(String[] postPhone) {
- this.postPhone = postPhone;
- }
-
- public void setPostOrgUserId(String[] postOrgUserId) {
- this.postOrgUserId = postOrgUserId;
- }
-
- public void setSelected(String[] selected) {
- this.selected = selected;
- }
-
- public void setPostAddress1(String[] postAddress1) {
- this.postAddress1 = postAddress1;
- }
-
- public void setPostBusinessCountryCode(String[] postBusinessCountryCode) {
- this.postBusinessCountryCode = postBusinessCountryCode;
- }
-
- public void setPostCity(String[] postCity) {
- this.postCity = postCity;
- }
-
- public void setPostCommandChain(String[] postCommandChain) {
- this.postCommandChain = postCommandChain;
- }
-
- public void setPostCompany(String[] postCompany) {
- this.postCompany = postCompany;
- }
-
- public void setPostCompanyCode(String[] postCompanyCode) {
- this.postCompanyCode = postCompanyCode;
- }
-
- public void setPostDepartment(String[] postDepartment) {
- this.postDepartment = postDepartment;
- }
-
- public void setPostDepartmentName(String[] postDepartmentName) {
- this.postDepartmentName = postDepartmentName;
- }
-
- public void setPostBusinessCountryName(String[] postBusinessCountryName) {
- this.postBusinessCountryName = postBusinessCountryName;
- }
-
- public void setPostJobTitle(String[] postJobTitle) {
- this.postJobTitle = postJobTitle;
- }
-
- public void setPostLocationClli(String[] postLocationClli) {
- this.postLocationClli = postLocationClli;
- }
-
- public void setPostOrgManagerUserId(String[] postOrgManagerUserId) {
- this.postOrgManagerUserId = postOrgManagerUserId;
- }
-
- public void setPostState(String[] postState) {
- this.postState = postState;
- }
-
- public void setPostZipCode(String[] postZipCode) {
- this.postZipCode = postZipCode;
- }
-
- public String[] getPostAddress2() {
+ private User user = null;
+ private User userOrig = null;
+ private String[] selected;
+ private String[] postHrid;
+ private String[] postOrgUserId;
+ private String[] postFirstName;
+ private String[] postLastName;
+ private String[] postOrgCode;
+ private String[] postPhone;
+ private String[] postEmail;
+ private String[] postAddress1;
+ private String[] postAddress2;
+ private String[] postCity;
+ private String[] postState;
+ private String[] postZipCode;
+ private String[] postLocationClli;
+ private String[] postBusinessCountryCode;
+ private String[] postBusinessCountryName;
+ private String[] postDepartment;
+ private String[] postDepartmentName;
+ private String[] postBusinessUnit;
+ private String[] postBusinessUnitName;
+ private String[] postJobTitle;
+ private String[] postOrgManagerUserId;
+ private String[] postCommandChain;
+ private String[] postCompanyCode;
+ private String[] postCompany;
+ private String[] postCostCenter;
+ private String[] postSiloStatus;
+ private String[] postFinancialLocCode;
+
+ public PostSearchBean() {
+ this(null);
+ }
+
+ @SuppressWarnings("rawtypes")
+ public PostSearchBean(List items) {
+ super(items);
+ user = new User();
+ userOrig = new User();
+ setSortBy1("");
+ setSortBy1Orig("");
+ }
+
+ public String getFirstName() {
+ return user.getFirstName();
+ }
+
+ public String getLastName() {
+ return user.getLastName();
+ }
+
+ public String getHrid() {
+ return user.getHrid();
+ }
+
+ public String getOrgUserId() {
+ return user.getOrgUserId();
+ }
+
+ public String getOrgCode() {
+ return user.getOrgCode();
+ }
+
+ public String getEmail() {
+ return user.getEmail();
+ }
+
+ public String getOrgManagerUserId() {
+ return user.getOrgManagerUserId();
+ }
+
+ public String getFirstNameOrig() {
+ return user.getFirstName();
+ }
+
+ public String getLastNameOrig() {
+ return user.getLastName();
+ }
+
+ public String getHridOrig() {
+ return user.getHrid();
+ }
+
+ public String getOrgUserIdOrig() {
+ return user.getOrgUserId();
+ }
+
+ public String getOrgCodeOrig() {
+ return user.getOrgCode();
+ }
+
+ public String getEmailOrig() {
+ return user.getEmail();
+ }
+
+ public String getOrgManagerUserIdOrig() {
+ return user.getOrgManagerUserId();
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public String[] getPostEmail() {
+ return postEmail;
+ }
+
+ public String[] getPostFirstName() {
+ return postFirstName;
+ }
+
+ public String[] getPostHrid() {
+ return postHrid;
+ }
+
+ public String[] getPostLastName() {
+ return postLastName;
+ }
+
+ public String[] getPostOrgCode() {
+ return postOrgCode;
+ }
+
+ public String[] getPostPhone() {
+ return postPhone;
+ }
+
+ public String[] getPostOrgUserId() {
+ return postOrgUserId;
+ }
+
+ public String[] getSelected() {
+ return selected;
+ }
+
+ public String[] getPostAddress1() {
+ return postAddress1;
+ }
+
+ public String[] getPostBusinessCountryCode() {
+ return postBusinessCountryCode;
+ }
+
+ public String[] getPostCity() {
+ return postCity;
+ }
+
+ public String[] getPostCommandChain() {
+ return postCommandChain;
+ }
+
+ public String[] getPostCompany() {
+ return postCompany;
+ }
+
+ public String[] getPostCompanyCode() {
+ return postCompanyCode;
+ }
+
+ public String[] getPostDepartment() {
+ return postDepartment;
+ }
+
+ public String[] getPostDepartmentName() {
+ return postDepartmentName;
+ }
+
+ public String[] getPostBusinessCountryName() {
+ return postBusinessCountryName;
+ }
+
+ public String[] getPostJobTitle() {
+ return postJobTitle;
+ }
+
+ public String[] getPostLocationClli() {
+ return postLocationClli;
+ }
+
+ public String[] getPostOrgManagerUserId() {
+ return postOrgManagerUserId;
+ }
+
+ public String[] getPostState() {
+ return postState;
+ }
+
+ public String[] getPostZipCode() {
+ return postZipCode;
+ }
+
+ public void setFirstName(String value) {
+ user.setFirstName(value);
+ }
+
+ public void setLastName(String value) {
+ user.setLastName(value);
+ }
+
+ public void setHrid(String value) {
+ user.setHrid(value);
+ }
+
+ public void setOrgUserId(String value) {
+ user.setOrgUserId(value);
+ }
+
+ public void setOrgCode(String value) {
+ user.setOrgCode(value);
+ }
+
+ public void setEmail(String value) {
+ user.setEmail(value);
+ }
+
+ public void setOrgManagerUserId(String value) {
+ user.setOrgManagerUserId(value);
+ }
+
+ public void setFirstNameOrig(String value) {
+ userOrig.setFirstName(value);
+ }
+
+ public void setLastNameOrig(String value) {
+ userOrig.setLastName(value);
+ }
+
+ public void setHridOrig(String value) {
+ userOrig.setHrid(value);
+ }
+
+ public void setOrgUserIdOrig(String value) {
+ userOrig.setOrgUserId(value);
+ }
+
+ public void setOrgCodeOrig(String value) {
+ userOrig.setOrgCode(value);
+ }
+
+ public void setEmailOrig(String value) {
+ userOrig.setEmail(value);
+ }
+
+ public void setOrgManagerUserIdOrig(String value) {
+ userOrig.setOrgManagerUserId(value);
+ }
+
+ public void setUser(User value) {
+ this.user = value;
+ }
+
+ public void setPostEmail(String[] postEmail) {
+ this.postEmail = postEmail;
+ }
+
+ public void setPostFirstName(String[] postFirstName) {
+ this.postFirstName = postFirstName;
+ }
+
+ public void setPostHrid(String[] postHrid) {
+ this.postHrid = postHrid;
+ }
+
+ public void setPostLastName(String[] postLastName) {
+ this.postLastName = postLastName;
+ }
+
+ public void setPostOrgCode(String[] postOrgCode) {
+ this.postOrgCode = postOrgCode;
+ }
+
+ public void setPostPhone(String[] postPhone) {
+ this.postPhone = postPhone;
+ }
+
+ public void setPostOrgUserId(String[] postOrgUserId) {
+ this.postOrgUserId = postOrgUserId;
+ }
+
+ public void setSelected(String[] selected) {
+ this.selected = selected;
+ }
+
+ public void setPostAddress1(String[] postAddress1) {
+ this.postAddress1 = postAddress1;
+ }
+
+ public void setPostBusinessCountryCode(String[] postBusinessCountryCode) {
+ this.postBusinessCountryCode = postBusinessCountryCode;
+ }
+
+ public void setPostCity(String[] postCity) {
+ this.postCity = postCity;
+ }
+
+ public void setPostCommandChain(String[] postCommandChain) {
+ this.postCommandChain = postCommandChain;
+ }
+
+ public void setPostCompany(String[] postCompany) {
+ this.postCompany = postCompany;
+ }
+
+ public void setPostCompanyCode(String[] postCompanyCode) {
+ this.postCompanyCode = postCompanyCode;
+ }
+
+ public void setPostDepartment(String[] postDepartment) {
+ this.postDepartment = postDepartment;
+ }
+
+ public void setPostDepartmentName(String[] postDepartmentName) {
+ this.postDepartmentName = postDepartmentName;
+ }
+
+ public void setPostBusinessCountryName(String[] postBusinessCountryName) {
+ this.postBusinessCountryName = postBusinessCountryName;
+ }
+
+ public void setPostJobTitle(String[] postJobTitle) {
+ this.postJobTitle = postJobTitle;
+ }
+
+ public void setPostLocationClli(String[] postLocationClli) {
+ this.postLocationClli = postLocationClli;
+ }
+
+ public void setPostOrgManagerUserId(String[] postOrgManagerUserId) {
+ this.postOrgManagerUserId = postOrgManagerUserId;
+ }
+
+ public void setPostState(String[] postState) {
+ this.postState = postState;
+ }
+
+ public void setPostZipCode(String[] postZipCode) {
+ this.postZipCode = postZipCode;
+ }
+
+ public String[] getPostAddress2() {
return postAddress2;
}
@@ -367,27 +443,25 @@ public class PostSearchBean extends SearchBase {
this.postFinancialLocCode = postFinancialLocCode;
}
+ @Override
public void resetSearch() {
- super.resetSearch();
- setUser(new User());
- } // resetSearch
-
+ super.resetSearch();
+ setUser(new User());
+ }
+ @Override
public boolean isCriteriaUpdated() {
- if(user==null&&userOrig==null)
- return false;
- else if(user==null||userOrig==null)
- return true;
- else
- return (! (
- Utilities.nvl(user.getFirstName()).equals(Utilities.nvl(userOrig.getFirstName()))&&
- Utilities.nvl(user.getLastName()).equals(Utilities.nvl(userOrig.getLastName()))&&
- //Utilities.nvl(user.getHrid()).equals(Utilities.nvl(userOrig.getHrid()))&&
- Utilities.nvl(user.getOrgUserId()).equals(Utilities.nvl(userOrig.getOrgUserId()))&&
- Utilities.nvl(user.getOrgCode()).equals(Utilities.nvl(userOrig.getOrgCode()))&&
- Utilities.nvl(user.getEmail()).equals(Utilities.nvl(userOrig.getEmail()))&&
- Utilities.nvl(user.getOrgManagerUserId()).equals(Utilities.nvl(userOrig.getOrgManagerUserId()))&&
- true));
- } // isCriteriaUpdated
-
-} // PostSearchBean
+ if (user == null && userOrig == null)
+ return false;
+ else if (user == null || userOrig == null)
+ return true;
+ else
+ return !(Utilities.nvl(user.getFirstName()).equals(Utilities.nvl(userOrig.getFirstName()))
+ && Utilities.nvl(user.getLastName()).equals(Utilities.nvl(userOrig.getLastName()))
+ && Utilities.nvl(user.getOrgUserId()).equals(Utilities.nvl(userOrig.getOrgUserId()))
+ && Utilities.nvl(user.getOrgCode()).equals(Utilities.nvl(userOrig.getOrgCode()))
+ && Utilities.nvl(user.getEmail()).equals(Utilities.nvl(userOrig.getEmail()))
+ && Utilities.nvl(user.getOrgManagerUserId()).equals(Utilities.nvl(userOrig.getOrgManagerUserId())));
+ }
+
+}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java
index 49854e6b..8c768102 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/UserRowBean.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -41,63 +41,50 @@ import org.onap.portalsdk.core.domain.User;
public class UserRowBean extends User {
- /**
- *
- */
private static final long serialVersionUID = -2724597119083972190L;
- private String sessionId;
- private String lastAccess;
- private String remaining;
- private String loginTime;
- private String LastLoginTime;
-
-
- public String getLastAccess(){
- return this.lastAccess;
- }
-
-
- public void setLastAccess(String lastAccess){
- this.lastAccess = lastAccess;
- }
-
+ private String sessionId;
+ private String lastAccess;
+ private String remaining;
+ private String loginTime;
+ private String lastLoginTime;
+
+ public String getLastAccess() {
+ return this.lastAccess;
+ }
- public String getRemaining(){
- return this.remaining;
- }
+ public void setLastAccess(final String lastAccess) {
+ this.lastAccess = lastAccess;
+ }
-
- public void setRemaining(String remaining){
- this.remaining = remaining;
- }
+ public String getRemaining() {
+ return this.remaining;
+ }
+ public void setRemaining(final String remaining) {
+ this.remaining = remaining;
+ }
public String getSessionId() {
return sessionId;
}
-
- public void setSessionId(String sessionId) {
+ public void setSessionId(final String sessionId) {
this.sessionId = sessionId;
}
-
public String getLoginTime() {
return loginTime;
}
-
- public void setLoginTime(String loginTime) {
+ public void setLoginTime(final String loginTime) {
this.loginTime = loginTime;
}
-
public String getLastLoginTime() {
- return LastLoginTime;
+ return lastLoginTime;
}
-
- public void setLastLoginTime(String lastLoginTime) {
- LastLoginTime = lastLoginTime;
+ public void setLastLoginTime(final String lastLoginTime) {
+ this.lastLoginTime = lastLoginTime;
}
}
\ No newline at end of file
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java
index c053d95b..dcd14b91 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchBase.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,252 +37,240 @@
*/
package org.onap.portalsdk.core.command.support;
-import java.util.*;
+import java.util.List;
import org.onap.portalsdk.core.domain.support.FusionCommand;
public abstract class SearchBase extends FusionCommand {
- public static String SORT_BY_MODIFIER_DESC = "D";
- public static String SORT_BY_MODIFIER_ASC = "A";
- public static String SORT_BY_MODIFIER_DESC_IMAGE_NAME = "sort_desc.gif";
- public static String SORT_BY_MODIFIER_ASC_IMAGE_NAME = "sort_asc.gif";
+ public static final String SORT_BY_MODIFIER_DESC = "D";
+ public static final String SORT_BY_MODIFIER_ASC = "A";
+ public static final String SORT_BY_MODIFIER_DESC_IMAGE_NAME = "sort_desc.gif";
+ public static final String SORT_BY_MODIFIER_ASC_IMAGE_NAME = "sort_asc.gif";
+ private String sortBy1 = null;
+ private String sortBy2 = null;
+ private String sortBy3 = null;
- private String sortBy1 = null;
- private String sortBy2 = null;
- private String sortBy3 = null;
+ private String sortBy1Orig = null;
+ private String sortBy2Orig = null;
+ private String sortBy3Orig = null;
- private String sortBy1Orig = null;
- private String sortBy2Orig = null;
- private String sortBy3Orig = null;
+ private String sortByModifier1 = null;
+ private String sortByModifier2 = null;
+ private String sortByModifier3 = null;
- private String sortByModifier1 = null;
- private String sortByModifier2 = null;
- private String sortByModifier3 = null;
+ private String sortByModifier1Orig = null;
+ private String sortByModifier2Orig = null;
+ private String sortByModifier3Orig = null;
- private String sortByModifier1Orig = null;
- private String sortByModifier2Orig = null;
- private String sortByModifier3Orig = null;
+ private String accessType = "WRITE";
- private String accessType = "WRITE"; //null;
+ private String submitAction = "";
+ private String masterId = "";
+ private String detailId = "";
- private String submitAction = "";
- private String masterId = "";
- private String detailId = "";
+ private String showResult = "Y";
- private String showResult = "Y";
+ private SearchResult searchResult = null;
- private SearchResult searchResult = null;
- private boolean sortingUpdated;
+ @SuppressWarnings("rawtypes")
+ public SearchBase(List items) {
+ searchResult = (items == null) ? (new SearchResult()) : (new SearchResult(items));
+ } // SearchBase
- @SuppressWarnings("rawtypes")
- public SearchBase(List items) {
- searchResult = (items == null) ? (new SearchResult()) : (new SearchResult(items));
- } // SearchBase
+ public String getSortBy1() {
+ return sortBy1;
+ }
+ public String getSortBy2() {
+ return sortBy2;
+ }
- public String getSortBy1() {
- return sortBy1;
- }
+ public String getSortBy3() {
+ return sortBy3;
+ }
- public String getSortBy2() {
- return sortBy2;
- }
+ public String getSortBy1Orig() {
+ return sortBy1;
+ }
- public String getSortBy3() {
- return sortBy3;
- }
+ public String getSortBy2Orig() {
+ return sortBy2;
+ }
- public String getSortBy1Orig() {
- return sortBy1;
- }
+ public String getSortBy3Orig() {
+ return sortBy3;
+ }
- public String getSortBy2Orig() {
- return sortBy2;
- }
+ public String getAccessType() {
+ return accessType;
+ }
- public String getSortBy3Orig() {
- return sortBy3;
- }
+ public String getSubmitAction() {
+ return submitAction;
+ }
- public String getAccessType() {
- return accessType;
- }
+ public String getMasterId() {
+ return masterId;
+ }
- public String getSubmitAction() {
- return submitAction;
- }
+ public String getDetailId() {
+ return detailId;
+ }
- public String getMasterId() {
- return masterId;
- }
+ public String getShowResult() {
+ return showResult;
+ }
- public String getDetailId() {
- return detailId;
- }
+ public SearchResult getSearchResult() {
+ return searchResult;
+ }
- public String getShowResult() {
- return showResult;
- }
+ public String getSortByModifier1() {
+ return sortByModifier1;
+ }
- //public ArrayList getSortByList() { return sortByList; }
+ public String getSortByModifier1Orig() {
+ return sortByModifier1;
+ }
- public SearchResult getSearchResult() {
- return searchResult;
- }
+ public String getSortByModifier2() {
+ return sortByModifier2;
+ }
- public String getSortByModifier1() {
- return sortByModifier1;
- }
+ public String getSortByModifier2Orig() {
+ return sortByModifier2;
+ }
- public String getSortByModifier1Orig() {
- return sortByModifier1;
- }
+ public String getSortByModifier3() {
+ return sortByModifier3;
+ }
- public String getSortByModifier2() {
- return sortByModifier2;
- }
+ public String getSortByModifier3Orig() {
+ return sortByModifier3;
+ }
- public String getSortByModifier2Orig() {
- return sortByModifier2;
- }
+ public int getPageNo() {
+ return (isCriteriaUpdated() || isSortingUpdated()) ? 0 : getSearchResult().getPageNo();
+ }
- public String getSortByModifier3() {
- return sortByModifier3;
- }
+ public int getPageSize() {
+ return getSearchResult().getPageSize();
+ }
- public String getSortByModifier3Orig() {
- return sortByModifier3;
- }
+ public int getDataSize() {
+ return getSearchResult().getDataSize();
+ }
- public int getPageNo() {
- return (isCriteriaUpdated() || isSortingUpdated()) ? 0 : getSearchResult().getPageNo();
- }
-
- public int getPageSize() {
- return getSearchResult().getPageSize();
- }
-
- public int getDataSize() {
- return getSearchResult().getDataSize();
- }
-
- public int getNewDataSize() {
- return isCriteriaUpdated() ? -1 : getDataSize();
- }
-
-
- public void setSortBy1(String sortBy1) {
- this.sortBy1 = sortBy1;
- }
-
- public void setSortBy2(String sortBy2) {
- this.sortBy2 = sortBy2;
- }
-
- public void setSortBy3(String sortBy3) {
- this.sortBy3 = sortBy3;
- }
-
- public void setSortBy1Orig(String sortBy1Orig) {
- this.sortBy1Orig = sortBy1Orig;
- }
-
- public void setSortBy2Orig(String sortBy2Orig) {
- this.sortBy2Orig = sortBy2Orig;
- }
-
- public void setSortBy3Orig(String sortBy3Orig) {
- this.sortBy3Orig = sortBy3Orig;
- }
-
- public void setAccessType(String accessType) {
- this.accessType = accessType;
- }
-
- public void setSubmitAction(String submitAction) {
- this.submitAction = submitAction;
- }
-
- public void setMasterId(String masterId) {
- this.masterId = masterId;
- }
-
- public void setDetailId(String detailId) {
- this.detailId = detailId;
- }
-
- public void setShowResult(String showResult) {
- this.showResult = showResult;
- }
-
- public void setSearchResult(SearchResult searchResult) {
- this.searchResult = searchResult;
- }
-
- public void setSortByModifier1(String sortByModifier1) {
- this.sortByModifier1 = sortByModifier1;
- }
-
- public void setSortByModifier1Orig(String sortByModifier1Orig) {
- this.sortByModifier1Orig = sortByModifier1Orig;
- }
-
- public void setSortByModifier2(String sortByModifier2) {
- this.sortByModifier2 = sortByModifier2;
- }
-
- public void setSortByModifier2Orig(String sortByModifier2Orig) {
- this.sortByModifier2Orig = sortByModifier2Orig;
- }
-
- public void setSortByModifier3(String sortByModifier3) {
- this.sortByModifier3 = sortByModifier3;
- }
-
- public void setSortByModifier3Orig(String sortByModifier3Orig) {
- this.sortByModifier3Orig = sortByModifier3Orig;
- }
-
- public void setSortingUpdated(boolean sortingUpdated) {
- this.sortingUpdated = sortingUpdated;
- }
-
- public void setPageNo(int pageNo) {
- getSearchResult().setPageNo(pageNo);
- }
-
- public void setPageSize(int pageSize) {
- getSearchResult().setPageSize(pageSize);
- }
-
- public void setDataSize(int dataSize) {
- getSearchResult().setDataSize(dataSize);
- }
-
-
- public void resetSearch() {
- setSortBy1(null);
- setSortBy2(null);
- setSortBy3(null);
- setSortByModifier1(SearchBase.SORT_BY_MODIFIER_ASC);
- setSortByModifier2(SearchBase.SORT_BY_MODIFIER_ASC);
- setSortByModifier3(SearchBase.SORT_BY_MODIFIER_ASC);
- setPageNo(0);
- setDataSize( -1);
- } // resetSearch
-
-
- public abstract boolean isCriteriaUpdated();
-
- public boolean isSortingUpdated() {
- return (!(Utilities.nvl(sortBy1).equals(Utilities.nvl(sortBy1Orig)) &&
- Utilities.nvl(sortBy2).equals(Utilities.nvl(sortBy2Orig)) &&
- Utilities.nvl(sortBy3).equals(Utilities.nvl(sortBy3Orig)) &&
- Utilities.nvl(sortByModifier1).equals(Utilities.nvl(sortByModifier1Orig)) &&
- Utilities.nvl(sortByModifier2).equals(Utilities.nvl(sortByModifier2Orig)) &&
- Utilities.nvl(sortByModifier3).equals(Utilities.nvl(sortByModifier3Orig))));
- } // isSortingUpdated
-
-} // SearchBase
+ public int getNewDataSize() {
+ return isCriteriaUpdated() ? -1 : getDataSize();
+ }
+
+ public void setSortBy1(String sortBy1) {
+ this.sortBy1 = sortBy1;
+ }
+
+ public void setSortBy2(String sortBy2) {
+ this.sortBy2 = sortBy2;
+ }
+
+ public void setSortBy3(String sortBy3) {
+ this.sortBy3 = sortBy3;
+ }
+
+ public void setSortBy1Orig(String sortBy1Orig) {
+ this.sortBy1Orig = sortBy1Orig;
+ }
+
+ public void setSortBy2Orig(String sortBy2Orig) {
+ this.sortBy2Orig = sortBy2Orig;
+ }
+
+ public void setSortBy3Orig(String sortBy3Orig) {
+ this.sortBy3Orig = sortBy3Orig;
+ }
+
+ public void setAccessType(String accessType) {
+ this.accessType = accessType;
+ }
+
+ public void setSubmitAction(String submitAction) {
+ this.submitAction = submitAction;
+ }
+
+ public void setMasterId(String masterId) {
+ this.masterId = masterId;
+ }
+
+ public void setDetailId(String detailId) {
+ this.detailId = detailId;
+ }
+
+ public void setShowResult(String showResult) {
+ this.showResult = showResult;
+ }
+
+ public void setSearchResult(SearchResult searchResult) {
+ this.searchResult = searchResult;
+ }
+
+ public void setSortByModifier1(String sortByModifier1) {
+ this.sortByModifier1 = sortByModifier1;
+ }
+
+ public void setSortByModifier1Orig(String sortByModifier1Orig) {
+ this.sortByModifier1Orig = sortByModifier1Orig;
+ }
+
+ public void setSortByModifier2(String sortByModifier2) {
+ this.sortByModifier2 = sortByModifier2;
+ }
+
+ public void setSortByModifier2Orig(String sortByModifier2Orig) {
+ this.sortByModifier2Orig = sortByModifier2Orig;
+ }
+
+ public void setSortByModifier3(String sortByModifier3) {
+ this.sortByModifier3 = sortByModifier3;
+ }
+
+ public void setSortByModifier3Orig(String sortByModifier3Orig) {
+ this.sortByModifier3Orig = sortByModifier3Orig;
+ }
+
+ public void setPageNo(int pageNo) {
+ getSearchResult().setPageNo(pageNo);
+ }
+
+ public void setPageSize(int pageSize) {
+ getSearchResult().setPageSize(pageSize);
+ }
+
+ public void setDataSize(int dataSize) {
+ getSearchResult().setDataSize(dataSize);
+ }
+
+ public void resetSearch() {
+ setSortBy1(null);
+ setSortBy2(null);
+ setSortBy3(null);
+ setSortByModifier1(SearchBase.SORT_BY_MODIFIER_ASC);
+ setSortByModifier2(SearchBase.SORT_BY_MODIFIER_ASC);
+ setSortByModifier3(SearchBase.SORT_BY_MODIFIER_ASC);
+ setPageNo(0);
+ setDataSize(-1);
+ }
+
+ public abstract boolean isCriteriaUpdated();
+
+ public boolean isSortingUpdated() {
+ return !(Utilities.nvl(sortBy1).equals(Utilities.nvl(sortBy1Orig))
+ && Utilities.nvl(sortBy2).equals(Utilities.nvl(sortBy2Orig))
+ && Utilities.nvl(sortBy3).equals(Utilities.nvl(sortBy3Orig))
+ && Utilities.nvl(sortByModifier1).equals(Utilities.nvl(sortByModifier1Orig))
+ && Utilities.nvl(sortByModifier2).equals(Utilities.nvl(sortByModifier2Orig))
+ && Utilities.nvl(sortByModifier3).equals(Utilities.nvl(sortByModifier3Orig)));
+ }
+
+}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java
index d1c1f315..35985c9f 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/command/support/SearchResult.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,49 +37,62 @@
*/
package org.onap.portalsdk.core.command.support;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
@SuppressWarnings("rawtypes")
public class SearchResult extends ArrayList implements java.io.Serializable {
- /**
- *
- */
+
private static final long serialVersionUID = -451947878984459011L;
- private int pageNo = 0;
+ private int pageNo = 0;
private int pageSize = 50;
private int dataSize = -1;
- private String accessType = null;
-
- //private boolean empty = true; // Overrides collections [isEmpty] with searchResult present/not present logic
-
+ private String accessType = null;
- public SearchResult() {}
+ public SearchResult() {
+ super();
+ }
@SuppressWarnings("unchecked")
public SearchResult(List items) {
super(items);
- } // SearchResult
+ }
+
+ public int getPageNo() {
+ return pageNo;
+ }
+
+ public int getPageSize() {
+ return pageSize;
+ }
- /*public SearchResult(boolean empty) {
- this();
- this.empty = empty;
- } // SearchResult*/
+ public int getDataSize() {
+ return dataSize;
+ }
+ public int getSize() {
+ return size();
+ } // for Struts bean property access
- public int getPageNo() { return pageNo; }
- public int getPageSize() { return pageSize; }
- public int getDataSize() { return dataSize; }
+ public String getAccessType() {
+ return accessType;
+ }
- public int getSize() { return size(); } // for Struts bean property access
- //public boolean isEmpty() { return empty; }
+ public void setPageNo(int pageNo) {
+ this.pageNo = pageNo;
+ }
- public String getAccessType() { return accessType; }
+ public void setPageSize(int pageSize) {
+ this.dataSize = pageSize;
+ }
- public void setPageNo(int pageNo) { this.pageNo=pageNo; }
- public void setPageSize(int pageSize) { this.dataSize=pageSize; }
- public void setDataSize(int dataSize) { this.dataSize=dataSize; }
+ public void setDataSize(int dataSize) {
+ this.dataSize = dataSize;
+ }
- public void setAccessType(String accessType) { this.accessType = accessType; }
+ public void setAccessType(String accessType) {
+ this.accessType = accessType;
+ }
-} // SearchResult
+}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java
index 26624359..60888b6d 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -51,17 +51,12 @@ import org.onap.portalsdk.core.menu.MenuBuilder;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
import org.onap.portalsdk.core.service.DataAccessService;
import org.onap.portalsdk.core.service.DataAccessServiceImpl;
-import org.onap.portalsdk.core.service.LocalAccessCondition;
-import org.onap.portalsdk.core.service.RestApiRequestBuilder;
import org.onap.portalsdk.core.util.SystemProperties;
import org.onap.portalsdk.core.web.support.AppUtils;
import org.onap.portalsdk.core.web.support.UserUtils;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Conditional;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
@@ -83,7 +78,9 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppConfig.class);
- private final List tileDefinitions = new ArrayList();
+ private final List tileDefinitions = new ArrayList<>();
+ private String[] excludeUrlPathsForSessionTimeout = {};
+
protected ApplicationContext appApplicationContext = null;
public AppConfig() {
@@ -94,12 +91,13 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
/**
* Creates and returns a new instance of a secondary (order=2)
- * {@link ViewResolver} that finds files by adding prefix "/WEB-INF/jsp/"
- * and suffix ".jsp" to the base view name.
+ * {@link ViewResolver} that finds files by adding prefix "/WEB-INF/jsp/" and
+ * suffix ".jsp" to the base view name.
*
* @return New instance of {@link ViewResolver}.
*/
@Bean
+ @Override
public ViewResolver viewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
@@ -110,21 +108,20 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
}
/**
- * Loads all the default logging fields into the global MDC context and
- * marks each log file type that logging has been started.
+ * Loads all the default logging fields into the global MDC context and marks
+ * each log file type that logging has been started.
*/
private void initGlobalLocalContext() {
logger.init();
}
- /*
+ /**
* Any requests from the url pattern /static/**, Spring will look for the
- * resources from the /static/ Same as in xml
+ * resources from the /static/ Same as
+ * in xml
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
- // registry.addResourceHandler("/static/**").addResourceLocations("/static/");
registry.addResourceHandler("/**").addResourceLocations("/");
}
@@ -134,6 +131,7 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
* @return New instance of {@link DataAccessService}.
*/
@Bean
+ @Override
public DataAccessService dataAccessService() {
return new DataAccessServiceImpl();
}
@@ -157,15 +155,14 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
public MenuBuilder menuBuilder() {
return new MenuBuilder();
}
-
+
/**
* Creates and returns a new instance of a {@link UserUtils} class.
*
* @return New instance of {@link UserUtils}.
*/
@Bean
- public UserUtils userUtil()
- {
+ public UserUtils userUtil() {
return new UserUtils();
}
@@ -213,7 +210,7 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
String password = SystemProperties.getProperty(SystemProperties.DB_PASSWORD);
if (SystemProperties.containsProperty(SystemProperties.DB_ENCRYPT_FLAG)) {
String encryptFlag = SystemProperties.getProperty(SystemProperties.DB_ENCRYPT_FLAG);
- if (encryptFlag != null && encryptFlag.equalsIgnoreCase("true")) {
+ if (encryptFlag != null && "true".equalsIgnoreCase(encryptFlag)) {
password = CipherUtil.decrypt(password);
}
}
@@ -227,14 +224,12 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
dataSource.setTestConnectionOnCheckout(getConnectionOnCheckout());
dataSource.setPreferredTestQuery(getPreferredTestQuery());
} catch (Exception e) {
+ // Show details
logger.error(EELFLoggerDelegate.errorLogger,
- "Error initializing database, verify database settings in properties file: "
- + UserUtils.getStackTrace(e),
- AlarmSeverityEnum.CRITICAL);
+ "Error initializing database, verify database settings in properties file", e);
+ // Include alarm in log
logger.error(EELFLoggerDelegate.debugLogger,
- "Error initializing database, verify database settings in properties file: "
- + UserUtils.getStackTrace(e),
- AlarmSeverityEnum.CRITICAL);
+ "Error initializing database", AlarmSeverityEnum.CRITICAL);
// Raise an alarm that opening a connection to the database failed.
logger.logEcompError(AppMessagesEnum.BeDaoSystemError);
throw e;
@@ -243,9 +238,8 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
}
/**
- * Gets the value of the property
- * {@link SystemProperties#PREFERRED_TEST_QUERY}; defaults to "Select 1" if
- * the property is not defined.
+ * Gets the value of the property {@link SystemProperties#PREFERRED_TEST_QUERY};
+ * defaults to "Select 1" if the property is not defined.
*
* @return String value that is a SQL query
*/
@@ -266,8 +260,8 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
/**
* Gets the value of the property
- * {@link SystemProperties#TEST_CONNECTION_ON_CHECKOUT}; defaults to true if
- * the property is not defined.
+ * {@link SystemProperties#TEST_CONNECTION_ON_CHECKOUT}; defaults to true if the
+ * property is not defined.
*
* @return Boolean value
*/
@@ -288,8 +282,8 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
}
/*
- * TODO: Check whether it is appropriate to extend the list of tile
- * definitions at every invocation.
+ * TODO: Check whether it is appropriate to extend the list of tile definitions
+ * at every invocation.
*/
protected String[] tileDefinitions() {
tileDefinitions.add("/WEB-INF/fusion/defs/definitions.xml");
@@ -304,8 +298,9 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
*
* @return An empty list.
*/
+ @Override
public List addTileDefinitions() {
- return new ArrayList();
+ return new ArrayList<>();
}
/**
@@ -324,9 +319,8 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
}
/**
- * Adds new instances of the following interceptors to the specified
- * interceptor registry: {@link SessionTimeoutInterceptor},
- * {@link ResourceInterceptor}
+ * Adds new instances of the following interceptors to the specified interceptor
+ * registry: {@link SessionTimeoutInterceptor}, {@link ResourceInterceptor}
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
@@ -345,8 +339,6 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
return new ResourceInterceptor();
}
- private String[] excludeUrlPathsForSessionTimeout = {};
-
/**
* Gets the array of Strings that are paths excluded for session timeout.
*
@@ -374,9 +366,8 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
* (org.springframework.context.ApplicationContext)
*/
@Override
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ public void setApplicationContext(ApplicationContext applicationContext) {
appApplicationContext = applicationContext;
-
}
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java
index 0865b987..d2690c8d 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppInitializer.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -46,34 +46,29 @@ import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatche
public abstract class AppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppInitializer.class);
-
- private final String activeProfile = "src";
+
+ private static final String activeProfile = "src";
@Override
protected WebApplicationContext createServletApplicationContext() {
WebApplicationContext context = super.createServletApplicationContext();
-
try {
-
((ConfigurableEnvironment) context.getEnvironment()).setActiveProfiles(activeProfile);
} catch (Exception e) {
-
- logger.error(EELFLoggerDelegate.errorLogger, "Unable to set the active profile" + e.getMessage(),AlarmSeverityEnum.MAJOR);
+ logger.error(EELFLoggerDelegate.errorLogger, "Unable to set the active profile" + e.getMessage(),
+ AlarmSeverityEnum.MAJOR);
throw e;
-
}
-
return context;
}
@Override
protected Class>[] getRootConfigClasses() {
- return null;
+ return new Class>[0];
}
@Override
protected Class>[] getServletConfigClasses() {
-
return new Class[] { AppConfig.class };
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java
index d890e609..647315d5 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/Configurable.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -44,13 +44,13 @@ import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
public interface Configurable {
-
- public ViewResolver viewResolver();
-
- public void addResourceHandlers(ResourceHandlerRegistry registry) ;
-
- public DataAccessService dataAccessService();
-
- public List addTileDefinitions();
-
+
+ public ViewResolver viewResolver();
+
+ public void addResourceHandlers(ResourceHandlerRegistry registry);
+
+ public DataAccessService dataAccessService();
+
+ public List addTileDefinitions();
+
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java
index 54512865..4c142a2c 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateConfiguration.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -48,7 +48,6 @@ import java.util.Properties;
import javax.sql.DataSource;
import org.hibernate.SessionFactory;
-import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.beans.factory.annotation.Autowired;
@@ -83,7 +82,8 @@ public class HibernateConfiguration {
}
/**
- * Builds a properties object with Hibernate properties in te system.properties file.
+ * Builds a properties object with Hibernate properties in te system.properties
+ * file.
*
* @return Properties object
*/
@@ -107,27 +107,18 @@ public class HibernateConfiguration {
String sql = "SELECT schema_id,datasource_type,connection_url,user_name,password,driver_class,min_pool_size,max_pool_size,idle_connection_test_period FROM schema_info";
rs = stmt.executeQuery(sql);
while (rs.next()) {
- ComboPooledDataSource dataSource = new ComboPooledDataSource();
- dataSource.setDriverClass(rs.getString("driver_class"));
- dataSource.setJdbcUrl(rs.getString("connection_url"));
- dataSource.setUser(rs.getString("user_name"));
- dataSource.setPassword(rs.getString("password"));
- dataSource.setMinPoolSize(rs.getInt("min_pool_size"));
- dataSource.setMaxPoolSize(rs.getInt("max_pool_size"));
- dataSource.setIdleConnectionTestPeriod(rs.getInt("idle_connection_test_period"));
- dataSourceMap.put(rs.getString("schema_id"), dataSource);
+ ComboPooledDataSource pool = new ComboPooledDataSource();
+ pool.setDriverClass(rs.getString("driver_class"));
+ pool.setJdbcUrl(rs.getString("connection_url"));
+ pool.setUser(rs.getString("user_name"));
+ pool.setPassword(rs.getString("password"));
+ pool.setMinPoolSize(rs.getInt("min_pool_size"));
+ pool.setMaxPoolSize(rs.getInt("max_pool_size"));
+ pool.setIdleConnectionTestPeriod(rs.getInt("idle_connection_test_period"));
+ dataSourceMap.put(rs.getString("schema_id"), pool);
}
- rs.close();
- rs = null;
- stmt.close();
- stmt = null;
- conn.close();
- conn = null;
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger,
- "Error initializing database, verify database settings in properties file: " + e.getMessage(),
- AlarmSeverityEnum.CRITICAL);
- e.printStackTrace();
+ logger.error(EELFLoggerDelegate.errorLogger, "dataSourceMap failed", e);
dataSourceMap = null;
throw e;
} finally {
@@ -139,15 +130,9 @@ public class HibernateConfiguration {
if (conn != null)
conn.close();
} catch (SQLException se2) {
- }
- try {
- if (conn != null)
- conn.close();
- } catch (SQLException se) {
- se.printStackTrace();
+ logger.warn(EELFLoggerDelegate.errorLogger, "dataSourceMap failed to close", se2);
}
}
-
return dataSourceMap;
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java
index 743d4b76..11effb62 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/HibernateMappingLocatable.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -43,19 +43,20 @@ import org.springframework.core.io.Resource;
* Defines methods used by developers to supply Hibernate configuration.
*/
public interface HibernateMappingLocatable {
-
+
/**
* Gets Hibernate mapping locations.
*
- * @return Array of Resource objects (usually ClassPathResource that's a
- * file) which contain Hibernate mapping information.
+ * @return Array of Resource objects (usually ClassPathResource that's a file)
+ * which contain Hibernate mapping information.
*/
- public Resource [] getMappingLocations();
+ public Resource[] getMappingLocations();
/**
* Gets package names.
*
- * @return Array of Java package names to scan for classes with Hibernate annotations.
+ * @return Array of Java package names to scan for classes with Hibernate
+ * annotations.
*/
- public String [] getPackagesToScan();
+ public String[] getPackagesToScan();
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java
index 48c145b3..980feaec 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/FusionBaseController.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -63,77 +63,70 @@ import org.springframework.web.bind.annotation.ModelAttribute;
import com.fasterxml.jackson.databind.ObjectMapper;
@Controller
-public abstract class FusionBaseController implements SecurityInterface{
-
+public abstract class FusionBaseController implements SecurityInterface {
+
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FusionBaseController.class);
-
- @Override
- public boolean isAccessible() {
- return true;
- }
-
- public boolean isRESTfulCall(){
- return true;
- }
+
@Autowired
private FnMenuService fnMenuService;
-
+
@Autowired
- private MenuBuilder menuBuilder;
-
+ private MenuBuilder menuBuilder;
+
@Autowired
- private DataAccessService dataAccessService;
-
+ private DataAccessService dataAccessService;
+
@Autowired
- AppService appService;
-
+ private AppService appService;
+
@SuppressWarnings({ "unchecked", "rawtypes" })
@ModelAttribute("menu")
public Map getMenu(HttpServletRequest request) {
HttpSession session = null;
- Map model = new HashMap();
+ Map model = new HashMap<>();
try {
- try {
- String appName = appService.getDefaultAppName();
- if (appName==null || appName=="") {
- appName = SystemProperties.SDK_NAME;
- }
- logger.setRequestBasedDefaultsIntoGlobalLoggingContext(request, appName);
- } catch (Exception e) {
- }
-
+ String appName = appService.getDefaultAppName();
+ if (appName == null || appName == "")
+ appName = SystemProperties.SDK_NAME;
+ logger.setRequestBasedDefaultsIntoGlobalLoggingContext(request, appName);
+
session = request.getSession();
User user = UserUtils.getUserSession(request);
- if(session!=null && user!=null){
- Set menuResult = (Set) session.getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
- if(menuResult==null){
- Set appMenu = getMenuBuilder().getMenu(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_SET_NAME),dataAccessService);
- session.setAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME), MenuBuilder.filterMenu(appMenu, request));
- menuResult = (Set) session.getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
+ if (session != null && user != null) {
+ Set menuResult = (Set) session
+ .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
+ if (menuResult == null) {
+ Set appMenu = getMenuBuilder().getMenu(
+ SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_SET_NAME),
+ dataAccessService);
+ session.setAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME),
+ MenuBuilder.filterMenu(appMenu, request));
+ menuResult = (Set) session.getAttribute(
+ SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
}
- model = setMenu(menuResult);
+ model = setMenu(menuResult);
}
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, e.getMessage());
+ logger.error(EELFLoggerDelegate.errorLogger, "getMenu failed", e);
}
return model;
}
-
- public Map setMenu(Set menuResult) throws Exception{
+
+ public Map setMenu(Set menuResult) throws Exception {
ObjectMapper mapper = new ObjectMapper();
- List> childItemList = new ArrayList>();;
- List parentList = new ArrayList();;
- Map model = new HashMap();
- try{
- fnMenuService.setMenuDataStructure(childItemList, parentList, menuResult);
- }catch(Exception e){
- logger.error(EELFLoggerDelegate.errorLogger, e.getMessage());
- }
+ List> childItemList = new ArrayList<>();
+ List parentList = new ArrayList<>();
+ try {
+ fnMenuService.setMenuDataStructure(childItemList, parentList, menuResult);
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "setMenu failed", e);
+ }
+ Map model = new HashMap<>();
model.put("childItemList", mapper.writeValueAsString(childItemList));
model.put("parentList", mapper.writeValueAsString(parentList));
return model;
}
-
+
public MenuBuilder getMenuBuilder() {
return menuBuilder;
}
@@ -149,5 +142,14 @@ public abstract class FusionBaseController implements SecurityInterface{
public void setDataAccessService(DataAccessService dataAccessService) {
this.dataAccessService = dataAccessService;
}
-
+
+ @Override
+ public boolean isAccessible() {
+ return true;
+ }
+
+ public boolean isRESTfulCall() {
+ return true;
+ }
+
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java
index 1659dc32..5fdac61b 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedBaseController.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,32 +37,35 @@
*/
package org.onap.portalsdk.core.controller;
-public class RestrictedBaseController extends FusionBaseController{
-
+public class RestrictedBaseController extends FusionBaseController {
+
protected String viewName;
private String exceptionView;
+
@Override
public boolean isAccessible() {
return false;
}
+
@Override
- public boolean isRESTfulCall(){
+ public boolean isRESTfulCall() {
return false;
}
+
protected String getViewName() {
return viewName;
}
+
protected void setViewName(String viewName) {
this.viewName = viewName;
}
public String getExceptionView() {
- return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
+ return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
}
public void setExceptionView(String exceptionView) {
this.exceptionView = exceptionView;
}
-
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java
index 1dfffaa0..5a33c752 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/RestrictedRESTfulBaseController.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,32 +37,35 @@
*/
package org.onap.portalsdk.core.controller;
-public class RestrictedRESTfulBaseController extends FusionBaseController{
-
+public class RestrictedRESTfulBaseController extends FusionBaseController {
+
protected String viewName;
private String exceptionView;
+
@Override
public boolean isAccessible() {
return false;
}
+
@Override
- public boolean isRESTfulCall(){
+ public boolean isRESTfulCall() {
return true;
}
+
protected String getViewName() {
return viewName;
}
+
protected void setViewName(String viewName) {
this.viewName = viewName;
}
public String getExceptionView() {
- return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
+ return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
}
public void setExceptionView(String exceptionView) {
this.exceptionView = exceptionView;
}
-
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java
index 81f0c54d..b78f7bfb 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/controller/UnRestrictedBaseController.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,17 +37,19 @@
*/
package org.onap.portalsdk.core.controller;
-public class UnRestrictedBaseController extends FusionBaseController{
+public class UnRestrictedBaseController extends FusionBaseController {
protected String viewName;
-
+
@Override
public boolean isAccessible() {
return true;
}
+
@Override
- public boolean isRESTfulCall(){
+ public boolean isRESTfulCall() {
return false;
}
+
protected String getViewName() {
return viewName;
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java
index c1d063a9..e70468c6 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/AbstractDao.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -36,6 +36,7 @@
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.onap.portalsdk.core.dao;
+
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
@@ -43,38 +44,39 @@ import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
-
-public abstract class AbstractDao {
-
- private final Class persistentClass;
-
- @SuppressWarnings("unchecked")
- public AbstractDao(){
- this.persistentClass =(Class) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[1];
- }
-
- @Autowired
- private SessionFactory sessionFactory;
-
- protected Session getSession(){
- return sessionFactory.getCurrentSession();
- }
-
- @SuppressWarnings("unchecked")
- public T getByKey(PK key) {
- return (T) getSession().get(persistentClass, key);
- }
-
- public void persist(T entity) {
- getSession().persist(entity);
- }
-
- public void delete(T entity) {
- getSession().delete(entity);
- }
-
- protected Criteria createEntityCriteria(){
- return getSession().createCriteria(persistentClass);
- }
-
+
+public abstract class AbstractDao {
+
+ private final Class persistentClass;
+
+ @Autowired
+ private SessionFactory sessionFactory;
+
+ @SuppressWarnings("unchecked")
+ public AbstractDao() {
+ this.persistentClass = (Class) ((ParameterizedType) this.getClass().getGenericSuperclass())
+ .getActualTypeArguments()[1];
+ }
+
+ protected Session getSession() {
+ return sessionFactory.getCurrentSession();
+ }
+
+ @SuppressWarnings("unchecked")
+ public T getByKey(K key) {
+ return (T) getSession().get(persistentClass, key);
+ }
+
+ public void persist(T entity) {
+ getSession().persist(entity);
+ }
+
+ public void delete(T entity) {
+ getSession().delete(entity);
+ }
+
+ protected Criteria createEntityCriteria() {
+ return getSession().createCriteria(persistentClass);
+ }
+
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java
index bb93ac36..a34737c8 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDao.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -43,5 +43,6 @@ import org.onap.portalsdk.core.domain.Profile;
public interface ProfileDao {
List findAll();
+
Profile getProfile(int id);
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java
index ee6c32d3..471aed01 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/ProfileDaoImpl.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -41,29 +41,24 @@ import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
-import org.onap.portalsdk.core.dao.AbstractDao;
import org.onap.portalsdk.core.domain.Profile;
import org.springframework.stereotype.Repository;
@Repository("profileDao")
-public class ProfileDaoImpl extends AbstractDao implements ProfileDao{
+public class ProfileDaoImpl extends AbstractDao implements ProfileDao {
-
+ @Override
+ @SuppressWarnings("unchecked")
public List findAll() {
Criteria crit = getSession().createCriteria(Profile.class);
- @SuppressWarnings("unchecked")
- List p = crit.list();
-
- return p;
+ return crit.list();
}
-
+ @Override
public Profile getProfile(int id) {
Criteria crit = getSession().createCriteria(Profile.class);
crit.add(Restrictions.eq("id", id));
- Profile profile = (Profile) crit.uniqueResult();
-
- return profile;
+ return (Profile) crit.uniqueResult();
}
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java
index 2c3fa5da..f1fcd889 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/hibernate/ModelOperationsCommon.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -67,7 +67,6 @@ public abstract class ModelOperationsCommon extends FusionDao {
@SuppressWarnings({ "rawtypes", "unchecked" })
public List _getList(Class domainClass, String filterClause, Integer fromIndex, Integer toIndex, String orderBy) {
- List list = null;
String className = domainClass.getName();
Session session = getSessionFactory().getCurrentSession();
@@ -76,19 +75,15 @@ public abstract class ModelOperationsCommon extends FusionDao {
+ ((fromIndex != null) ? " from rows " + fromIndex.toString() + " to " + toIndex.toString() : "")
+ "...");
-
- if (filterClause != null && filterClause.length() > 0) {
+ if (filterClause != null && filterClause.length() > 0)
logger.info(EELFLoggerDelegate.debugLogger, "Filtering " + className + " by: " + filterClause);
- }
-
- list = session.createQuery("from " + className + Utilities.nvl(filterClause, "")
+ List list = session.createQuery("from " + className + Utilities.nvl(filterClause, "")
+ ((orderBy != null) ? " order by " + orderBy : "")).list();
list = (fromIndex != null) ? list.subList(fromIndex.intValue() - 1, toIndex.intValue()) : list;
- if (orderBy == null && list != null) {
+ if (orderBy == null && list != null)
Collections.sort(list);
- }
return list;
}
@@ -121,9 +116,8 @@ public abstract class ModelOperationsCommon extends FusionDao {
if (fetchModeMap != null) {
Iterator itr = fetchModeMap.keySet().iterator();
- String key = null;
while (itr.hasNext()) {
- key = itr.next();
+ String key = itr.next();
criteria.setFetchMode(key, fetchModeMap.get(key));
}
@@ -133,21 +127,20 @@ public abstract class ModelOperationsCommon extends FusionDao {
@SuppressWarnings("rawtypes")
public DomainVo _get(Class domainClass, Serializable id) {
- DomainVo vo = null;
Session session = getSessionFactory().getCurrentSession();
- logger.info(EELFLoggerDelegate.debugLogger, "Getting " + domainClass.getName() + " record for id - " + id.toString());
+ logger.info(EELFLoggerDelegate.debugLogger,
+ "Getting " + domainClass.getName() + " record for id - " + id.toString());
-
- vo = (DomainVo) session.get(domainClass, id);
+ DomainVo vo = (DomainVo) session.get(domainClass, id);
if (vo == null) {
try {
vo = (DomainVo) domainClass.newInstance();
} catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "Failed while instantiating a class of " + domainClass.getName() + e.getMessage());
-
+ logger.error(EELFLoggerDelegate.errorLogger,
+ "Failed while instantiating a class of " + domainClass.getName(), e);
}
}
@@ -156,7 +149,7 @@ public abstract class ModelOperationsCommon extends FusionDao {
@SuppressWarnings("rawtypes")
public List _getLookupList(String dbTable, String dbValueCol, String dbLabelCol, String dbFilter, String dbOrderBy,
- HashMap additionalParams) {
+ Map additionalParams) {
logger.info(EELFLoggerDelegate.debugLogger, "Retrieving " + dbTable + " lookup list...");
List list = null;
@@ -164,7 +157,7 @@ public abstract class ModelOperationsCommon extends FusionDao {
Session session = getSessionFactory().getCurrentSession();
- // default the orderBy if null;
+ // default the orderBy if null
if (Utilities.nvl(dbOrderBy).length() == 0) {
dbOrderByCol = dbLabelCol;
dbOrderBy = dbLabelCol;
@@ -174,8 +167,7 @@ public abstract class ModelOperationsCommon extends FusionDao {
}
}
- StringBuffer sql = new StringBuffer();
-
+ StringBuilder sql = new StringBuilder();
sql.append("select distinct ").append(dbLabelCol).append(" as lab, ").append(dbValueCol).append(" as val, ")
.append(dbOrderByCol).append(" as sortOrder ").append("from ").append(dbTable).append(" ")
.append((Utilities.nvl(dbFilter).length() == 0) ? "" : (" where " + dbFilter)).append(" order by ")
@@ -185,19 +177,23 @@ public abstract class ModelOperationsCommon extends FusionDao {
list = session.createSQLQuery(sql.toString()).addEntity(Lookup.class).list();
} catch (Exception e) {
list = null;
- logger.info(EELFLoggerDelegate.debugLogger, "The results for the lookup list query [" + sql + "] were empty.");
+ logger.error(EELFLoggerDelegate.errorLogger, "_getLookupList failed on SQL: [" + sql + "]", e);
}
return list;
} // getLookupList
- /* This method is used to execute SQL queries */
+ /**
+ * This method is used to execute SQL queries
+ */
@SuppressWarnings("rawtypes")
protected final List _executeSQLQuery(String sql, Class domainClass) {
return _executeSQLQuery(sql, domainClass, null, null);
}
- /* This method is used to execute SQL queries with paging */
+ /**
+ * This method is used to execute SQL queries with paging
+ */
@SuppressWarnings("rawtypes")
protected final List _executeSQLQuery(String sql, Class domainClass, Integer fromIndex, Integer toIndex) {
Session session = getSessionFactory().getCurrentSession();
@@ -213,13 +209,17 @@ public abstract class ModelOperationsCommon extends FusionDao {
return query.list();
}
- /* This method is used to execute HQL queries */
+ /**
+ * This method is used to execute HQL queries
+ */
@SuppressWarnings("rawtypes")
protected final List _executeQuery(String sql) {
return _executeQuery(sql, null, null);
}
- /* This method is used to execute HQL queries with paging */
+ /**
+ * This method is used to execute HQL queries with paging
+ */
@SuppressWarnings("rawtypes")
protected final List _executeQuery(String sql, Integer fromIndex, Integer toIndex) {
Session session = getSessionFactory().getCurrentSession();
@@ -235,22 +235,22 @@ public abstract class ModelOperationsCommon extends FusionDao {
return query.list();
}
- /*
+ /**
* This method can be used to execute both HQL or SQL named queries. The
- * distinction will come in the hbm.xml mapping file defining the named
- * query. Named HQL queries use the tag while named SQL queries use
- * the tag.
+ * distinction will come in the hbm.xml mapping file defining the named query.
+ * Named HQL queries use the tag while named SQL queries use the
+ * tag.
*/
@SuppressWarnings("rawtypes")
protected final List _executeNamedQuery(String queryName, Map params) {
return _executeNamedQuery(queryName, params, null, null);
}
- /*
- * This method can be used to execute both HQL or SQL named queries with
- * paging. The distinction will come in the hbm.xml mapping file defining
- * the named query. Named HQL queries use the tag while named SQL
- * queries use the tag.
+ /**
+ * This method can be used to execute both HQL or SQL named queries with paging.
+ * The distinction will come in the hbm.xml mapping file defining the named
+ * query. Named HQL queries use the tag while named SQL queries use the
+ * tag.
*/
@SuppressWarnings("rawtypes")
protected final List _executeNamedQuery(String queryName, Map params, Integer fromIndex, Integer toIndex) {
@@ -266,37 +266,32 @@ public abstract class ModelOperationsCommon extends FusionDao {
}
// RAPTOR ZK
- /*
- * This method can be used to execute both HQL or SQL named queries with
- * paging. The distinction will come in the hbm.xml mapping file defining
- * the named query. Named HQL queries use the tag while named SQL
- * queries use the tag.
+
+ /**
+ * This method can be used to execute both HQL or SQL named queries with paging.
+ * The distinction will come in the hbm.xml mapping file defining the named
+ * query. Named HQL queries use the tag while named SQL queries use the
+ * tag.
*/
@SuppressWarnings("rawtypes")
protected final List _executeNamedCountQuery(Class entity, String queryName, String whereClause, Map params) {
Session session = getSessionFactory().getCurrentSession();
Query query = session.getNamedQuery(queryName);
String queryStr = query.getQueryString();
- StringBuffer modifiedSql = new StringBuffer(" select count(*) as countRows from (" + queryStr + " ) al ");
+ StringBuilder modifiedSql = new StringBuilder("select count(*) as countRows from (" + queryStr + " ) al ");
if (whereClause != null && whereClause.length() > 0)
modifiedSql.append("where " + whereClause);
- // SQLQuery sqlQuery = session.createSQLQuery(" select count(*) as
- // {reportSearch.countRows} from ("+ modifiedSql.toString()+")");
SQLQuery sqlQuery = session.createSQLQuery(modifiedSql.toString());
bindQueryParameters(sqlQuery, params);
sqlQuery.addScalar("countRows", LongType.INSTANCE);
- // sqlQuery.addEntity("reportSearch", entity);
- // sqlQuery.setResultTransformer(new
- // AliasToBeanResultTransformer(SearchCount.class));
return sqlQuery.list();
-
}
- /*
- * This method can be used to execute both HQL or SQL named queries with
- * paging. The distinction will come in the hbm.xml mapping file defining
- * the named query. Named HQL queries use the tag while named SQL
- * queries use the tag. It is modified to test ZK filter.
+ /**
+ * This method can be used to execute both HQL or SQL named queries with paging.
+ * The distinction will come in the hbm.xml mapping file defining the named
+ * query. Named HQL queries use the tag while named SQL queries use the
+ * tag. It is modified to test ZK filter.
*/
@SuppressWarnings("rawtypes")
protected final List _executeNamedQuery(Class entity, String queryName, String whereClause, Map params,
@@ -305,12 +300,13 @@ public abstract class ModelOperationsCommon extends FusionDao {
Query query = session.getNamedQuery(queryName);
bindQueryParameters(query, params);
String queryStr = query.getQueryString();
- StringBuffer modifiedSql = new StringBuffer(" select * from (" + queryStr + " ) al ");
+ StringBuilder modifiedSql = new StringBuilder(" select * from (" + queryStr + " ) al ");
if (whereClause != null && whereClause.length() > 0)
modifiedSql.append("where " + whereClause);
SQLQuery sqlQuery = session.createSQLQuery(modifiedSql.toString());
bindQueryParameters(sqlQuery, params);
+ // why is reportSearch hardcoded here?
sqlQuery.addEntity("reportSearch", entity);
if (fromIndex != null && toIndex != null) {
@@ -321,11 +317,11 @@ public abstract class ModelOperationsCommon extends FusionDao {
return sqlQuery.list();
}
- /*
- * This method can be used to execute both HQL or SQL named queries with
- * paging. The distinction will come in the hbm.xml mapping file defining
- * the named query. Named HQL queries use the tag while named SQL
- * queries use the tag.
+ /**
+ * x This method can be used to execute both HQL or SQL named queries with
+ * paging. The distinction will come in the hbm.xml mapping file defining the
+ * named query. Named HQL queries use the tag while named SQL queries
+ * use the tag.
*/
@SuppressWarnings("rawtypes")
protected final List _executeNamedQueryWithOrderBy(Class entity, String queryName, Map params, String _orderBy,
@@ -346,7 +342,6 @@ public abstract class ModelOperationsCommon extends FusionDao {
return sqlQuery.list();
}
- // Where Clause
@SuppressWarnings("rawtypes")
protected final List _executeNamedQueryWithOrderBy(Class entity, String queryName, String whereClause, Map params,
String _orderBy, boolean asc, Integer fromIndex, Integer toIndex) {
@@ -355,10 +350,7 @@ public abstract class ModelOperationsCommon extends FusionDao {
bindQueryParameters(query, params);
String queryStr = query.getQueryString();
queryStr = String.format(queryStr, _orderBy, asc ? "ASC" : "DESC");
- // StringBuffer modifiedSql = new StringBuffer(queryStr );
- StringBuffer modifiedSql = new StringBuffer(" select * from (" + queryStr + " ) al ");
- // modifiedSql.insert(queryStr.lastIndexOf("order by"), " " +
- // whereClause + " ");
+ StringBuilder modifiedSql = new StringBuilder(" select * from (" + queryStr + " ) al ");
if (whereClause != null && whereClause.length() > 0)
modifiedSql.append("where " + whereClause);
SQLQuery sqlQuery = session.createSQLQuery(modifiedSql.toString());
@@ -375,7 +367,7 @@ public abstract class ModelOperationsCommon extends FusionDao {
// RAPTOR ZK END
/* Processes custom Insert/Update/Delete SQL statements */
- protected final int _executeUpdateQuery(String sql) throws Exception {
+ protected final int _executeUpdateQuery(String sql) {
Session session = getSessionFactory().getCurrentSession();
Query query = session.createSQLQuery(sql);
return query.executeUpdate();
@@ -383,7 +375,7 @@ public abstract class ModelOperationsCommon extends FusionDao {
/* Processes Insert/Update/Delete Named SQL statements */
@SuppressWarnings("rawtypes")
- protected final int _executeNamedUpdateQuery(String queryName, Map params) throws Exception {
+ protected final int _executeNamedUpdateQuery(String queryName, Map params) {
Session session = getSessionFactory().getCurrentSession();
Query query = session.getNamedQuery(queryName);
bindQueryParameters(query, params);
@@ -391,7 +383,7 @@ public abstract class ModelOperationsCommon extends FusionDao {
}
protected final void _update(DomainVo vo, Integer userId) {
- _update(vo, ((userId != null) ? userId.intValue() : 0));
+ _update(vo, (userId != null) ? userId.intValue() : 0);
}
protected final void _update(DomainVo vo, int userId) {
@@ -427,16 +419,10 @@ public abstract class ModelOperationsCommon extends FusionDao {
@SuppressWarnings("rawtypes")
protected final int _remove(Class domainClass, String whereClause) {
- int rowsAffected = 0;
-
Session session = getSessionFactory().getCurrentSession();
-
- StringBuffer sql = new StringBuffer("delete from ");
-
+ StringBuilder sql = new StringBuilder("delete from ");
sql.append(domainClass.getName()).append(" where ").append(whereClause);
-
- rowsAffected = session.createQuery(sql.toString()).executeUpdate();
-
+ int rowsAffected = session.createQuery(sql.toString()).executeUpdate();
return rowsAffected;
}
@@ -452,17 +438,14 @@ public abstract class ModelOperationsCommon extends FusionDao {
Map.Entry entry = (Map.Entry) i.next();
Object parameterValue = entry.getValue();
-
if (!(parameterValue instanceof Collection) && !(parameterValue instanceof Object[])) {
query.setParameter((String) entry.getKey(), parameterValue);
+ } else if (parameterValue instanceof Collection) {
+ query.setParameterList((String) entry.getKey(), (Collection) parameterValue);
+ } else if (parameterValue instanceof Object[]) {
+ query.setParameterList((String) entry.getKey(), (Object[]) parameterValue);
} else {
- if (parameterValue instanceof Collection) {
- query.setParameterList((String) entry.getKey(), (Collection) parameterValue);
- } else {
- if (parameterValue instanceof Object[]) {
- query.setParameterList((String) entry.getKey(), (Object[]) parameterValue);
- }
- }
+ logger.warn("bindQueryParameters: unimplemented case for {}", parameterValue);
}
}
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java
index a3ff27fd..3ff2e47a 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/dao/support/FusionDao.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -41,13 +41,13 @@ import org.hibernate.SessionFactory;
import org.onap.portalsdk.core.FusionObject;
public class FusionDao implements FusionObject {
- private SessionFactory sessionFactory;
+ private SessionFactory sessionFactory;
- public void setSessionFactory(SessionFactory sessionFactory) {
- this.sessionFactory = sessionFactory;
- }
+ public void setSessionFactory(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
- public SessionFactory getSessionFactory() {
- return this.sessionFactory;
- }
+ public SessionFactory getSessionFactory() {
+ return this.sessionFactory;
+ }
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java
index dfc4ae3c..0fa94a10 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/App.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -58,7 +58,7 @@ public class App extends DomainVo {
private String alternateUrl; // app_alternate_url
private String restEndpoint; // app_rest_endpoint
private String mlAppName; // ml_app_name
- private String mlAppAdminId; // ml_app_admin_id;
+ private String mlAppAdminId; // ml_app_admin_id
private String motsId; // mots_id
private String appPassword; // app_password
private String open;
@@ -216,6 +216,7 @@ public class App extends DomainVo {
/**
* Answers true if the objects have the same ID.
*/
+ @Override
public int compareTo(Object obj) {
Long c1 = getId();
Long c2 = ((App) obj).getId();
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java
index 7cebc1af..b9f49519 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/AuditLog.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -47,61 +47,60 @@ public class AuditLog extends DomainVo {
*
*/
private static final long serialVersionUID = 1L;
- public static final String CD_ACTIVITY_LOGIN = "login";
- public static final String CD_ACTIVITY_LOGOUT = "logout";
- public static final String CD_ACTIVITY_MOBILE_LOGIN = "mobile_login";
- public static final String CD_ACTIVITY_MOBILE_LOGOUT = "mobile_logout";
-
- /*-------Profile activities -----------*/
- public static final String CD_ACTIVITY_ROLE_ADD = "add_role";
- public static final String CD_ACTIVITY_ROLE_REMOVE = "remove_role";
- public static final String CD_ACTIVITY_CHILD_ROLE_ADD = "add_child_role";
- public static final String CD_ACTIVITY_CHILD_ROLE_REMOVE = "remove_child_role";
- public static final String CD_ACTIVITY_ROLE_ADD_FUNCTION = "add_role_function";
- public static final String CD_ACTIVITY_ROLE_REMOVE_FUNCTION = "remove_role_function";
- public static final String CD_ACTIVITY_USER_ROLE_ADD = "add_user_role";
- public static final String CD_ACTIVITY_USER_ROLE_REMOVE = "remove_user_role";
-
- /*Audit activities*/
- public static final String CD_ACTIVITY_FUNCTIONAL_ACCESS = "functional_access";
- public static final String CD_ACTIVITY_TAB_ACCESS = "tab_access";
- public static final String CD_ACTIVITY_APP_ACCESS = "app_access";
- public static final String CD_ACTIVITY_LEFT_MENU_ACCESS = "left_menu_access";
-
-
- private String activityCode;
- private String affectedRecordId;
- private String comments;
- private Date auditDate;
- private Long userId;
-
- public AuditLog() {
- setCreated(new Date());
- }
-
- public String getActivityCode() {
- return activityCode;
- }
-
- public String getComments() {
- return comments;
- }
-
- public String getAffectedRecordId() {
- return affectedRecordId;
- }
-
- public void setActivityCode(String activityCode) {
- this.activityCode = activityCode;
- }
-
- public void setComments(String comments) {
- this.comments = comments;
- }
-
- public void setAffectedRecordId(String affectedRecordId) {
- this.affectedRecordId = affectedRecordId;
- }
+ public static final String CD_ACTIVITY_LOGIN = "login";
+ public static final String CD_ACTIVITY_LOGOUT = "logout";
+ public static final String CD_ACTIVITY_MOBILE_LOGIN = "mobile_login";
+ public static final String CD_ACTIVITY_MOBILE_LOGOUT = "mobile_logout";
+
+ /*-------Profile activities -----------*/
+ public static final String CD_ACTIVITY_ROLE_ADD = "add_role";
+ public static final String CD_ACTIVITY_ROLE_REMOVE = "remove_role";
+ public static final String CD_ACTIVITY_CHILD_ROLE_ADD = "add_child_role";
+ public static final String CD_ACTIVITY_CHILD_ROLE_REMOVE = "remove_child_role";
+ public static final String CD_ACTIVITY_ROLE_ADD_FUNCTION = "add_role_function";
+ public static final String CD_ACTIVITY_ROLE_REMOVE_FUNCTION = "remove_role_function";
+ public static final String CD_ACTIVITY_USER_ROLE_ADD = "add_user_role";
+ public static final String CD_ACTIVITY_USER_ROLE_REMOVE = "remove_user_role";
+
+ /* Audit activities */
+ public static final String CD_ACTIVITY_FUNCTIONAL_ACCESS = "functional_access";
+ public static final String CD_ACTIVITY_TAB_ACCESS = "tab_access";
+ public static final String CD_ACTIVITY_APP_ACCESS = "app_access";
+ public static final String CD_ACTIVITY_LEFT_MENU_ACCESS = "left_menu_access";
+
+ private String activityCode;
+ private String affectedRecordId;
+ private String comments;
+ private Date auditDate;
+ private Long userId;
+
+ public AuditLog() {
+ setCreated(new Date());
+ }
+
+ public String getActivityCode() {
+ return activityCode;
+ }
+
+ public String getComments() {
+ return comments;
+ }
+
+ public String getAffectedRecordId() {
+ return affectedRecordId;
+ }
+
+ public void setActivityCode(String activityCode) {
+ this.activityCode = activityCode;
+ }
+
+ public void setComments(String comments) {
+ this.comments = comments;
+ }
+
+ public void setAffectedRecordId(String affectedRecordId) {
+ this.affectedRecordId = affectedRecordId;
+ }
public Date getAuditDate() {
return auditDate;
@@ -118,7 +117,5 @@ public class AuditLog extends DomainVo {
public void setUserId(Long userId) {
this.userId = userId;
}
-
-
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java
index d75a030a..01d6caed 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/BroadcastMessage.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,106 +37,99 @@
*/
package org.onap.portalsdk.core.domain;
-import java.util.*;
+import java.util.Date;
import org.onap.portalsdk.core.domain.support.DomainVo;
public class BroadcastMessage extends DomainVo {
-
- /**
- *
- */
-
- private static final long serialVersionUID = 1L;
- public BroadcastMessage() {
- }
-
- public static final String ID_MESSAGE_LOCATION_LOGIN = "10";
- public static final String ID_MESSAGE_LOCATION_WELCOME = "20";
-
- private String messageText;
- private Integer locationId;
- private Date startDate;
- private Date endDate;
- private Integer sortOrder;
- private Boolean active;
- private String siteCd;
-
- public Boolean getActive() {
- return active;
- }
-
- public Date getEndDate() {
- return endDate;
- }
-
- public Integer getLocationId() {
- return locationId;
- }
-
- public String getMessageText() {
- return messageText;
- }
-
- public Integer getSortOrder() {
- return sortOrder;
- }
-
- public Date getStartDate() {
- return startDate;
- }
-
- public String getSiteCd() {
- return siteCd;
- }
-
-
- public void setActive(Boolean active) {
- this.active = active;
- }
-
- public void setEndDate(Date endDate) {
- this.endDate = endDate;
- }
-
- public void setLocationId(Integer locationId) {
- this.locationId = locationId;
- }
-
- public void setMessageText(String messageText) {
- this.messageText = messageText;
- }
-
- public void setSortOrder(Integer sortOrder) {
- this.sortOrder = sortOrder;
- }
-
- public void setStartDate(Date startDate) {
- this.startDate = startDate;
- }
-
- public void setSiteCd(String siteCd) {
- this.siteCd = siteCd;
- }
-
-
- public int compareTo(Object obj){
- Integer c1 = getLocationId();
- Integer c2 = ((BroadcastMessage)obj).getLocationId();
-
- if (c1.compareTo(c2) == 0) {
- c1 = getSortOrder();
- c2 = ((BroadcastMessage)obj).getSortOrder();
-
- if (c1.compareTo(c2) == 0) {
- Long c3 = getId();
- Long c4 = ((BroadcastMessage)obj).getId();
-
- return c3.compareTo(c4);
- }
- }
-
- return c1.compareTo(c2);
- }
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String ID_MESSAGE_LOCATION_LOGIN = "10";
+ public static final String ID_MESSAGE_LOCATION_WELCOME = "20";
+
+ private String messageText;
+ private Integer locationId;
+ private Date startDate;
+ private Date endDate;
+ private Integer sortOrder;
+ private Boolean active;
+ private String siteCd;
+
+ public Boolean getActive() {
+ return active;
+ }
+
+ public Date getEndDate() {
+ return endDate;
+ }
+
+ public Integer getLocationId() {
+ return locationId;
+ }
+
+ public String getMessageText() {
+ return messageText;
+ }
+
+ public Integer getSortOrder() {
+ return sortOrder;
+ }
+
+ public Date getStartDate() {
+ return startDate;
+ }
+
+ public String getSiteCd() {
+ return siteCd;
+ }
+
+ public void setActive(Boolean active) {
+ this.active = active;
+ }
+
+ public void setEndDate(Date endDate) {
+ this.endDate = endDate;
+ }
+
+ public void setLocationId(Integer locationId) {
+ this.locationId = locationId;
+ }
+
+ public void setMessageText(String messageText) {
+ this.messageText = messageText;
+ }
+
+ public void setSortOrder(Integer sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+
+ public void setStartDate(Date startDate) {
+ this.startDate = startDate;
+ }
+
+ public void setSiteCd(String siteCd) {
+ this.siteCd = siteCd;
+ }
+
+ @Override
+ public int compareTo(Object obj) {
+ Integer c1 = getLocationId();
+ Integer c2 = ((BroadcastMessage) obj).getLocationId();
+
+ if (c1.compareTo(c2) == 0) {
+ c1 = getSortOrder();
+ c2 = ((BroadcastMessage) obj).getSortOrder();
+
+ if (c1.compareTo(c2) == 0) {
+ Long c3 = getId();
+ Long c4 = ((BroadcastMessage) obj).getId();
+
+ return c3.compareTo(c4);
+ }
+ }
+
+ return c1.compareTo(c2);
+ }
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java
index 355f36cb..2818bf04 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/DomainVo.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -48,7 +48,7 @@ import java.util.Set;
/* Super class from which all data objects descend
*
- * Per Sunder T on 3 June 2016:
+ * @deprecated per Sunder T on 3 June 2016:
*
* Yes, we need to get rid of domain.DomainVO and fold all the references to the support.DomainVO.
*/
@@ -56,9 +56,6 @@ import java.util.Set;
@Deprecated
public class DomainVo extends FusionVo implements Serializable, Cloneable, Comparable {
- /**
- *
- */
private static final long serialVersionUID = 1L;
protected Long id;
protected Date created;
@@ -71,9 +68,6 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa
Set auditTrail = null;
- public DomainVo() {
- }
-
public void setId(Long i) {
id = i;
}
@@ -147,10 +141,6 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa
getAuditTrail().add(auditLog);
}
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
public Object copy() {
return copy(false);
}
@@ -185,6 +175,7 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa
return newVo;
}
+ @Override
public int compareTo(Object obj) {
Long c1 = getId();
Long c2 = ((DomainVo) obj).getId();
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java
index f4ed41e4..894c35f1 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FnMenu.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -37,123 +37,148 @@
*/
package org.onap.portalsdk.core.domain;
-
import org.onap.portalsdk.core.domain.support.DomainVo;
/**
- *
RoleFunction.java
+ *
+ * RoleFunction.java
+ *
*
- *
Represents a role function data object.
+ *
+ * Represents a role function data object.
+ *
*
* @version 1.0
*/
public class FnMenu extends DomainVo {
- /**
- *
- */
+
private static final long serialVersionUID = 1L;
- public FnMenu() {}
-
- private Integer menuId;
- private String label;
- private Integer parentId;
- private String action;
- private String functionCd;
- private Integer sortOrder;
- private String servlet;
- private String queryString;
- private String externalUrl;
- private String target;
- private String active;
- private String separator;
- private String imageSrc;
- private String menuSetCode;
-
+
+ private Integer menuId;
+ private String label;
+ private Integer parentId;
+ private String action;
+ private String functionCd;
+ private Integer sortOrder;
+ private String servlet;
+ private String queryString;
+ private String externalUrl;
+ private String target;
+ private String active;
+ private String separator;
+ private String imageSrc;
+ private String menuSetCode;
+
public Integer getMenuId() {
return menuId;
}
+
public void setMenuId(Integer menuId) {
this.menuId = menuId;
}
+
public String getLabel() {
return label;
}
+
public void setLabel(String label) {
this.label = label;
}
+
public Integer getParentId() {
return parentId;
}
+
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
+
public String getAction() {
return action;
}
+
public void setAction(String action) {
this.action = action;
}
+
public String getFunctionCd() {
return functionCd;
}
+
public void setFunctionCd(String functionCd) {
this.functionCd = functionCd;
}
+
public Integer getSortOrder() {
return sortOrder;
}
+
public void setSortOrder(Integer sortOrder) {
this.sortOrder = sortOrder;
}
+
public String getServlet() {
return servlet;
}
+
public void setServlet(String servlet) {
this.servlet = servlet;
}
+
public String getQueryString() {
return queryString;
}
+
public void setQueryString(String queryString) {
this.queryString = queryString;
}
+
public String getExternalUrl() {
return externalUrl;
}
+
public void setExternalUrl(String externalUrl) {
this.externalUrl = externalUrl;
}
+
public String getTarget() {
return target;
}
+
public void setTarget(String target) {
this.target = target;
}
+
public String getActive() {
return active;
}
+
public void setActive(String active) {
this.active = active;
}
+
public String getSeparator() {
return separator;
}
+
public void setSeparator(String separator) {
this.separator = separator;
}
+
public String getImageSrc() {
return imageSrc;
}
+
public void setImageSrc(String imageSrc) {
this.imageSrc = imageSrc;
}
+
public String getMenuSetCode() {
return menuSetCode;
}
+
public void setMenuSetCode(String menuSetCode) {
this.menuSetCode = menuSetCode;
}
-
-
-
+
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java
index bf2321ba..ac25ae10 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/FusionVo.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -40,6 +40,7 @@ package org.onap.portalsdk.core.domain;
import org.onap.portalsdk.core.FusionObject;
public class FusionVo implements FusionObject {
- public FusionVo() {
- }
+ public FusionVo() {
+ // No-argument constructor
+ }
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java
index 742f26b6..f6675a01 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/LoginBean.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -44,162 +44,169 @@ import org.onap.portalsdk.core.domain.support.FusionCommand;
@SuppressWarnings("rawtypes")
public class LoginBean extends FusionCommand {
- private String loginId;
- private String loginPwd;
- private String hrid;
- private String orgUserId;
- private String siteAccess;
- private String loginErrorMessage;
-
- private User user;
- private Set menu;
- private Set businessDirectMenu;
-
- /**
- * getLoginId
- *
- * @return String
- */
- public String getLoginId() {
- return loginId;
- }
-
- /**
- * getLoginPwd
- *
- * @return String
- */
- public String getLoginPwd() {
- return loginPwd;
- }
-
- /**
- * getMenu
- *
- * @return Set
- */
- public Set getMenu() {
- return menu;
- }
-
- /**
- * getUser
- *
- * @return User
- */
- public User getUser() {
- return user;
- }
-
- /**
- * getHrid
- *
- * @return String
- */
- public String getHrid() {
- return hrid;
- }
-
- /**
- * getSiteAccess
- *
- * @return String
- */
- public String getSiteAccess() {
- return siteAccess;
- }
-
- /**
- * getBusinessDirectMenu
- *
- * @return Set
- */
- public Set getBusinessDirectMenu() {
- return businessDirectMenu;
- }
-
- /**
- * getLoginErrorMessage
- *
- * @return String
- */
- public String getLoginErrorMessage() {
- return loginErrorMessage;
- }
-
- public String getOrgUserId() {
- return orgUserId;
- }
-
- /**
- * setLoginId
- *
- * @param loginId String
- */
- public void setLoginId(String loginId) {
- this.loginId = loginId;
- }
-
- /**
- * setLoginPwd
- *
- * @param loginPwd String
- */
- public void setLoginPwd(String loginPwd) {
- this.loginPwd = loginPwd;
- }
-
- public void setMenu(Set menu) {
- this.menu = menu;
- }
-
- /**
- * setUser
- *
- * @param user User
- */
- public void setUser(User user) {
- this.user = user;
- }
-
- /**
- * setHrid
- *
- * @param hrid String
- */
- public void setHrid(String hrid) {
- this.hrid = hrid;
- }
-
- /**
- * setSiteAccess
- *
- * @param siteAccess String
- */
- public void setSiteAccess(String siteAccess) {
- this.siteAccess = siteAccess;
- }
-
- /**
- * setBusinessDirectMenu
- *
- * @param businessDirectMenu Set
- */
- public void setBusinessDirectMenu(Set businessDirectMenu) {
- this.businessDirectMenu = businessDirectMenu;
- }
-
- /**
- * setLoginErrorMessage
- *
- * @param loginErrorMessage String
- */
- public void setLoginErrorMessage(String loginErrorMessage) {
- this.loginErrorMessage = loginErrorMessage;
- }
-
- public void setOrgUserId(String orgUserId) {
- this.orgUserId = orgUserId;
- }
+ private String loginId;
+ private String loginPwd;
+ private String hrid;
+ private String orgUserId;
+ private String siteAccess;
+ private String loginErrorMessage;
+
+ private User user;
+ private Set menu;
+ private Set businessDirectMenu;
+
+ /**
+ * getLoginId
+ *
+ * @return String
+ */
+ public String getLoginId() {
+ return loginId;
+ }
+
+ /**
+ * getLoginPwd
+ *
+ * @return String
+ */
+ public String getLoginPwd() {
+ return loginPwd;
+ }
+
+ /**
+ * getMenu
+ *
+ * @return Set
+ */
+ public Set getMenu() {
+ return menu;
+ }
+
+ /**
+ * getUser
+ *
+ * @return User
+ */
+ public User getUser() {
+ return user;
+ }
+
+ /**
+ * getHrid
+ *
+ * @return String
+ */
+ public String getHrid() {
+ return hrid;
+ }
+
+ /**
+ * getSiteAccess
+ *
+ * @return String
+ */
+ public String getSiteAccess() {
+ return siteAccess;
+ }
+
+ /**
+ * getBusinessDirectMenu
+ *
+ * @return Set
+ */
+ public Set getBusinessDirectMenu() {
+ return businessDirectMenu;
+ }
+
+ /**
+ * getLoginErrorMessage
+ *
+ * @return String
+ */
+ public String getLoginErrorMessage() {
+ return loginErrorMessage;
+ }
+
+ public String getOrgUserId() {
+ return orgUserId;
+ }
+
+ /**
+ * setLoginId
+ *
+ * @param loginId
+ * String
+ */
+ public void setLoginId(String loginId) {
+ this.loginId = loginId;
+ }
+
+ /**
+ * setLoginPwd
+ *
+ * @param loginPwd
+ * String
+ */
+ public void setLoginPwd(String loginPwd) {
+ this.loginPwd = loginPwd;
+ }
+
+ public void setMenu(Set menu) {
+ this.menu = menu;
+ }
+
+ /**
+ * setUser
+ *
+ * @param user
+ * User
+ */
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ /**
+ * setHrid
+ *
+ * @param hrid
+ * String
+ */
+ public void setHrid(String hrid) {
+ this.hrid = hrid;
+ }
+
+ /**
+ * setSiteAccess
+ *
+ * @param siteAccess
+ * String
+ */
+ public void setSiteAccess(String siteAccess) {
+ this.siteAccess = siteAccess;
+ }
+
+ /**
+ * setBusinessDirectMenu
+ *
+ * @param businessDirectMenu
+ * Set
+ */
+ public void setBusinessDirectMenu(Set businessDirectMenu) {
+ this.businessDirectMenu = businessDirectMenu;
+ }
+
+ /**
+ * setLoginErrorMessage
+ *
+ * @param loginErrorMessage
+ * String
+ */
+ public void setLoginErrorMessage(String loginErrorMessage) {
+ this.loginErrorMessage = loginErrorMessage;
+ }
+
+ public void setOrgUserId(String orgUserId) {
+ this.orgUserId = orgUserId;
+ }
}
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java
index 6248de85..cf7163ca 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/domain/Lookup.java
@@ -6,7 +6,7 @@
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
- * under the Apache License, Version 2.0 (the “License”);
+ * under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -19,7 +19,7 @@
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
@@ -44,56 +44,56 @@ import org.onap.portalsdk.core.domain.support.NameValueId;
public class Lookup extends FusionVo implements Serializable {
- /**
- *
- */
private static final long serialVersionUID = 1L;
- private NameValueId nameValueId = new NameValueId();
+ private NameValueId nameValueId = new NameValueId();
- public Lookup() {}
+ public Lookup() {
+ super();
+ }
- public Lookup(String label, String value) {
- this();
- setLabel(label);
- setValue(value);
- }
+ public Lookup(String label, String value) {
+ this();
+ setLabel(label);
+ setValue(value);
+ }
- public String getValue() {
- return getNameValueId().getVal();
- }
+ public String getValue() {
+ return getNameValueId().getVal();
+ }
- public String getLabel() {
- return getNameValueId().getLab();
- }
+ public String getLabel() {
+ return getNameValueId().getLab();
+ }
- public void setValue(String value) {
- getNameValueId().setVal(value);
- }
+ public void setValue(String value) {
+ getNameValueId().setVal(value);
+ }
- public void setLabel(String label) {
- getNameValueId().setLab(label);
- }
+ public void setLabel(String label) {
+ getNameValueId().setLab(label);
+ }
- public NameValueId getNameValueId() {
- return nameValueId;
- }
+ public NameValueId getNameValueId() {
+ return nameValueId;
+ }
- public void setNameValueId(NameValueId nameValueId) {
- this.nameValueId = nameValueId;
- }
+ public void setNameValueId(NameValueId nameValueId) {
+ this.nameValueId = nameValueId;
+ }
- // required by ZK for to set the selectedItems of Listboxes (used heavily for