My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
/**
* Vosao CMS. Simple CMS for Google App Engine.
*
* Copyright (C) 2009-2010 Vosao development team.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* email: vosao.dev@gmail.com
*/

package org.vosao.velocity;

import java.util.Date;
import java.util.List;

import org.vosao.entity.PageEntity;
import org.vosao.service.vo.CommentVO;
import org.vosao.service.vo.FileVO;
import org.vosao.service.vo.UserVO;

/**
* @author Alexander Oleynik
*/
public interface VelocityService {

/**
* Find approved last version of page entity by friendlyURL.
* @param path - firnedly url.
* @return found page.
*/
PageEntity findPage(final String path);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL. Ordered by publishDate.
* @param path - friendly url.
* @return list of found pages.
*/
List<PageEntity> findPageChildren(final String path);

/**
* Find approved last versions of children pages entity by parent pages
* friendlyURL. Ordered by publishDate.
* @param paths - friendly urls.
* @return list of found pages.
*/
List<PageEntity> findPageChildren(final List<String> paths);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL. Ordered by publishDate.
* @param path - friendly url.
* @param count - maximum list size.
* @return list of found pages.
*/
List<PageEntity> findPageChildren(final String path, final int count);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL. Ordered by publishDate.
* @param path - friendly url.
* @param start - start page index. 0 - based.
* @param count - maximum list size.
* @return list of found pages.
*/
List<PageEntity> findPageChildren(final String path, final int start,
final int count);

/**
* Find approved last versions of children pages entity by parent pages
* friendlyURL. Ordered by publishDate.
* @param paths - friendly urls.
* @param start - start page index. 0 - based.
* @param count - maximum list size.
* @return list of found pages.
*/
List<PageEntity> findPageChildren(final List<String> paths, final int start,
final int count);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL and publish date.
* @param path - friendly url.
* @param publishDate - publishDate.
* @return list of found pages.
*/
List<PageEntity> findPageChildren(final String path,
final Date publishDate);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL and publish date in period between startDate end endDate.
* @param path - friendly url.
* @param startDate - period start publish date (inclusive).
* @param endDate - period end publish date (exclusive).
* @return list of found pages.
*/
List<PageEntity> findPageChildren(final String path,
final Date startDate, final Date endDate);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL and publish date in period adjusted by year and month.
* @param path - friendly url.
* @param year - year of period.
* @param month - month of period.
* @return list of found pages.
*/
List<PageEntity> findPageChildrenMonth(final String path,
final int year, final int month);

/**
* Find approved last versions of children pages entity by parent pages
* friendlyURL and publish date in period adjusted by year and month.
* @param paths - friendly urls.
* @param year - year of period.
* @param month - month of period.
* @return list of found pages.
*/
List<PageEntity> findPageChildrenMonth(final List<String> paths,
final int year, final int month);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL. Ordered by sortIndex.
* @param path - friendly url.
* @return list of found pages.
*/
List<PageEntity> findPageChildrenOrdered(final String path);

/**
* Find approved last versions of children pages entity by parent page
* friendlyURL. Ordered by sortIndex.
* @param path - friendly url.
* @param count - maximum list size.
* @return list of found pages.
*/
List<PageEntity> findPageChildrenOrdered(final String path, final int count);

List<CommentVO> getCommentsByPage(final String pageUrl);

/**
* Find approved last version page content by friendlyURL and language.
* @param path - page friendlyURL.
* @param languageCode - content language code.
* @return found content.
*/
String findContent(final String path, final String languageCode);

/**
* Find approved last version page content by friendlyURL and current
* language.
* @param path - page friendlyURL.
* @return found content.
*/
String findContent(final String path);

/**
* Find approved last versions of children pages content by parent page
* friendlyURL and language code.
* @param path - firnedly url.
* @param languageCode - language code.
* @return list of found contents.
*/
List<String> findChildrenContent(final String path,
final String languageCode);

/**
* Find approved last versions of children pages content by parent page
* friendlyURL and current language code.
* @param path - firnedly url.
* @return list of found contents.
*/
List<String> findChildrenContent(final String path);

UserVO findUser(final String email);

/**
* Find approved last version structured page field content by friendlyURL
* and current language.
* @param path - page friendlyURL.
* @param field - structured page field.
* @return found content.
*/
String findStructureContent(String path, String field);

/**
* Find approved last version structured page field content by friendlyURL
* and specified language.
* @param path - page friendlyURL.
* @param field - structured page field.
* @param languageCode - two char language code. For example "ru".
* @return found content.
*/
String findStructureContent(String path, String field, String languageCode);

TagVelocityService getTag();

PicasaVelocityService getPicasa();

/**
* Render structure page specified by path using structure template
* specified by unique structureTemplateName.
* @param path - page path.
* @param structureTemplateName - structure template name.
* @return - rendered content.
*/
String renderStructureContent(String path, String structureTemplateName);

/**
* Get all page's resources.
* @param url - page friendly url.
* @return - list of page's file resources.
*/
List<FileVO> getPageResources(String url);

/**
* Get all resources by folder path.
* @param path - folder path.
* @return - list of file resources.
*/
List<FileVO> getResources(String path);

/**
* Get resource by folder path.
* @param path - resource path.
* @param encoding - text file encoding.
* @return - file resource.
*/
FileVO getResource(String path, String encoding);

/**
* Get resource by folder path.
* @param path - resource path.
* @return - file resource.
*/
FileVO getResource(String path);

List<CommentVO> getRecentComments(int limit);
}

Change log

r1048 by kinyelo on Apr 13, 2011   Diff
Fixed  issue 458 
Go to: 
Project members, sign in to write a code review

Older revisions

r1020 by kinyelo on Feb 24, 2011   Diff
Implemented recent comments Velocity
service.
r1008 by kinyelo on Feb 8, 2011   Diff
Fixed  issue 383 
r916 by kinyelo on Sep 25, 2010   Diff
Fixed  issue 341 
All revisions of this file

File info

Size: 7861 bytes, 252 lines
Powered by Google Project Hosting