cancel
Showing results for 
Search instead for 
Did you mean: 

JSP page modifications

soeursourire
Champ in-the-making
Champ in-the-making
Hi!

I got into troubles while adding a field "pays" and /or a listbox "userNames" in person-properties.jsp. Here is what I am doing and the error I have while opening this page. Please tell me what I am doing wrong or what I am missing?

- I create a sub-class MyNewUserWizard
- Inside I added two attributes :
-            protected String pays = null;
-            protected static List<SelectItem> userNames = null;
- I initialize this list as follow:
-             this.userNames= new ArrayList<SelectItem>(8);
-             userNames.add(new SelectItem("soso", "Sophie"));
-             userNames.add(new SelectItem("charlot","Charlot"));
- I added this listbox in my jsp page as follow:
- <tr>
        <td>
        <div style="padding:4px">
        <h:selectOneListbox id="userNames" style="width:250px" size="5">
        <f:selectItems value="#{MyNewUserWizard.userNames}" />
        </h:selectOneListbox>
        </div>
        </td>
   </tr>
- And I would like to use MyNewUserWizard instead of NewUserWizard
- But how can I do to modify <h:input value = #(NewUserWizard.email) How can I use MyNewUserWizard.setEmail() here?
- I added "pays" in ContentModel.xml and I added a manage-bean MyNewUserWizard in faces-config.xml
- But I still have the following error while opening the page:
-       javax.portlet.PortletException: org.apache.jasper.JasperException: Bean: org.alfresco.web.bean.wizard.MyNewUserWizard, propertySmiley Tongueays

Please tell me what is wrong here?
Thanks in advance
14 REPLIES 14

gavinc
Champ in-the-making
Champ in-the-making
It depends, if you have defined the property "pays" on a custom type or an aspect then the Node being represented in the Map should aldready have the "pays" property available. fullName and homeSpace are calculated properties, they are not stored in the database, hence the reason they are added manually in this way.

startWizardForEdit will get called once for the wizard i.e. once you press the edit link in users.jsp. So the init method should be called just before person-properties.jsp is called. Have you redined the "NewUserWizard" bean in faces-config.xml to point to your subclass? Maybe your init method is not called for this reason?

soeursourire
Champ in-the-making
Champ in-the-making
Thanks for your answer.

I defined pays as follow:
<aspects>
      <aspect name="custom:EthicFlow_person">
         <title>Department</title>
         <properties>
            <property name="customSmiley Tongueays">
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
   </aspects>
And it is an attribute of MyNewUserWizard. The node represented in the Map should be the nodeRef that point on MyNewUserWizard?

And in faces-config.xml I left the bean NewUserWizard and I added mine as follow:

<managed-bean>
      <description>
         The bean that backs up the New User Wizard
      </description>
      <managed-bean-name>NewUserWizard</managed-bean-name>
      <managed-bean-class>org.alfresco.web.bean.wizard.NewUserWizard</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>searchService</property-name>
         <value>#{SearchService}</value>
      </managed-property>
      <managed-property>
         <property-name>navigator</property-name>
         <value>#{NavigationBean}</value>
      </managed-property>
      <managed-property>
         <property-name>browseBean</property-name>
         <value>#{BrowseBean}</value>
      </managed-property>
      <managed-property>
         <property-name>authenticationService</property-name>
         <value>#{authenticationService}</value>
      </managed-property>
      <managed-property>
         <property-name>permissionService</property-name>
         <value>#{PermissionService}</value>
      </managed-property>
      <managed-property>
         <property-name>namespaceService</property-name>
         <value>#{NamespaceService}</value>
      </managed-property>
      <managed-property>
         <property-name>personService</property-name>
         <value>#{personService}</value>
      </managed-property>
      <managed-property>
         <property-name>ownableService</property-name>
         <value>#{OwnableService}</value>
      </managed-property>
      <managed-property>
         <property-name>configService</property-name>
         <value>#{configService}</value>
      </managed-property>
   </managed-bean>
  
    <managed-bean>
      <description>
         The bean that backs up My New User Wizard
      </description>
      <managed-bean-name>MyNewUserWizard</managed-bean-name>
      <managed-bean-class>org.alfresco.web.bean.wizard.MyNewUserWizard</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>searchService</property-name>
         <value>#{SearchService}</value>
      </managed-property>
      <managed-property>
         <property-name>navigator</property-name>
         <value>#{NavigationBean}</value>
      </managed-property>
      <managed-property>
         <property-name>browseBean</property-name>
         <value>#{BrowseBean}</value>
      </managed-property>
      <managed-property>
         <property-name>authenticationService</property-name>
         <value>#{authenticationService}</value>
      </managed-property>
      <managed-property>
         <property-name>permissionService</property-name>
         <value>#{PermissionService}</value>
      </managed-property>
      <managed-property>
         <property-name>namespaceService</property-name>
         <value>#{NamespaceService}</value>
      </managed-property>
      <managed-property>
         <property-name>personService</property-name>
         <value>#{personService}</value>
      </managed-property>
      <managed-property>
         <property-name>ownableService</property-name>
         <value>#{OwnableService}</value>
      </managed-property>
      <managed-property>
         <property-name>configService</property-name>
         <value>#{configService}</value>
      </managed-property>
   </managed-bean>

Is it false like this?

soeursourire
Champ in-the-making
Champ in-the-making
I found my fault for the "pays" I was not calling the startWizard of MyNewUserWizard….

But for the menu list I have this error now
Value is no String and component person-props:handleMetaDataEvent_id25 does not have a Converter

Do you know from where that can come from?

gavinc
Champ in-the-making
Champ in-the-making
It may be something to do with the SelectItem objects you are returning. The values inside need to be String.

How are you constructing these? Could you post the code you have in the init() method of your wizard?

zummy
Champ in-the-making
Champ in-the-making
Hi smilesister ;-),

Did u finally managed to customized the user creation/editing? I'm new in Alfresco and I need to do that so I was wondering if u could give me some clue.

Thks in advance.

Zummy