use of org.geotoolkit.sml.xml.v100.Link in project dishevelled-bio by heuermh.
the class LinksToCytoscapeEdges method call.
@Override
public Integer call() throws Exception {
PrintWriter edgesWriter = null;
try {
edgesWriter = writer(outputEdgesFile);
edgesWriter.println(HEADER);
final PrintWriter ew = edgesWriter;
Gfa1Reader.stream(reader(inputGfa1File), new Gfa1Adapter() {
@Override
public boolean link(final Link link) {
StringBuilder sb = new StringBuilder();
sb.append(link.getSource().getName());
sb.append("\t");
sb.append(link.getSource().getOrientation().getSymbol());
sb.append("\t");
sb.append(link.getTarget().getName());
sb.append("\t");
sb.append(link.getTarget().getOrientation().getSymbol());
sb.append("\tL\t");
sb.append(link.getIdOpt().orElse(""));
sb.append("\t");
sb.append(link.getOverlapOpt().orElse(""));
sb.append("\t");
sb.append(link.containsMappingQuality() ? link.getMappingQuality() : "");
sb.append("\t");
sb.append(link.containsMismatchCount() ? link.getMismatchCount() : "");
sb.append("\t");
ew.println(sb);
return true;
}
});
return 0;
} finally {
try {
edgesWriter.close();
} catch (Exception e) {
// empty
}
}
}
use of org.geotoolkit.sml.xml.v100.Link in project dishevelled-bio by heuermh.
the class LinksToPropertyGraph method call.
@Override
public Integer call() throws Exception {
PrintWriter edgesWriter = null;
try {
edgesWriter = writer(outputEdgesFile);
edgesWriter.println(HEADER);
final PrintWriter ew = edgesWriter;
Gfa1Reader.stream(reader(inputGfa1File), new Gfa1Adapter() {
@Override
public boolean link(final Link link) {
if (!link.containsId()) {
throw new IllegalArgumentException("link identifiers are required for property graph CSV format");
}
StringBuilder sb = new StringBuilder();
sb.append(link.getId());
sb.append(",");
sb.append(link.getSource().getName());
sb.append(",");
sb.append(link.getTarget().getName());
sb.append(",");
sb.append(link.getSource().getOrientation().getSymbol());
sb.append(",");
sb.append(link.getTarget().getOrientation().getSymbol());
sb.append(",L,");
sb.append(link.getOverlapOpt().orElse(""));
sb.append(",");
sb.append(link.containsMappingQuality() ? link.getMappingQuality() : "");
sb.append(",");
sb.append(link.containsMismatchCount() ? link.getMismatchCount() : "");
ew.println(sb);
return true;
}
});
return 0;
} finally {
try {
edgesWriter.close();
} catch (Exception e) {
// empty
}
}
}
use of org.geotoolkit.sml.xml.v100.Link in project flowlogix by flowlogix.
the class LoginFormBase method detectJavaScript.
@AfterRender
public void detectJavaScript() {
Link link = componentResources.createEventLink(ENABLE_JS_EVENT);
String eventURI = link.toAbsoluteURI(requestGlobals.getRequest().isSecure());
jsSupport.addInitializerCall("detectJS", eventURI);
}
use of org.geotoolkit.sml.xml.v100.Link in project flowlogix by flowlogix.
the class UpdateEvent method createEvent.
private void createEvent(String event) {
Link link = null;
if (context == null) {
link = cr.createEventLink(event);
} else {
link = cr.createEventLink(event, context);
}
String uri = link.toAbsoluteURI(request.isSecure());
JSONObject spec = new JSONObject();
spec.put("elementId", zone.getClientId());
spec.put("uri", uri);
js.addInitializerCall("updateEvent", spec);
}
use of org.geotoolkit.sml.xml.v100.Link in project identity-api-server by wso2.
the class ServerApplicationManagementService method getAllApplications.
public ApplicationListResponse getAllApplications(Integer limit, Integer offset, String filter, String sortOrder, String sortBy, String requiredAttributes) {
handleNotImplementedCapabilities(sortOrder, sortBy, requiredAttributes);
String tenantDomain = ContextLoader.getTenantDomainFromContext();
boolean isEqualFilterUsed = false;
limit = validateAndGetLimit(limit);
offset = validateAndGetOffset(offset);
// Format the filter to a value that can be interpreted by the backend.
ExpressionNode expressionNode = buildFilterNode(filter);
String formattedFilter = null;
if (expressionNode != null) {
// Handle eq operation as special case, there will be only one application with a given name in tenant.
if (isEqualOperation(expressionNode)) {
isEqualFilterUsed = true;
}
formattedFilter = generateFilterStringForBackend(expressionNode.getAttributeValue(), expressionNode.getOperation(), expressionNode.getValue());
}
String username = ContextLoader.getUsernameFromContext();
try {
int totalResults = getApplicationManagementService().getCountOfApplications(tenantDomain, username, formattedFilter);
ApplicationBasicInfo[] filteredAppList;
if (isEqualFilterUsed) {
ApplicationBasicInfo applicationBasicInfo = getApplicationManagementService().getApplicationBasicInfoByName(expressionNode.getValue(), tenantDomain);
if (applicationBasicInfo == null) {
filteredAppList = new ApplicationBasicInfo[0];
} else {
filteredAppList = new ApplicationBasicInfo[] { applicationBasicInfo };
}
} else {
filteredAppList = getApplicationManagementService().getApplicationBasicInfo(tenantDomain, username, formattedFilter, offset, limit);
}
int resultsInCurrentPage = filteredAppList.length;
return new ApplicationListResponse().totalResults(totalResults).startIndex(offset + 1).count(resultsInCurrentPage).applications(getApplicationListItems(filteredAppList)).links(Util.buildPaginationLinks(limit, offset, totalResults, APPLICATION_MANAGEMENT_PATH_COMPONENT).entrySet().stream().map(link -> new Link().rel(link.getKey()).href(link.getValue())).collect(Collectors.toList()));
} catch (IdentityApplicationManagementException e) {
String msg = "Error listing applications of tenantDomain: " + tenantDomain;
throw handleIdentityApplicationManagementException(e, msg);
}
}
Aggregations