probleme formulaire de saisie[Résolu]

cancel
Showing results for 
Search instead for 
Did you mean: 
paradoxil
Member II

probleme formulaire de saisie[Résolu]

bonjour tous le monde

je veut faire un formulaire de saisie des informations d'un produit et ensuite  une fiche du produit au format PDF est générée sur la base des informations saisies.

mais j'ai une erreur suivante quand je clique sur "Nouveau produit" que j'ai ajouté  au menu:

javax.faces.el.EvaluationException: Exception while invoking expression #{SaveProductDialog.setupFlagCreate}
caused by:
javax.faces.el.PropertyNotFoundException: Base is null: SaveProductDialog

Hide Details

javax.faces.el.EvaluationException: Exception while invoking expression #{SaveProductDialog.setupFlagCreate}
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:168)
at javax.faces.component.UICommand.broadcast(UICommand.java:89)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy194.doFilter(Unknown Source)
at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:122)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy194.doFilter(Unknown Source)
at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.PropertyNotFoundException: Base is null: SaveProductDialog
at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:463)
at org.apache.myfaces.el.MethodBindingImpl.resolveToBaseAndProperty(MethodBindingImpl.java:183)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:117)
… 43 more

voici mais fichies :

productmodel.xml :

<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>
<model name="product:model" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Custom Content Model</description>
   <author>KOOSSERY TECHNOLOGY</author>
   <version>1.0</version>

   <!– ici nos imports de modèles M1  –>    
   <imports>
        <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

<!– ci-dessous notre modèle M2 pour ce projet  –>

   <!– on définit le namespace de notre modèle M2 –>
   <namespaces>
      <namespace uri="http://www.koossery-tech.com/model/product/1.0" prefix="product"/>
   </namespaces>
 
   <types>
      <!– The product type –>
      <type name="product:product">
          <title>Product</title>
         <parent>cm:content</parent>
         <properties>
            <property name="product:name">
               <title>Name</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="product:description">
               <title>Description</title>
               <type>d:text</type>
            </property>
            <property name="product:ref">
               <title>REF</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="product:prize">
               <title>Prize</title>
               <type>d:float</type>
               <mandatory>true</mandatory>
            </property>
            <property name="product:stock">
               <title>Stock</title>
               <type>d:int</type>
            </property>
       </properties>
      
       <associations>
            <!–  ci-dessous l’association qui lie le produit à ses images   –>
            <association name="product:image">
               <target>
                  <class>product:picture</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
         </associations>
      
       <!–  on greffe les aspect/comportements versionable et auditable  –>
       <mandatory-aspects>
          <aspect>cm:versionable</aspect>
          <aspect>cm:auditable</aspect>
       </mandatory-aspects>
      </type>

     <!– The product image –>
     <type name="product:picture">
        <title>Picture</title>
         <parent>cm:content</parent>
         <properties>
            <property name="product:pictureLegend">
               <title>Legend</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
       </properties>
      </type>
     
    </types>
  
</model>

web-client-config-custom.xml :

<alfresco-config>
    <config>
      <actions>
         
            <!– action :créer une fiche  produit –>
          <action id="create_product">
             <permissions>
                <permission allow="true">Write</permission>
             </permissions>
             <label-id>create_product</label-id>
             <image>/images/icons/add.gif</image>
             <action-listener>#{SaveProductDialog.setupFlagCreate}</action-listener>
             <action>dialog:save_product</action>
          </action>        
         
          <!– action :modifier une fiche  produit –>
          <action id="update_product">
             <permissions>
                <permission allow="true">Write</permission>
             </permissions>
             <evaluator>com.koossery.web.action.evaluator.UpdateProductEvaluator</evaluator>
             <label-id>update-product</label-id>
             <image>/images/icons/update.gif</image>
             <action-listener>#{SaveProductDialog.setupContentAction}</action-listener>
             <action>dialog:save_product</action>
             <params>
                <param name="id">#{actionContext.id}</param>
             </params>
          </action>
         
          <!– ici on ajoute l'action 'créer produit' dans le groupe  'browse_create_menu'–>
          <action-group id="browse_create_menu">
             <action idref="create_product" />
          </action-group>        
   
          <!– ici on ajoute l'action 'créer produit' dans le groupe  'document_browse'–>
          <action-group id="document_browse">
             <action idref="update_product" />        
          </action-group>
                      
      </actions>
    </config>

<!– configuration du Dialog–>
   <config> 
      <dialogs>  
          <dialog name="save_product" page="/jsp/extension/content/save-product-dialog.jsp"
                   managed-bean="SaveProductDialog"
                  icon="/images/icons/new_content_large.gif" title-id="save_product_dialog_title"
                  description-id="save_product_description_dialog">               
         </dialog>        
       </dialogs>   
   </config>

   <!– Configuration of Advanced search –>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         <type name="product:product"/>
         </content-types>
         <custom-properties>
            <meta-data type="product:product" property="product:name" />
         <meta-data type="product:product" property="product:description" />
         <meta-data type="product:product" property="product:ref" />
         <meta-data type="product:product" property="product:prize" />
         <meta-data type="product:product" property="product:stock" />
         </custom-properties>
      </advanced-search>
   </config>

