| POST | /api/DMS/AddUploadFile |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Add a uploadfile with metadata.
*/
@Api(Description="Add a uploadfile with metadata.")
public static class AddUploadFile
{
/**
* Registration profile ID
*/
@ApiMember(Description="Registration profile ID", IsRequired=true)
public UUID RegistrationProfileID = null;
/**
* Registration navigation path
*/
@ApiMember(Description="Registration navigation path")
public String NavigationPath = null;
/**
* File name
*/
@ApiMember(Description="File name", IsRequired=true)
public String FileName = null;
/**
* File date
*/
@ApiMember(Description="File date", IsRequired=true)
public Date FileDate = null;
/**
* File content
*/
@ApiMember(Description="File content", IsRequired=true)
public byte[] FileContent = new byte[]{};
/**
* File description
*/
@ApiMember(Description="File description", IsRequired=true)
public String Description = null;
/**
* Keep document in uploads (false; register immediately)
*/
@ApiMember(Description="Keep document in uploads (false; register immediately)")
public Boolean DocumentUpload = null;
/**
* Source of the file
*/
@ApiMember(Description="Source of the file")
public String Source = null;
/**
* MetaDataFields
*/
@ApiMember(Description="MetaDataFields")
public ArrayList<MetaDataField> MetaDataFields = null;
/**
* Document ID
*/
@ApiMember(Description="Document ID")
public UUID DocumentID = null;
/**
* Main Document ID
*/
@ApiMember(Description="Main Document ID")
public UUID MainDocumentID = null;
/**
* Sub Document IDs
*/
@ApiMember(Description="Sub Document IDs")
public ArrayList<UUID> SubDocumentIDs = null;
public UUID getRegistrationProfileID() { return RegistrationProfileID; }
public AddUploadFile setRegistrationProfileID(UUID value) { this.RegistrationProfileID = value; return this; }
public String getNavigationPath() { return NavigationPath; }
public AddUploadFile setNavigationPath(String value) { this.NavigationPath = value; return this; }
public String getFileName() { return FileName; }
public AddUploadFile setFileName(String value) { this.FileName = value; return this; }
public Date getFileDate() { return FileDate; }
public AddUploadFile setFileDate(Date value) { this.FileDate = value; return this; }
public byte[] getFileContent() { return FileContent; }
public AddUploadFile setFileContent(byte[] value) { this.FileContent = value; return this; }
public String getDescription() { return Description; }
public AddUploadFile setDescription(String value) { this.Description = value; return this; }
public Boolean isDocumentUpload() { return DocumentUpload; }
public AddUploadFile setDocumentUpload(Boolean value) { this.DocumentUpload = value; return this; }
public String getSource() { return Source; }
public AddUploadFile setSource(String value) { this.Source = value; return this; }
public ArrayList<MetaDataField> getMetaDataFields() { return MetaDataFields; }
public AddUploadFile setMetaDataFields(ArrayList<MetaDataField> value) { this.MetaDataFields = value; return this; }
public UUID getDocumentID() { return DocumentID; }
public AddUploadFile setDocumentID(UUID value) { this.DocumentID = value; return this; }
public UUID getMainDocumentID() { return MainDocumentID; }
public AddUploadFile setMainDocumentID(UUID value) { this.MainDocumentID = value; return this; }
public ArrayList<UUID> getSubDocumentIDs() { return SubDocumentIDs; }
public AddUploadFile setSubDocumentIDs(ArrayList<UUID> value) { this.SubDocumentIDs = value; return this; }
}
@DataContract
public static class MetaDataField
{
@DataMember
public UUID ID = null;
@DataMember
public UUID DocumentVeldID = null;
@DataMember
public String Name = null;
@DataMember
public String Label = null;
@DataMember
public String Datatype = null;
@DataMember
public String PrintLabel = null;
@DataMember
public String Entity = null;
@DataMember
public String PrintValue = null;
@DataMember
public String RegistrationValue = null;
@DataMember
public String SPSiteColumnName = null;
@DataMember
public String ShadowName = null;
@DataMember
public String ShadowDatatype = null;
@DataMember
public String ShadowSPSiteColumnName = null;
@DataMember
public String ShadowSPSiteColumnRegistrationValue = null;
@DataMember
public String ShadowRegistrationValue = null;
@DataMember
public Boolean IsKeyField = null;
@DataMember
public Boolean KopierenBijNieuweVersie = null;
public UUID getId() { return ID; }
public MetaDataField setId(UUID value) { this.ID = value; return this; }
public UUID getDocumentVeldID() { return DocumentVeldID; }
public MetaDataField setDocumentVeldID(UUID value) { this.DocumentVeldID = value; return this; }
public String getName() { return Name; }
public MetaDataField setName(String value) { this.Name = value; return this; }
public String getLabel() { return Label; }
public MetaDataField setLabel(String value) { this.Label = value; return this; }
public String getDatatype() { return Datatype; }
public MetaDataField setDatatype(String value) { this.Datatype = value; return this; }
public String getPrintLabel() { return PrintLabel; }
public MetaDataField setPrintLabel(String value) { this.PrintLabel = value; return this; }
public String getEntity() { return Entity; }
public MetaDataField setEntity(String value) { this.Entity = value; return this; }
public String getPrintValue() { return PrintValue; }
public MetaDataField setPrintValue(String value) { this.PrintValue = value; return this; }
public String getRegistrationValue() { return RegistrationValue; }
public MetaDataField setRegistrationValue(String value) { this.RegistrationValue = value; return this; }
public String getSpSiteColumnName() { return SPSiteColumnName; }
public MetaDataField setSpSiteColumnName(String value) { this.SPSiteColumnName = value; return this; }
public String getShadowName() { return ShadowName; }
public MetaDataField setShadowName(String value) { this.ShadowName = value; return this; }
public String getShadowDatatype() { return ShadowDatatype; }
public MetaDataField setShadowDatatype(String value) { this.ShadowDatatype = value; return this; }
public String getShadowSPSiteColumnName() { return ShadowSPSiteColumnName; }
public MetaDataField setShadowSPSiteColumnName(String value) { this.ShadowSPSiteColumnName = value; return this; }
public String getShadowSPSiteColumnRegistrationValue() { return ShadowSPSiteColumnRegistrationValue; }
public MetaDataField setShadowSPSiteColumnRegistrationValue(String value) { this.ShadowSPSiteColumnRegistrationValue = value; return this; }
public String getShadowRegistrationValue() { return ShadowRegistrationValue; }
public MetaDataField setShadowRegistrationValue(String value) { this.ShadowRegistrationValue = value; return this; }
public Boolean getIsKeyField() { return IsKeyField; }
public MetaDataField setIsKeyField(Boolean value) { this.IsKeyField = value; return this; }
public Boolean isKopierenBijNieuweVersie() { return KopierenBijNieuweVersie; }
public MetaDataField setKopierenBijNieuweVersie(Boolean value) { this.KopierenBijNieuweVersie = value; return this; }
}
@DataContract
public static class AddUploadFileResponse
{
@DataMember
public UUID DocumentId = null;
@DataMember
public Integer DocumentUploadId = null;
@DataMember
public String DocumentNr = null;
@DataMember
public InformationMessages Messages = null;
public UUID getDocumentId() { return DocumentId; }
public AddUploadFileResponse setDocumentId(UUID value) { this.DocumentId = value; return this; }
public Integer getDocumentUploadId() { return DocumentUploadId; }
public AddUploadFileResponse setDocumentUploadId(Integer value) { this.DocumentUploadId = value; return this; }
public String getDocumentNr() { return DocumentNr; }
public AddUploadFileResponse setDocumentNr(String value) { this.DocumentNr = value; return this; }
public InformationMessages getMessages() { return Messages; }
public AddUploadFileResponse setMessages(InformationMessages value) { this.Messages = value; return this; }
}
public static class InformationMessages extends ArrayList<InformationMessageBase> implements IInformationMessages
{
}
public static class InformationMessageBase implements IInformationMessage
{
public MessageType Type = null;
public String Summary = null;
public String FullMessage = null;
public String FieldName = null;
public Boolean KeepOpen = null;
public MessageType getType() { return Type; }
public InformationMessageBase setType(MessageType value) { this.Type = value; return this; }
public String getSummary() { return Summary; }
public InformationMessageBase setSummary(String value) { this.Summary = value; return this; }
public String getFullMessage() { return FullMessage; }
public InformationMessageBase setFullMessage(String value) { this.FullMessage = value; return this; }
public String getFieldName() { return FieldName; }
public InformationMessageBase setFieldName(String value) { this.FieldName = value; return this; }
public Boolean isKeepOpen() { return KeepOpen; }
public InformationMessageBase setKeepOpen(Boolean value) { this.KeepOpen = value; return this; }
}
public static enum MessageType
{
Information(1),
Warning(2),
Error(3),
Success(4);
private final int value;
MessageType(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/DMS/AddUploadFile HTTP/1.1
Host: test-do-services.klokgroep.nl
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"RegistrationProfileID":"00000000-0000-0000-0000-000000000000","NavigationPath":"String","FileName":"String","FileDate":"0001-01-01T00:00:00.0000000","FileContent":"AA==","Description":"String","DocumentUpload":false,"Source":"String","MetaDataFields":[{"ID":"00000000-0000-0000-0000-000000000000","DocumentVeldID":"00000000-0000-0000-0000-000000000000","Name":"String","Label":"String","Datatype":"String","PrintLabel":"String","Entity":"String","PrintValue":"String","RegistrationValue":"String","SPSiteColumnName":"String","ShadowName":"String","ShadowDatatype":"String","ShadowSPSiteColumnName":"String","ShadowSPSiteColumnRegistrationValue":"String","ShadowRegistrationValue":"String","IsKeyField":false,"KopierenBijNieuweVersie":false}],"DocumentID":"00000000-0000-0000-0000-000000000000","MainDocumentID":"00000000-0000-0000-0000-000000000000","SubDocumentIDs":["00000000-0000-0000-0000-000000000000"]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"DocumentId":"00000000-0000-0000-0000-000000000000","DocumentUploadId":0,"DocumentNr":"String","Messages":[{}]}