- New edit properties dialog used when new content is added/created

- Minor fixes/enhancements

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2805 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-05-10 08:54:14 +00:00
parent 7f6fabb0b6
commit c953c45c3d
26 changed files with 711 additions and 171 deletions

View File

@@ -528,7 +528,7 @@ public class AlfrescoNavigationHandler extends NavigationHandler
}
else
{
logger.warn("Failed to find configuration for dialog '" + name + "'");
//logger.warn("Failed to find configuration for dialog '" + name + "'");
// send the dialog name as the outcome to the original handler
handleDispatch(context, fromAction, name);
@@ -565,7 +565,7 @@ public class AlfrescoNavigationHandler extends NavigationHandler
}
else
{
logger.warn("Failed to find configuration for wizard '" + name + "'");
//logger.warn("Failed to find configuration for wizard '" + name + "'");
// send the dialog name as the outcome to the original handler
handleDispatch(context, fromAction, name);
@@ -610,7 +610,16 @@ public class AlfrescoNavigationHandler extends NavigationHandler
if (logger.isDebugEnabled())
logger.debug("Closing " + closingItem + " with an overridden outcome of '" + overriddenOutcome + "'");
navigate(context, fromAction, overriddenOutcome);
// if the override is calling another dialog or wizard come back through
// the navigation handler from the beginning
if (isDialog(overriddenOutcome) || isWizard(overriddenOutcome))
{
this.handleNavigation(context, fromAction, overriddenOutcome);
}
else
{
navigate(context, fromAction, overriddenOutcome);
}
}
}
else

View File

@@ -9,6 +9,7 @@ import javax.faces.event.ActionEvent;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.FileUploadBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
@@ -21,7 +22,7 @@ public class AddContentDialog extends BaseContentWizard
protected File file;
// ------------------------------------------------------------------------------
// Wizard implementation
// Dialog implementation
@Override
protected String finishImpl(FacesContext context, String outcome)
@@ -29,7 +30,8 @@ public class AddContentDialog extends BaseContentWizard
{
saveContent(this.file, null);
return "cancel";
// return default outcome
return outcome;
}
@Override
@@ -39,10 +41,38 @@ public class AddContentDialog extends BaseContentWizard
clearUpload();
}
@Override
protected String doPostCommitProcessing(FacesContext context, String outcome)
{
// as we were successful, go to the set properties dialog if asked
// to otherwise just return
if (this.showOtherProperties)
{
// we are going to immediately edit the properties so we need
// to setup the BrowseBean context appropriately
this.browseBean.setDocument(new Node(this.createdNode));
return "dialog:setContentProperties";
}
else
{
return outcome;
}
}
@Override
protected String getDefaultFinishOutcome()
{
// as we are using this dialog outside the dialog framework
// just go back to the main page
return "browse";
}
// ------------------------------------------------------------------------------
// Bean getters and setters
/**
* @return Returns the message to display when a file has been uploaded
*/

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;
@@ -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);
}
}
}
}
}
}

View File

@@ -12,7 +12,9 @@ import org.alfresco.config.Config;
import org.alfresco.config.ConfigElement;
import org.alfresco.config.ConfigService;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.data.IDataContainer;
import org.alfresco.web.data.QuickSort;
import org.apache.commons.logging.Log;
@@ -40,6 +42,7 @@ public class CreateContentWizard extends BaseContentWizard
{
saveContent(null, this.content);
// return the default outcome
return outcome;
}
@@ -74,6 +77,26 @@ public class CreateContentWizard extends BaseContentWizard
return disabled;
}
@Override
protected String doPostCommitProcessing(FacesContext context, String outcome)
{
// as we were successful, go to the set properties dialog if asked
// to otherwise just return
if (this.showOtherProperties)
{
// we are going to immediately edit the properties so we need
// to setup the BrowseBean context appropriately
this.browseBean.setDocument(new Node(this.createdNode));
return getDefaultFinishOutcome() + AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
"dialog:setContentProperties";
}
else
{
return outcome;
}
}
// ------------------------------------------------------------------------------
// Bean Getters and Setters

View File

