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 |
|
package info.magnolia.module.blossom.view; |
35 |
|
|
36 |
|
import java.util.Map; |
37 |
|
import javax.servlet.http.HttpServletRequest; |
38 |
|
import javax.servlet.http.HttpServletResponse; |
39 |
|
|
40 |
|
import org.springframework.web.servlet.view.RedirectView; |
41 |
|
|
42 |
|
import info.magnolia.link.LinkUtil; |
43 |
|
import info.magnolia.repository.RepositoryConstants; |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
@see |
49 |
|
@since |
50 |
|
|
|
|
| 80% |
Uncovered Elements: 2 (10) |
Complexity: 4 |
Complexity Density: 0.67 |
|
51 |
|
public class UuidRedirectView extends RedirectView { |
52 |
|
|
53 |
|
private String workspace; |
54 |
|
private String uuid; |
55 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
0 |
public UuidRedirectView(String uuid) {... |
57 |
0 |
this(RepositoryConstants.WEBSITE, uuid); |
58 |
|
} |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
60 |
5 |
public UuidRedirectView(String workspace, String uuid) {... |
61 |
5 |
this.workspace = workspace; |
62 |
5 |
this.uuid = uuid; |
63 |
|
} |
64 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
65 |
|
public String getWorkspace() {... |
66 |
|
return workspace; |
67 |
|
} |
68 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
69 |
|
@Deprecated... |
70 |
|
public String getRepository() { |
71 |
|
return workspace; |
72 |
|
} |
73 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
74 |
|
public String getUuid() {... |
75 |
|
return uuid; |
76 |
|
} |
77 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
78 |
7 |
@Override... |
79 |
|
public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { |
80 |
7 |
setUrl(resolveUuidToUrl(workspace, uuid)); |
81 |
7 |
super.render(model, request, response); |
82 |
|
} |
83 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
84 |
7 |
protected String resolveUuidToUrl(String workspace, String uuid) throws Exception {... |
85 |
7 |
return LinkUtil.createLink(workspace, uuid); |
86 |
|
} |
87 |
|
} |