How can I fix the 'sha' undefined error for my Netlify site? - jekyll

So I've built a Jekyll site with the theme [Moon](Failed to persist entry: TypeError: Cannot read property 'sha' of undefined) and I've uploaded it to my GitHub repository. Then I want to add Netlify's admin panel to my site so I follow this guide which I modify the config.yml to the following code:
backend:
name: git-gateway
publish_mode: editorial_workflow
media_folder: "files"
display_url: https://ccsource.org
slug:
encoding: "ascii"
clean_accents: true
collections:
- name: "story"
label: "Story"
folder: "_posts"
extension: "md"
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
create: true
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "post"}
- {label: "Title", name: "title", widget: "string"}
- label: "tags"
name: "tags"
widget: "list"
allow_add: true
default: ["story"]
- {label: "Summary", name: "excerpt", widget: "string", required: false}
- {label: "comments", name: "comments", widget: "hidden", default: true}
- label: "Publish date"
name: "date"
widget: "datetime"
default: ""
format: "MMM Do YY"
- {label: "Body", name: "body", widget: "markdown", required: true}
Since I got markdown sample file like:
---
layout: post
title: "Sample"
date: 2016-03-15
excerpt: "Hello..."
tag:
- sample
- post
- video
comments: true
---
# Sample
But after all things setup and deployed I visit my site's admin panel and try to create a new post I keep getting the following error.
Failed to persist entry: TypeError: Cannot read property 'sha' of undefined
And I've googled and modified the branch value to site which match to my github repository, but the error keeps showing, how can I fix it?

For anyone else experiencing this, the issue was that Netlify Identity was enabled, but Git Gateway, a sub-feature of Netlify Identity, was not. Instructions for enabling Git Gateway here: https://www.netlify.com/docs/git-gateway/#getting-started

Related

my file is not added in the folder [DRIVE API]

I am updating with AJAX the name of the file and in which folder it should be saved, the name is updated but the place destined to save (the folder) does not work.
What am I doing wrong?
url: "https://www.googleapis.com/drive/v3/files/D5Rs1c...",
data: JSON.stringify({
name: "name the drive",
parents: [{
kind: "drive#parentReference",
id: "1isO7RhgpuvNo-dkC0UJLrziGC..."
}]
}),
contentType: "application/json",
type: "PATCH"
From your endpoint of url: "https://www.googleapis.com/drive/v3/files/D5Rs1c...",, it seems that you are using Drive API v3. In this case, the filename and folder of the metadata are name: "samplename" and parents: ["folderId"], respectively. In your request body, parents: [{kind: "drive#parentReference",id: "1isO7RhgpuvNo-dkC0UJLrziGC..."}] is used while the filename is set as name: "name the drive". I think that this is the reason for your current issue. So, please modify your request body as follows.
From:
data: JSON.stringify({
name: "name the drive",
parents: [{
kind: "drive#parentReference",
id: "1isO7RhgpuvNo-dkC0UJLrziGC..."
}]
}),
To:
data: JSON.stringify({
name: "name the drive",
parents: ["1isO7RhgpuvNo-dkC0UJLrziGC..."]
})
Note:
If your folder of folder ID is in the shared Drive, please add a query parameter of supportsAllDrives=true to the endpoint.
Reference:
Files: update

Shared Views + Forge access - Can I push an Inventor model as a shared view and then access the bucket in a forge app