@@ -0,0 +1,255 @@
package org.alfresco.web.bean.content;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.model.FileExistsException;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
/**
* Bean implementation of the "Edit Content Properties" dialog.
*
* @author gavinc
*/
public class EditContentPropertiesDialog extends BaseDialogBean
{
protected static final String TEMP_PROP_MIMETYPE = "mimetype";
protected Node editableNode;
// ------------------------------------------------------------------------------
// Dialog implementation
@Override
public void init()
{
super.init();
// setup the editable node
this.editableNode = new Node(this.browseBean.getDocument().getNodeRef());
// special case for Mimetype - since this is a sub-property of the ContentData object
// we must extract it so it can be edited in the client, then we check for it later
// and create a new ContentData object to wrap it and it's associated URL
ContentData content = (ContentData)this.editableNode.getProperties().get(ContentModel.PROP_CONTENT);
if (content != null)
{
this.editableNode.getProperties().put(TEMP_PROP_MIMETYPE, content.getMimetype());
}
}
@Override
protected String finishImpl(FacesContext context, String outcome)
throws Exception
{
NodeRef nodeRef = this.browseBean.getDocument().getNodeRef();
Map<String, Object> props = this.editableNode.getProperties();
// get the name and move the node as necessary
String name = (String) props.get(ContentModel.PROP_NAME);
if (name != null)
{
fileFolderService.rename(nodeRef, name);
}
Map<QName, Serializable> properties = this.nodeService.getProperties(nodeRef);
// we need to put all the properties from the editable bag back into
// the format expected by the repository
// but first extract and deal with the special mimetype property for ContentData
String mimetype = (String)props.get(TEMP_PROP_MIMETYPE);
if (mimetype != null)
{
// remove temporary prop from list so it isn't saved with the others
props.remove(TEMP_PROP_MIMETYPE);
ContentData contentData = (ContentData)props.get(ContentModel.PROP_CONTENT);
if (contentData != null)
{
contentData = ContentData.setMimetype(contentData, mimetype);
props.put(ContentModel.PROP_CONTENT.toString(), contentData);
}
}
// extra and deal with the Author prop if the aspect has not been applied yet
String author = (String)props.get(ContentModel.PROP_AUTHOR);
if (author != null && author.length() != 0)
{
// add aspect if required
if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == false)
{
Map<QName, Serializable> authorProps = new HashMap<QName, Serializable>(1, 1.0f);
authorProps.put(ContentModel.PROP_AUTHOR, author);
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_AUTHOR, authorProps);
}
// else it will get updated in the later setProperties() call
}
// deal with adding the "titled" aspect if required
String title = (String)props.get(ContentModel.PROP_TITLE);
String description = (String)props.get(ContentModel.PROP_DESCRIPTION);
if (title != null || description != null)
{
// add the aspect to be sure it's present
nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, null);
// props will get added later in setProperties()
}
// add the remaining properties
Iterator<String> iterProps = props.keySet().iterator();
while (iterProps.hasNext())
{
String propName = iterProps.next();
QName qname = QName.createQName(propName);
// make sure the property is represented correctly
Serializable propValue = (Serializable)props.get(propName);
// check for empty strings when using number types, set to null in this case
if ((propValue != null) && (propValue instanceof String) &&
(propValue.toString().length() == 0))
{
PropertyDefinition propDef = this.dictionaryService.getProperty(qname);
if (propDef != null)
{
if (propDef.getDataType().getName().equals(DataTypeDefinition.DOUBLE) ||
propDef.getDataType().getName().equals(DataTypeDefinition.FLOAT) ||
propDef.getDataType().getName().equals(DataTypeDefinition.INT) ||
propDef.getDataType().getName().equals(DataTypeDefinition.LONG))
{
propValue = null;
}
}
}
properties.put(qname, propValue);
}
// send the properties back to the repository
this.nodeService.setProperties(this.browseBean.getDocument().getNodeRef(), properties);
// we also need to persist any association changes that may have been made
// add any associations added in the UI
Map<String, Map<String, AssociationRef>> addedAssocs = this.editableNode.getAddedAssociations();
for (Map<String, AssociationRef> typedAssoc : addedAssocs.values())
{
for (AssociationRef assoc : typedAssoc.values())
{
this.nodeService.createAssociation(assoc.getSourceRef(), assoc.getTargetRef(), assoc.getTypeQName());
}
}
// remove any association removed in the UI
Map<String, Map<String, AssociationRef>> removedAssocs = this.editableNode.getRemovedAssociations();
for (Map<String, AssociationRef> typedAssoc : removedAssocs.values())
{
for (AssociationRef assoc : typedAssoc.values())
{
this.nodeService.removeAssociation(assoc.getSourceRef(), assoc.getTargetRef(), assoc.getTypeQName());
}
}
// add any child associations added in the UI
Map<String, Map<String, ChildAssociationRef>> addedChildAssocs = this.editableNode.getAddedChildAssociations();
for (Map<String, ChildAssociationRef> typedAssoc : addedChildAssocs.values())
{
for (ChildAssociationRef assoc : typedAssoc.values())
{
this.nodeService.addChild(assoc.getParentRef(), assoc.getChildRef(), assoc.getTypeQName(), assoc.getTypeQName());
}
}
// remove any child association removed in the UI
Map<String, Map<String, ChildAssociationRef>> removedChildAssocs = this.editableNode.getRemovedChildAssociations();
for (Map<String, ChildAssociationRef> typedAssoc : removedChildAssocs.values())
{
for (ChildAssociationRef assoc : typedAssoc.values())
{
this.nodeService.removeChild(assoc.getParentRef(), assoc.getChildRef());
}
}
return outcome;
}
@Override
protected String doPostCommitProcessing(FacesContext context, String outcome)
{
// reset the document held by the browse bean as it's just been updated
this.browseBean.getDocument().reset();
return outcome;
}
/**
* Formats the error message to display if an error occurs during finish processing
*
* @param The exception
* @return The formatted message
*/
@Override
protected String formatErrorMessage(Throwable exception)
{
if (exception instanceof FileExistsException)
{
return MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_EXISTS),
((FileExistsException)exception).getExisting().getName());
}
else if (exception instanceof InvalidNodeRefException)
{
return MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF),
new Object[] {this.browseBean.getDocument().getId()});
}
else
{
return super.formatErrorMessage(exception);
}
}
@Override
protected String getErrorOutcome(Throwable exception)
{
if (exception instanceof InvalidNodeRefException)
{
// this failure means the node no longer exists - we cannot show
// the content properties screen again so go back to the main page
return "browse";
}
else
{
return super.getErrorOutcome(exception);
}
}
// ------------------------------------------------------------------------------
// Bean getters and setters
/**
* Returns the node being edited
*
* @return The node being edited
*/
public Node getEditableNode()
{
return this.editableNode;
}
}

View File

@@ -0,0 +1,27 @@
package org.alfresco.web.bean.content;
import org.alfresco.web.app.AlfrescoNavigationHandler;
/**
* Bean implementation of the "Set Content Properties" dialog.
*
* @author gavinc
*/
public class SetContentPropertiesDialog extends EditContentPropertiesDialog
{
@Override
protected String getDefaultCancelOutcome()
{
return super.getDefaultCancelOutcome() +
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
"browse";
}
@Override
protected String getDefaultFinishOutcome()
{
return super.getDefaultFinishOutcome() +
AlfrescoNavigationHandler.OUTCOME_SEPARATOR +
"browse";
}
}

View File

@@ -82,7 +82,7 @@ public abstract class BaseDialogBean implements IDialogBean
// rollback the transaction
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
Utils.addErrorMessage(formatErrorMessage(e));
outcome = null;
outcome = getErrorOutcome(e);
}
}
@@ -209,11 +209,24 @@ public abstract class BaseDialogBean implements IDialogBean
}
/**
* The default message id to use in error messages
*
* @return The error message lookup id
*/
protected String getErrorMessageId()
{
return "error_generic";
return Repository.ERROR_GENERIC;
}
/**
* The outcome to return if the given exception occurs
*
* @param exception The exception that got thrown
* @return The error outcome, null by default
*/
protected String getErrorOutcome(Throwable exception)
{
return null;
}
/**

View File

@@ -31,17 +31,20 @@ public class MimeTypeSelectorGenerator extends BaseComponentGenerator
UIPropertySheet propertySheet, PropertySheetItem property,
PropertyDefinition propertyDef, UIComponent component)
{
if (property.getConverter() != null)
if (propertySheet.inEditMode() == false)
{
// create and add the custom converter
createAndSetConverter(context, property.getConverter(), component);
}
else
{
// if there isn't a custom converter add the mime type
// converter as a default
createAndSetConverter(context, MimeTypeConverter.CONVERTER_ID,
component);
if (property.getConverter() != null)
{
// create and add the custom converter
createAndSetConverter(context, property.getConverter(), component);
}
else
{
// if there isn't a custom converter add the mime type
// converter as a default
createAndSetConverter(context, MimeTypeConverter.CONVERTER_ID,
component);
}
}
}

View File

@@ -68,6 +68,7 @@ public final class Repository
public static final String ERROR_GENERIC = "error_generic";
public static final String ERROR_NOHOME = "error_homespace";
public static final String ERROR_SEARCH = "error_search";
public static final String ERROR_EXISTS = "error_exists";
private static final String METADATA_EXTACTER_REGISTRY = "metadataExtracterRegistry";
@@ -76,12 +77,6 @@ public final class Repository
/** cache of client StoreRef */
private static StoreRef storeRef = null;
/** reference to Person folder */
private static NodeRef peopleRef = null;
/** reference to System folder */
private static NodeRef systemRef = null;
/** reference to the NamespaceService */
private static NamespaceService namespaceService = null;

View File

@@ -76,8 +76,7 @@ public class CreateRuleWizard extends BaseActionWizard
protected static final String CONDITION_PAGES_LOCATION = "/jsp/rules/";
private static final Log logger = LogFactory.getLog(CreateRuleWizard.class);
// ------------------------------------------------------------------------------
// Wizard implementation
@@ -209,63 +208,7 @@ public class CreateRuleWizard extends BaseActionWizard
{
return "error_rule";
}
/**
* Sets up the given rule using the current state of the wizard
*
* @param context FacesContext
* @param rule The rule to setup
* @param outcome The default outcome
* @return The outcome
*/
protected String setupRule(FacesContext context, Rule rule, String outcome)
{
// setup the rule and add it to the space
rule.setTitle(this.title);
rule.setDescription(this.description);
rule.applyToChildren(this.applyToSubSpaces);
rule.setExecuteAsynchronously(this.runInBackground);
// add all the conditions to the rule
for (Map<String, Serializable> condParams : this.allConditionsProperties)
{
String conditionName = (String)condParams.get(PROP_CONDITION_NAME);
this.condition = conditionName;
this.currentConditionProperties = condParams;
Map<String, Serializable> repoCondParams = buildConditionParams();
// add the condition to the rule
ActionCondition condition = this.actionService.
createActionCondition(conditionName);
condition.setParameterValues(repoCondParams);
// specify whether the condition result should be inverted
Boolean not = (Boolean)condParams.get(PROP_CONDITION_NOT);
condition.setInvertCondition(((Boolean)not).booleanValue());
rule.addActionCondition(condition);
}
// add all the actions to the rule
for (Map<String, Serializable> actionParams : this.allActionsProperties)
{
// use the base class version of buildActionParams(), but for this we need
// to setup the currentActionProperties and action variables
String actionName = (String)actionParams.get(PROP_ACTION_NAME);
this.action = actionName;
this.currentActionProperties = actionParams;
Map<String, Serializable> repoActionParams = buildActionParams();
// add the action to the rule
Action action = this.actionService.createAction(actionName);
action.setParameterValues(repoActionParams);
rule.addAction(action);
}
return outcome;
}
// ------------------------------------------------------------------------------
// Bean Getters and Setters
@@ -680,6 +623,61 @@ public class CreateRuleWizard extends BaseActionWizard
// ------------------------------------------------------------------------------
// Helper methods
/**
* Sets up the given rule using the current state of the wizard
*
* @param context FacesContext
* @param rule The rule to setup
* @param outcome The default outcome
* @return The outcome
*/
protected String setupRule(FacesContext context, Rule rule, String outcome)
{
// setup the rule and add it to the space
rule.setTitle(this.title);
rule.setDescription(this.description);
rule.applyToChildren(this.applyToSubSpaces);
rule.setExecuteAsynchronously(this.runInBackground);
// add all the conditions to the rule
for (Map<String, Serializable> condParams : this.allConditionsProperties)
{
String conditionName = (String)condParams.get(PROP_CONDITION_NAME);
this.condition = conditionName;
this.currentConditionProperties = condParams;
Map<String, Serializable> repoCondParams = buildConditionParams();
// add the condition to the rule
ActionCondition condition = this.actionService.
createActionCondition(conditionName);
condition.setParameterValues(repoCondParams);
// specify whether the condition result should be inverted
Boolean not = (Boolean)condParams.get(PROP_CONDITION_NOT);
condition.setInvertCondition(((Boolean)not).booleanValue());
rule.addActionCondition(condition);
}
// add all the actions to the rule
for (Map<String, Serializable> actionParams : this.allActionsProperties)
{
// use the base class version of buildActionParams(), but for this we need
// to setup the currentActionProperties and action variables
String actionName = (String)actionParams.get(PROP_ACTION_NAME);
this.action = actionName;
this.currentActionProperties = actionParams;
Map<String, Serializable> repoActionParams = buildActionParams();
// add the action to the rule
Action action = this.actionService.createAction(actionName);
action.setParameterValues(repoActionParams);
rule.addAction(action);
}
return outcome;
}
/**
* Sets up any default state required by the UI for collecting the
* condition settings. The view id to use for the condition UI can also

View File

@@ -46,31 +46,8 @@ public class EditRuleWizard extends CreateRuleWizard
{
private static final Log logger = LogFactory.getLog(EditRuleWizard.class);
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// get hold of the space the rule will apply to and make sure
// it is actionable
Node currentSpace = browseBean.getActionSpace();
// get the existing rule
Rule rule = this.rulesBean.getCurrentRule();
// remove all the conditions and actions from the current rule
rule.removeAllActionConditions();
rule.removeAllActions();
// re-setup the rule
outcome = setupRule(context, rule, outcome);
// Save the rule
this.ruleService.saveRule(currentSpace.getNodeRef(), rule);
if (logger.isDebugEnabled())
logger.debug("Updated rule '" + this.title + "'");
return outcome;
}
// ------------------------------------------------------------------------------
// Wizard implementation
@Override
public void init()
@@ -133,6 +110,35 @@ public class EditRuleWizard extends CreateRuleWizard
this.action = null;
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// get hold of the space the rule will apply to and make sure
// it is actionable
Node currentSpace = browseBean.getActionSpace();
// get the existing rule
Rule rule = this.rulesBean.getCurrentRule();
// remove all the conditions and actions from the current rule
rule.removeAllActionConditions();
rule.removeAllActions();
// re-setup the rule
outcome = setupRule(context, rule, outcome);
// Save the rule
this.ruleService.saveRule(currentSpace.getNodeRef(), rule);
if (logger.isDebugEnabled())
logger.debug("Updated rule '" + this.title + "'");
return outcome;
}
// ------------------------------------------------------------------------------
// Helper methods
/**
* Populates a Map of properties the wizard is expecting for the given condition
*

View File

@@ -654,7 +654,7 @@ public class CreateSpaceWizard extends BaseWizardBean
if (exception instanceof FileExistsException)
{
return MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), "error_exists"),
FacesContext.getCurrentInstance(), Repository.ERROR_EXISTS),
((FileExistsException)exception).getExisting().getName());
}
else

View File

@@ -22,6 +22,7 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.Application;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.component.UIListItem;
/**
@@ -225,14 +226,14 @@ public class EditSpaceDialog extends BaseDialogBean
if (exception instanceof FileExistsException)
{
return MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), "error_exists"),
FacesContext.getCurrentInstance(), Repository.ERROR_EXISTS),
((FileExistsException)exception).getExisting().getName());
}
else
{
return MessageFormat.format(Application.getMessage(
FacesContext.getCurrentInstance(), "error_space"),
((FileExistsException)exception).getExisting().getName());
exception.getMessage());
}
}
}

View File

@@ -37,6 +37,7 @@ public class UIMimeTypeSelector extends UISelectOne
{
UISelectItems items = (UISelectItems)context.getApplication().
createComponent("javax.faces.SelectItems");
items.setId(this.getId() + "_items");
items.setValue(createList());
// add the child component