DocLib Item stays checked out after edit - sharepoint

here are steps of my problem:
Go to custom DocumentLibrary (custom fields, custom ListForm with custom FieldIterator)
Select one of existing on production Word documents (*.doc)
Click "Edit document" in order to edit in a client Office application
Edit doc and click save, look at progress bar of changes uploading...
Close document, the view I`d opened before will be refreshed.
Problem:
The item becomes checked out by Administrator. It does not matter what user you use to edit, you will always see checked out document under Administrator.
Changes to document are applied time by time.
Results of my investigation:
I`ve loocked through Fiddler and found out this CellRequestFail error from CellStorage.svc:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ResponseVersion Version="2" MinorVersion="0" xmlns="http://schemas.microsoft.com/sharepoint/soap/"/>
<ResponseCollection WebUrl="http://kbstg.rt.ru" xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<Response Url="http://siteurl/Lists/DocumentationListInstance/02_D-link_DSL2640_UEBRUC2E_V2.doc" RequestToken="1" HealthScore="1">
<SubResponse SubRequestToken="1" ErrorCode="Success" HResult="0">
<SubResponseData/>
</SubResponse>
<SubResponse SubRequestToken="2" ErrorCode="CellRequestFail" HResult="2147500037">
<SubResponseData Etag=""{BB1B8453-5F6F-4D05-8210-E42DB21A6711},12"" CoalesceHResult="0" ContainsHotboxData="False" HaveOnlyDemotionChanges="False">DAALAJ3PKfM5lAabFgMCAAAOAgYAAwUBbgIgAL+u/no9AyhInDE5d6/lgklaAggAZgIAADcBBwGLAQ==</SubResponseData>
</SubResponse>
</Response>
</ResponseCollection>
</s:Body>
</s:Envelope>
ULS Logs gave me:
ttidLogCellStg Sub-request rtQueryChanges failed with error ICsiError: csierrBlobHeap_ClockReversed (0x266)
If I uploaded there any new document then all will be good. Even if I downloaded an problematic document and uploaded it after by creating new item then all will be fine again.
Updated:
I made some tests on a file, so I can say that ETag in the file properties is equal to ETag which figure in SubRequest.

This is the problem in MS-FSSHTTPS protocol. The protocol is responsible for file sync of Office documents between Office client (Word) and server (SharePoint). It should reduce the amount of data transferred between client and server. Better results are get for DOCX documents but it works also with DOC files. According to the protocol documentation:
Etag: A string that specifies a unique string value that gets updated
every time the file contents are changed. The unique string gets
updated irrespective of which protocol client updated the file
contents in a co-authorable file. Anytime the protocol client
specifies the Etag attribute in a cell sub request, the server MUST
check to ensure that the Etag sent by the client matches the Etag
specified for that file on the server. If there is a mismatch of Etag
between the version specified by the client and version stored by the
server, the protocol server MUST send an error code value set to
"CellRequestFail" in the cell sub response message. The protocol
server processes this value as specified in [RFC2616].
It seems that the ETAG metadata information is corrupted in your document.

Related

What is the correct way to handle changes.watch webhook requests?

I'm trying to watch for google drive changes, and write down history of changes in database, also I want to store the files (all versions).
For now I have set up webhook, so I get some info in request.header, but this info looks weird, only message number differs, resourceUri or pageToken in it are the same.
Request headers don't contain info about file or folder that was changed. No change id, no file id, no actors.
I want to know, how this method is helpful and what should I do to get real-time changes with information about files that were changed.
There are some steps to handle Drive file changes.
1. Choose the change type you want to track
It could be just changes within the file, changes in the file metadata, such as moving the file to another folder or to a shared drive. You might want to use the Reports API for that one.
2. Watch for changes
You can use the Changes API to detect what data has changed or has been removed. If you want detailed information about the changes, you can also check the Activity API
3. Get the notification
Set up a webhook when changes are detected on the file
POST https://www.googleapis.com/drive/v3/files/fileId/watch
Authorization: Bearer auth_token_for_current_user
Content-Type: application/json
{
"id": "01234567-89ab-cdef-0123456789ab", // Your channel ID.
"type": "web_hook",
"address": "https://example.com/notifications", // Your receiving URL.
...
"token": "target=myApp-myFilesChannelDest", // (Optional) Your channel token.
"expiration": 1426325213000 // (Optional) Your requested channel expiration time.
}
Sample code from https://developers.google.com/drive/api/v3/push
4. Export the new version of the file
After a new change is triggered, you can download the new file version using the export method
You can check a more detailed guide on https://developers.google.com/drive/api/v3/manage-revisions

BizTalk "New" SharePoint Adapter Send Document Silent Fail

