cancel
Showing results for 
Search instead for 
Did you mean: 

Custom view/button in user home

fhomasp
Champ in-the-making
Champ in-the-making
I'd like to modifty the page so a button shows up.  The button should only show when a user is browsing his user_home space, however that last requirement is not a priority.

I'm using the Tomcat community edition and I run it with the built in tomcat container, which does not contain source code.  I do have the source code of course.
Or another possibility is providing the action from this button in one of the drop down menu items, perhaps that's the better choice.

So as Q, what's the best way to go about this?  The action is opening a custom JSF page with java bean which I now open through a JavaScript file in the user space.
8 REPLIES 8

fhomasp
Champ in-the-making
Champ in-the-making
Some additional info. 

At this point I am running an external class with JSF form and external backing bean.  When placed in the Tomcat context path it merges their facescontext.  Perhaps I should embed the external classes and JSF page in the war file, although I'm unsure.
The JSF page gets brought up by a javascript link but problem is, no matter what security constraints that are set, the added page can be typed in the browser and it can access content in the alfresco repository.  Which is of course normal, as it is ran from an external context.  It uses webservice API for accessing and storing using admin credentials so obviously the page works as its supposed to.
I could use some advice on how to do this properly Smiley Happy
Modifying the web client UI is also something I'm rather unfamiliar with.  Perhaps it is a better choice to modify the spaces page (free marker?) to provide a link to the external pages.

Anyone who knows anything about any question, feel free to answer ^^ Smiley Happy

gavinc
Champ in-the-making
Champ in-the-making
You should definitely put your custom classes in the WAR file and deploy it all together.

There is a wiki page that provides details on setting up a development environment that will allow you to build your own WAR file: http://wiki.alfresco.com/wiki/Alfresco_SVN_Development_Environment

The other option is to try the SDK: http://wiki.alfresco.com/wiki/Alfresco_SDK

fhomasp
Champ in-the-making
Champ in-the-making
The button problem is solved and it was a lot easier than I thought.  I just built a freemarker presentation template and applied it to the user space.  The freemarker template contains a simple a href link Smiley Happy

Thanks for that link btw.

So I should place the class files in the appropriate classes folder, the libs in the lib folder and the JSF pages in a new folder?  Or should I build the classes as a .jar file and include it in the lib folder?

gavinc
Champ in-the-making
Champ in-the-making
Typically you'd package all your classes into a JAR file and place it in the WEB-INF/lib folder and then yes, create a new folder for your JSPs.

Apologies I should have also mentioned the following wiki page that provides details on creating AMP (Alfresco Module Package) files which keep your customisation self contained: http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module

We also provide a Module Management Tool to help you install/unistall AMPs: http://wiki.alfresco.com/wiki/Module_Management_Tool

Hope that helps.

fhomasp
Champ in-the-making
Champ in-the-making
You are most helpful, ty very much Smiley Happy

fhomasp
Champ in-the-making
Champ in-the-making
Hey,

Yet another question.

I bind my custom bean and JSF context on "<managed-bean-scope>session</managed-bean-scope>".  Does that mean that the whole page will be bound on the session of the logged in user? 
And if so, can I somehow get info on the current user who this session belongs to through the Alfresco Web Service SDK?  I could use authenticationUtils but then I have to ask the user to log in again.
And I can't use "admin/admin" for that matter or the admin counterpart, as I really need to limit accessibility for regular users.

Thanks in advance

fhomasp
Champ in-the-making
Champ in-the-making
I might be needing a little help with the AMP file generation and use.  At this point I cannot seem to find alfresco-mmt-2.1.jar and if I could find it, would it be compatible with an alfresco 2.9B war file?

Also..
* What's needed in the ant build file?  I'm not an ant guru at all.
* How do I set up a link to the custom page and how do I access it either by typing the address in the browser or through a link or both?

And again also
* Can I switch easily from the alfresco out-of-the-box client to the SDK version without losing settings and data?  I'm currently running the source-less client version.
* Does the MMT install work for an out-of-the-box client version .war file?  You know, the ones without source code?

How do I check the user for access regulation?  I upload/retrieve info through the Web Service API, which currently works by first logging in as admin/admin.

Sorry if I ask too much or easily obtainable info.  This whole deal is rather overwhelming and it's easy to lose track of what I need in between all the info, settings, versions and whatnot…

If you require additional info, by all means ask and I will provide.

fhomasp
Champ in-the-making
Champ in-the-making
I decided to abandon MMT for customizing my Alfresco based project.  I just opened alfresco.war, put my project in as a jar, placed my jsp in the /browse folder under jsp and it's up and running.
I was surprised that the library alfresco.webservice was not standardly embedded, which is why my custom JSF pages weren't working.

I do however find another odd problem.
I placed a very simple button as a custom view using html in a presentation template.  The button directs the user to my custom page but upon returning to the user space with the button none of the links work.  Not in the navigator, not the search, nothing.  Only exception is my button, which keeps on working.

Code for the button is as simple as it gets.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
</head>
<body>
<form>
<input type="button" value="Adjust CV" onClick="window.location.href='personal.jsp'">
</form>
</body>
</html>