tvpl.api

<back to all web services

GetTemplateByIdRequest

Requires Authentication
The following routes are available for this service:
GET/document-template
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class GetTemplateByIdRequest
    {
        public Integer id = null;
        
        public Integer getId() { return id; }
        public GetTemplateByIdRequest setId(Integer value) { this.id = value; return this; }
    }

    public static class DocumentTemplateResponse
    {
        public DocumentTemplateDto template = null;
        public Integer insertedId = null;
        public Integer code = null;
        public String message = null;
        
        public DocumentTemplateDto getTemplate() { return template; }
        public DocumentTemplateResponse setTemplate(DocumentTemplateDto value) { this.template = value; return this; }
        public Integer getInsertedId() { return insertedId; }
        public DocumentTemplateResponse setInsertedId(Integer value) { this.insertedId = value; return this; }
        public Integer getCode() { return code; }
        public DocumentTemplateResponse setCode(Integer value) { this.code = value; return this; }
        public String getMessage() { return message; }
        public DocumentTemplateResponse setMessage(String value) { this.message = value; return this; }
    }

    public static class DocumentTemplateDto extends DocumentTemplate
    {
        public ArrayList<DocumentElementDto> elements = null;
        
        public ArrayList<DocumentElementDto> getElements() { return elements; }
        public DocumentTemplateDto setElements(ArrayList<DocumentElementDto> value) { this.elements = value; return this; }
    }

    public static class DocumentTemplate
    {
        public Integer id = null;
        @Required()
        public String title = null;

        public String description = null;
        public Boolean isActive = null;
        public String fileKey = null;
        public String fileUrl = null;
        public String fileName = null;
        public Long fileSize = null;
        
        public Integer getId() { return id; }
        public DocumentTemplate setId(Integer value) { this.id = value; return this; }
        public String getTitle() { return title; }
        public DocumentTemplate setTitle(String value) { this.title = value; return this; }
        public String getDescription() { return description; }
        public DocumentTemplate setDescription(String value) { this.description = value; return this; }
        public Boolean getIsActive() { return isActive; }
        public DocumentTemplate setIsActive(Boolean value) { this.isActive = value; return this; }
        public String getFileKey() { return fileKey; }
        public DocumentTemplate setFileKey(String value) { this.fileKey = value; return this; }
        public String getFileUrl() { return fileUrl; }
        public DocumentTemplate setFileUrl(String value) { this.fileUrl = value; return this; }
        public String getFileName() { return fileName; }
        public DocumentTemplate setFileName(String value) { this.fileName = value; return this; }
        public Long getFileSize() { return fileSize; }
        public DocumentTemplate setFileSize(Long value) { this.fileSize = value; return this; }
    }

    public static class DocumentElementDto extends DocumentElement
    {
        public ArrayList<DocumentElementDto> children = null;
        
        public ArrayList<DocumentElementDto> getChildren() { return children; }
        public DocumentElementDto setChildren(ArrayList<DocumentElementDto> value) { this.children = value; return this; }
    }

    public static class DocumentElement
    {
        public Integer id = null;
        public Integer templateId = null;
        @Required()
        public String elementKey = null;

        @Required()
        public String tag = null;

        public Integer parentId = null;
        @Required()
        public String title = null;

        public String description = null;
        @Required()
        public String dataType = null;

        public String templateType = null;
        public Integer orderIndex = null;
        public Boolean isRequired = null;
        
        public Integer getId() { return id; }
        public DocumentElement setId(Integer value) { this.id = value; return this; }
        public Integer getTemplateId() { return templateId; }
        public DocumentElement setTemplateId(Integer value) { this.templateId = value; return this; }
        public String getElementKey() { return elementKey; }
        public DocumentElement setElementKey(String value) { this.elementKey = value; return this; }
        public String getTag() { return tag; }
        public DocumentElement setTag(String value) { this.tag = value; return this; }
        public Integer getParentId() { return parentId; }
        public DocumentElement setParentId(Integer value) { this.parentId = value; return this; }
        public String getTitle() { return title; }
        public DocumentElement setTitle(String value) { this.title = value; return this; }
        public String getDescription() { return description; }
        public DocumentElement setDescription(String value) { this.description = value; return this; }
        public String getDataType() { return dataType; }
        public DocumentElement setDataType(String value) { this.dataType = value; return this; }
        public String getTemplateType() { return templateType; }
        public DocumentElement setTemplateType(String value) { this.templateType = value; return this; }
        public Integer getOrderIndex() { return orderIndex; }
        public DocumentElement setOrderIndex(Integer value) { this.orderIndex = value; return this; }
        public Boolean getIsRequired() { return isRequired; }
        public DocumentElement setIsRequired(Boolean value) { this.isRequired = value; return this; }
    }

}

Java GetTemplateByIdRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /document-template HTTP/1.1 
Host: qlcn-api.vsmlab.vn 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DocumentTemplateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
  <Code>0</Code>
  <InsertedId>0</InsertedId>
  <Message>String</Message>
  <Template>
    <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
    <CreatedBy xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</CreatedBy>
    <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
    <FileKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</FileKey>
    <FileName xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</FileName>
    <FileSize xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</FileSize>
    <FileUrl xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</FileUrl>
    <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
    <IsActive xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsActive>
    <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
    <Elements>
      <DocumentElementDto>
        <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
        <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
        <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
        <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
        <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
        <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
        <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
        <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
        <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
        <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
        <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
        <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
        <Children>
          <DocumentElementDto>
            <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
            <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
            <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
            <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
            <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
            <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
            <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
            <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
            <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
            <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
            <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
            <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
            <Children>
              <DocumentElementDto>
                <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
                <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
                <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
                <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
                <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
                <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
                <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
                <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
                <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
                <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
                <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
                <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
                <Children i:nil="true" />
              </DocumentElementDto>
            </Children>
          </DocumentElementDto>
        </Children>
      </DocumentElementDto>
    </Elements>
  </Template>
</DocumentTemplateResponse>