1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rest.internal.resources.pages; |
21 |
|
|
22 |
|
import javax.inject.Named; |
23 |
|
|
24 |
|
import org.xwiki.component.annotation.Component; |
25 |
|
import org.xwiki.rest.XWikiResource; |
26 |
|
import org.xwiki.rest.XWikiRestException; |
27 |
|
import org.xwiki.rest.internal.DomainObjectFactory; |
28 |
|
import org.xwiki.rest.internal.Utils; |
29 |
|
import org.xwiki.rest.model.jaxb.Page; |
30 |
|
import org.xwiki.rest.resources.pages.PageTranslationVersionResource; |
31 |
|
|
32 |
|
import com.xpn.xwiki.XWikiException; |
33 |
|
import com.xpn.xwiki.api.Document; |
34 |
|
|
35 |
|
|
36 |
|
@version |
37 |
|
|
38 |
|
@Component |
39 |
|
@Named("org.xwiki.rest.internal.resources.pages.PageTranslationVersionResourceImpl") |
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.4 |
|
40 |
|
public class PageTranslationVersionResourceImpl extends XWikiResource implements PageTranslationVersionResource |
41 |
|
{ |
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
42 |
0 |
@Override... |
43 |
|
public Page getPageTranslationVersion(String wikiName, String spaceName, String pageName, String language, |
44 |
|
String version, Boolean withPrettyNames) throws XWikiRestException |
45 |
|
{ |
46 |
0 |
try { |
47 |
0 |
DocumentInfo documentInfo = getDocumentInfo(wikiName, spaceName, pageName, language, version, true, false); |
48 |
|
|
49 |
0 |
Document doc = documentInfo.getDocument(); |
50 |
|
|
51 |
0 |
return DomainObjectFactory.createPage(objectFactory, uriInfo.getBaseUri(), uriInfo.getAbsolutePath(), doc, |
52 |
|
false, Utils.getXWikiApi(componentManager), withPrettyNames); |
53 |
|
} catch (XWikiException e) { |
54 |
0 |
throw new XWikiRestException(e); |
55 |
|
} |
56 |
|
} |
57 |
|
} |