1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.plugin.activitystream.plugin

File ActivityEvent.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart3.png
80% of files have more coverage

Code metrics

6
35
30
1
295
138
33
0.94
1.17
30
1.1

Classes

Class Line # Actions
ActivityEvent 33 35 0% 33 52
0.2676056326.8%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package com.xpn.xwiki.plugin.activitystream.plugin;
21   
22    import com.xpn.xwiki.api.Api;
23    import com.xpn.xwiki.XWikiContext;
24   
25    import java.util.Date;
26    import java.util.Map;
27   
28    /**
29    * Api wrapper for a {@link com.xpn.xwiki.plugin.activitystream.api.ActivityEvent} to be exposed from velocity.
30    *
31    * @version $Id: 9446f358b6727f2e354749680da30ea1b4f29751 $
32    */
 
33    public class ActivityEvent extends Api
34    {
35    /**
36    * Wrapped event.
37    */
38    protected com.xpn.xwiki.plugin.activitystream.api.ActivityEvent event;
39   
40    /**
41    * Constructor.
42    *
43    * @param event event to wrap
44    * @param context the XWiki context
45    */
 
46  126 toggle public ActivityEvent(com.xpn.xwiki.plugin.activitystream.api.ActivityEvent event, XWikiContext context)
47    {
48  126 super(context);
49  126 this.event = event;
50    }
51   
52    /**
53    * @return The unique ID of the event
54    */
 
55  0 toggle public String getEventId()
56    {
57  0 return event.getEventId();
58    }
59   
60    /**
61    * @return The request ID
62    */
 
63  19 toggle public String getRequestId()
64    {
65  19 return event.getRequestId();
66    }
67   
68    /**
69    * @return The priority of the event
70    */
 
71  0 toggle public int getPriority()
72    {
73  0 return event.getPriority();
74    }
75   
76    /**
77    * @return The type of the event
78    */
 
79  504 toggle public String getType()
80    {
81  504 return event.getType();
82    }
83   
84    /**
85    * @return The application name
86    */
 
87  96 toggle public String getApplication()
88    {
89  96 return event.getApplication();
90    }
91   
92    /**
93    * @return The stream name
94    */
 
95  0 toggle public String getStream()
96    {
97  0 return event.getStream();
98    }
99   
100    /**
101    * @return The stream name
102    */
 
103  72 toggle public Date getDate()
104    {
105  72 return event.getDate();
106    }
107   
108    /**
109    * @return The wiki name of the user creating the event
110    */
 
111  232 toggle public String getUser()
112    {
113  232 return event.getUser();
114    }
115   
116    /**
117    * @return The wiki name in which the event was created
118    */
 
119  55 toggle public String getWiki()
120    {
121  55 return event.getWiki();
122    }
123   
124    /**
125    * @return The space name in which the event was created
126    */
 
127  0 toggle public String getSpace()
128    {
129  0 return event.getSpace();
130    }
131   
132    /**
133    * @return The page of the event
134    */
 
135  0 toggle public String getPage()
136    {
137  0 return event.getPage();
138    }
139   
140    /**
141    * @return The target url
142    */
 
143  0 toggle public String getUrl()
144    {
145  0 return event.getUrl();
146    }
147   
148    /**
149    * @return The title of the event
150    */
 
151  0 toggle public String getTitle()
152    {
153  0 return event.getTitle();
154    }
155   
156    /**
157    * @return The Body of the event
158    */
 
159  0 toggle public String getBody()
160    {
161  0 return event.getBody();
162    }
163   
164    /**
165    * Allows to modify the title of an event This might be useful to control the display or RSS feeds.
166    *
167    * @param title title to set
168    */
 
169  0 toggle public void setTitle(String title)
170    {
171  0 if (hasProgrammingRights()) {
172  0 event.setTitle(title);
173    }
174    }
175   
176    /**
177    * Allows to modify the body of an event This might be useful to control the display or RSS feeds.
178    *
179    * @param body body to set
180    */
 
181  0 toggle public void setBody(String body)
182    {
183  0 if (hasProgrammingRights()) {
184  0 event.setBody(body);
185    }
186    }
187   
188    /**
189    * @return The document version on the event
190    */
 
191  14 toggle public String getVersion()
192    {
193  14 return event.getVersion();
194    }
195   
196    /**
197    * @return The first param of the event
198    */
 
199  0 toggle public String getParam1()
200    {
201  0 return event.getParam1();
202    }
203   
204    /**
205    * @return The second param of the event
206    */
 
207  0 toggle public String getParam2()
208    {
209  0 return event.getParam2();
210    }
211   
212    /**
213    * @return The third param of the event
214    */
 
215  0 toggle public String getParam3()
216    {
217  0 return event.getParam3();
218    }
219   
220    /**
221    * @return The fourth param of the event
222    */
 
223  0 toggle public String getParam4()
224    {
225  0 return event.getParam4();
226    }
227   
228    /**
229    * @return The fifth param of the event
230    */
 
231  0 toggle public String getParam5()
232    {
233  0 return event.getParam5();
234    }
235   
236    /**
237    * @return the event in displayable format.
238    */
 
239  0 toggle public String getDisplayTitle()
240    {
241  0 return event.getDisplayTitle(context);
242    }
243   
244    /**
245    * @return the event body in displayable format
246    */
 
247  0 toggle public String getDisplayBody()
248    {
249  0 return event.getDisplayBody(context);
250    }
251   
252    /**
253    * @return the event date in displayable format
254    */
 
255  0 toggle public String getDisplayDate()
256    {
257  0 return event.getDisplayDate(context);
258    }
259   
260    /**
261    * @return the event user in displayable format
262    */
 
263  0 toggle public String getDisplayUser()
264    {
265  0 return event.getDisplayUser(context);
266    }
267   
268    /**
269    * @return the parameters associated with the event
270    */
 
271  0 toggle public Map<String, String> getParameters()
272    {
273  0 return event.getParameters();
274    }
275   
276    /**
277    * @return the wrapped event
278    */
 
279  0 toggle public com.xpn.xwiki.plugin.activitystream.api.ActivityEvent getProtectedEvent()
280    {
281  0 if (hasProgrammingRights()) {
282  0 return event;
283    } else {
284  0 return null;
285    }
286    }
287   
288    /**
289    * @return the wrapped event
290    */
 
291  72 toggle protected com.xpn.xwiki.plugin.activitystream.api.ActivityEvent getEvent()
292    {
293  72 return event;
294    }
295    }