• REST API - How to delete first section of a document ?

    Everything is in the title, I want to replace a batch of documents in a FileCabinet. I cannot use a checkout/checkin process as versionning isn't enabled on this file cabinet. So I want to attach the new document to the existing record and delete the first document (section).
    Is it possible ?
  • RE: webservices uploading a 50mb file

    I have had informations about a 30 Mb limit with DocuWare Cloud. So if you want to upload larger file you need to do a chunked upload.
    The process to send chunks to DocuWare was quite difficult to understand.
    You need to use differents headers for your request (see code below). After each chunk sent the XML DocuWare response contains a  link to send the next chunk.
    Python example :

    def read_in_chunks(file_object, chunk_size=3000000):
        while True:
            data = file_object.read(chunk_size)
            if not data:
                break
            yield data

    def UploadBigFile(file, queryurl, session, url):
     
        content_name, file_extension = os.path.splitext(file)
        content_path = os.path.abspath(file)
        content_size = os.stat(content_path).st_size
        print('Fichier transféré : '+content_name+file_extension)
        print('Taille du fichier : '+str(content_size))
        mtime=os.path.getmtime(file)
     
        f = open(content_path,'rb')
     
        index = 0
        offset = 0
        headers = {}
     
        for chunk in read_in_chunks(f):
            offset = index + len(chunk)
            headers['X-File-Name'] = content_name+'.'+file_extension
            headers['X-File-Type'] = 'application/'+file_extension
            headers['X-File-Size'] = str(content_size)
            headers['X-File-ModifiedDate'] = time.strftime('"%Y-%m-%dT%H:%M:%SZ"', time.gmtime(mtime))
            ContentRange = 'octets %s-%s/%s' % (str(index), str(offset), str(content_size))
            index = offset
            r = session.request("POST",queryurl, data=chunk, headers=headers)
            print("r: %s, Interval de données: %s" % (r, ContentRange))
            file=open("chunk_response.xml","w+")
            file.write(r.content.decode())
            file.close()
            chunktree = ET.parse("response.xml",ET.XMLParser(encoding='ISO-8859-1'))
            chunkroot = chunktree.getroot()
            for member in chunkroot.findall('ns:FileChunk/s:Links/s:Link',namespaces):
                queryurl=url+ member.get('href')
                print(queryurl)
     
        print(r.text)
        return r

  • RE: REST API - Search on Dates and Empty date field

    Well, I have the answer :
    - Yes, you can perform a research on an empty date field using the EMPTY() keyword (tested).
    - The search date syntax is correct, my DBName wasn't ;)
  • REST API - Search on Dates and Empty date field

    Hi,
    is it possible to search for an empty date field ?
    If not, what is the XML syntax to search for a specific date ?
    Here is the XML file I send with my request  (I have tried to send the date in UTC format too) :
    <?xml version="1.0" encoding="utf-8"?>
    <DialogExpression xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Operation="And" xmlns="http://dev.docuware.com/schema/public/services/platform">
        <Condition DBName="ATTRIBUTIONS">
            <Value>*Ecole du Sacre-Coeur*</Value>
        </Condition>
        <Condition DBName="EDITION_CAHIER_DE_TRANSMISSION">
            <Value>1900-01-01</Value>
        </Condition>
    </DialogExpression>

    I receive no result with that request, but I have results without the date condition.
    Thanks,
    Fred.