PLONE to call and perform REST API calls on another application - plone

we are developing a plone interface to consume REST API services from a web application.
Users login to plone and be able to access the REST API & perform some actions on the "Another Web Application" via REST API calls. Please find the graphical representation attached here.
Query 1)What and all the Plone programming documentation I needed to refer to design & develop such a solution in Plone? that is,access and perform actions on REST APIs, from a PLONE based Solution.
Query: 2) What all are the different technologies I need to refer to learn & program in PLONE and python to achieve this work using PLONE framework?
Please share your valuable inputs and suggestion to move in the right direction.
Please refer the attached block diagram of the proposed solution.
.

In a first step you could register a "view" for authenticated users in Plone. In the view's Python module you could call the restful api of the other web application.
Helpful resources are:
Creating a basic package (Plone Addon) with mr.bob and bobtemplates.plone: https://github.com/plone/bobtemplates.plone
Creating and registering a view: http://docs.plone.org/develop/plone/views/browserviews.html#creating-and-registering-a-view
Call a resful api with python: Making a request to a RESTful API using python
If you have to collect data from your plone site to transmit to the restful api f.e. user data, then plone.api is the standarized way. http://docs.plone.org/develop/plone.api/docs/

Recently a very nice module developed, exactly for the purpose you mentioned here, in Plone. It's called "plone.restapi".
github link: https://github.com/plone/plone.restapi

Related

Create Connetor CMIS BonitaSoft

I'm working with BonitaSoft Community version 7.6.3 and I want to create a CMIS connector to list the folders and documents for version 5.2 of Alfresco. I noticed that for this version of Bonita many connectors that existed in version 5.9.1 disappeared. When I asked the question how could I list Alfresco's folders and documents indicated that I would have to create a connector, however when reading the documentation for UI Designer forms it is not possible and that the solution would be REST API extension. When I analyze information about how to create REST API extensions it only gives Performance, Efficiency and Teamwork. How can I get around this?
The REST API extension documentation page has been updated and now cover the community edition as well.
Note that connector are used when you need to interact between Bonita process execution and an external system. Execution of connectors happen on the Bonita server. When executed, a connector has access to a context that includes information about the current process definition, instance and task instance.
REST API extension are usually call from the user web browser. More precisely it is the forms or pages served by Bonita that will execute the REST API call. REST API is executed on the Bonita server but has no context information about the currently running process or task. If you need such information you need to provide them as part of the REST API extension.

cmis or web scripts use?

I want to build a JavaEE GED application using alfresco and activiti Workflow engine which manages and monitors the mail of an organization (Letter, Fax, mail etc.). Since I am new with alfresco I want to know the best way to communicate with alfresco in my case : the use of CMIS or web scripts (I'm building a third-party application ) .
I can suggest two solutions using Using the REST API or CMIS with a library like Apache Chemistry
Apache Chemistry is very well documented and you can find good pointers on the official website for pretty much any thing you would want to do !
If you want to get a session from your Alfresco Repository for example follow this post : How to retrieve 'repository root' id/children from CMIS repository?
Alternatively, you can find a lot of resources around for interacting with alfresco using REST (either the new REST API, or old restful endpoints). Check the platform integrations portal from the official docs, it would be a very good starting point.

ASP.NET Core Web Api automatic help pages

In previous versions of ASP.NET, when I created Web Api 2, visual studio automatically wired up automatic generation of documentation for the API.
It's also explained here:
http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/creating-api-help-pages
I'm writing a new project and I've decided to do it with ASP.NET Core, but I don't see anything similar to what existed in the previous versions that generates the documentation from the API (I'm also guessing that's its a bit different since all controllers now inherit from the same Controller class).
But, is there some way to have help files generated for ASP.NET Core APIs?
The functionality you want is at https://github.com/domaindrivendev/Swashbuckle
The following link provides an example of how to configure and use the well-designed utility
https://damienbod.com/2015/12/13/asp-net-5-mvc-6-api-documentation-using-swagger/
John Davidson made a good post showing how to generate Swagger documentation - that is useful and great.
But if you want to stick to ASP.Net MVC 5 - Api Explorer documentation, you should have a look to that excellent blog post :
https://andrewlock.net/introduction-to-the-apiexplorer-in-asp-net-core/

Embed Alfresco WebPreviewer in my own website

I have a Spring MVC application that connect with Alfresco using CMIS libraries, actually I can upload documents and download it but I need integrate Alfresco's WebPreviewer to preview documents in my app.
I found some code here but I don't know how to do it
It's hard to say for certain because of the limited amount of information that you've provided, but I think that the problem that you're going to be faced with when trying to use any of the existing previewer code is one of authentication. If you're using only using CMIS then you won't be able to use any of the WebScript based REST APIs that the Alfresco widgets will be using.
There are two possible previewer widgets that you can use - the older YUI2 based previewer (that you'd currently find in the document details page and the Document Library film strip view, and the newer Aikau component that you'd find in the faceted search previewer (from version 5.0 onwards).
I suspect that you won't be able to re-use either of these components without either authenticating against Alfresco in a way that allows you to access the WebScript based REST APIs or extending and customizing those widgets.
You've said that you have your own Spring MVC application, but you haven't said whether or not that is using the Surf extension - if it is, and you're using the authentication capabilities provided by Surf then you will be authenticated to use those REST APIs - as the Surf authentication provides access across all APIs (including CMIS) via a single authentication.
If you are able to access those APIs then you should be able to follow the steps outlined in both the form post and the blog posts in your own question and the previous answer, however - based on your question I suspect that you can't do that.
If you've not come across it, you might be interested in the Aikau archetype that builds a ready-made Alfresco client using Surf (see this link) and that tutorial also shows how to use the Aikau previewer (see here).
Because this is providing you with a Spring MVC client that is preconfigured to authenticate against Alfresco, you might be able to port your application to use it.
Otherwise, as I said earlier - chances are you'll need to extend the existing widgets to use the CMIS APIs to render the previewers. Again, Aikau is easier to extend that the old YUI2 widgets - but is reliant on Surf.

.NET WebAPI - automatic pdf generation

I have developed an ExtJS 5 + .NET MVC WebAPI RIA for reporting purposes.
Now the client is requesting a feature to subscribe to some reports. The reports (pdf) should be generated automatically and then the server should send them per mail to the user who subscribed a report. It would also be a nice to have that the user can specify the date and time when he will receive the report.
Currently the application has already a PDF export where the user can save these reports. In this case the applications sends the html of the report section to the server and the server is working with wkhtmltopdf to generate the pdf.
For my new feature i have the following questions:
Can i implement this new feature service in my WebAPI (e.g. as a thread which ill start on startup) or should i write an independet service for it.
Would it be appropriate to just load the site on the server with the reports and execute the process which i am already running for my PDF export to get the pdf out of it?
I am thankful for every advice.
A separate process that calls the WebApi makes a lot of sense. Separation of concerns and all that. But whether you include it in the API itself or in a separate mailer portal, I suggest you don't try to write any scheduling yourself. Scott Hanselman has a great post on why you shouldn't and suggests several alternatives. Of those, my favorite solution is Hangfire. I use it in production, and it's pretty easy to set up and use.
And if you need nicely formatted emails, I suggest checking out Postal for their composition.

Resources