Merge "Fix sql injection vulnerability"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / transport / CommonWidget.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * 
37  */
38 package org.onap.portalapp.portal.transport;
39
40 import javax.persistence.Column;
41 import javax.persistence.Entity;
42 import javax.persistence.GeneratedValue;
43 import javax.persistence.GenerationType;
44 import javax.persistence.Id;
45 import javax.persistence.Table;
46
47 import org.hibernate.validator.constraints.SafeHtml;
48 import org.onap.portalsdk.core.domain.support.DomainVo;
49 import com.fasterxml.jackson.annotation.JsonInclude;
50
51 /**
52  * This is to handle portal admins
53  */
54 @Entity 
55 @Table(name="fn_common_widget_data")
56 @JsonInclude(JsonInclude.Include.NON_NULL)
57 public class CommonWidget extends DomainVo{
58
59         private static final long serialVersionUID = 7897021982887364557L;
60         
61         @Id
62         @GeneratedValue(strategy=GenerationType.AUTO)
63         @Column(name = "id")
64         private Long id;
65
66         @Column(name = "category")
67         @SafeHtml
68         public String category;
69         
70         @Column(name = "href")
71         @SafeHtml
72         public String href;
73
74         @Column(name = "title")
75         @SafeHtml
76         public String title;
77         
78         @Column(name = "content")
79         @SafeHtml
80         public String content;
81
82         @Column(name = "event_date")
83         @SafeHtml
84         public String eventDate;
85         
86         @Column(name = "sort_order")
87         public Integer sortOrder;
88
89
90         public CommonWidget(){
91
92         }
93
94         public CommonWidget(String category, String href, String title, String content, String eventDate, Integer sortOrder){
95                 this.category = category;
96                 this.href = href;
97                 this.title = title;
98                 this.content = content;
99                 this.eventDate = eventDate;
100                 this.sortOrder = sortOrder;
101         }
102
103         public String getCategory() {
104                 return category;
105         }
106
107         public void setCategory(String category) {
108                 this.category = category;
109         }
110
111         public String getHref() {
112                 return href;
113         }
114
115         public void setHref(String href) {
116                 this.href = href;
117         }
118
119         public String getTitle() {
120                 return title;
121         }
122
123         public void setTitle(String title) {
124                 this.title = title;
125         }
126
127         public Integer getSortOrder() {
128                 return sortOrder;
129         }
130
131         public void setSortOrder(Integer sortOrder) {
132                 this.sortOrder = sortOrder;
133         }
134
135         public static long getSerialversionuid() {
136                 return serialVersionUID;
137         }
138
139         public Long getId() {
140                 return id;
141         }
142
143         public void setId(Long id) {            
144                 this.id = id;
145         }
146
147         public String getContent() {
148                 return content;
149         }
150
151         public void setContent(String content) {
152                 this.content = content;
153         }
154
155         public String getEventDate() {
156                 return eventDate;
157         }
158
159         public void setEventDate(String eventDate) {
160                 this.eventDate = eventDate;
161         }       
162 }