cancel
Showing results for 
Search instead for 
Did you mean: 

Exposing templates

simon
Champ in-the-making
Champ in-the-making
Hi aigain,

These templates look very promising to build a website for our clients on top  of the Alfresco repository. Supposing that these templates and the PHP framework work well together we would like to create a different view (other HTML page) for some spaces.

Our folder structure looks like this:
    + Company Home
      - Contracts
        * Contract 1
        * Contract 2
      - Other spaces…
A template would show the documents with some metadata (version number, date added, etc.). I can now see this page in the dashboard view of every folder. So far so good…

Now, how can I hide all the other components for these users? I would like to give them a direct access link to this space (they are redirected to the login page first) but they shouldn't see the full featured Alfresco system, the webpage alone is enough. So only the dashboard view should be visible…

Thanks!
4 REPLIES 4

kevinr
Star Contributor
Star Contributor
Hi Simon,

As part of the "Guest" access work for v1.2, the various content access servlets (including the Template processing servlet) now respond to Guest access by default. This means you can create direct access URLs that render the output of a template as a full HTML page directly to the browser even for non-alfresco users. This (as usual! Smiley Very Happy ) will be available in the next release.

Thanks,

Kevin

simon
Champ in-the-making
Champ in-the-making
Thanks Kevin, seems like the next release will be a major update if you'll implement everything you have to promise on the forum here!  :wink:

One more question on this. The Guest access is nice and may be useful in our case but we would like to use this system to present the documents in a more appropriate way to our clients. These documents are confidential documents and the client has an account in the Alfresco system. So:

- externalisation of templates will work in the 1.2 release, great
- does this work for accounts that will need to login first as well?

This is how I see it:

1. give a URL to the client, this URL points to an appropriate space (in our case the contracts space)
2. the client enters this URL in his browser
3. the client isn't authenticated yet so Alfresco redirects to the login window and the client enters his username and password
4. client authenticated and redirected to the contracts space
5. the contract space doesn't look like an Alfresco page but uses our template (so this would look like a normal website)

You mention the same problem here: Problem using template my_spaces.ftl but if I try to use the external access link I get redirected to the details view of a space.

Thanks again!

kevinr
Star Contributor
Star Contributor
Hi Simon,

- externalisation of templates will work in the 1.2 release, great
- does this work for accounts that will need to login first as well?

Yes, if you don't have a login the system will attempt Guest access, if you do have a login username (now saved in an HTTP Cookie value) then it will present you with the login page (you can now clear this saved value by explicitly Logging Out).

To answer your points:
1. Yes
2. Yes
3. Yes that will happen if they had a previously saved username value in a Cookie as mentioned above, otherwise the system will attempt an automatic Guest access login
4. Yes
5. To do exactly this, the URL you give out should be a URL that uses the Content Template servlet. This servlet is specifically designed to render the output of a template (e.g. a dashboard) against a specific node and send the result directly to the output stream.

An example of a content template URL is something like this:
http://machine/alfresco/template/workspace/SpacesStore/0000-0000-0000-0000
where the last 3 arguments are the NodeRef of the node to execute the template against (the template to use is picked up from the Dashboard view setting in this case). The code for the TemplateContentServlet should give you more info.

With the guest access, it means you can generate and give out URLs that render any accessable Alfresco content against a template to any user. So you could for instance give out a URL that executed an RSS XML template against a space to say provide a list of the last updated documents (also accessable via Guest access).

The external access link you mention is specifically for jumping directly to details or browse screens for a specific node from outside the system.

Cheers,

Kevin

simon
Champ in-the-making
Champ in-the-making
Great reply, thanks! I'll have a look at the TemplateContentServlet.

I don't get number 3:
Yes that will happen if they had a previously saved username value in a Cookie as mentioned above, otherwise the system will attempt an automatic Guest access login.
Seems likely that they didn't have a cookie yet but still need to login (first time a new user tries the URL we sent to him). I probably don't exactly understand what you're saying but I can imaging Alfresco will test if the space has guest access when there is no cookie set and if there isn't it will ask the user credentials. This is not so important, will wait for version 1.2 to check these things first before asking more questions.