You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2013/11/26 02:19:50 UTC
svn commit: r1545492 - in
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces: application/
view/ view/facelets/ view/facelets/component/ view/facelets/tag/jsf/core/
Author: lu4242
Date: Tue Nov 26 01:19:50 2013
New Revision: 1545492
URL: http://svn.apache.org/r1545492
Log:
MYFACES-3822 General cleanup and remove unused web config params
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java?rev=1545492&r1=1545491&r2=1545492&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java Tue Nov 26 01:19:50 2013
@@ -102,7 +102,6 @@ public class ViewHandlerImpl extends Vie
{
try
{
- //TODO: JSF 2.0 - need to make sure calculateViewId follows the new algorithm from 7.5.2
return getViewHandlerSupport(context).calculateAndCheckViewId(context, input);
}
catch (InvalidViewIdException e)
@@ -120,7 +119,6 @@ public class ViewHandlerImpl extends Vie
{
try
{
- //TODO: JSF 2.0 - need to make sure calculateViewId follows the new algorithm from 7.5.2
return getViewHandlerSupport(context).calculateViewId(context, rawViewId);
}
catch (InvalidViewIdException e)
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java?rev=1545492&r1=1545491&r2=1545492&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java Tue Nov 26 01:19:50 2013
@@ -31,7 +31,7 @@ import org.apache.myfaces.view.facelets.
import org.apache.myfaces.view.jsp.JspViewDeclarationLanguageStrategy;
/**
- * This is the default PDL factory used as of JSF 2.0, it tries to use Facelet PDL whenever possible,
+ * This is the default VDL factory used as of JSF 2.0, it tries to use Facelet VDL whenever possible,
* but fallback on JSP if required.
*
* @author Simon Lessard (latest modification by $Author$)
@@ -68,14 +68,6 @@ public class ViewDeclarationLanguageFact
@Override
public ViewDeclarationLanguage getViewDeclarationLanguage(String viewId)
{
- //if (viewId == null)
- //{
- // throw new NullPointerException("viewId");
- //}
-
- // TODO: It would be nice to be able to preinitialize the factory. However, since it requires
- // access to the ExternalContext it may not be possible, depending on the loading order
- // in the FactoryFinder. Could use ideas here. -= SL =-
if (!_initialized)
{
initialize();
@@ -89,12 +81,6 @@ public class ViewDeclarationLanguageFact
}
}
- // throw new FacesException("Cannot find a valid PDL for view id " + viewId);
- // It does not have sense to throw an exception in this point. Instead
- // just return null, to indicate that no VDL can handle the viewId.
- // For example, in org.apache.myfaces.shared.application.DefaultViewHandlerSupport
- // first getViewDeclarationLanguage(String viewId) is called and if returns null
- // try the default strategy (look for a file in web folder).
return null;
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java?rev=1545492&r1=1545491&r2=1545492&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java Tue Nov 26 01:19:50 2013
@@ -185,8 +185,6 @@ public class DefaultFaceletsStateManagem
{
_vdlFactory = (ViewDeclarationLanguageFactory)
FactoryFinder.getFactory(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY);
- //TODO: This object should be application scoped and shared
- //between jsp and facelets
}
@SuppressWarnings("unchecked")
@@ -281,10 +279,6 @@ public class DefaultFaceletsStateManagem
}
if (state.length == 3)
{
- //if (view.getId() == null)
- //{
- // view.setId(view.createUniqueId(context, null));
- //}
//Jump to where the count is
view.getAttributes().put(UNIQUE_ID_COUNTER_KEY, state[2]);
}
@@ -302,12 +296,10 @@ public class DefaultFaceletsStateManagem
}
}
}
- // TODO: Why is necessary enable event processing?
- // ANS: On RestoreViewExecutor, setProcessingEvents is called first to false
+ // On RestoreViewExecutor, setProcessingEvents is called first to false
// and then to true when postback. Since we need listeners registered to PostAddToViewEvent
- // event to be handled, we should enable it again. We are waiting a response from EG about
- // the behavior of those listeners, because for partial state saving we need this listeners
- // be called from here and relocate components properly, but for now we have to let this code as is.
+ // event to be handled, we should enable it again. For partial state saving we need this listeners
+ // be called from here and relocate components properly.
try
{
context.setProcessingEvents (true);
@@ -315,8 +307,6 @@ public class DefaultFaceletsStateManagem
// In the latest code related to PostAddToView, it is
// triggered no matter if it is applied on postback. It seems that MYFACES-2389,
// TRINIDAD-1670 and TRINIDAD-1671 are related.
- // This code is no longer necessary, but better let it here.
- //_publishPostBuildComponentTreeOnRestoreViewEvent(context, view);
suscribeListeners(view);
}
finally
@@ -404,25 +394,6 @@ public class DefaultFaceletsStateManagem
handleDynamicAddedRemovedComponents(context, view, states);
}
}
- // Restore binding, because UIViewRoot.processRestoreState() is never called
- //the event processing has to be enabled because of the restore view event triggers
- //TODO ask the EG the this is a spec violation if we do it that way
- //see Section 2.2.1
- // TODO: Why is necessary enable event processing?
- // ANS: On RestoreViewExecutor, setProcessingEvents is called first to false
- // and then to true when postback. Since we need listeners registered to PostAddToViewEvent
- // event to be handled, we should enable it again. We are waiting a response from EG about
- // the behavior of those listeners (see comment on vdl.buildView).
- // -= Leonardo Uribe =- I think enable event processing in this point does not have any
- // side effect. Enable it allows programatically add components when binding is set with
- // pss enabled. That feature works without pss, so we should preserve backward behavior.
- // Tomahawk t:aliasBean example creating components on binding requires this to work.
- //context.setProcessingEvents(true);
- //try {
- // view.visitTree(VisitContext.createVisitContext(context), new RestoreStateCallback());
- //} finally {
- // context.setProcessingEvents(oldContextEventState);
- //}
return view;
}
@@ -584,13 +555,6 @@ public class DefaultFaceletsStateManagem
return null;
}
- //if (view.isTransient())
- //{
- // Must return null immediately per spec.
-
- //return null;
- //}
-
Object serializedView = context.getAttributes()
.get(SERIALIZED_VIEW_REQUEST_ATTR);
@@ -619,8 +583,6 @@ public class DefaultFaceletsStateManagem
// Create save state objects for every component.
- //view.visitTree (VisitContext.createVisitContext (context), new SaveStateVisitor (states));
-
if (view.getAttributes().containsKey(COMPONENT_ADDED_AFTER_BUILD_VIEW))
{
ensureClearInitialState(view);
@@ -651,10 +613,6 @@ public class DefaultFaceletsStateManagem
}
}
- // TODO: not sure the best way to handle dynamic adds/removes as mandated by the spec.
-
- // As required by ResponseStateManager, the return value is an Object array. First
- // element is the structure object, second is the state map.
Integer uniqueIdCount = (Integer) view.getAttributes().get(UNIQUE_ID_COUNTER_KEY);
if (uniqueIdCount != null && !uniqueIdCount.equals(1))
{
@@ -669,18 +627,10 @@ public class DefaultFaceletsStateManagem
serializedView = new Object[] { null, states };
}
- //externalContext.getRequestMap().put(SERIALIZED_VIEW_REQUEST_ATTR,
- // getStateCache().encodeSerializedState(context, serializedView));
-
context.getAttributes().put(SERIALIZED_VIEW_REQUEST_ATTR, serializedView);
}
- //if (!context.getApplication().getStateManager().isSavingStateInClient(context))
- //{
- //getStateCache().saveSerializedView(context, serializedView);
- //}
-
return serializedView;
}
@@ -1057,11 +1007,6 @@ public class DefaultFaceletsStateManagem
{
_facesContext = FacesContext.getCurrentInstance();
}
- //FacesContext facesContext = FacesContext.getCurrentInstance();
- //if (FaceletViewDeclarationLanguage.isRefreshingTransientBuild(facesContext))
- //{
- // return;
- //}
if (event instanceof PostAddToViewEvent)
{
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java?rev=1545492&r1=1545491&r2=1545492&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/component/UIRepeat.java Tue Nov 26 01:19:50 2013
@@ -1563,7 +1563,6 @@ public class UIRepeat extends UIComponen
// corresponding DataModel element.
_rowStates.clear();
}
- // TODO Auto-generated method stub
super.encodeBegin(context);
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java?rev=1545492&r1=1545491&r2=1545492&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java Tue Nov 26 01:19:50 2013
@@ -222,8 +222,7 @@ public class AjaxHandler extends TagHand
AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
// Push and pop this ajax handler to the stack, to delegate the
// call to applyAttachedObject to ComponentTagHandlerDelegate
- // TODO: The spec is not clear about how to deal with
- // composite component instances. The default one proposed here is
+ // The default one proposed here is
// use a different stack on DefaultFaceletContext.applyCompositeComponent,
// so components inside composite:implementation tag will not be
// affected by f:ajax outsider handlers.