I would like to use the Shared Views feature of Vault/AutoCAD/ACADE/Inventor to push models and such (in particular larger Inventor assemblies) up to the cloud, where I assume they land in an OSS bucket. I think that they are only valid up there for 30 days, but that length of time is fine for my purpose. What I would like to know is there any way I can get the ID of the bucket, and then use that to view or pull that SVF file into an APP back inside my firewall for further use? I have some extensions planned in a viewer app back on premises, but I don't have a good way to get the models into the cloud and generated in the first place because of the references in the model - I would have to checkout the model and all references, zip them up, and then send it to the model derivative and such. I am hoping that since the shared views feature already does that part, I can just leverage that to start my process.
MORE INFO:
So, using Fiddler I can see several interesting calls related to this. I went into Vault and created a shared view for a DWG file, then just watched the traffic. I see calls in a pattern that could be maybe leveraged.
Call 1:
GET https://360.autodesk.com/Viewer/GetViewerTranslationById?viewerId=dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u
Call 2:
GET https://360.autodesk.com/Viewer/GetAccessToken
Call 2 returns a token:
token_type: "Bearer"
expires_in: "3599"
expires_at: "2020-07-17T17:02:15.1187374+00:00"
access_token: "eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJzY29wZSI6WyJkYXRhOnJlYWQiLCJkYXRhOndyaXRlIiwiZGF0YTpzZWFyY2giXSwiY2xpZW50X2lkIjoiVmZNQ3U1NDg2U3hLQXVRaGRVMU9aYTJuTHdqR1VXcEciLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiI5NVFQYnhGWjlmZ1p0YWxzbXg2OW1oUWczck9WbWRKeDRtZjdtdUY0Z0xBME01TmNqZjJCT1hoa3RiRHdlVm04IiwiZXhwIjoxNTk1MDA1MzQ2fQ.tRQYz7PP-_NIDrZFrWbXvxiP4NfooBHAIC89eQuelkw"
bucket: "a360viewer"
Then Call 3 to the derivatives service:
GET https://developer.api.autodesk.com/derivativeservice/v2/manifest/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u
.....
Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJzY29wZSI6WyJkYXRhOnJlYWQiLCJkYXRhOndyaXRlIiwiZGF0YTpzZWFyY2giXSwiY2xpZW50X2lkIjoiVmZNQ3U1NDg2U3hLQXVRaGRVMU9aYTJuTHdqR1VXcEciLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiI5NVFQYnhGWjlmZ1p0YWxzbXg2OW1oUWczck9WbWRKeDRtZjdtdUY0Z0xBME01TmNqZjJCT1hoa3RiRHdlVm04IiwiZXhwIjoxNTk1MDA1MzQ2fQ.tRQYz7PP-_NIDrZFrWbXvxiP4NfooBHAIC89eQuelkw
....
Call 3 returns lots of information:
guid: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
owner: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
hasThumbnail: "true"
startedAt: "Fri Jul 17 16:06:29 UTC 2020"
type: "design"
urn: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
success: "100%"
progress: "complete"
region: "US"
status: "success"
children:
0:
guid: "aa85aad6-c480-4a35-9cbf-4cf5994a25ba"
hasThumbnail: "true"
role: "viewable"
progress: "complete"
type: "folder"
status: "success"
version: "2.0"
urn: "dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u"
inputFileSize: 1059328
inputFileType: "collaboration"
name: "C-424305-036.dwg.dwf"
success: "100%"
children:
0:
guid: "87CBE465-EAB2-43C0-BA0A-D148B3418FF3_Sheets"
type: "folder"
name: "Sheets"
hasThumbnail: "true"
status: "success"
progress: "complete"
success: "100%"
children:
0:
guid: "933b32f8-830d-4861-6e81-294f5d07d4fc"
type: "geometry"
role: "2d"
name: "C-424305-036-Model"
status: "success"
size: 585718
hasThumbnail: "true"
progress: "complete"
success: "100%"
viewableID: "com.autodesk.dwf.ePlot_87CBE466-EAB2-43C0-BA0A-D148B3418FF3"
order: 0
children:
0:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/933b32f8-830d-4861-6e81-294f5d07d4fc_f2d/primaryGraphics.f2d"
role: "graphics"
size: 503288
mime: "application/autodesk-f2d"
guid: "c7624064-cb61-933b-787c-e02bef313ea4"
type: "resource"
status: "success"
1:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/933b32f8-830d-4861-6e81-294f5d07d4fc_f2d/section_properties.db"
role: "Autodesk.CloudPlatform.PropertyDatabase"
size: 24576
mime: "application/autodesk-db"
guid: "20392091-d0da-d74d-741f-904b078b9c0a"
type: "resource"
status: "success"
2:
guid: "a3a9ad7f-b9aa-451e-8bbc-da2972137d82"
type: "view"
role: "2d"
name: "INITIAL"
viewbox:
0: 0.67
1: 0.575
2: 16.330833
3: 10.423333
1:
guid: "d6e600db-d158-d84f-3101-0a654aa29df3"
type: "geometry"
role: "2d"
name: "C-424305-036-C-424305-036-00"
status: "success"
size: 617457
hasThumbnail: "true"
progress: "complete"
success: "100%"
viewableID: "com.autodesk.dwf.ePlot_87CBE467-EAB2-43C0-BA0A-D148B3418FF3"
order: 1
children:
0:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/d6e600db-d158-d84f-3101-0a654aa29df3_f2d/primaryGraphics.f2d"
role: "graphics"
size: 535065
mime: "application/autodesk-f2d"
guid: "441471cc-a249-1b4e-36dd-7ea4bff584cd"
type: "resource"
status: "success"
1:
urn: "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YTM2MHZpZXdlci90NjM3MzA1OTg3ODExMjQxMTQ4XzQxYjE3M2M1LTVmZjctNDQ2ZC1iNTFkLTgwZTg1NjQ3NjU3ZC5jb2xsYWJvcmF0aW9u/output/d6e600db-d158-d84f-3101-0a654aa29df3_f2d/section_properties.db"
role: "Autodesk.CloudPlatform.PropertyDatabase"
size: 24576
mime: "application/autodesk-db"
guid: "03334fbb-15ce-446d-ff80-111dc8616642"
type: "resource"
status: "success"
2:
guid: "69f50589-0774-4cf3-9b21-8164c1e71027"
type: "view"
role: "2d"
name: "INITIAL"
viewbox:
0: 3.958333
1: 0.4325
2: 16.330833
3: 10.565
Further research reveals that the ID used for calling is base64 encoded, decoding it reveals this:
urn:adsk.objects:os.object:a360viewer/t637305987811241148_41b173c5-5ff7-446d-b51d-80e85647657d.collaboration

