use of org.activityinfo.ui.client.input.RecordPlace in project activityinfo by bedatadriven.
the class AppPlaceHistoryMapper method getPlace.
@Override
public Place getPlace(String token) {
String[] parts = token.split("/");
if (parts[0].equals("table")) {
return new TablePlace(ResourceId.valueOf(parts[1]));
} else if (parts[0].equals("analysis")) {
if (parts.length > 1) {
return new AnalysisPlace(parts[1]);
} else {
return new AnalysisPlace(ResourceId.generateCuid());
}
} else if (parts[0].equals("record")) {
ResourceId formId = ResourceId.valueOf(parts[1]);
ResourceId recordId = ResourceId.valueOf(parts[2]);
return new RecordPlace(formId, recordId);
} else if (parts[0].equals("catalog")) {
Optional<String> parentId = Optional.absent();
if (parts.length > 1) {
parentId = Optional.of(parts[1]);
}
return new CatalogPlace(parentId);
} else {
return null;
}
}
Aggregations