nexus site path corrected
[portal.git] / ecomp-portal-BE / src / main / java / org / openecomp / portalapp / portal / transport / FunctionalMenuItem.java
1 /*-
2  * ================================================================================
3  * eCOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.transport;
21
22 import java.io.Serializable;
23 import java.util.List;
24
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.GenerationType;
29 import javax.persistence.Id;
30 import javax.persistence.Table;
31 import javax.persistence.Transient;
32
33 @Entity
34 @Table(name="fn_menu_functional")
35 public class FunctionalMenuItem implements Serializable {
36         private static final long serialVersionUID = 1L;
37
38         @Id
39     @GeneratedValue(strategy=GenerationType.IDENTITY)
40         @Column(name = "MENU_ID")
41         public Long menuId;
42         
43         @Column(name = "COLUMN_NUM")
44         public Integer column;
45         
46         @Column(name = "TEXT")
47         public String text;
48         
49         @Column(name = "PARENT_MENU_ID")
50         public Integer parentMenuId;
51         
52         @Column(name = "URL")
53         public String url;
54         
55         @Column(name="ACTIVE_YN")
56         public String active_yn;
57
58         @Transient
59         public Integer appid;
60         
61         @Transient
62         public List<Integer> roles;
63         
64         @Transient
65         public Boolean restrictedApp;
66         
67         public void normalize() {
68                 if (this.column == null)
69                         this.column = new Integer(1);
70                 this.text = (this.text == null) ? "" : this.text.trim();
71                 if (this.parentMenuId == null)
72                         this.parentMenuId = new Integer(-1);
73                 this.url = (this.url == null) ? "" : this.url.trim();
74         }
75
76         @Override
77         public String toString() {
78                 return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
79                                 + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
80                                 + ", restrictedApp=" + restrictedApp + "]";
81         }
82
83         public void setUrl(String url) {
84                 this.url = url;
85         }
86
87         public void setRestrictedApp(Boolean restrictedApp) {
88                 this.restrictedApp = restrictedApp;
89         }
90 }