[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-93) give a Component more than one DataModel
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-93?page=all ]
Gavin King closed JBSEAM-93.
----------------------------
> give a Component more than one DataModel
> ----------------------------------------
>
> Key: JBSEAM-93
> URL: http://jira.jboss.com/jira/browse/JBSEAM-93
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Affects Versions: 1.0 beta 1
> Environment: normal
> Reporter: ya xiang
> Attachments: Component.java, DataModel2.java
>
> Original Estimate: 1 hour
> Remaining Estimate: 1 hour
>
> sometimes I need place more than one DataModel in one component control object.
> but at present, Componenent can only do a single DataModel.
> can model DataModel annotation and Component let it support multiple DataModel.
> I have a simple solution without modified exist model and application, just add DataModel2 annotation. and remain origin DataModel and its usage.
> code as follows:
> /**
> * FIXME:added by xiangya
> */
> private Set<Field> dataModelFields = new HashSet<Field>();
> public void inject(Object bean/*, boolean isActionInvocation*/)
> {
> injectMethods(bean/*, isActionInvocation*/);
> injectFields(bean/*, isActionInvocation*/);
> injectDataModelSelection(bean);
> injectDataModels(bean);
> }
> public void outject(Object bean)
> {
> outjectMethods(bean);
> outjectFields(bean);
> outjectDataModel(bean);
> outjectDataModels(bean);
> }
>
> //TODO: submit;
> private void injectDataModels(Object bean) {
> Field selectionIndexField=null, selectionField=null;
> for (Field field : dataModelFields)
> {
> DataModel2 dm = field.getAnnotation(DataModel2.class);
> String name = toName(dm.value(), field);
> javax.faces.model.DataModel dataModel = (javax.faces.model.DataModel)Contexts.getConversationContext().get(name);
> if (dataModel!=null){
> if (dm.selectionIndex().length()>0){
> try{
> selectionIndexField =beanClass.getDeclaredField(dm.selectionIndex());
> log.info(selectionIndexField);
> selectionIndexField.setAccessible(true);
> setFieldValue(bean, selectionIndexField, name, dataModel.getRowIndex());
> }catch (NoSuchFieldException e) {
> log.info(String.format("can not found DataModelSelectionIndex %s in DataModel %s ",
> dm.value(), dm.selectionIndex()));
> }
> }
> if (dm.selection().length()>0){
> try{
> selectionField = beanClass.getDeclaredField(dm.selection());
> log.info(selectionIndexField);
> selectionField.setAccessible(true);
> setFieldValue(bean, selectionField, name, dataModel.getRowData());
> }catch(NoSuchFieldException e){
> log.info(String.format("can not found DataModelSelection %s in DataModel %s", dm.value(), dm.selection()));
> }
> }
> }
> }
>
> }
>
> private void outjectDataModels(Object bean) {
> List list=null;
> for(Field field: dataModelFields){
> list = (List) getFieldValue(bean, field);
> name = toName(field.getAnnotation(DataModel2.class).value(), field);
> if (list!=null)
> {
> ListDataModel dataModel = new org.jboss.seam.jsf.ListDataModel(list);
> Contexts.getConversationContext().set( name, dataModel );
> }
> else
> {
> Contexts.getConversationContext().remove(name);
> }
> }
> }
> //TODO: submit;
> oooh, maybe I should create a patch.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 4 months
[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-96) saveOrUpdate() issue
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-96?page=all ]
Gavin King closed JBSEAM-96.
----------------------------
> saveOrUpdate() issue
> --------------------
>
> Key: JBSEAM-96
> URL: http://jira.jboss.com/jira/browse/JBSEAM-96
> Project: JBoss Seam
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.0 beta 1
> Reporter: nusa
> Attachments: SeamTest.war, SeamTest.zip
>
>
> When using saveOrUpdate(), it's only commit for a new record, not a modifed one.
> I attache a war file and the source as well.
> These are steps to produce the problem :
> 1. unzip the source
> 2. copy josss-seam.jar into <your_jboss_location>/jboss-4.0.3/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs/
> 3. start jboss
> 4. run <seamtest_location>/SeamTest/setup/setup_hsql.sql
> 5. deploy SeamTest.war
> 6. point your browser to http://localhost:8080/SeamTest/faces/index.jsp
> 7.this is optional, click on New button, then put some data.
> 8. back twice, if you do 7
> 9. click on Update button
> 10 modified any row, then click Update button. If you check this through HSQL Database Manager, your modified row is not commited.
> I suspect it's just the way I'm using @In and/or @Out, but maybe something else.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 4 months
[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-111) Check for duplicate component name on registration
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-111?page=all ]
Gavin King closed JBSEAM-111.
-----------------------------
> Check for duplicate component name on registration
> --------------------------------------------------
>
> Key: JBSEAM-111
> URL: http://jira.jboss.com/jira/browse/JBSEAM-111
> Project: JBoss Seam
> Issue Type: Patch
> Components: Core
> Affects Versions: 1.0 beta 1
> Reporter: Jye Tucker
> Assigned To: Thomas Heute
> Priority: Trivial
> Fix For: 1.1.0.BETA1
>
>
> Issues a warning when you try to register a component with a name that has previously been registered. Also wrapped addComponent methods and moved the ".component" suffix to a static variable.
> Index: Initialization.java
> ===================================================================
> RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/Initialization.java,v
> retrieving revision 1.23
> diff -u -r1.23 Initialization.java
> --- Initialization.java 28 Nov 2005 14:09:13 -0000 1.23
> +++ Initialization.java 4 Dec 2005 13:17:50 -0000
> @@ -44,6 +44,8 @@
> */
> public class Initialization
> {
> + public static final String COMPONENT_SUFFIX = ".component";
> +
> private static final Logger log = Logger.getLogger(Seam.class);
>
> private Map<String, String> properties = new HashMap<String, String>();
> @@ -160,15 +162,30 @@
>
> }
>
> - protected void addComponent(String name, Class clazz, Context context)
> - {
> - context.set( name + ".component", new Component(clazz, name) );
> + protected void addComponent(String name, Class clazz, Context context) {
> + if (isComponentRegistered(name, context)) {
> + log.warn("Component name '" + name + "' has been previously registered. May experience unexpected behaviour");
> + }
> + context.set(name + COMPONENT_SUFFIX, new Component(clazz, name));
> + }
> +
> + protected void addComponent(Class clazz, Context context) {
> + addComponent(Seam.getComponentName(clazz), clazz, context);
> + }
> +
> + /**
> + *
> + * @param name The name of the component
> + * @param context The context to inspect
> + * @return True if a component with the specified name exists in context
> + */
> + protected boolean isComponentRegistered(String name, Context context) {
> + if (context.get(name + COMPONENT_SUFFIX) != null) {
> + return true;
> + }
> + return false;
> }
>
> - protected void addComponent(Class clazz, Context context)
> - {
> - context.set( Seam.getComponentName(clazz) + ".component", new Component(clazz) );
> - }
>
> public boolean isScannerEnabled()
> {
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 4 months
[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-110) strack trace during logout form the booking app
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-110?page=all ]
Gavin King closed JBSEAM-110.
-----------------------------
> strack trace during logout form the booking app
> -----------------------------------------------
>
> Key: JBSEAM-110
> URL: http://jira.jboss.com/jira/browse/JBSEAM-110
> Project: JBoss Seam
> Issue Type: Bug
> Components: JSF
> Reporter: Gavin King
> Assigned To: Thomas Heute
> Fix For: 1.0 beta 2
>
>
> 10:13:52,484 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
> java.lang.ClassCastException: org.apache.catalina.session.StandardSessionFacade
> at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:175)
> at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:82)
> at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:4
> 58)
> at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:307)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
> ava:252)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 4 months
[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-101) @Factory does not work for POJO components
by Gavin King (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-101?page=all ]
Gavin King closed JBSEAM-101.
-----------------------------
> @Factory does not work for POJO components
> ------------------------------------------
>
> Key: JBSEAM-101
> URL: http://jira.jboss.com/jira/browse/JBSEAM-101
> Project: JBoss Seam
> Issue Type: Bug
> Components: Core
> Reporter: Christian Bauer
> Priority: Blocker
>
> In a POJO component. This works:
> @DataModel
> public List<Category>rootCategoryList;
> @DataModelSelection
> public Category category;
> @Factory("rootCategoryList")
> public void findRootCategories() { ... }
> This doesn't:
> @Out(scope = EVENT, required = false)
> public TreeNode categoryTree;
> @Out(scope = EVENT, required = false)
> public TreeNode node;
> @Factory("categoryTree")
> public void initializeTree() { ... }
> Caused by: java.lang.NoSuchMethodException: org.hibernate.ce.auction.seam.noejb.BrowseCategories$$EnhancerByCGLIB$$d5838cdf.initializeTree()
> at java.lang.Class.getMethod(Class.java:1581)
> at org.jboss.seam.Component.callComponentMethod(Component.java:926)
> at org.jboss.seam.Component.getInstanceFromFactory(Component.java:887)
> at org.jboss.seam.Component.getInstance(Component.java:850)
> at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:43)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 4 months