Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>org.reactome.web.pwp</groupId>
<artifactId>model</artifactId>
<packaging>jar</packaging>
<version>2.1.20-SNAPSHOT</version>
<version>2.1.21-SNAPSHOT</version>
<name>Reactome Data Model</name>

<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,9 @@ interface AncestorsLoaded extends ContentClientHandler {
interface DatabaseInfo extends ContentClientHandler {
void onDatabaseInfoLoaded(DBInfo dbInfo);
}

interface Citation extends ContentClientHandler {
void onCitationTextLoaded(String citation);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,11 @@ public static void getDatabaseInformation(ContentClientHandler.DatabaseInfo hand
});
}
}

public static void getStaticCitation(String id, ContentClientHandler.Citation handler) {
request("citation/static/" + id, Accept.TEXT_PLAIN, handler, body -> {
String citation = body;
handler.onCitationTextLoaded(citation);
});
}
}
24 changes: 24 additions & 0 deletions src/main/java/org/reactome/web/pwp/model/test/WidgetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void onModuleLoad() {
addDatabaseName();
addSpecies();
addTopLvelPathway();
getCitation("31691815");
// //RAF/MAP -> 109869 (for v52)
// DatabaseObjectFactory.get(109869L, new DatabaseObjectCreatedHandler() {
// @Override
Expand Down Expand Up @@ -147,4 +148,27 @@ public void onContentClientError(ContentClientError error) {
}
});
}

private void getCitation(String id) {
ContentClient.getStaticCitation(id, new ContentClientHandler.Citation() {
@Override
public void onCitationTextLoaded(String citation) {
container.add(new Label(citation));
}

@Override
public void onContentClientException(Type type, String message) {
container.add(new Label("in content client exception"));
container.add(new Label(type.toString()));
container.add(new Label(message));
}

@Override
public void onContentClientError(ContentClientError error) {
container.add(new Label("in content client error"));
container.add(new Label(error.toString()));
}
});
}

}