</alfresco-config>

save-product-dialog.jsp :

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>

<%@ page buffer="32kb" contentType="text/html;charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ page import="javax.faces.context.FacesContext"%>
<%@ page import="org.alfresco.web.app.Application"%>
<%@ page import="com.koossery.alfresco.web.bean.content.SaveProductDialog"%>
<%@ page import="org.alfresco.web.app.servlet.FacesHelper"%>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator"%>

<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>

<%
   boolean photoFileUploaded = false;

   SaveProductDialog dialog = (SaveProductDialog) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "SaveProductDialog");
   if (dialog != null && dialog.getPhotoFileNodeRef() != null)
   {
      photoFileUploaded = true;
   }
%>

<%– load a bundle of properties with I18N strings –%>
<f:loadBundle basename="alfresco.messages.customcontent-webclient" var="custom"/>

<a:panel id="general-panel" label="#{custom.new_product}"
         border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" styleClass="mainSubTitle">
<f:verbatim>
<table cellspacing="0" cellpadding="3" border="0" width="100%">
   <tr>
      <td>
      </f:verbatim>
      <h:panelGrid id="panelGrid-01" columns="2" cellpadding="2">
             <%– Name –%>
             <h:outputText id="out-01" value="#{custom.name}:"/>
         <h:inputText id="product-name" value="#{DialogManager.bean.name}"
               maxlength="1024" size="20" />
              
             <%– Description –%>
             <h:outputText id="out-02" value="#{custom.description}:"/>
         <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "white", "white"); %>
         <h:inputTextarea id="product-description" rows="6" cols="30" value="#{DialogManager.bean.description}" />
         <% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "white"); %>

             <%– REF –%>
             <h:outputText id="out-03" value="#{custom.reference}:"/>
          <h:inputText id="product-reference" value="#{DialogManager.bean.ref}"
                maxlength="1024" size="35" disabled="true"/>          
   
             <%– Prize –%>
             <h:outputText id="out-04" value="#{custom.prize}:"/>
         <h:inputText id="product-prize" value="#{DialogManager.bean.prize}"
               maxlength="1024" size="20" />

             <%– Stock –%>
             <h:outputText id="out-05" value="#{custom.stock}:"/>
         <h:inputText id="product-stock" value="#{DialogManager.bean.stock}"
               maxlength="1024" size="20" />
                  
        </h:panelGrid>                    
      
      </f:verbatim>
      </td>
   </tr>
   <tr>
      <td>
      </f:verbatim>

      <h:panelGrid id="panelGrid-02" columns="1" cellpadding="2">
      
          <%– Legend –%>      
         <h:panelGrid id="panelGrid-03" columns="2" cellpadding="2">
                <h:outputText id="out-06" value="#{custom.legend}:"/>
            <h:inputText id="photo-legend" value="#{DialogManager.bean.pictureLegend}"
                  maxlength="1024" size="20" />                     
           </h:panelGrid>

         <%
            if (photoFileUploaded == false)
            {
         %>

         <%– Photo –%>
         <h:panelGrid id="panelGrid-04" columns="2" cellpadding="2">
               <h:outputText id="out-07" value="#{custom.photo}:"/>
                <r:upload id="photo-uploader" value="#{DialogManager.bean.photoFileName}" framework="dialog"/>          
            </h:panelGrid>
            
         <%}
            if (photoFileUploaded)
            {
         %>
        
         <h:panelGrid id="photo-prop-panelGrid" columns="2" cellpadding="2" cellspacing="2" border="0">
         <h:outputText id="photo-label" value="#{custom.photo}:" styleClass="propertiesLabel" />
           <h:panelGroup id="photo-panelGroup">
               <h:panelGroup id="pg1" rendered="#{DialogManager.bean.photoUrl == null}">
                  <f:verbatim><div style="border: 2px solid #cccccc;width:200px;height:120px"></f:verbatim>
               </h:panelGroup>
               <h:panelGroup id="pg2" rendered="#{DialogManager.bean.photoUrl != null}">
                  <f:verbatim><div style="border: 2px solid #cccccc;width:200px;height:auto"></f:verbatim>
               </h:panelGroup>
               <h:graphicImage id="photo-image" url="#{DialogManager.bean.photoUrl}" width="200" rendered="#{DialogManager.bean.photoUrl != null}" />
               <f:verbatim></div></f:verbatim>
           </h:panelGroup>
        </h:panelGrid>
         <%
         }
         %>
                  
        </h:panelGrid>
        
      </f:verbatim>
      </td>
   </tr>   

</table>
</f:verbatim>
   
</a:panel>
faces-config-custom.xml :


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
                              "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>

   <managed-bean>
      <managed-bean-name>SaveProductDialog</managed-bean-name>
      <managed-bean-class>com.koossery.alfresco.web.bean.content.SaveProductDialog</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
         <property-name>nodeService</property-name>
         <value>#{NodeService}</value>
      </managed-property>
      <managed-property>
         <property-name>contentService</property-name>
         <value>#{ContentService}</value>
      </managed-property>
      <managed-property>
         <property-name>browseBean</property-name>
         <value>#{BrowseBean}</value>
      </managed-property>
      <managed-property>
         <property-name>serviceRegistry</property-name>
         <value>#{ServiceRegistry}</value>
      </managed-property>
   </managed-bean>

</faces-config>

et voici le build.xml que j'utilise :

<?xml version="1.0"?>

<project name="Custom Content Build File" default="package-extension" basedir=".">
   
   <property name="project.dir" value="."/>
   <property name="build.dir" value="${project.dir}/build"/>
   <property name="source.dir" value="${project.dir}/src/main/java"/>
   <property name="resources.dir" value="${project.dir}/src/main/resources"/>
   <property name="config.dir" value="${project.dir}/src/main/config"/>
   <property name="web.dir" value="${project.dir}/src/main/webapp" />
   <property name="package.file.jar" value="${build.dir}/custom-content.jar"/>
   <property name="package.file.zip" value="${build.dir}/custom-content.zip"/>
   
   <path id="class.path">
      <dirset dir="${build.dir}" />
      <fileset dir="../lib/server" includes="**/*.jar"/>
   </path>
  
   <target name="clean">
       <delete dir="${build.dir}"/>
   </target>
   
   <target name="compile" depends="clean">
      <mkdir dir="${build.dir}" />
      <javac classpathref="class.path" srcdir="${source.dir}" destdir="${build.dir}" />
    
      <copydir dest="${build.dir}" src="${resources.dir}">
     </copydir>
      <copydir dest="${build.dir}" src="${config.dir}">
     </copydir>

      <delete dir="${build.dir}/alfresco"/>
      
      <mkdir dir="${build.dir}/alfresco/extension" />
        <copy todir="${build.dir}/alfresco/extension">
          <fileset dir="${resources.dir}/alfresco/extension"
                includes="*.xml,*.properties"
                  excludes="web-client-config-custom.xml"/>
      </copy>
     <copy todir="${build.dir}/alfresco/extension">
        <fileset dir="${config.dir}/alfresco/extension"
            includes="*.xml,*.properties" />
     </copy>

     <mkdir dir="${build.dir}/META-INF" />
     <copy todir="${build.dir}/META-INF">
        <fileset dir="${resources.dir}/alfresco/extension"
            includes="web-client-config-custom.xml"/>
  </copy>

      <mkdir dir="${build.dir}/alfresco/messages" />
     <copy todir="${build.dir}/alfresco/messages">
        <fileset dir="${config.dir}/alfresco/messages"
              includes="*.xml,*.properties"/>
    </copy>

   </target>
  
   <target name="package-jar" depends="compile">
      <delete file="${package.file.jar}" /> 
      <jar destfile="${package.file.jar}">
         <fileset dir="${build.dir}" excludes="*.zip"/>
      </jar>
   </target>
  
   <target name="package-extension" depends="package-jar">
      <delete file="${package.file.zip}" />
      <zip destfile="${package.file.zip}">
         <zipfileset file="${package.file.jar}" prefix="WEB-INF/lib" />
         <zipfileset dir="${web.dir}" />
      </zip>
   </target>
  
   <target name="integrate-extension" depends="package-extension">
      <available file="C:\Alfresco\tomcat\webapps\alfresco.war"
         type="file" property="alfresco.war.present" />
      <fail unless="alfresco.war.present"
            message="Could not find alfresco.war" />
      <zip destfile="C:\Alfresco\tomcat\webapps\alfresco.war"
         update="true">
         <zipfileset file="${package.file.jar}" prefix="WEB-INF/lib" />
         <zipfileset dir="${web.dir}" />
      </zip>
   </target>
   
</project>   
merci bcp
3 Replies
jayjayecl
Active Member II

Re: probleme formulaire de saisie[Résolu]

michael tu as fusionné le faces-config et la jsp !!
michaelh
Active Member

Re: probleme formulaire de saisie[Résolu]

Corrigé (10 ans après) !
william_3082
Member II

Re: probleme formulaire de saisie[Résolu]

bonjour a tous, j'ai également ce problème pouvez vous me dire précisément ce qu'il faut faire?

merci par avance
cdl