2  * ================================================================================
\r 
   4  * ================================================================================
\r 
   5  * Copyright (C) 2017 AT&T Intellectual Property
\r 
   6  * ================================================================================
\r 
   7  * Licensed under the Apache License, Version 2.0 (the "License");
\r 
   8  * you may not use this file except in compliance with the License.
\r 
   9  * You may obtain a copy of the License at
\r 
  11  *      http://www.apache.org/licenses/LICENSE-2.0
\r 
  13  * Unless required by applicable law or agreed to in writing, software
\r 
  14  * distributed under the License is distributed on an "AS IS" BASIS,
\r 
  15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r 
  16  * See the License for the specific language governing permissions and
\r 
  17  * limitations under the License.
\r 
  18  * ================================================================================
\r 
  20 package org.openecomp.portalapp.portal.domain;
\r 
  22 import java.util.List;
\r 
  24 import javax.persistence.Column;
\r 
  25 import javax.persistence.Entity;
\r 
  26 import javax.persistence.GeneratedValue;
\r 
  27 import javax.persistence.GenerationType;
\r 
  28 import javax.persistence.Id;
\r 
  29 import javax.persistence.Transient;
\r 
  32  * This class is almost identical to org.openecomp.portalapp.portal.transport.FunctionalMenuItem
\r 
  33  * The only difference is the appId field. In FunctionMenuItem, we used @Transient as an attribute, and we are using @Column in this class.
\r 
  34  * In some sql queries, we need to have appId, but it's not a field in fn_menu_functional table.
\r 
  40 public class FunctionalMenuItemWithAppID{
\r 
  41         private static final long serialVersionUID = 1L;
\r 
  44     @GeneratedValue(strategy=GenerationType.IDENTITY)
\r 
  45         @Column(name = "MENU_ID")
\r 
  48         @Column(name = "COLUMN_NUM")
\r 
  49         public Integer column;
\r 
  51         @Column(name = "TEXT")
\r 
  54         @Column(name = "PARENT_MENU_ID")
\r 
  55         public Integer parentMenuId;
\r 
  57         @Column(name = "URL")
\r 
  60         @Column(name="ACTIVE_YN")
\r 
  61         public String active_yn;
\r 
  63         @Column(name="APP_ID")
\r 
  64         public Integer appid;
\r 
  67         public List<Integer> roles;
\r 
  70         public Boolean restrictedApp;
\r 
  72         public void normalize() {
\r 
  73                 if (this.column == null)
\r 
  74                         this.column = new Integer(1);
\r 
  75                 this.text = (this.text == null) ? "" : this.text.trim();
\r 
  76                 if (this.parentMenuId == null)
\r 
  77                         this.parentMenuId = new Integer(-1);
\r 
  78                 this.url = (this.url == null) ? "" : this.url.trim();
\r 
  82         public String toString() {
\r 
  83                 return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
\r 
  84                                 + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
\r 
  85                                 + ", restrictedApp=" + restrictedApp + "]";
\r 
  88         public void setUrl(String url) {
\r 
  92         public void setRestrictedApp(Boolean restrictedApp) {
\r 
  93                 this.restrictedApp = restrictedApp;
\r