mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- Incorporated new sidebar which contains the shelf and navigator (tree) components
- Changed version number to 2.0.0 (dev) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4538 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -38,6 +38,7 @@ import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.web.app.servlet.AuthenticationHelper;
|
||||
import org.alfresco.web.app.servlet.FacesHelper;
|
||||
import org.alfresco.web.bean.ErrorBean;
|
||||
import org.alfresco.web.bean.SidebarBean;
|
||||
import org.alfresco.web.bean.dashboard.DashboardManager;
|
||||
import org.alfresco.web.bean.dialog.DialogManager;
|
||||
import org.alfresco.web.bean.repository.User;
|
||||
@@ -203,6 +204,16 @@ public class Application
|
||||
return (DashboardManager)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "DashboardManager");
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the SidebarBean
|
||||
*
|
||||
* @return SidebarBean bean
|
||||
*/
|
||||
public static SidebarBean getSidebarBean()
|
||||
{
|
||||
return (SidebarBean)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "SidebarBean");
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the configured error page for the application
|
||||
*
|
||||
@@ -481,6 +492,7 @@ public class Application
|
||||
* @param context FacesContext for current user
|
||||
* @param code The ISO locale code to set
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void setLanguage(FacesContext context, String code)
|
||||
{
|
||||
Locale locale = parseLocale(code);
|
||||
@@ -633,6 +645,7 @@ public class Application
|
||||
*
|
||||
* @return ResourceBundle for this user
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static ResourceBundle getBundle(FacesContext context)
|
||||
{
|
||||
// get the resource bundle for the current locale
|
||||
|
@@ -21,7 +21,10 @@ package org.alfresco.web.app.context;
|
||||
* <p>
|
||||
* Beans supporting this interface should be register against the UIContextService. Then Beans
|
||||
* which wish to indicate that the UI should refresh itself i.e. dump all cached data and settings,
|
||||
* call the UIContextService.notifyBeans() to inform all registered instances of the change.
|
||||
* call the UIContextService.notifyBeans() to inform all registered instances of the change.
|
||||
* <p>
|
||||
* Registered beans will also be informed of changes in location, for example when the current
|
||||
* space changes or when the user has changed area i.e. from company home to my home.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
@@ -32,4 +35,16 @@ public interface IContextListener
|
||||
* all UI Beans should refresh dump all cached data and settings.
|
||||
*/
|
||||
public void contextUpdated();
|
||||
|
||||
/**
|
||||
* Method called by UIContextService.spaceChanged() to inform all registered beans that
|
||||
* the current space has changed.
|
||||
*/
|
||||
public void spaceChanged();
|
||||
|
||||
/**
|
||||
* Method called by UIContextService.areaChanged() to inform all registered beans that
|
||||
* the user has changed area i.e. from company home to my home.
|
||||
*/
|
||||
public void areaChanged();
|
||||
}
|
||||
|
@@ -24,7 +24,10 @@ import javax.faces.context.FacesContext;
|
||||
/**
|
||||
* Beans supporting the IContextListener interface are registered against this class. Then Beans
|
||||
* which wish to indicate that the UI should refresh itself i.e. dump all cached data and settings,
|
||||
* call the UIContextService.notifyBeans() to inform all registered instances of the change.
|
||||
* call the UIContextService.notifyBeans() to inform all registered instances of the change.
|
||||
* <p>
|
||||
* Registered beans will also be informed of changes in location, for example when the current
|
||||
* space changes or when the user has changed area i.e. from company home to my home.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
@@ -42,6 +45,7 @@ public final class UIContextService
|
||||
*
|
||||
* @return UIContextService for this Thread
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static UIContextService getInstance(FacesContext fc)
|
||||
{
|
||||
Map session = fc.getExternalContext().getSessionMap();
|
||||
@@ -97,6 +101,29 @@ public final class UIContextService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call to notify all register beans that the current space has changed and they should
|
||||
* refresh themselves as appropriate.
|
||||
*/
|
||||
public void spaceChanged()
|
||||
{
|
||||
for (IContextListener listener: this.registeredBeans.values())
|
||||
{
|
||||
listener.spaceChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call to notify all register beans that the area i.e. my home, has changed and they should
|
||||
* refresh themselves as appropriate.
|
||||
*/
|
||||
public void areaChanged()
|
||||
{
|
||||
for (IContextListener listener: this.registeredBeans.values())
|
||||
{
|
||||
listener.areaChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/** key for the UI context service in the session */
|
||||
private final static String CONTEXT_KEY = "__uiContextService";
|
||||
|
@@ -52,9 +52,9 @@ import org.alfresco.web.bean.repository.Repository;
|
||||
public class InvokeCommand extends BaseAjaxCommand
|
||||
{
|
||||
public void execute(final FacesContext facesContext,
|
||||
final String expression,
|
||||
final HttpServletRequest request,
|
||||
final HttpServletResponse response)
|
||||
final String expression,
|
||||
final HttpServletRequest request,
|
||||
final HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
// setup the JSF response writer.
|
||||
@@ -64,6 +64,8 @@ public class InvokeCommand extends BaseAjaxCommand
|
||||
// therefore, for now we will always return a content type of text/xml.
|
||||
// In the future we may use annotations on the method to be called to specify what content
|
||||
// type should be used for the response.
|
||||
// NOTE: JSF only seems to support XML and HTML content types by default so this will
|
||||
// also need to be addressed if other content types need to be returned i.e. JSON.
|
||||
|
||||
OutputStream os = response.getOutputStream();
|
||||
UIViewRoot viewRoot = facesContext.getViewRoot();
|
||||
@@ -76,7 +78,7 @@ public class InvokeCommand extends BaseAjaxCommand
|
||||
facesContext.setResponseWriter(writer);
|
||||
// must be text/xml otherwise IE doesn't parse the response properly into responseXML
|
||||
response.setContentType(MimetypeMap.MIMETYPE_XML);
|
||||
|
||||
|
||||
// create the JSF binding expression
|
||||
String bindingExpr = makeBindingExpression(expression);
|
||||
|
||||
@@ -107,16 +109,19 @@ public class InvokeCommand extends BaseAjaxCommand
|
||||
{
|
||||
// rollback the transaction
|
||||
try { if (tx != null) { tx.rollback(); } } catch (Exception ex) { }
|
||||
if (err instanceof EvaluationException)
|
||||
{
|
||||
|
||||
if (err instanceof EvaluationException)
|
||||
{
|
||||
final Throwable cause = ((EvaluationException)err).getCause();
|
||||
if (cause != null)
|
||||
err = cause;
|
||||
}
|
||||
logger.error(err);
|
||||
if (cause != null)
|
||||
{
|
||||
err = cause;
|
||||
}
|
||||
}
|
||||
|
||||
logger.error(err);
|
||||
throw new AlfrescoRuntimeException("Failed to execute method " + expression +
|
||||
": " + err.getMessage(),
|
||||
err);
|
||||
": " + err.getMessage(), err);
|
||||
}
|
||||
|
||||
// force the output back to the client
|
||||
|
Reference in New Issue
Block a user