cancel
Showing results for 
Search instead for 
Did you mean: 

How JSP and BEAN work ?

milona
Champ in-the-making
Champ in-the-making
Hello!

I don't understand how jsp and beans works with Alfresco.

web-client-config-wizards.xml contains :
wizard name="createSpace" managed-bean="CreateSpaceWizard"
                 title-id="create_space_title" description-id="create_space_desc"
                 icon="/images/icons/create_space_large.gif">
            <step name="create-from" title-id="starting_space" description-id="create_space_step1_desc">
               <page path="/jsp/spaces/create-space-wizard/create-from.jsp"
                     title-id="create_space_step1_title"
                     description-id="create_space_step1_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="options" title-id="space_options" description-id="create_space_step2_desc">
               <condition if="#{CreateSpaceWizard.createFrom == 'scratch'}">
                  <page path="/jsp/spaces/create-space-wizard/from-scratch.jsp"
                        title-id="create_space_step2_title"
                        description-id="create_space_step2_desc"
                        instruction-id="default_instruction" />
               </condition>
               <condition if="#{CreateSpaceWizard.createFrom == 'existing'}">
                  <page path="/jsp/spaces/create-space-wizard/from-existing.jsp"
                        title-id="create_space_step2_title"
                        description-id="create_space_step2_desc"
                        instruction-id="default_instruction" />
               </condition>
               <condition if="#{CreateSpaceWizard.createFrom == 'template'}">
                  <page path="/jsp/spaces/create-space-wizard/from-template.jsp"
                        title-id="create_space_step2_title"
                        description-id="create_space_step2_desc"
                        instruction-id="default_instruction" />
               </condition>
            </step>

I would like to delete the step 1 from this wizard and modifie the variable WizardManager.bean.createFrom to only be always equal to "template".

This file create-from.jsp is called during step 1, and I don't need it:
<h:panelGrid columns="1">
<h:outputText value="#{msg.how_to_create_space}"/>
<h:selectOneRadio id="create-from" value="#{WizardManager.bean.createFrom}" layout="pageDirection">
<f:selectItem itemValue="scratch" itemLabel="#{msg.from_scratch}" />
<f:selectItem itemValue="existing" itemLabel="#{msg.based_on_existing_space}" />
<f:selectItem itemValue="template" itemLabel="#{msg.using_a_template}" />
</h:selectOneRadio>
</h:panelGrid>

Please could you give me clues ?

Thank you
1 REPLY 1

gavinc
Champ in-the-making
Champ in-the-making
You can achieve this by overriding the wizard configuration for the create space wizard and changing what you need. For your scenario you can just point the wizard to a copy of the default page that removes the option to copy from a template. Have a look at the following wiki pages for info on doing this:

http://wiki.alfresco.com/wiki/Web_Client_Configuration_Guide
http://wiki.alfresco.com/wiki/Web_Client_Customisation_Guide
http://wiki.alfresco.com/wiki/Customising_The_Create_Content_Wizard