I have a BizTalk 2016 solution. It's collecting a document (Pdf or Word) from a varbinary(max) column of a Sql Server database, along with some metadata. So, the message that makes its way to the messagebox from the Sql Receive Port looks like:
<TypedPolling xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedPolling/ReadyForBizTalk">
<TypedPollingResultSet0>
<TypedPollingResultSet0>
<Id>3</Id>
<DocId>104</DocId>
<Uprn>76675</Uprn>
<Address1>48 Cardinal Square </Address1>
<Address2>City</Address2>
<Address3>County</Address3>
<Postcode>AF1 5FF</Postcode>
<Title>Doc title</Title>
<DocType>Pdf</DocType>
<Version>-1</Version>
<Date>30/01/2019 14:46:26</Date>
<Description>Description</Description>
<FilePath />
<Extension>.pdf</Extension>
<SystemGenerated>false</SystemGenerated>
<Content>/9j/4AAQSkZJRgAB...</Content>
<ProcessedByBizTalk>false</ProcessedByBizTalk>
</TypedPollingResultSet0>
</TypedPollingResultSet0>
I want BizTalk to send this to send the binary document (content of the Content element) and the metadata "Title" value to a SharePoint 2013 document library. I have created a send port and configured the following properties:
Use Cleint OM = Yes
Destination Folder URL
SharePoint Site URL
Column 01 = Title
Column 01 Value = %XPATH=//Title%
I realise that I've not made any attempt to send the "Content" yet but I thought I'd try to get this simple case working first.
When I set a new rec to be collected from the Sql Server table, it is collected ok by BizTalk and I can see from Tracked Messages that a send is made through the SharePoint adaptor. There are no errors either in the BizTalk admin console or event log, but new item appears in the document library
I have a couple of questions:
Any ideas why nothing new is appearing on the doc library?
Once I'm able to persist "something" to SharePoint library, does anyone know how I can get the binary document into the library?

DocuSign - Random UNABLE_TO_CONVERT_DOCUMENT error

I am using Docusign create envelop API using the endpoint https://au.docusign.net/restapi/v2/accounts/{AccountID}/envelopes. The API call works on most instance but occasionally I am receiving an error stating that the System was unable to convert this document to a PDF. I am submitting a docx type document which is failing randomly(say once in a day). On re submission the same document submission works without any issue.
In order to understand the problem I tried enabling logging on DocuSign login. Since the log can only keep upto 50 entries at any given time I am clearing the log to ensure I am ready to capture the failure when it happens.
Actual Error Message received:
{
"errorCode": "UNABLE_TO_CONVERT_DOCUMENT",
"message": "System was unable to convert this document to a PDF. Unable to convert Document(Document Name.docx) to a PDF. Error: UserId:{GUID} IPAddress:XX.XX.XXX.XXX Source:ApiRESTv2:Failed to convert FileType: docx"
}
Now I am trying to download the log file via DocuSign UI and I am receiving constant timeout issue while trying to do so. Does anyone know about any programmatic log file extract from DocuSign? Anyone done this previously?
Any pointers on the error resolution or help downloading the error log is much appreciated. Please help
The DocuSign platform by default accepts PDF documents so when sending through the API you simply need to include the document bytes for PDFs. However for any other file format you need to set the fileExtension property on the document object to the file type you are sending.
For example if using one of the open source DocuSign SDKs use the setFileExtension() setter method to set the extension:
document.setFileExtension("docx");
Or if you are calling the REST API directly (ie not using an SDK) then set the fileExtension property to "docx":
{
...
"fileExtension": "docx",
....
}
If you still receive the error after this then you I would start testing with a different document and confirm the document you are using not corrupt in any way and if properly formatted.

Angular 6: Change Content-Type of template-generated page

Notice: This question is not about ANGULAR's HttpClient, but the document generated by a component's template.
I want to do an old trick for a simple, yet powerful MS EXCEL export: Generate an HTML document containing one single <table>, and serve it with "Content-Type: application/xls". The user's browser will forward the document to a locally installed MS EXCEL, which detects that this is not a "real" .xls, but HTML, and converts very nicely the HTML into a spreadsheet.
My approach to implement this is straigtforward: Add a route for path, say, "/export-xls", and a new component that gets the data and renders it in its template.
However I absolutely cannot find a way to set the "Content-Type" header in the response!? I envisage that in the "Routes" array I would set "contentType: 'application/xls'", but no way.
What is the easiest and best way to generate such a document from within ANGULAR?
You can solve your problem by doing following steps
create a file containing your table in your local file system and create a URL for that file using URL.createObjectURL method
send an http request to that file
intercept the request and add contentType: 'application/xls' to response headers
after receiving your file revoke the URL using URL.revokeObjectURL method and delete the file from your local file system
I am not sure if you can do this without the creation of physical file because you need an http request because of the response content type

Retrieve signed document using DocuSign API

I want to download a document signed recipient using DocuSign API (REST).
I am using the following endpoint as per the documentation.
HTTP request
GET /v2/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}
Request Headers
X-DocuSign-Authentication:{"Username": <Username>,"Password": <Password>,"IntegratorKey": <IntegratorKey>}
Accept: application/pdf
Content-Transfer-Encoding:base64
I got document in a base64 format which I am able to download but when try to open that file using PDF viewer we got the following message:
The file is blank and some error related to signature, check following screenshot
PDF open error snapshot
Are there any parameters missing while downloading the document? Please help.
Thanks.
See this link for EnvelopeId stamp control
https://support.docusign.com/en/articles/How-do-I-move-the-Envelope-ID-Stamp-on-my-documents
In DEMO environment you will always have the "demonstration only" stamp on the document. This will not be present when you goto prod environment

Resources