Describing properties in swagger example

Try to add multiline example in definition of JSON response in swagger. Need to get structure like
{
"result": {
"urls": {
"site/index": true,
"site/create": true,
"site/update": true,
"site/delete": true,
"site/types": true,
"site/save": false
}
}
}
but now everything I've got only
{
"result": {
"urls": [
{
"site/index": true
},
{
"site/create": true
},
{
"site/update": true
},
{
"site/delete": true
},
{
"site/types": true
},
{
"site/save": false
}
]
}
}
My YAML file looks like
swagger: "2.0"
info:
description: "xxx"
version: 1.2.8
title: "xxx"
host: "xxx"
basePath: "xxx"
schemes:
- "https"
consumes:
- application/json
produces:
- application/json
/site/check:
post:
summary: ""
description: ""
parameters:
- in: body
name: urls
required: true
schema:
$ref: '#/definitions/CheckAccess'
responses:
200:
description: OK
schema:
$ref: '#/definitions/CheckAccessOKResponse'
definitions:
CheckAccess:
properties:
urls:
type: string
example:
- "site/index"
- "site/create"
- "site/update"
- "site/delete"
- "site/types"
- "site/save"
required:
- urls
CheckAccessOKResponse:
properties:
result:
type: object
properties:
urls:
type: object
example:
- "site/index": true
- "site/create": true
- "site/update": true
- "site/delete": true
- "site/types": true
- "site/save": false
Strings in example can be different, it's just a block of paths.
How can I fix my example or structure of CheckAccessOKResponse to get the needed view of JSON?
Thank you.
Remove the leading dashes from the example value list. Dashes indicate array items, you don't need that.
Also, result.urls is currently defined as a free-form object, but you probably want a string-to-boolean map instead.
CheckAccessOKResponse:
properties:
result:
type: object
properties:
urls:
type: object
additionalProperties: # <--- this means the object is
type: boolean # a string-to-boolean map
example:
"site/index": true # <--- no leading dashes
"site/create": true
"site/update": true
"site/delete": true
"site/types": true
"site/save": false

Cannot retrieve custom Netlify CMS collections in Jekyll

