All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netgrif.application.engine.petrinet.web.responsebodies.PetriNetReferenceResource Maven / Gradle / Ivy

Go to download

System provides workflow management functions including user, role and data management.

There is a newer version: 6.3.3
Show newest version
package com.netgrif.application.engine.petrinet.web.responsebodies;

import com.netgrif.application.engine.petrinet.web.PetriNetController;
import org.springframework.hateoas.EntityModel;
import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder;

public class PetriNetReferenceResource extends EntityModel {

    public PetriNetReferenceResource(PetriNetReference content) {
        super(content);
        buildLinks();
    }

    private void buildLinks() {
        add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder
                        .methodOn(PetriNetController.class).getOne(getContent().getStringId(), null, null))
                .withSelfRel());

        add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder
                        .methodOn(PetriNetController.class).getOne(getContent().getIdentifier(), getContent().getVersion(), null, null))
                .withRel("identifier"));

        add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder
                        .methodOn(PetriNetController.class).getRoles(getContent().getStringId(), null))
                .withRel("roles"));

        add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder
                        .methodOn(PetriNetController.class).getTransactions(getContent().getStringId(), null))
                .withRel("transaction"));

        add(WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder
                        .methodOn(PetriNetController.class).getNetFile(getContent().getStringId(), getContent().getTitle(), null, null))
                .withRel("file"));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy