Morning merge.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@2812 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-05-10 14:46:54 +00:00
parent 7f6fabb0b6
commit 41976834d5
31 changed files with 799 additions and 195 deletions

View File

@@ -45,6 +45,8 @@ public abstract class BaseContentWizard extends BaseWizardBean
protected String mimeType;
protected String objectType;
protected boolean inlineEdit;
protected boolean otherPropertiesChoiceVisible = true;
protected boolean showOtherProperties = true;
// the NodeRef of the node created during finish
protected NodeRef createdNode;
@@ -57,9 +59,9 @@ public abstract class BaseContentWizard extends BaseWizardBean
// Wizard implementation
@Override
public void init()
public void init(Map<String, String> parameters)
{
super.init();
super.init(parameters);
this.fileName = null;
this.author = null;
@@ -68,6 +70,8 @@ public abstract class BaseContentWizard extends BaseWizardBean
this.mimeType = null;
this.inlineEdit = false;
this.objectType = ContentModel.TYPE_CONTENT.toString();
initOtherProperties();
}
@Override
@@ -200,6 +204,32 @@ public abstract class BaseContentWizard extends BaseWizardBean
this.inlineEdit = inlineEdit;
}
/**
* @return Determines whether the choice to modify all properties
* is shown
*/
public boolean getOtherPropertiesChoiceVisible()
{
return this.otherPropertiesChoiceVisible;
}
/**
* @return Determines whether the edit properties dialog should be
* shown when this one ends
*/
public boolean getShowOtherProperties()
{
return this.showOtherProperties;
}
/**
* @param showOthers Sets whether the edit properties dialog is shown
*/
public void setShowOtherProperties(boolean showOthers)
{
this.showOtherProperties = showOthers;
}
/**
* @return Returns a list of object types to allow the user to select from
*/
@@ -417,4 +447,38 @@ public abstract class BaseContentWizard extends BaseWizardBean
return objType;
}
/**
* Initialises the other properties flags from config
*/
protected void initOtherProperties()
{
ConfigService configSvc = Application.getConfigService(FacesContext.getCurrentInstance());
if (configSvc != null)
{
Config config = configSvc.getConfig("Content Wizards");
if (config != null)
{
ConfigElement otherPropsCfg = config.getConfigElement("other-properties");
if (otherPropsCfg != null)
{
// get the attributes
String userChoiceVisible = otherPropsCfg.getAttribute("user-choice-visible");
String userChoiceDefault = otherPropsCfg.getAttribute("user-choice-default");
// set the defaults
if (userChoiceVisible != null)
{
this.otherPropertiesChoiceVisible = Boolean.parseBoolean(userChoiceVisible);
}
if (userChoiceDefault != null)
{
this.showOtherProperties = Boolean.parseBoolean(userChoiceDefault);
}
}
}
}
}
}