I created a new Netlify CMS website based on Jekyll and created new collections workshop and consultant
With the Netlify CMS interface, I can see, add, edit and delete the new collections, but I cannot retrieve them in the view.
--/_consultants
name.md
--/_workshops
title.md
config.yml
collections:
# WORKSHOPS
- name: "workshop" # Used in routes, ie.: /admin/collections/:slug/edit
label: "Workshop" # Used in the UI, ie.: "New Post"
folder: "_workshops" # The path to the folder where the documents are stored
sort: "title:desc" # Default is title:asc
create: true # Allow users to create new documents in this collection
slug: "{{slug}}"
output: true
permalink: /wokshop/:title
fields: # The fields each document in this collection have
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- label: "Consultant"
name: "consultant"
widget: "relation"
collection: "consultant"
searchFields: ["name"]
valueField: "name"
- {label: "Location", name: "location", widget: "string"}
- {label: "Duration", name: "duration", widget: "string"}
- label: "Category"
name: "category"
widget: "select"
options: ["Business", "Team & Culture", "Design"]
- {label: "Price", name: "price", widget: "string", required: false}
- {label: "Permalink", name: "permalink", widget: "hidden"}
- {label: "Blurb", name: "ws-blurb", widget: "string"}
- {label: "Description", name: "ws-description", widget: "markdown"}
# CONSULTANTS
- name: "consultant" # Used in routes, ie.: /admin/collections/:slug/edit
label: "Consultant" # Used in the UI, ie.: "New Post"
folder: "_consultants" # The path to the folder where the documents are stored
sort: "date:desc" # Default is title:asc
create: true # Allow users to create new documents in this collection
slug: "{{slug}}"
identifier_field: name
output: true
fields: # The fields each document in this collection have
- {label: "Permalink", name: "permalink", widget: "hidden"}
- {label: "Name", name: "name", widget: "string", tagname: "h1"}
- label: "Image"
name: "image"
widget: "image"
# default: "/uploads/chocolate-dogecoin.jpg"
media_library:
config:
multiple: false
- {label: "Bio", name: "bio", widget: "markdown"}
- {label: "References", name: "references", widget: "markdown"}
- {label: "Link", name: "link", widget: "string"}
- {label: "Workshops hosted", name: "ws-hosted", widget: "number"}
When I try to retrieve the newly created workshops and consultants I can't get it to work:
<ul>
{% for item in site.workshops %}
<li>
<h2>
{{ item.title }}
</h2>
</li>
{% endfor %}
</ul>
And when I try to debug the object, it returns NULL: {{ site.workshops | jsonify }}
What confuses me the most is that I can access the collections through the admin interface, but for the last 4 hours I failed at retrieving them in the view.
What am I missing?
I found the solution! So for anyone getting stuck at this point: the information below has to go to _config.yml and not (!) to config.yml
collections:
workshops:
output: true
consultants:
output: true

Autodesk setreference for child assemblies not working

