cancel
Showing results for 
Search instead for 
Did you mean: 

Adding additional pages to the Add Content Wizard

davewhit
Champ in-the-making
Champ in-the-making
I've attempted to add new steps to the Add Content Wizard and have had decent success thus far. However, I have some distance to go yet and haven't gotten all of the details ironed out.

In particular, I was hoping somebody could help me with the following items:

1) I assume there is some instance of one of the Java Collection types in one of the beans that declares how many steps are in the Add Content wizard. Which class is it and what is the name of the variable? How is this list populated?

2) I have inserted a new step into the three step Add Content Wizard thus making it four steps. My new step is now step one. I've noticed that as I step through the wizard, the "Steps" panel lags one behind the step I'm actually at. I'm sure this is more than just a formatting issue and likely relates to an important control variable for tracking steps and their progress. Could somebody discuss the process that is at work here and provide further detail about classes, variables, and the rough algorithm that is at play for this process.

Thanks,
dave
2 REPLIES 2

gavinc
Champ in-the-making
Champ in-the-making
Hi,

The lifecycle for a wizard creating a new item is as follows:

    startWizard()
    init()
    next() or back()
    determineOutcomeForStep(int)
    finish() or cancel()
The lifecycle for a wizard editing an item is:

    startWizardForEdit()
    init()
    populate()
    next() or back()
    determineOutcomeForStep(int)
    finish() or cancel()
The key to stepping through the wizard (for navigation) is the determineOutcomeForStep method. This method will return an outcome for the step the wizard is on. This outcome is used to lookup a JSP page from faces-config-navigation.xml. So in the case of AddContentWizard step 1 returns "upload" which in turn maps to "/jsp/wizard/add-content/upload.jsp" then step 2 returns "properties"  which in turn maps to "/jsp/wizard/add-content/properties.jsp", so to add another page you would need to override the determineOutcomeForStep() method and add the relevant outcome mapping to faces-config-navigation.xml

You will also need to override the following methods to display the correct text on each page:

    getWizardDescription()
    getWizardTitle()
    getStepTitle()
    getStepDescription()
    getStepInstructions()
As for the "Steps" being out of sync the value attribute in the modelist component determines which step is highlighted so you probably just need to change this number in each page.

<a:modeList itemSpacing="3" iconColumnWidth="2" selectedStyleClass="statusListHighlight" value="1" disabled="true">

Hope this all helps.

roman
Champ in-the-making
Champ in-the-making
Got problems with the Add Content Wizard.

My aim is to write a custom wizard which is kind a Add Content Wizard with extended functionality. but i would like to keep the standard Add Content wizard too.

i've read this threads:
http://forums.alfresco.com/viewtopic.php?p=34509#34509
http://forums.alfresco.com/viewtopic.php?p=34510#34510

but i still don't know which is the right solution.

i need a method of resolution…
it's hurrying

thx in advance