tvpl.api

<back to all web services

GetTemplateByDocumentIdRequest

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

public class dtos
{

    public static class GetTemplateByDocumentIdRequest
    {
        public Integer documentId = null;
        
        public Integer getDocumentId() { return documentId; }
        public GetTemplateByDocumentIdRequest setDocumentId(Integer value) { this.documentId = 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;
        @Ignore()
        public ArrayList<Integer> documentIds = null;

        @Ignore()
        public ArrayList<Document> documents = 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 ArrayList<Integer> getDocumentIds() { return documentIds; }
        public DocumentTemplate setDocumentIds(ArrayList<Integer> value) { this.documentIds = value; return this; }
        public ArrayList<Document> getDocuments() { return documents; }
        public DocumentTemplate setDocuments(ArrayList<Document> value) { this.documents = value; return this; }
    }

    public static class Document extends BasicDocument
    {
        public Integer id = null;
        @StringLength(500)
        public String reasonReturn = null;

        public Integer accountId = null;
        public Date deletedAt = null;
        @StringLength(500)
        public String deletedBy = null;

        @StringLength(500)
        public String updatedBy = null;

        public Date createdAt = null;
        @StringLength(500)
        public String createdBy = null;

        public Boolean isParty = null;
        public Boolean isRevisionRequested = null;
        public Date lastUpdatedAt = null;
        public Boolean isPrivate = null;
        public Integer departmentId = null;
        public Date publicationDate = null;
        public Integer processStatusId = null;
        public String fullTextSearchContent = null;
        
        public Integer getId() { return id; }
        public Document setId(Integer value) { this.id = value; return this; }
        public String getReasonReturn() { return reasonReturn; }
        public Document setReasonReturn(String value) { this.reasonReturn = value; return this; }
        public Integer getAccountId() { return accountId; }
        public Document setAccountId(Integer value) { this.accountId = value; return this; }
        public Date getDeletedAt() { return deletedAt; }
        public Document setDeletedAt(Date value) { this.deletedAt = value; return this; }
        public String getDeletedBy() { return deletedBy; }
        public Document setDeletedBy(String value) { this.deletedBy = value; return this; }
        public String getUpdatedBy() { return updatedBy; }
        public Document setUpdatedBy(String value) { this.updatedBy = value; return this; }
        public Date getCreatedAt() { return createdAt; }
        public Document setCreatedAt(Date value) { this.createdAt = value; return this; }
        public String getCreatedBy() { return createdBy; }
        public Document setCreatedBy(String value) { this.createdBy = value; return this; }
        public Boolean getIsParty() { return isParty; }
        public Document setIsParty(Boolean value) { this.isParty = value; return this; }
        public Boolean getIsRevisionRequested() { return isRevisionRequested; }
        public Document setIsRevisionRequested(Boolean value) { this.isRevisionRequested = value; return this; }
        public Date getLastUpdatedAt() { return lastUpdatedAt; }
        public Document setLastUpdatedAt(Date value) { this.lastUpdatedAt = value; return this; }
        public Boolean getIsPrivate() { return isPrivate; }
        public Document setIsPrivate(Boolean value) { this.isPrivate = value; return this; }
        public Integer getDepartmentId() { return departmentId; }
        public Document setDepartmentId(Integer value) { this.departmentId = value; return this; }
        public Date getPublicationDate() { return publicationDate; }
        public Document setPublicationDate(Date value) { this.publicationDate = value; return this; }
        public Integer getProcessStatusId() { return processStatusId; }
        public Document setProcessStatusId(Integer value) { this.processStatusId = value; return this; }
        public String getFullTextSearchContent() { return fullTextSearchContent; }
        public Document setFullTextSearchContent(String value) { this.fullTextSearchContent = value; return this; }
    }

    public static class BasicDocument
    {
        @Required()
        public String title = null;

        @StringLength(4000)
        public String description = null;

        @StringLength(500)
        public String owner = null;

        public Integer documentPolicyId = null;
        public Integer updateDocumentId = null;
        public Date effectBeginDate = null;
        public Date effectEndDate = null;
        public Integer issuingAgencyId = null;
        public Integer documentTypeId = null;
        public Integer documentGroupId = null;
        public Integer subjectId = null;
        @StringLength(500)
        public String signBy = null;

        public Date signDate = null;
        public Integer statusId = null;
        public Boolean isInternal = null;
        public String documentNumber = null;
        public String documentCode = null;
        public Boolean isUrgent = null;
        public Integer scopeType = null;
        public Boolean isActive = null;
        
