We are moving to Alfresco Content Management system and there is no direct documentation for retrieving custom metadata.
Is there a way to get custom metadata/ custom properties that I have added to Record category in Alfresco Records Management File plan? Custom metadata is basically the data fields that are in scanned document like name, dob, form id, etc.
Eg: I have created RM site and added the following file plan.
TestCategory
|
--TestFolder1
|
--Record1
--Record2
|
--TestFolder2
|
--Record1
--Record2
These records contains uploaded form(scanned document) along with metadata (custom).
To Retrieve metadata, am using
http://127.0.0.1:8090/alfresco/service/api/metadata/node/workspace/SpacesStore/ed6e2cc6-6dc5-4bfb-bf9d-b450f68863dd?alf_ticket=TICKET_06265902898618fe5a46e67992e07a9d4b72701a
It is returning 405-Method not allowed (GET not supported).
To Retrieve all the subfolders/documents in Folders, m using
http://127.0.0.1:8090/alfresco/service/slingshot/doclib/doclist/documents/site/rm/documentLibrary/TestCat1/TestFolder2
Above one returns
{
"totalRecords": 1,
"startIndex": 0,
"metadata": {
"repositoryId": "3b9d4f67-dc84-4531-b8b2-4dbcef15e25a",
"container": "workspace://SpacesStore/7d1349bb-5289-4709-9055-c75c03ab5481",
"parent": {
"nodeRef": "workspace://SpacesStore/5d40660e-64d9-4bc4-a75e-ae4ae8b2201a",
"permissions": {
"userAccess": {
"create": true,
"edit": true,
"delete": true,
"cancel-checkout": false,
"permissions": true
}
}
},
"onlineEditing": true,
"itemCounts": {
"folders": 0,
"documents": 1
}
},
"items": [
{
"nodeRef": "workspace://SpacesStore/65b9b52b-3418-4a85-98b0-d4770cf9399d",
"nodeType": "cm:content",
"type": "document",
"mimetype": "application/pdf",
"isFolder": false,
"isLink": false,
"fileName": "BO (2016-1464237424392).pdf",
"displayName": "BO (2016-1464237424392).pdf",
"status": "",
"title": "þÿ",
"description": "test description",
"author": "",
"createdOn": "2016-05-26T00:37:04.350-04:00",
"createdBy": "Administrator",
"createdByUser": "admin",
"modifiedOn": "2016-05-31T15:50:21.269-04:00",
"modifiedBy": "Administrator",
"modifiedByUser": "admin",
"lastThumbnailModification": "doclib:1464237426243",
"lockedBy": "",
"lockedByUser": "",
"size": "156702",
"version": "1.0",
"contentUrl": "api/node/content/workspace/SpacesStore/65b9b52b-3418-4a85-98b0-d4770cf9399d/BO%20(2016-1464237424392).pdf",
"webdavUrl": "/webdav/Sites/rm/documentLibrary/TestCat1/TestFolder2/BO%20(2016-1464237424392).pdf",
"actionSet": "document",
"tags": [],
"activeWorkflows": "",
"isFavourite": false,
"likes": {
"isLiked": false,
"totalLikes": 0
},
"location": {
"repositoryId": "3b9d4f67-dc84-4531-b8b2-4dbcef15e25a",
"site": "rm",
"siteTitle": "Records Management",
"container": "documentLibrary",
"path": "/TestCat1/TestFolder2",
"file": "BO (2016-1464237424392).pdf",
"parent": {
"nodeRef": "workspace://SpacesStore/5d40660e-64d9-4bc4-a75e-ae4ae8b2201a"
}
},
"permissions": {
"inherited": true,
"roles": [
"ALLOWED;ROLE_EXTENDED_READER;ReadRecords;INHERITED",
"ALLOWED;GROUP_Administrator7d1349bb-5289-4709-9055-c75c03ab5481;Filing;INHERITED",
"ALLOWED;ROLE_EXTENDED_WRITER;Filing;INHERITED"
],
"userAccess": {
"create": true,
"edit": true,
"delete": true,
"cancel-checkout": false,
"permissions": true
}
},
"custom": {},
"actionLabels": {}
}
]
}
Using PostMan chrome app to test rest api. TIA.
Another way to do this: I found it in Alfresco forums :
/alfresco/service/api/metadata?nodeRef=workspace://SpacesStore/a2a6c249- c55d-4d29-8692-3e9cb1f811a8 [GET service]
This should do it. Example request.
http://localhost:8080/alfresco/service/slingshot/doclib2/node/workspace/SpacesStore/f558838b-24fa-4ea3-bb2a-602c7b4cec41
Give it a shot, it will return everything you need, not only metadata but for example aspects too.
If the response you are getting is overwhelming for anyone like me, in the accepted (great) answer/solution given by Lista, here is a simpler way:
HTTP GET:
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb
Need some more details? Try this:
http://localhost:8080/alfresco/api/-default-/public/alfresco/versions/1/nodes/dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb?include=association,path,permissions
You will get a response similar to this:
{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},"modifiedAt":"2020-12-16T00:01:56.615+0000","nodeType":"cm:content","content":{"mimeType":"application/pdf","mimeTypeName":"Adobe PDF Document","sizeInBytes":8037,"encoding":"UTF-8"},"parentId":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:taggable","cm:author"],"createdAt":"2020-12-13T16:48:27.600+0000","isFolder":false,"modifiedByUser":{"id":"admin","displayName":"Administrator"},"name":"fileName","id":"dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb","properties":{"cm:title":"titletest","cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:description":"descriptiontest"}}}
And with include options the response will look similar to this -
{"entry":{"isFile":true,"createdByUser":{"id":"admin","displayName":"Administrator"},"modifiedAt":"2020-12-16T00:01:56.615+0000","association":{"isPrimary":true,"assocType":"cm:contains"},"nodeType":"cm:content","content":{"mimeType":"application/pdf","mimeTypeName":"Adobe PDF Document","sizeInBytes":8037,"encoding":"UTF-8"},"parentId":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","aspectNames":["cm:versionable","cm:titled","cm:auditable","cm:taggable","cm:author"],"createdAt":"2020-12-13T16:48:27.600+0000","path":{"name":"/Company Home/Sites/site1/documentLibrary/Employee/Test","isComplete":true,"elements":[{"id":"3ac0f350-a3e0-4da4-8dfa-c8e74553b024","name":"Company Home","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable","app:uifacets"]},{"id":"15d878c2-e880-4a3f-ac00-60596ba2dcd1","name":"Sites","nodeType":"st:sites","aspectNames":["cm:titled","cm:auditable","app:uifacets"]},{"id":"46c2a6b1-2839-4b25-ac5d-c7dd874aea1e","name":"site1","nodeType":"st:site","aspectNames":["cm:tagscope","cm:titled","cm:auditable"]},{"id":"e8bc3bfe-7b41-416e-aa6a-9ee1b4fc9779","name":"documentLibrary","nodeType":"cm:folder","aspectNames":["cm:tagscope","st:siteContainer","cm:ownable","cm:titled","cm:auditable"]},{"id":"d5027ba7-874c-4996-bcde-923c68ec4c5b","name":"Employee","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable"]},{"id":"c250f9c5-d3f9-4c9e-83c6-2d239f8c2237","name":"Test","nodeType":"cm:folder","aspectNames":["cm:titled","cm:auditable"]}]},"isFolder":false,"permissions":{"inherited":[{"authorityId":"GROUP_EVERYONE","name":"SiteConsumer","accessStatus":"ALLOWED"},{"authorityId":"GROUP_EVERYONE","name":"ReadPermissions","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteConsumer","name":"SiteConsumer","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteManager","name":"SiteManager","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteCollaborator","name":"SiteCollaborator","accessStatus":"ALLOWED"},{"authorityId":"GROUP_site_site1_SiteContributor","name":"SiteContributor","accessStatus":"ALLOWED"}],"settable":["Contributor","Collaborator","Coordinator","Editor","Consumer"],"isInheritanceEnabled":true},"modifiedByUser":{"id":"admin","displayName":"Administrator"},"name":"fileName","id":"dc2d0a1b-a78d-47a9-aaab-31df0f09e8fb","properties":{"cm:title":"titletest","cm:versionType":"MAJOR","cm:versionLabel":"1.0","cm:description":"descriptiontest"}}}
Disclaimer: I am using Alfresco 6.2 Community Edition. But as per documentation (public rest-api link) it says:
Note: this endpoint is available in Alfresco 5.2 and newer versions.
Related
I deployed wso2am-4.0 on my vm, I tried to create api by curl. I'm so confused I don't know how to add params in paylod. I guess that params could be added to payload in operations section. but there are no attribute about params. How to add body or query params in payload?
{
"name": "PizzaShackAPI",
"description": "This is a simple API for Pizza Shack online pizza delivery store.",
"context": "pizza",
"version": "1.0.0",
"provider": "admin",
"lifeCycleStatus": "CREATED",
"responseCachingEnabled": false,
"hasThumbnail": false,
"isDefaultVersion": false,
"enableSchemaValidation": false,
"type": "HTTP",
"transport": [
"http",
"https"
],
"tags": [
"substract",
"add"
],
"policies": [
"Unlimited"
],
"apiThrottlingPolicy": "Unlimited",
"securityScheme": ["oauth2"],
"maxTps": {
"production": 1000,
"sandbox": 1000
},
"visibility": "PUBLIC",
"visibleRoles": [],
"visibleTenants": [],
"subscriptionAvailability": "CURRENT_TENANT",
"additionalProperties": [
{
"name" : "AdditionalProperty",
"value" : "PropertyValue",
"display" : true
}
],
"accessControl": "NONE",
"businessInformation": {
"businessOwner": "John Doe",
"businessOwnerEmail": "johndoe#wso2.com",
"technicalOwner": "Jane Roe",
"technicalOwnerEmail": "janeroe#wso2.com"
},
"endpointConfig": {
"endpoint_type": "http",
"sandbox_endpoints": {
"url": "https://localhost:9443/am/sample/pizzashack/v1/api/"
},
"production_endpoints": {
"url": "https://localhost:9443/am/sample/pizzashack/v1/api/"
}
},
"operations": [
{
"target": "/order/{orderId}",
"verb": "POST",
"throttlingPolicy": "Unlimited"
"uriMapping": "uriMapping-test1",
"payloadSchema": "payloadSchema-test1"
},
{
"target": "/menu",
"verb": "GET",
"throttlingPolicy": "Unlimited",
"uriMapping": "uriMapping-test2",
"payloadSchema": "payloadSchema-test1"
}
]
}
In ui, there would be added like below:
For this you need to do a Swagger PUT - https://apim.docs.wso2.com/en/4.0.0/reference/product-apis/publisher-apis/publisher-v2/publisher-v2/#tag/APIs/operation/getAPISwagger
The API payload does not support adding these Swagger specific stuff.
Here is a sample definition for the resource check - https://gist.github.com/pubudu538/8a8eec6663cc0bbf97302bf50a7f2194#file-swagger-put-L354
I'm setting up a test connect account through Stripe, but for some reason during the onboarding I get:
You cannot request any capability other than transfers for accounts that are under the recipient service agreement.
even though I set the capabilities only to transfers.requested: true.
Full details:
1. I created a connect account
Request:
POST https://api.stripe.com/v1/accounts
x-www-form-urlencoded body:
tos_acceptance[service_agreement]: recipient
capabilities[transfers][requested]: true
country: AT
type: express
Response:
{
"id": "acct_1IEKs6Q5kVIyiDKZ",
"object": "account",
"business_profile": {
"mcc": null,
"name": null,
"product_description": null,
"support_address": null,
"support_email": null,
"support_phone": null,
"support_url": null,
"url": null
},
"business_type": null,
"capabilities": {
"transfers": "inactive"
},
"charges_enabled": false,
"country": "AT",
"created": 1611780255,
"default_currency": "eur",
"details_submitted": false,
"email": null,
"external_accounts": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/accounts/acct_1IEKs6Q5kVIyiDKZ/external_accounts"
},
"login_links": {
"object": "list",
"total_count": 0,
"has_more": false,
"url": "/v1/accounts/acct_1IEKs6Q5kVIyiDKZ/login_links",
"data": []
},
"metadata": {},
"payouts_enabled": false,
"requirements": {
"current_deadline": null,
"currently_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"disabled_reason": "requirements.past_due",
"errors": [],
"eventually_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"past_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"pending_verification": []
},
"settings": {
"bacs_debit_payments": {},
"branding": {
"icon": null,
"logo": null,
"primary_color": null,
"secondary_color": null
},
"card_payments": {
"decline_on": {
"avs_failure": false,
"cvc_failure": false
},
"statement_descriptor_prefix": null
},
"dashboard": {
"display_name": "Some business LLC",
"timezone": "Etc/UTC"
},
"payments": {
"statement_descriptor": null,
"statement_descriptor_kana": null,
"statement_descriptor_kanji": null
},
"payouts": {
"debit_negative_balances": false,
"schedule": {
"delay_days": 7,
"interval": "daily"
},
"statement_descriptor": null
},
"sepa_debit_payments": {}
},
"tos_acceptance": {
"date": null,
"ip": null,
"service_agreement": "recipient",
"user_agent": null
},
"type": "express"
}
2. Got the onboarding link:
Request:
POST https://api.stripe.com/v1/accounts
x-www-form-urlencoded body:
account: acct_1IEKs6Q5kVIyiDKZ
refresh_url: https://example.com/reauth
return_url: https://example.com/return
type: account_onboarding
Response:
{
"object": "account_link",
"created": 1611780861,
"expires_at": 1611781161,
"url": "https://connect.stripe.com/express/onboarding/<some string>"
}
3. Went to the onboarding link
I got an error after pressing Next on the Tell us about your business section.
You cannot request any capability other than transfers for accounts that are under the recipient service agreement. For more information on recipient service agreements, see https://stripe.com/docs/connect/service-agreement-types#recipient.
Why does stripe think I'm requesting capabilities other than transfers?
Stripe got back to me:
The error is a bit cryptic but it is likely due to the way you configured Connect Onboarding in your settings in the Dashboard. This error happens because we try to request the card_payments capability for this account but it's not supported because you use the recipient agreement type. The reason we ask for that capability comes from the fact that you configured Connect to require that capability for European accounts. You can change this default behaviour in your dashboard settings in Test mode here: https://dashboard.stripe.com/test/settings/applications/express (and you would do the same for Live mode). With your flow you want only Transfers as a capability.
The suggestion worked:
Incorrect Settings:
Correct Settings:
It's strange because I used to be able to create accounts from these requests. So the settings must have changed at some point. But to my knowledge I never went and changed them.
How do I deploy swagger from ARM Template to Azure API Management using the option "contentFormat": "swagger-json"
https://learn.microsoft.com/en-us/azure/templates/microsoft.apimanagement/2018-06-01-preview/service/apis
"contentFormat": "swagger-json",
"contentValue": "D:\\tempvsts\\APISwagger\\APISwagger\\swagger.json",
When I run this I get the following error
"message": "Parsing error(s): Unexpected character encountered while
parsing value: D. Path '', line 0, position 0."
Please note I have used the below option and it works
"contentFormat": "swagger-link-json",
Full ARM template
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"ApimServiceName": {
"type": "string"
}
},
"variables": {
},
"resources": [
{
"type": "Microsoft.ApiManagement/service/apis",
"name": "[concat(parameters('ApimServiceName'), '/animalAPI4')]",
"apiVersion": "2018-06-01-preview",
"scale": null,
"properties": {
"displayName": "HTTP animal API",
"apiRevision": "1",
"description": "API Management facade for a very handy and free online HTTP toolsds",
"serviceUrl": "https://animailhttpbin.org",
"path": "animals4",
"contentFormat": "swagger-json",
"contentValue": "D:\\tempvsts\\APISwagger\\APISwagger\\swagger.json",
"apiVersionSet": {
"id": "[concat(resourceId('Microsoft.ApiManagement/service', parameters('ApimServiceName')), '/api-version-sets/versionset-animal-api4')]"
},
"protocols": [
"https"
],
"authenticationSettings": null,
"subscriptionKeyParameterNames": null,
"apiVersion": "v1"
},
"dependsOn": [
]
}
]
}
Like 4c74356b41 mentioned, the JSON content value as an escaped string has to be used.
Your swagger JSON would be something like this
{ "swagger":"2.0", ... }
So, it would go into your ARM template like this
{
...
"contentFormat": "swagger-json",
"contentValue": "{ \"swagger\":\"2.0\", ... }",
...
}
I am working on a cognitive skillset in Azure Search, and I need to add Text Translator functionality to the project. Currently all of the text is translated correctly, unless the character count is above the maximum value. In which case, the api returns null.
I am currently using document/content as my input for the text translator, but I've also tried using the output of the predefined Split Skill. When I pass the files through the Split Skill (by page) before the translator skill, the indexer breaks and all of the files fail to index (even the ones that don't need to be translated)
This code taken from my skillset.json that translates all of the files below the character limit cutoff.
{
"#odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
"description": "Our new translator custom skill",
"uri": "[my-uri]",
"batchSize":1,
"context": "/document",
"inputs": [
{
"name": "text",
"source": "/document/content"
},
{
"name": "language",
"source": "/document/languageCode"
}
],
"outputs": [
{
"name": "text",
"targetName": "translatedText"
}
]
}
This is my attempt to split the text by page before passing the text through the translator api. This results in a 501 error.
{
"#odata.type": "#Microsoft.Skills.Text.SplitSkill",
"textSplitMode" : "pages",
"maximumPageLength": 4000,
"inputs": [
{
"name": "text",
"source": "/document/content"
},
{
"name": "languageCode",
"source": "/document/languageCode"
}
],
"outputs": [
{
"name": "textItems",
"targetName": "pages"
}
]
},
{
"#odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
"description": "Our new translator custom skill",
"uri": "[my-uri]",
"batchSize":1,
"context": "/document/pages/*",
"inputs": [
{
"name": "text",
"source": "/document/pages/*"
},
{
"name": "language",
"source": "/document/languageCode"
}
],
"outputs": [
{
"name": "text",
"targetName": "translatedText"
}
]
}
I use the exact same implementation for the Named Entity Recognition Skill (using document/pages/* as input), and it works fine. I'm not sure what the difference would be with the Text Translator skill.
We are seeing different behaviour when we create a workspace in the WebInterface versus when we create the same conversation via the API.
The JSON export for the dialognode is the same:
{ "type": "standard",
"title": "SmallTalk: weerbericht",
"output": {
"text": {
"values": [],
"selection_policy": "sequential" } },
"parent": "smalltalk_container",
"context": { "user_weer": "#weerbericht",
"user_location": "#plaatsnamen" },
"metadata": {
"_customization": {
"mcr": false } },
"next_step": { "behavior": "jump_to", "selector": "condition", "dialog_node": "node_33_1519129633532"
},
"conditions": "#ST_weersbericht",
"description": null,
"dialog_node": "node_9_1517408489377",
"previous_sibling": "node_3_1518680265483" },
But the behaviour is different, which can be explained when we look at the UI
there is a difference
This is the UI for the dialogNode created via the browser
This is the UI for the same dialogNode created via the API
One difference we found is the Multiple Reponse switch:
It should be OFF (image on the right) and as per the JSON (mcr:false).
But even when we switch it on manually, the context variables don't show.
What should I be looking for in the API to fix this ?
The dialog model for multiple condition responses is that the parent node needs to be either standard dialog node or frame. Now when adding a multiple condition response to this node (and hence making an MCR node out of that parent node) you need to add a dialog node with "type":"response_condition" under this node.
This is a way how to create multiple condition responses through the api.
To give you and example to create MCR node:
The JSON of dialog nodes that need to pushed through the API will look like:
{
"type": "standard",
"title": "mcr node",
"output": {
},
"parent": null,
"context": null,
"metadata": {
"_customization": {
"mcr": true
}
},
"next_step": null,
"conditions": "#book_flight",
"digress_in": "does_not_return",
"description": null,
"dialog_node": "node_8_1525086089064",
"digress_out": "allow_all",
"previous_sibling": null
},
{
"type": "response_condition",
"title": null,
"output": {
"text": {
"values": ["I see city entity!"]
}
},
"parent": "node_8_1525086089064",
"context": null,
"metadata": {
},
"next_step": null,
"conditions": "#city",
"description": null,
"dialog_node": "node_9_1525086100114",
"previous_sibling": null
},
{
"type": "response_condition",
"title": null,
"output": {
"text": {
"values": ["I don't see anything."]
}
},
"parent": "node_8_1525086089064",
"context": null,
"metadata": {
},
"next_step": null,
"conditions": "anything_else",
"description": null,
"dialog_node": "node_10_1525086122332",
"previous_sibling": "node_9_1525086100114"
}