Embed Alfresco WebPreviewer in my own website - spring-mvc

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.

Related

Microsoft Dynamics Integration with Magnolia

We need Magnolia 5.5 integration with Microsoft Dynamics(CRM) but as per the following magnolia documentation the integration is not available out of the box with Magnolia. Magnolia Documentation
How can we build that functionality in Magnolia, please advice.
Thanks in advance..
All depends on what kind of API Dynamics exposes for such integration. And what features of Dynamics exactly do you want to integrate.
If there is any REST based API, you can have a look at similar integrations (those for SugarCRM, Eloqua or SalesForce come to my mind) and do what needs to be done. Source code for the above integrations provided by Magnolia is AFAIK available to all Enterprise customers.
Typically you have two parts of the integrations
- backend one where you create content connector for an app and the app directly to allow your editors to interact and select items from Dynamics, and
- some templating functions that allow templates to understand items previously selected by the editors and retrieve those from Dynamics when rendering the template.
- typically you will also have to deal somehow with authentication between Magnolia and Dynamics and (unless all is super fast) with caching items retrieved from Dynamics in Magnolia in some form of volatile cache.
But really, any more details on what to do and how depends on the use case. It would be different for building customer self service portal and for e.g. just listing phone number of the sales/support rep closest to visitor of the site based on geolocation.

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/

PLONE to call and perform REST API calls on another application

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

How to get and set custom metadata values in Alfresco via REST API?

Please help me to get/set metadata by REST API Calls.I am Using Alfresco 5.0 version.
Unfortunately the Alfresco REST API is limited to a small subset wich doesn't support (custom) metadata. Alfresco expects you use CMIS instead. Since CMIS may be too complicated / an overkill to integrate in your use case you could still create your own WebScripts to enable RESTful methods as you expect. This is straight forward. Take a look into the Web_Scripts_Examples and the official Web Scripts Documentation
You can find details of all existing rest api on below link
http://host:port/alfresco/service/index/all
If the api does not exist on above than you need to create your custom one.I am not sure about metadata.But you can find it on above link.

Facebook Connect for Qt

I am trying to use the facebook API provided by Nokia Developer:
http://www.developer.nokia.com/Community/Wiki/Facebook_Connect
I need to know what library or files should i include to connect to this API. And if you can provide me with any important guidelines it would be great.
Thanks,
Did you actually read the page you linked to? The first line has a link to the download location and the entire page is full of examples of how to use the API.
However, if you did follow the download link you'd see this:
Facebook is deprecating the old REST api upon which this library is
based on. The new api is called facebook graph api and that should be
used, the rest api breaks all the time so its not a good idea to use
it. Please look at http://gitorious.org/qfacebook for a Qt
implementation of the new facebook graph API
Which makes your question somewhat irrelevant.
With Qt 5, you can now use the V-Play Facebook Qt Plugin.
It wraps the native Facebook SDK around a QML item and thus has the advantage that native login functionality and the whole Facebook Graph API is available cross-platform.
There is a free sample, documentation and tutorials available here: http://plugins.v-play.net/plugins/facebook/

Resources