I am having trouble referencing child assemblies that are required for a parent assembly translation.
First I POST to https://developer.api.autodesk.com/references/v1/setreference with the following body
{ master: 'urn:adsk.objects:os.object:stemn/57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam',
dependencies:
[ { file: 'urn:adsk.objects:os.object:stemn/57b9f339c77fe2652f830206-e3l7hokp0qxqn227b7qcjo47vi.iam',
metadata:
{ childPath: 'fuselage.iam',
parentPath: '57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam' } },
{ file: 'urn:adsk.objects:os.object:stemn/57b9f339c77fe2652f830206-mhrb7um0of74iasv37nzh0k9.iam',
metadata:
{ childPath: 'motor_mount.iam',
parentPath: '57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam' } } ] }
After setting references, I request translation and get the following result of the translation:
{ Result: 'Success',
Scope: '25660970-8194-4de0-baa4-c8f1f132b2a7',
RegisterType: [ 'thumbnail', '2dviewing', '3dviewing' ] }
After that I get the manifest for the urn and it is as follows:
{ guid: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
owner: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
type: 'design',
hasThumbnail: 'false',
startedAt: 'Wed Jan 04 04:43:59 UTC 2017',
urn: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
region: 'US',
status: 'failed',
progress: 'complete',
success: '100%',
children:
[ { guid: 'aa85aad6-c480-4a35-9cbf-4cf5994a25ba',
messages:
[ { type: 'warning',
message: 'The drawing\'s thumbnails were not properly created.',
code: 'TranslationWorker-ThumbnailGenerationFailed' } ],
name: '57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.iam',
success: '100%',
hasThumbnail: 'false',
role: 'viewable',
version: '2.0',
urn: 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt',
status: 'failed',
assetCount: 25,
type: 'folder',
progress: 'complete',
children:
[ { guid: '015896d9-e6d3-4be6-8f3d-96da5e64eed3',
type: 'folder',
name: 'Scenes',
status: 'success',
progress: 'complete',
success: '100%',
hasThumbnail: 'false',
children:
[ { guid: '451f7aab-1917-40dd-b117-5dd8f90ab6a7',
type: 'geometry',
role: '3d',
name: 'Scene',
status: 'success',
messages:
[ { type: 'warning',
code: 'ATF-1023',
message:
[ 'The file: {0} does not exist.',
'X:\\Google Drive\\SCAAD\\PRJ_HAARDCraft\\HAARDCraft_JFlight\\CAD\\Fuselage\\fuselage.iam' ] },
{ type: 'warning',
code: 'ATF-1023',
message:
[ 'The file: {0} does not exist.',
'X:\\Google Drive\\SCAAD\\PRJ_HAARDCraft\\HAARDCraft_JFlight\\CAD\\Engine mount\\motor_mount.iam' ] },
{ type: 'error',
code: 'ATF-1026',
message:
[ 'The file: {0} is empty.',
'C:/worker/viewing-inventor-lmv/tmp/job-1/68/output/1/57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.svf' ] } ],
size: 27864,
progress: 'complete',
success: '100%',
hasThumbnail: 'false',
children:
[ { guid: '6dc4b244-8a47-4a75-bcb3-811dc7b4f294',
type: 'resource',
urn: 'urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt/output/1/57b9f339c77fe2652f830206-ckwdob3791d6u359wz7eklnmi.svf',
role: 'graphics',
mime: 'application/autodesk-svf',
size: 27864 } ] },
{ guid: '9bb1adbe-d9d9-4482-ac03-1d60bb0aea36',
type: 'resource',
urn: 'urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt/output/1/properties.db',
role: 'Autodesk.CloudPlatform.PropertyDatabase',
mime: 'application/autodesk-db',
status: 'success',
size: 24576 } ] },
{ guid: '039c2bcf-beb7-426b-916c-4a5adb814593',
type: 'resource',
role: 'Autodesk.CloudPlatform.DesignDescription',
urn: 'urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTdiOWYzMzljNzdmZTI2NTJmODMwMjA2LWNrd2RvYjM3OTFkNnUzNTl3ejdla2xubWkuaWFt/output/xref/designDescription.json',
mime: 'application/json' } ] } ] }
Using the same code path I can successfully render an assembly with non-assembly child parts that have been set using setreference, but when rendering an assembly with child assemblies, setreference doesn't seem to set the references to the child assembly files successfully. Is there something wrong in my sequence for setting references to child assemblies?
I discussed with #sabrehage and finally got the working codes.
firstly, it is recommended to use Forge Derivative API v2 (zip + specify root file only), by which, the API user does not need to specify the references explicitly.
If you still want to use Forge Derivative API v1, the following is the note:
In local Inventor, the file references are managed by Inventor Project. Inventor will look for the ref files firstly in the specific folders of the Project, then look for the relative paths. Obviously, when the files are uploaded to bucket of Forge, no project file, all files are in the same level in physical perspective. So in v1, it depends on the reference file that the sender specifies.
If the hierarchy is like:
Top Assembly.iam
part1.ipt
part2.ipt
The reference file can be simply composed like what is mentioned in the blog:
http://adndevblog.typepad.com/cloud_and_mobile/2015/09/how-to-set-references-with-inventor-files-for-view-and-data-api.html.
In the dataset of #sabrehagen, the hierarchy contains nested assemblies, even in sub folder:
topassemb.iam
part in top assemb.ipt
subassem folder
subassem.iam
part1 in sub assem1.ipt
part2 in sub assem1.ipt
The correct way is to specify in one call (for top assembly only), and specify the subfolder in the reference map. In addition, we should define path name with original name, instead of that has been URL encoded. i.e.
{
"master" : "urn:adsk.objects:os.object:adsk2017-8/topassemb.iam",
"dependencies" : [
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/subassem.iam",
"metadata" : {
"childPath" : "subassem/subassem.iam",
"parentPath" : "topassemb.iam"
}
},
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/part1%20in%20sub%20assem1.ipt",
"metadata" : {
"childPath" : "part1 in sub assem1.ipt",
"parentPath" : "subassem/subassem.iam"
}
},
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/part2%20in%20sub%20assem1.ipt",
"metadata" : {
"childPath" : "part2 in sub assem1.ipt",
"parentPath" : "subassem/subassem.iam"
}
},
{
"file" : "urn:adsk.objects:os.object:adsk2017-8/part%20in%20top%20assemb.ipt",
"metadata" : {
"childPath" : "part in top assemb.ipt",
"parentPath" : "topassemb.iam"
}
}
]
}
If without specifying subfolder, Forge thinks all files are within the same level, but it conflicts to the hierarchy of the last saving (absolute path). So it failed to find the corresponding files in the bucket.
After Forge gets the files and correct reference, it will look at the reference file and create the subfolders if they are specified, then put those files to the subfolder from bucket, finally translate.
as I remember, you would also need to configure the parts in the web service of set reference. This is a blog: http://adndevblog.typepad.com/cloud_and_mobile/2015/09/how-to-set-references-with-inventor-files-for-view-and-data-api.html. probably it could help you to diagnose the issue.
But, I strongly suggest you migrate to v2, by which you do not need to set reference manually. you can just upload all dataset as a zip file and set which file is the top (root) file, Forge will analyze the hierarchy automatically. This is another blog: http://adndevblog.typepad.com/cloud_and_mobile/2016/07/translate-referenced-files-by-derivative-api.html