Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) AddAttachment(documentID, filename string, data []byte) error
- func (c *Client) AddDocumentPage(documentID string, pg *entity.Page) (*entity.Page, error)
- func (c *Client) AddFolder(fldr *entity.Label) error
- func (c *Client) AddUser(usrp *entity.User) error
- func (c *Client) ChangeDocumentPageLevel(documentID string, plrm *[]models.PageLevelRequestModel) error
- func (c *Client) ChangeDocumentPageSequence(documentID string, psrm *[]models.PageSequenceRequestModel) error
- func (c *Client) DeleteAttachment(att *entity.Attachment) error
- func (c *Client) DeleteDocument(documentID string) error
- func (c *Client) DeleteDocumentPage(documentID, pageID string) error
- func (c *Client) DeleteDocumentPages(documentID string, pageIDlist []string) error
- func (c *Client) DeleteUser(userID string) error
- func (c *Client) GetAttachmentData(att *entity.Attachment) error
- func (c *Client) GetAttachments(documentID string) (entAtts []entity.Attachment, err error)
- func (c *Client) GetDocument(documentID string) (*entity.Document, error)
- func (c *Client) GetDocumentAsDocx(documentID string) (string, []byte, error)
- func (c *Client) GetDocumentMeta(documentID string) (*entity.DocumentMeta, error)
- func (c *Client) GetDocumentPages(documentID string) ([]entity.Page, error)
- func (c *Client) GetDocumentPagesBatch(documentID, pageIDlist string) ([]entity.Page, error)
- func (c *Client) GetDocumentsByFolder(folderID string) ([]entity.Document, error)
- func (c *Client) GetFolder(folderID string) (*entity.Label, error)
- func (c *Client) GetFolderPermissions(folderID string) (*[]entity.LabelRole, error)
- func (c *Client) GetFolders() ([]entity.Label, error)
- func (c *Client) GetFoldersVisibility() ([]entity.Label, error)
- func (c *Client) GetNamedFolderIDs(name string) ([]string, error)
- func (c *Client) GetOrganizations() ([]entity.Organization, error)
- func (c *Client) GetRobots() ([]byte, error)
- func (c *Client) GetSitemap() ([]byte, error)
- func (c *Client) GetTemplates(useStock bool) (temps []entity.Template, err error)
- func (c *Client) GetUserFolderPermissions() (*[]entity.LabelRole, error)
- func (c *Client) GetUserInfo() (*entity.User, error)
- func (c *Client) GetUsers() ([]entity.User, error)
- func (c *Client) LoadData(folderID, docName string, docData *api.DocumentConversionResponse) (*entity.Document, error)
- func (c *Client) LoadFile(folderID, targetFile string) (*entity.Document, error)
- func (c *Client) RemoveFolder(folderID, moveToID string) error
- func (c *Client) SearchDocuments(keywords string) ([]entity.DocumentSearch, error)
- func (c *Client) SetFolderPermissions(folderID, msg string, perms *[]entity.LabelRole) error
- func (c *Client) StartDocumentFromTemplate(isStock bool, templateID, folderID string) (DocumentID string, err error)
- func (c *Client) UpdateDocument(document *entity.Document) error
- func (c *Client) UpdateDocumentPage(pg *entity.Page) error
- func (c *Client) UpdateFolder(fldr *entity.Label) error
- func (c *Client) UpdateOrganization(org *entity.Organization) error
- func (c *Client) UpdateUser(usrp *entity.User) error
- func (c *Client) Validate() error
Constants ¶
const HeaderAuthTokenName = "Authorization"
HeaderAuthTokenName is the name of the authorization token required in the http header
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { BaseURL string Domain string Client *http.Client Auth models.AuthenticationModel }
Client holds the data for a sustained connection to Documize.
func NewClient ¶
NewClient authorizes the user on Documize and returns the Client type whose methods allow API access the Documize system.
func (*Client) AddAttachment ¶
AddAttachment adds a new attachement to a document
func (*Client) AddDocumentPage ¶
AddDocumentPage adds the given page into the indicated document.
func (*Client) AddFolder ¶
AddFolder adds the given folder for the current user. Fields added by the host are added to the folder structure referenced.
func (*Client) AddUser ¶
AddUser adds the given user to the system. The version of the user record written to the database is written into the referenced User record.
func (*Client) ChangeDocumentPageLevel ¶
func (c *Client) ChangeDocumentPageLevel(documentID string, plrm *[]models.PageLevelRequestModel) error
ChangeDocumentPageLevel sets the levels of the pages in the PageLevelRequestModel for the given document.
func (*Client) ChangeDocumentPageSequence ¶
func (c *Client) ChangeDocumentPageSequence(documentID string, psrm *[]models.PageSequenceRequestModel) error
ChangeDocumentPageSequence sets the sequences of the pages in the PageSequenceRequestModel for the given document.
func (*Client) DeleteAttachment ¶
func (c *Client) DeleteAttachment(att *entity.Attachment) error
DeleteAttachment removes a file attachment.
func (*Client) DeleteDocument ¶
DeleteDocument removes the given document from the Documize database.
func (*Client) DeleteDocumentPage ¶
DeleteDocumentPage deletes the given page from the indicated document.
func (*Client) DeleteDocumentPages ¶
DeleteDocumentPages deletes the given pageIDs in a slice from the indicated document.
func (*Client) DeleteUser ¶
DeleteUser deletes the given user.
func (*Client) GetAttachmentData ¶
func (c *Client) GetAttachmentData(att *entity.Attachment) error
GetAttachmentData get the data of a file attachement.
func (*Client) GetAttachments ¶
func (c *Client) GetAttachments(documentID string) (entAtts []entity.Attachment, err error)
GetAttachments gets a slice of the attachments for a document ID.
func (*Client) GetDocument ¶
GetDocument gets the document information.
func (*Client) GetDocumentAsDocx ¶
GetDocumentAsDocx returns a file-name and content for the given documentID. TODO allow the selection of either HTML or DOCX format.
func (*Client) GetDocumentMeta ¶
func (c *Client) GetDocumentMeta(documentID string) (*entity.DocumentMeta, error)
GetDocumentMeta gets the metadata for a document.
func (*Client) GetDocumentPages ¶
GetDocumentPages returns all the pages in a document.
func (*Client) GetDocumentPagesBatch ¶
GetDocumentPagesBatch returns those pages in a document whose RefIDs are in a comma-separated list.
func (*Client) GetDocumentsByFolder ¶
GetDocumentsByFolder returns a slice of document information for a given folder.
func (*Client) GetFolder ¶
GetFolder returns the documents in the given folder that the current user can see.
func (*Client) GetFolderPermissions ¶
GetFolderPermissions returns the given user's permissions.
func (*Client) GetFolders ¶
GetFolders returns the folders that the current user can see.
func (*Client) GetFoldersVisibility ¶
GetFoldersVisibility returns the visibility of folders that the current user can see.
func (*Client) GetNamedFolderIDs ¶
GetNamedFolderIDs returns those folder IDs with the given name (folder names are not unique).
func (*Client) GetOrganizations ¶
func (c *Client) GetOrganizations() ([]entity.Organization, error)
GetOrganizations returns the user's organizations.
func (*Client) GetRobots ¶
GetRobots returns the site map information based on the domain supplied in the URL called.
func (*Client) GetSitemap ¶
GetSitemap returns the site map information based on the domain supplied in the URL called.
func (*Client) GetTemplates ¶
GetTemplates returns the available templates; from the stock templates if useStock is set.
func (*Client) GetUserFolderPermissions ¶
GetUserFolderPermissions gets the folder permissions for the current user.
func (*Client) GetUserInfo ¶
GetUserInfo returns the user's information.
func (*Client) LoadData ¶
func (c *Client) LoadData(folderID, docName string, docData *api.DocumentConversionResponse) (*entity.Document, error)
LoadData uploads and converts the raw data comprising a Documize document into Documize, returning a fileID and error.
func (*Client) LoadFile ¶
LoadFile uploads and converts a file into Documize, returning a fileID and error.
func (*Client) RemoveFolder ¶
RemoveFolder removes the given folder and moves its contents to another.
func (*Client) SearchDocuments ¶
func (c *Client) SearchDocuments(keywords string) ([]entity.DocumentSearch, error)
SearchDocuments returns a list of documements which contain the supplied keywords. TODO explain the format of the keywords string (when not just the single word sought).
func (*Client) SetFolderPermissions ¶
SetFolderPermissions sets the given user's permissions.
func (*Client) StartDocumentFromTemplate ¶
func (c *Client) StartDocumentFromTemplate(isStock bool, templateID, folderID string) (DocumentID string, err error)
StartDocumentFromTemplate returns the documentID created in the given folderID from the given templateID, using either a stock template if isStock==true or a saved template.
func (*Client) UpdateDocument ¶
UpdateDocument updates document information obtained from GetDocument.
func (*Client) UpdateDocumentPage ¶
UpdateDocumentPage updates the given page from the indicated document.
func (*Client) UpdateFolder ¶
UpdateFolder changes the folder info the given folder for the current user, returning the changed version in the referenced folder structure.
func (*Client) UpdateOrganization ¶
func (c *Client) UpdateOrganization(org *entity.Organization) error
UpdateOrganization returns the user's organization information.
func (*Client) UpdateUser ¶
UpdateUser updates the given user, writing the changed version back into the given User structure.