Form Recognizer - model for each environment? - azure-cognitive-services

On our test environment we created custom Form Recognizer model. Is there a way to reuse this model on PROD environment? Prod environment is under different subscription.
I cannot find a way to somehow "export" model and move it to other environment. Do I need to create new model from scratch?

You can use the Copy Model API to copy a model between regions and subscriptions. See here for more details -
How to Copy API - https://learn.microsoft.com/en-us/azure/cognitive-services/form-recognizer/disaster-recovery#copy-api-overview
Copy Model API reference - https://westcentralus.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2-1-preview-2/operations/CopyCustomFormModel

Related

Is it possible to modify dimensions of revit model through design automation api? if yes how?

currently im trying to modify my model from viewer with help of design automation api, it is possible to get properties of revit file but how to modify those properties and view back to the viewer
Yes of course - possible workflow would be:
Create a plugin to modify your model - see this code sample here
Bundle your plugin to upload to Forge and define an activity for execution - see tutorial here
Load the model into Viewer after translating it with Model Derivative
Collect the data/parameter from user input and/or model properties/metadata
Call a workitem with the parameters and execute the plugin, can upload the modified output as versioned items to track changes
Use webhooks to get notified of new version being added and trigger a translation of it, or you can upload the output to your own app and trigger upload and translation with your own workflow
Load the modified model back into Viewer
See here for our official tutorial on Design Automation.

Alfresco share UI form for custom model

I'm using Alfresco one 5.1 Enterprise edition. I've created a custom content model using the Model Manager in Alfresco & it has some custom properties (ds:prority, ds:action, ds:actionText, ds:linkURL, etc) associated with it. I would like to customize Share UI to include these custom properties alongside the default cm:content properties (cm:content, cm:description, cm:title, etc). I'm referring to Jeff Potts post on ecmarchitect to use custom model & share UI customization.
Now my question is, can I use the model created in Alfresco Model Manager & create a customized Share form along with these custom properties. All the examples for this process I see content model definition done in a Alfresco repo AMP and then have the Share form customization done in an Alfresco share amp. Can I create the share AMP alone (for my Share UI Customization) & still refer the model which I've already created in Alfresco Model Manager ?
You can use model console to list out created & deployed models.
http://IP:Port/alfresco/s/enterprise/admin/admin-repoconsole
Command : show models
If you're able to see your model with loaded (isLoaded) status as "Yes" then you can deploy on the share amp should be fine.
Have you created this model in your development machine or production machine?
If it is development machine, you need the Repo amp to deploy the model in the production machine.
##
## Model Admin Commands
##
ok> show models
Show deployed models - that are stored in the repository data dictionary.
ok> deploy model
Upload model to repository and load into runtime data dictionary. This will also
set the repository model as active.
If a model is already deployed then it will be updated and re-deployed.
e.g. deploy model alfresco/extension/exampleModel.xml
ok> undeploy model
Permanently delete model from repository (all versions) and unload from runtime data dictionary.
e.g. undeploy model exampleModel.xml
ok> activate model
Set repository model to active and load into runtime data dictionary.
e.g. activate model exampleModel.xml
ok> deactivate model
Set repository model to inactive and unload from runtime data dictionary.
e.g. deactivate model exampleModel.xml
As you're using Enterpise edition, you can get in touch with Alfresco support also.
Hope this helps you.
As pointed out by Murali, once the model is active, we can create a Share AMP as pointed out in Jeff Potts tutorial, create a share amp archive using maven target (mvn package) and deploy the same to alfresco amps_share folder (/alfresco_one/amps_share) and then apply the same with the apply_amps.sh command in /bin/apply_amps.sh and then restart alfresco.
Note for my requirement I needed the custom properties to be part of inline-edit screen of share only. So I added the
<config evaluator="node-type" condition="<my model>">
...
<form id="doclib-inline-edit">
...
<show id="my:property" force="true" />
...
...
</config>
Initially I had cm:content in the condition evaluator & it didn't work. Only after updating it to my model name it started reflecting the changes.
Note: without restarting Alfresco the changes are not reflecting.

How do I create integration tests when leveraging Xamarin.Forms?

How do I create integration tests when leveraging Xamarin.Forms?
Specifically, I do NOT want to rely on UI automation to test integration between the components of a system (i.e. database using SQLite).
I want my integration tests to target the layer beneath the UI.
For this I would recommend xUnit (there are others as well), that can test directly against PCL's. The native projects should be fairly empty and your ViewModels and Views should be void of most code, which means you can test directly on the Model and below.
Place a mock ISQLite DB connection to test the code without the SQLite DB, or place another one in that actually connects to a local SQLite DB, either way.
xUnit Project
https://github.com/xunit/devices.xunit
Though download the packages from NuGet, its easier. Then the test can also be run from VS which is a nice addition.

Integration Testing Umbraco

So I have written a fairly simple DataAccess Layer for use with Umbraco CMS 4.9. I want to write some Integration tests to test that my repositories work etc.
Obviously Umbraco has some dependencies, so how do people test that their data access works normally?
p.s We already have BDD / selenium tests..I want proper Nunit Integration tests...
One approach might be to fake the source data, i.e. the nodes themselves. Obviously it would be a fair bit of work to set up a data tree, but because the Node object inherits from INode, you should be able to inject your own object implementing INode and create your own data tree for all the unit tests to use.

Non-persistent entities v.s. manual POJO + View + Controller?

I've successfully created a basic Spring Web MVC application using Roo, which I might add, was a treat! The application uses persistence (HIBERNATE + HYPERSONIC_IN_MEMORY), which is what you'd want for many POJOs.
Now, suppose I'd like to write some custom method which is to be accessed from the View-side, like end-of-day calculations or what have you. My immediate thoughts about how to implement these are either
1) Create an entity, keep it from using persistence and implement the desired method(s) for this class, rely upon MVC-scaffolding for presentation
or
2) Create the POJO + View + Controller manually
What is my best alternative? Is 1) even possible (i.e. not using persistence for entities through roo)? And if so: is it so that the .java files may be freely edited, while the .aj files are handled by Roo?
Thanks in advance!
Option 1 is absolutely Ok using Roo's entity command. You can create new entity in Roo shell and then perform scaffolding without any problem. And then you can edit your *.java part without problems too. The only recommendation is to keep Roo shell running while editing.

Resources