How to get current site details in alfresco repository? - share

I am trying to get current site name in alfresco repository side webscript. I tried a couple of ways.
page.url.templateArgs.site - //it wont work as its share side stuff.
Do anyone has any idea on this?
Regards.

Your question said you are in a repository tier web script. The repository has a service called SiteService. The SiteService allows you, among other things, to fetch a site by its ID. The getSite() method returns a Site object. Learn more about the SiteService and the Site object in the documentation.

Alfresco Repository Webscripts Root Objects won't give you that. You will get this from the Surf based Alfresco Share Root Objects

Related

Simplest CMS ever?

I’m building a super simple website with 5 pages and I want a CMS that allows me to change the text and the pictures in a couple of them.
In the past I used wordpress, but it has way too many features that i don’t need in this case.
I’ve been trying to learn gatsby.js so I would like to build it on that, but trying to see how to source from Netlify-CMS I started facing an overwhelming amount of information which I'm not sure I need.
Any tips?
Thanks!
M
Netlify has a built in CMS, and it's compatible with Gatsby! You can find examples online. It should be good for smaller sites, but for larger projects, I really like Prismic.io. Contentful is another popular one, but it's a bit pricier than prismic.
Edit: reread your comment about sourcing from Netlify. Netlify is not a "source" plug in in Gatsby. You use a local file +markdown source, and do the configuration for netlify, which adds an admin interface at an endpoint. You configure your data models in the interface, create login, etc. Then, when you submit changes, it modifies files in your connected git repo, so the local file + remark will make the data available in the graphql queries.
In the end I used Forestry.io, a good simple solution that did exactly what I needed in combination with Jekyll.

Start Alfresco Workflow on outside Alfresco Content

I am newbie in Alfresco. I was just going through the Alfresco documents here. I have gone through it, but didn't get the answer of my question as described below.
Is it possible to start workflow(/task) on the content outside of the Alfresco Content (i.e. Our Local System File/Folder)? If yes, how can I achieve the same?
I agree with Younes that you can configure a rule to launch a workflow. In order to do that, you'll want to take a look at the JavaScript workflow API.
Using a rule on a folder will require something to trigger the rule, such as a document being added to the folder. But your question asks if a workflow can be triggered external to Alfresco. To do that, you might consider using a Web Script.
A Web Script is simply a way to extend Alfresco's RESTful API with your own logic. So you could create a web script called "startMyWorkflow" that includes a JavaScript controller leveraging the same API I referenced earlier to kick off the workflow. With that in place, you'd be able to launch the workflow externally using anything that can speak REST over HTTP.
You can setup a rule action to start a workflow if certain conditions are met (files added to some folder, file metadata changed, a new revision has been uploaded ...).
To learn how to create new rules in alfresco follow this tutorial
Update : I may have forgotten to mention that -as the op suggested- he could then setup a cifs/ftp/webdav folder locally to point to some location in the repo having that rule action I was talking about.... So for example adding files to that folder would automatically start a workflow....

Alfresco - create online survey with forms

I am searching for a way (or a case study) where Alfresco is used to perform a survey by providing a form. The Alfresco Share visitors/users fill-in the fields of this form and by submission the results are transfered to a data list, filling in the respective fields. (something similar to google forms).
Does anyone know of such a case? How can something like this be materialized? Can Alfresco forms be used this way, or do I have it totally wrong?
This really isn't a good use for Alfresco.
Alfresco is an Enterprise Content Management system that stores your content as documents, files, etc along with associated metadata and there is nothing I can see in the use case you have provided that has to do with storing documents and/or metadata.
No matter what way I look at this it is going to be difficult to create a configurable survey. Your best bet is to look to having another survey tool such as Encuestame that you can deploy to your same Tomcat container and database and then share links to your surveys in Alfresco and publish results/reports to documents in Alfresco.
You have custom dashlet for creating pools on Share Extras.
I didn't tried it yet, but I don't think you'll have problems with deploying/using it.
It not a good way of using alfresco Instead of that you will find below way usefull.
There is one web application called orbeon forms.Which is helpfull in creating web form. Orbeon provides community version by which you can test.below is the link of site for orbeon form.
http://www.orbeon.com/
Create webform in orbeon.There are 2 interface in orbeon one is form builder using which you can create web form another is form runner using which you can enter data.
Orbeon provides support for submitting data which you can change to alfresco.Here you need to put rest url of alfresco webscript
Create rest api in alfresco for saving orbeon forms.
Hope this helps!!!!!
The question was also asked in the French section of Alfresco forum in 2013. While there are "Alfresco Forms", these have a completely different meaning, nothing in common with Google Forms. As an Alfresco add-on, "Form Factor" is an answer if you have entreprise and 5.5KUSD/CPU to pay each year.

Embed Complete GitHub Repository in a Web Page

I have created a repository on Github. This repository contains a complete project with the folder structure and files. If I have to embed this code on my website, I can do that by creating Gists and adding them to my web page.
The problem is that I have a big project and adding snippets as Gists is not an easy task; also, it will not be user friendly either, as the visitors won't get the idea of the complete project.
So, I just want to embed the whole repository on my web page in such a way that the visitor can browse the code. Do you have any idea about that? Any API, Plug In, code sample etc.
A JQuery plugin was recently created that adds this functionality. Take a look a repo.js.

FacebookWeb or FacebookWebMVC

can someone briefly explain what the difference is between these packages? The project pages don't seem to offer any clues?
I am creating an MVC application where i would like to associate facebook credentials with a user's profile. In terms of functionality, i need to simply post to the user's wall. So not sure which package would be best to do this with..
If this package follows conventions that are used for most NuGet packages, FacebookWebMVC will be the one for working with ASP.NET MVC.