Search in sources :

Example 21 with Link

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
        }
    }
}
Also used : Gfa1Adapter(org.dishevelled.bio.assembly.gfa1.Gfa1Adapter) Link(org.dishevelled.bio.assembly.gfa1.Link) CommandLineParseException(org.dishevelled.commandline.CommandLineParseException) PrintWriter(java.io.PrintWriter)

Example 22 with Link

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
        }
    }
}
Also used : Gfa1Adapter(org.dishevelled.bio.assembly.gfa1.Gfa1Adapter) Link(org.dishevelled.bio.assembly.gfa1.Link) CommandLineParseException(org.dishevelled.commandline.CommandLineParseException) PrintWriter(java.io.PrintWriter)

Example 23 with Link

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);
}
Also used : Link(org.apache.tapestry5.Link) ExternalPageLink(com.flowlogix.web.services.ExternalPageLink) AfterRender(org.apache.tapestry5.annotations.AfterRender)

Example 24 with Link

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);
}
Also used : JSONObject(org.apache.tapestry5.json.JSONObject) Link(org.apache.tapestry5.Link)

Example 25 with Link

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);
    }
}
Also used : ApplicationListResponse(org.wso2.carbon.identity.api.server.application.management.v1.ApplicationListResponse) ExpressionNode(org.wso2.carbon.identity.core.model.ExpressionNode) IdentityApplicationManagementException(org.wso2.carbon.identity.application.common.IdentityApplicationManagementException) ApplicationBasicInfo(org.wso2.carbon.identity.application.common.model.ApplicationBasicInfo) Link(org.wso2.carbon.identity.api.server.application.management.v1.Link)

Aggregations

Link (org.candlepin.dto.api.v1.Link)8 Link (org.apache.tapestry5.Link)6 PrintWriter (java.io.PrintWriter)5 Method (java.lang.reflect.Method)5 Link (org.dishevelled.bio.assembly.gfa1.Link)5 Link (de.micromata.opengis.kml.v_2_2_0.Link)4 NetworkLink (de.micromata.opengis.kml.v_2_2_0.NetworkLink)4 HashMap (java.util.HashMap)4 Gfa1Adapter (org.dishevelled.bio.assembly.gfa1.Gfa1Adapter)4 Test (org.junit.jupiter.api.Test)4 Kml (de.micromata.opengis.kml.v_2_2_0.Kml)3 Map (java.util.Map)3 UriBuilder (javax.ws.rs.core.UriBuilder)3 JSONObject (org.apache.tapestry5.json.JSONObject)3 CommandLineParseException (org.dishevelled.commandline.CommandLineParseException)3 BufferedReader (java.io.BufferedReader)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 Path (javax.ws.rs.Path)2 AfterRender (org.apache.tapestry5.annotations.AfterRender)2