Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@
<artifactId>javax.ws.rs-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
Expand Down Expand Up @@ -186,11 +181,6 @@
<artifactId>celements-shared-tests</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-core-shared-tests</artifactId>
<scope>test</scope>
</dependency>
<!-- JTidy Has been picked up at https://github.com/jtidy/jtidy and immediately was reabandoned.
However their release from Dec 2019 has at least some HTML5 support -->
<dependency>
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/com/celements/web/service/UrlService.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;
import javax.ws.rs.core.UriBuilder;

import org.xwiki.component.annotation.ComponentRole;
import org.xwiki.model.reference.EntityReference;
Expand Down Expand Up @@ -53,10 +52,4 @@ public String getURL(@NotNull EntityReference ref, @Nullable String action,
public String getExternalURL(@NotNull EntityReference ref, @Nullable String action,
@Nullable String queryString);

@NotNull
UriBuilder createURIBuilder(@NotNull EntityReference ref);

@NotNull
UriBuilder createURIBuilder(@NotNull EntityReference ref, @Nullable String action);

}
5 changes: 1 addition & 4 deletions src/main/java/com/celements/web/service/WebUtilsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,7 @@ public XWikiMessageTool getMessageTool(String adminLanguage) {
if (bundle == null) {
bundle = ResourceBundle.getBundle("ApplicationResources");
}
XWikiContext adminContext = (XWikiContext) getContext().clone();
adminContext.putAll(getContext());
adminContext.setLanguage(adminLanguage);
return new XWikiMessageTool(bundle, adminContext);
return new XWikiMessageTool(bundle, getContext(), adminLanguage);
}
} else {
return null;
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/com/celements/web/service/XWikiUrlService.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,6 @@ public String getExternalURL(EntityReference ref, String action, String queryStr
return createURLObject(ref, action, queryString).toExternalForm();
}

@Override
public UriBuilder createURIBuilder(EntityReference ref) {
return createURIBuilder(ref, null);
}

@Override
public UriBuilder createURIBuilder(EntityReference ref, String action) {
checkArgument(ref != null, "reference may not be null");
try {
return UriBuilder.fromUri(createURLObject(ref, action, null).toURI());
} catch (URISyntaxException exc) {
throw new IllegalArgumentException("illegal reference provided: " + ref, exc);
}
}

private URL createURLObject(EntityReference ref, String action, String queryString) {
URL url;
String wikiName = extractName(ref, EntityType.WIKI);
Expand Down
24 changes: 0 additions & 24 deletions src/test/java/com/celements/web/service/XWikiUrlServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,30 +166,6 @@ protected void execute() throws IllegalArgumentException {
verifyDefault();
}

@Test
public void test_createURIBuilder() throws Exception {
String url = "http://wiki.celements.com/space/page";
expect(urlFactoryMock.createURL("space", "page", "view", null, null, "wiki",
getContext())).andReturn(new URL(url));

replayDefault();
assertEquals(url, service.createURIBuilder(docRef).build().toString());
verifyDefault();
}

@Test
public void test_createURIBuilder_null() throws Exception {
replayDefault();
new ExceptionAsserter<IllegalArgumentException>(IllegalArgumentException.class) {

@Override
protected void execute() throws IllegalArgumentException {
service.createURIBuilder(null);
}
}.evaluate();
verifyDefault();
}

@Test
public void test_createURLObject_notEmptyForContentWebHome() throws Exception {
EntityReference docRefContentWebHome = new DocumentReference(getContext().getDatabase(),
Expand Down