-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable POST calls and streamline popup view
- Loading branch information
1 parent
a83a2ff
commit 024472b
Showing
18 changed files
with
321 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
backend/src/main/java/eu/clarin/switchboard/resources/IndexView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,43 @@ | ||
package eu.clarin.switchboard.resources; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import eu.clarin.switchboard.app.SwitchboardApp; | ||
import io.dropwizard.views.View; | ||
|
||
import java.util.UUID; | ||
|
||
public class IndexView extends View { | ||
static ObjectMapper mapper = new ObjectMapper(); | ||
|
||
static class Data { | ||
public UUID fileInfoID; | ||
public String errorMessage; | ||
public boolean popup; | ||
} | ||
|
||
String appContextPath = SwitchboardApp.APP_CONTEXT_PATH; | ||
String data = null; | ||
|
||
public IndexView() { | ||
super("index.mustache"); | ||
} | ||
|
||
public static IndexView fileInfoID(UUID id, boolean popup) throws JsonProcessingException { | ||
IndexView view = new IndexView(); | ||
Data data = new Data(); | ||
data.fileInfoID = id; | ||
data.popup = popup; | ||
view.data = mapper.writeValueAsString(data); | ||
return view; | ||
} | ||
|
||
public static IndexView error(String errorMessage, boolean popup) throws JsonProcessingException { | ||
IndexView view = new IndexView(); | ||
Data data = new Data(); | ||
data.errorMessage = errorMessage; | ||
data.popup = popup; | ||
view.data = mapper.writeValueAsString(data); | ||
return view; | ||
} | ||
} |
Oops, something went wrong.