| 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;
@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 GetTemplateByIdRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=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: etc-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>
<DocumentIds xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
<d3p1:int>0</d3p1:int>
</DocumentIds>
<Documents xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">
<Document>
<Description>String</Description>
<DocumentCode>String</DocumentCode>
<DocumentGroupId>0</DocumentGroupId>
<DocumentNumber>String</DocumentNumber>
<DocumentPolicyId>0</DocumentPolicyId>
<DocumentTypeId>0</DocumentTypeId>
<EffectBeginDate>0001-01-01T00:00:00</EffectBeginDate>
<EffectEndDate>0001-01-01T00:00:00</EffectEndDate>
<IsActive>false</IsActive>
<IsInternal>false</IsInternal>
<IsUrgent>false</IsUrgent>
<IssuingAgencyId>0</IssuingAgencyId>
<Owner>String</Owner>
<ScopeType>0</ScopeType>
<SignBy>String</SignBy>
<SignDate>0001-01-01T00:00:00</SignDate>
<StatusId>0</StatusId>
<SubjectId>0</SubjectId>
<Title>String</Title>
<UpdateDocumentId>0</UpdateDocumentId>
<AccountId>0</AccountId>
<CreatedAt>0001-01-01T00:00:00</CreatedAt>
<CreatedBy>String</CreatedBy>
<DeletedAt>0001-01-01T00:00:00</DeletedAt>
<DeletedBy>String</DeletedBy>
<DepartmentId>0</DepartmentId>
<FullTextSearchContent>String</FullTextSearchContent>
<Id>0</Id>
<IsParty>false</IsParty>
<IsPrivate>false</IsPrivate>
<IsRevisionRequested>false</IsRevisionRequested>
<LastUpdatedAt>0001-01-01T00:00:00</LastUpdatedAt>
<ProcessStatusId>0</ProcessStatusId>
<PublicationDate>0001-01-01T00:00:00</PublicationDate>
<ReasonReturn>String</ReasonReturn>
<UpdatedBy>String</UpdatedBy>
</Document>
</Documents>
<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>