        public String getTitle() { return title; }
        public BasicDocument setTitle(String value) { this.title = value; return this; }
        public String getDescription() { return description; }
        public BasicDocument setDescription(String value) { this.description = value; return this; }
        public String getOwner() { return owner; }
        public BasicDocument setOwner(String value) { this.owner = value; return this; }
        public Integer getDocumentPolicyId() { return documentPolicyId; }
        public BasicDocument setDocumentPolicyId(Integer value) { this.documentPolicyId = value; return this; }
        public Integer getUpdateDocumentId() { return updateDocumentId; }
        public BasicDocument setUpdateDocumentId(Integer value) { this.updateDocumentId = value; return this; }
        public Date getEffectBeginDate() { return effectBeginDate; }
        public BasicDocument setEffectBeginDate(Date value) { this.effectBeginDate = value; return this; }
        public Date getEffectEndDate() { return effectEndDate; }
        public BasicDocument setEffectEndDate(Date value) { this.effectEndDate = value; return this; }
        public Integer getIssuingAgencyId() { return issuingAgencyId; }
        public BasicDocument setIssuingAgencyId(Integer value) { this.issuingAgencyId = value; return this; }
        public Integer getDocumentTypeId() { return documentTypeId; }
        public BasicDocument setDocumentTypeId(Integer value) { this.documentTypeId = value; return this; }
        public Integer getDocumentGroupId() { return documentGroupId; }
        public BasicDocument setDocumentGroupId(Integer value) { this.documentGroupId = value; return this; }
        public Integer getSubjectId() { return subjectId; }
        public BasicDocument setSubjectId(Integer value) { this.subjectId = value; return this; }
        public String getSignBy() { return signBy; }
        public BasicDocument setSignBy(String value) { this.signBy = value; return this; }
        public Date getSignDate() { return signDate; }
        public BasicDocument setSignDate(Date value) { this.signDate = value; return this; }
        public Integer getStatusId() { return statusId; }
        public BasicDocument setStatusId(Integer value) { this.statusId = value; return this; }
        public Boolean getIsInternal() { return isInternal; }
        public BasicDocument setIsInternal(Boolean value) { this.isInternal = value; return this; }
        public String getDocumentNumber() { return documentNumber; }
        public BasicDocument setDocumentNumber(String value) { this.documentNumber = value; return this; }
        public String getDocumentCode() { return documentCode; }
        public BasicDocument setDocumentCode(String value) { this.documentCode = value; return this; }
        public Boolean getIsUrgent() { return isUrgent; }
        public BasicDocument setIsUrgent(Boolean value) { this.isUrgent = value; return this; }
        public Integer getScopeType() { return scopeType; }
        public BasicDocument setScopeType(Integer value) { this.scopeType = value; return this; }
        public Boolean getIsActive() { return isActive; }
        public BasicDocument setIsActive(Boolean value) { this.isActive = 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 GetTemplateByDocumentIdRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

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

{"template":{"elements":[{"children":[{"children":[{"children":null,"id":0,"templateId":0,"elementKey":"String","tag":"String","parentId":0,"title":"String","description":"String","dataType":"String","templateType":"String","orderIndex":0,"isRequired":false}],"id":0,"templateId":0,"elementKey":"String","tag":"String","parentId":0,"title":"String","description":"String","dataType":"String","templateType":"String","orderIndex":0,"isRequired":false}],"id":0,"templateId":0,"elementKey":"String","tag":"String","parentId":0,"title":"String","description":"String","dataType":"String","templateType":"String","orderIndex":0,"isRequired":false}],"id":0,"title":"String","description":"String","isActive":false,"documentIds":[0],"documents":[{"id":0,"reasonReturn":"String","accountId":0,"deletedAt":"0001-01-01T00:00:00.0000000+07:06","deletedBy":"String","updatedBy":"String","createdAt":"0001-01-01T00:00:00.0000000+07:06","createdBy":"String","isParty":false,"isRevisionRequested":false,"lastUpdatedAt":"0001-01-01T00:00:00.0000000+07:06","isPrivate":false,"departmentId":0,"publicationDate":"0001-01-01T00:00:00.0000000+07:06","processStatusId":0,"fullTextSearchContent":"String","title":"String","description":"String","owner":"String","documentPolicyId":0,"updateDocumentId":0,"effectBeginDate":"0001-01-01T00:00:00.0000000+07:06","effectEndDate":"0001-01-01T00:00:00.0000000+07:06","issuingAgencyId":0,"documentTypeId":0,"documentGroupId":0,"subjectId":0,"signBy":"String","signDate":"0001-01-01T00:00:00.0000000+07:06","statusId":0,"isInternal":false,"documentNumber":"String","documentCode":"String","isUrgent":false,"scopeType":0,"isActive":false}]},"insertedId":0,"code":0,"message":"String"}