UI related code/jsp fixes and cleanup to new ML space/dialog components.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5764 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-05-23 16:45:42 +00:00
parent 4e53d4b44d
commit e9e3fecbb9
18 changed files with 922 additions and 985 deletions

View File

@@ -103,6 +103,7 @@
<param name="id">#{actionContext.id}</param> <param name="id">#{actionContext.id}</param>
</params> </params>
</action> </action>
<!-- Edit document action to open using normal HTTP access or inline Edit if set --> <!-- Edit document action to open using normal HTTP access or inline Edit if set -->
<action id="edit_doc_http"> <action id="edit_doc_http">
<permissions> <permissions>

View File

@@ -29,7 +29,7 @@
<!-- Content and Space Dialogs --> <!-- Content and Space Dialogs -->
<!-- Definition of the create space dialog --> <!-- Definition of the create space dialog -->
<dialog name="createSpace" page="/jsp/spaces/create-space-dialog.jsp" managed-bean="CreateMultilingualSpaceDialog" <dialog name="createSpace" page="/jsp/spaces/create-space-dialog.jsp" managed-bean="CreateSpaceDialog"
icon="/images/icons/create_space_large.gif" title-id="create_space" icon="/images/icons/create_space_large.gif" title-id="create_space"
description-id="create_space_description" error-message-id="error_create_space_dialog" /> description-id="create_space_description" error-message-id="error_create_space_dialog" />

View File

@@ -473,4 +473,3 @@
</config> </config>
</alfresco-config> </alfresco-config>

View File

@@ -84,7 +84,6 @@ public class CreateMultilingualPropertiesBean
return this.newlanguage; return this.newlanguage;
} }
public void setUserPreferencesBean(UserPreferencesBean preferences) public void setUserPreferencesBean(UserPreferencesBean preferences)
{ {
this.preferences = preferences; this.preferences = preferences;
@@ -115,17 +114,16 @@ public class CreateMultilingualPropertiesBean
return this.description; return this.description;
} }
// Display the list of all multilingual properties // Display the list of all multilingual properties
public SelectItem[] getListAllDescriptionsProperties() public SelectItem[] getListAllDescriptionsProperties()
{ {
MLPropertyInterceptor.setMLAware(true); MLPropertyInterceptor.setMLAware(true);
BrowseBean browseBean = (BrowseBean) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "BrowseBean"); BrowseBean browseBean = (BrowseBean)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), BrowseBean.BEAN_NAME);
// create the space (just create a folder for now) // create the space (just create a folder for now)
NodeRef nodeRef = browseBean.getDocument().getNodeRef(); NodeRef nodeRef = browseBean.getDocument().getNodeRef();
if(nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null) if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null)
{ {
List<SelectItem> sel = new ArrayList<SelectItem>(); List<SelectItem> sel = new ArrayList<SelectItem>();
@@ -175,7 +173,7 @@ public class CreateMultilingualPropertiesBean
// create the space (just create a folder for now) // create the space (just create a folder for now)
NodeRef nodeRef = browseBean.getDocument().getNodeRef(); NodeRef nodeRef = browseBean.getDocument().getNodeRef();
if(nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null) if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null)
{ {
List<SelectItem> sel = new ArrayList<SelectItem>(); List<SelectItem> sel = new ArrayList<SelectItem>();
@@ -218,7 +216,15 @@ public class CreateMultilingualPropertiesBean
{ {
return preferences.getContentFilterLanguages(false); return preferences.getContentFilterLanguages(false);
} }
public boolean isAdd_new_properties() {return this.add_new_properties;}
public void setAdd_new_properties(boolean x){this.add_new_properties = x;} public boolean isAdd_new_properties()
{
return this.add_new_properties;
} }
public void setAdd_new_properties(boolean x)
{
this.add_new_properties = x;
}
}

View File

@@ -265,7 +265,6 @@ public class DocumentDetailsBean extends BaseDetailsBean
if (getDocument().hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT)) if (getDocument().hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT))
{ {
Map<Locale, NodeRef> translationsMap = this.multilingualContentService.getTranslations(getDocument().getNodeRef()); Map<Locale, NodeRef> translationsMap = this.multilingualContentService.getTranslations(getDocument().getNodeRef());
if (translationsMap != null && translationsMap.size() > 0) if (translationsMap != null && translationsMap.size() > 0)
@@ -282,7 +281,7 @@ public class DocumentDetailsBean extends BaseDetailsBean
String lgge = (locale != null) ? String lgge = (locale != null) ?
// convert the locale into new ISO codes // convert the locale into new ISO codes
contentFilterLanguagesService.convertToNewISOCode(locale.getLanguage()).toUpperCase() contentFilterLanguagesService.convertToNewISOCode(locale.getLanguage()).toUpperCase()
: null ; : null;
mapNode.put("name", nodeService.getProperty(nodeRef, ContentModel.PROP_NAME)); mapNode.put("name", nodeService.getProperty(nodeRef, ContentModel.PROP_NAME));
mapNode.put("language", lgge); mapNode.put("language", lgge);
@@ -789,7 +788,6 @@ public class DocumentDetailsBean extends BaseDetailsBean
return new Node(multilingualContentService.getTranslationContainer(nodeRef)); return new Node(multilingualContentService.getTranslationContainer(nodeRef));
} }
/** /**
* Sets the lock service instance the bean should use * Sets the lock service instance the bean should use
* *

View File

@@ -48,7 +48,6 @@ import org.alfresco.web.ui.common.Utils;
*/ */
public class AddTranslationWithoutContentDialog extends BaseDialogBean public class AddTranslationWithoutContentDialog extends BaseDialogBean
{ {
public static String LOCALE_REGEX = "%locale%"; public static String LOCALE_REGEX = "%locale%";
public static String EMPTY_DOCUMENT_EXTENSION = "." + LOCALE_REGEX + "_properties"; public static String EMPTY_DOCUMENT_EXTENSION = "." + LOCALE_REGEX + "_properties";
@@ -65,7 +64,6 @@ public class AddTranslationWithoutContentDialog extends BaseDialogBean
private String language; private String language;
@Override @Override
public void init(Map<String, String> parameters) public void init(Map<String, String> parameters)
{ {
@@ -76,7 +74,6 @@ public class AddTranslationWithoutContentDialog extends BaseDialogBean
description = null; description = null;
author = null; author = null;
language = null; language = null;
} }
@Override @Override
@@ -133,7 +130,6 @@ public class AddTranslationWithoutContentDialog extends BaseDialogBean
this.multilingualContentService = multilingualContentService; this.multilingualContentService = multilingualContentService;
} }
/** /**
* @return the author * @return the author
*/ */

View File

@@ -45,7 +45,6 @@ import org.alfresco.web.bean.repository.Node;
*/ */
public class AddTranslationlDialog extends AddContentDialog public class AddTranslationlDialog extends AddContentDialog
{ {
private MultilingualContentService multilingualContentService; private MultilingualContentService multilingualContentService;
private UserPreferencesBean userPreferencesBean; private UserPreferencesBean userPreferencesBean;
@@ -58,6 +57,7 @@ public class AddTranslationlDialog extends AddContentDialog
// languages available in the ML container yet // languages available in the ML container yet
private SelectItem[] unusedLanguages; private SelectItem[] unusedLanguages;
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.web.bean.content.AddContentDialog#init(java.util.Map) * @see org.alfresco.web.bean.content.AddContentDialog#init(java.util.Map)
*/ */
@@ -70,7 +70,6 @@ public class AddTranslationlDialog extends AddContentDialog
setMlContainer(this.browseBean.getDocument().getNodeRef()); setMlContainer(this.browseBean.getDocument().getNodeRef());
setFileName(null); setFileName(null);
unusedLanguages = null; unusedLanguages = null;
} }
/* (non-Javadoc) /* (non-Javadoc)
@@ -79,7 +78,6 @@ public class AddTranslationlDialog extends AddContentDialog
@Override @Override
protected String finishImpl(FacesContext context, String outcome) throws Exception protected String finishImpl(FacesContext context, String outcome) throws Exception
{ {
// add the new file to the repository // add the new file to the repository
outcome = super.finishImpl(context, outcome); outcome = super.finishImpl(context, outcome);
@@ -94,7 +92,6 @@ public class AddTranslationlDialog extends AddContentDialog
@Override @Override
protected String getDefaultFinishOutcome() protected String getDefaultFinishOutcome()
{ {
return "showDocDetails"; return "showDocDetails";
} }
@@ -149,15 +146,17 @@ public class AddTranslationlDialog extends AddContentDialog
{ {
type = nodeService.getType(mlContainer); type = nodeService.getType(mlContainer);
if(ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(type)){ if(ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(type))
{
this.mlContainer = mlContainer; this.mlContainer = mlContainer;
} }
else if(ContentModel.TYPE_CONTENT.equals(type) else if (ContentModel.TYPE_CONTENT.equals(type)
&& nodeService.hasAspect(mlContainer, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT)){ && nodeService.hasAspect(mlContainer, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT))
{
this.mlContainer = multilingualContentService.getTranslationContainer(mlContainer); this.mlContainer = multilingualContentService.getTranslationContainer(mlContainer);
} }
else{ else
{
this.mlContainer = null; this.mlContainer = null;
} }
} }
@@ -179,7 +178,6 @@ public class AddTranslationlDialog extends AddContentDialog
public SelectItem[] getUnusedLanguages() public SelectItem[] getUnusedLanguages()
{ {
if(unusedLanguages == null) if(unusedLanguages == null)
{ {
unusedLanguages = userPreferencesBean.getAvailablesContentFilterLanguages(getMlContainer(), false); unusedLanguages = userPreferencesBean.getAvailablesContentFilterLanguages(getMlContainer(), false);

View File

@@ -43,7 +43,6 @@ import org.alfresco.web.bean.repository.Node;
*/ */
public class EditMLContainerDialog extends BaseDialogBean public class EditMLContainerDialog extends BaseDialogBean
{ {
MultilingualContentService multilingualContentService; MultilingualContentService multilingualContentService;
private Node editableNode; private Node editableNode;
@@ -54,7 +53,6 @@ public class EditMLContainerDialog extends BaseDialogBean
super.init(parameters); super.init(parameters);
this.editableNode = initEditableNode(); this.editableNode = initEditableNode();
} }
@Override @Override
@@ -63,8 +61,6 @@ public class EditMLContainerDialog extends BaseDialogBean
return false; return false;
} }
@Override @Override
public String getFinishButtonLabel() public String getFinishButtonLabel()
{ {
@@ -105,7 +101,8 @@ public class EditMLContainerDialog extends BaseDialogBean
/** /**
* @return the editableNode * @return the editableNode
*/ */
public Node getEditableNode() { public Node getEditableNode()
{
return editableNode; return editableNode;
} }
@@ -135,6 +132,4 @@ public class EditMLContainerDialog extends BaseDialogBean
MultilingualContentService multilingualContentService) { MultilingualContentService multilingualContentService) {
this.multilingualContentService = multilingualContentService; this.multilingualContentService = multilingualContentService;
} }
} }

View File

@@ -46,7 +46,6 @@ import org.alfresco.web.bean.repository.Node;
*/ */
public class MakeMultilingualDialog extends BaseDialogBean public class MakeMultilingualDialog extends BaseDialogBean
{ {
private MultilingualContentService multilingualContentService; private MultilingualContentService multilingualContentService;
private UserPreferencesBean userPreferencesBean; private UserPreferencesBean userPreferencesBean;
@@ -71,6 +70,7 @@ public class MakeMultilingualDialog extends BaseDialogBean
// the node to edit // the node to edit
protected Node editableNode; protected Node editableNode;
@Override @Override
public void init(Map<String, String> parameters) public void init(Map<String, String> parameters)
{ {
@@ -82,7 +82,7 @@ public class MakeMultilingualDialog extends BaseDialogBean
NodeRef nodeRef = this.editableNode.getNodeRef(); NodeRef nodeRef = this.editableNode.getNodeRef();
// propose the author and the language of the content for the properties of the MLContainer // propose the author and the language of the content for the properties of the MLContainer
if(this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == true if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == true
&& this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR) != null) && this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR) != null)
{ {
setAuthor((String) this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR)); setAuthor((String) this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR));
@@ -92,7 +92,7 @@ public class MakeMultilingualDialog extends BaseDialogBean
setAuthor(""); setAuthor("");
} }
if(this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCALIZED) == true if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCALIZED) == true
&& this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE) != null) && this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE) != null)
{ {
setLanguage(((Locale) this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE)).toString()); setLanguage(((Locale) this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE)).toString());
@@ -133,7 +133,7 @@ public class MakeMultilingualDialog extends BaseDialogBean
// if the author of the node is not set, set it with the default author name of // if the author of the node is not set, set it with the default author name of
// the new ML Container // the new ML Container
String nodeAuthor = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR); String nodeAuthor = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR);
if(nodeAuthor == null || nodeAuthor.length() < 1) if (nodeAuthor == null || nodeAuthor.length() < 1)
nodeService.setProperty(nodeRef, ContentModel.PROP_AUTHOR, getAuthor()); nodeService.setProperty(nodeRef, ContentModel.PROP_AUTHOR, getAuthor());
// set properties of the ml container // set properties of the ml container
@@ -167,6 +167,7 @@ public class MakeMultilingualDialog extends BaseDialogBean
return "addTranslation"; return "addTranslation";
} }
} }
// close the dialog // close the dialog
return outcome; return outcome;
} }
@@ -252,7 +253,8 @@ public class MakeMultilingualDialog extends BaseDialogBean
* @return if the new translation must be added at the end of this dialog, * @return if the new translation must be added at the end of this dialog,
* this mode defines if the translation will be an empty document or not * this mode defines if the translation will be an empty document or not
*/ */
public String getAddingMode() { public String getAddingMode()
{
return addingMode; return addingMode;
} }
@@ -260,7 +262,8 @@ public class MakeMultilingualDialog extends BaseDialogBean
* @param addingMode if the new translation must be added at the end of this dialog, * @param addingMode if the new translation must be added at the end of this dialog,
* this mode defines if the translation will be an empty document or not * this mode defines if the translation will be an empty document or not
*/ */
public void setAddingMode(String addingMode) { public void setAddingMode(String addingMode)
{
this.addingMode = addingMode; this.addingMode = addingMode;
} }
@@ -282,7 +285,4 @@ public class MakeMultilingualDialog extends BaseDialogBean
{ {
this.userPreferencesBean = userPreferencesBean; this.userPreferencesBean = userPreferencesBean;
} }
} }

View File

@@ -29,7 +29,6 @@ import javax.faces.context.FacesContext;
import org.alfresco.web.app.AlfrescoNavigationHandler; import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.app.Application; import org.alfresco.web.app.Application;
public class CreateMultilingualPropertiesDialog extends CreateMultilingualPropertiesWizard public class CreateMultilingualPropertiesDialog extends CreateMultilingualPropertiesWizard
{ {
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
@@ -57,16 +56,10 @@ public class CreateMultilingualPropertiesDialog extends CreateMultilingualPrope
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
} }
protected String doPostCommitProcessing(FacesContext context, String outcome) protected String doPostCommitProcessing(FacesContext context, String outcome)
{ {
// do nothing by default, subclasses can override if necessary // do nothing by default, subclasses can override if necessary
return outcome; return outcome;
} }
} }

View File

@@ -64,7 +64,6 @@ public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
Serializable oTitle = nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE); Serializable oTitle = nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE);
Serializable oDescription = nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION); Serializable oDescription = nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION);
if(oTitle instanceof MLText) if(oTitle instanceof MLText)
{ {
title = (MLText) oTitle; title = (MLText) oTitle;
@@ -75,8 +74,6 @@ public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
title.addValue(I18NUtil.parseLocale(userPreferencesBean.getContentFilterLanguage()), oTitle.toString()); title.addValue(I18NUtil.parseLocale(userPreferencesBean.getContentFilterLanguage()), oTitle.toString());
} }
if(oDescription instanceof MLText) if(oDescription instanceof MLText)
{ {
description = (MLText) oDescription; description = (MLText) oDescription;
@@ -93,10 +90,9 @@ public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
properties.put(ContentModel.PROP_TITLE, title); properties.put(ContentModel.PROP_TITLE, title);
properties.put(ContentModel.PROP_DESCRIPTION, description); properties.put(ContentModel.PROP_DESCRIPTION, description);
// Ajout de l'aspect multilingue sur le titre // Ajout de l'aspect multilingue sur le titre
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, properties); this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, properties);
/* /*
MLText descriptionss = (MLText) nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION); MLText descriptionss = (MLText) nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION);
List<SelectItem> sel = new ArrayList(); List<SelectItem> sel = new ArrayList();
@@ -108,7 +104,7 @@ public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
SelectItem[] items = new SelectItem[sel.size()]; SelectItem[] items = new SelectItem[sel.size()];
sel.toArray(items); sel.toArray(items);
*/ */
// Modification du casting de l objet r<>cup<75>r<EFBFBD> des getters de MLText en Text // Modification du casting de l objet r<>cup<75>r<EFBFBD> des getters de MLText en Text
MLPropertyInterceptor.setMLAware(false); MLPropertyInterceptor.setMLAware(false);
} }
@@ -119,7 +115,6 @@ public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
{ {
} }
if (createMultilingualPropertiesBean.isAdd_new_properties()) if (createMultilingualPropertiesBean.isAdd_new_properties())
{ {
createMultilingualPropertiesBean.setTitle(""); createMultilingualPropertiesBean.setTitle("");
@@ -134,7 +129,6 @@ public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
} }
} }
/** /**
* @param preferences The UserPreferencesBean to set * @param preferences The UserPreferencesBean to set
*/ */

View File

@@ -53,8 +53,6 @@ public class CreateMultilingualSpaceDialog extends CreateMultilingualSpaceWizard
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME; return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
} }
protected String doPostCommitProcessing(FacesContext context, String outcome) protected String doPostCommitProcessing(FacesContext context, String outcome)
{ {
// do nothing by default, subclasses can override if necessary // do nothing by default, subclasses can override if necessary
@@ -68,7 +66,6 @@ public class CreateMultilingualSpaceDialog extends CreateMultilingualSpaceWizard
} }
} }
public void setCreateMultilingualPropertiesBean(CreateMultilingualPropertiesBean x) public void setCreateMultilingualPropertiesBean(CreateMultilingualPropertiesBean x)
{ {
this.createMultilingualPropertiesBean = x; this.createMultilingualPropertiesBean = x;
@@ -84,12 +81,9 @@ public class CreateMultilingualSpaceDialog extends CreateMultilingualSpaceWizard
this.edit=x; this.edit=x;
} }
private boolean edit; private boolean edit;
public CreateMultilingualPropertiesBean getCreateMultilingualPropertiesBean(){return this.createMultilingualPropertiesBean;} public CreateMultilingualPropertiesBean getCreateMultilingualPropertiesBean(){return this.createMultilingualPropertiesBean;}
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean; protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;
} }

View File

@@ -48,13 +48,10 @@ import org.alfresco.web.bean.UserPreferencesBean;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
public class CreateMultilingualSpaceWizard extends CreateSpaceWizard public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
{ {
protected boolean showOtherProperties = true; protected boolean showOtherProperties = true;
/** /**
* @return Determines whether the edit properties dialog should be * @return Determines whether the edit properties dialog should be
* shown when this one ends * shown when this one ends
@@ -72,14 +69,12 @@ public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
this.showOtherProperties = showOthers; this.showOtherProperties = showOthers;
} }
@Override @Override
protected String finishImpl(FacesContext context, String outcome) throws Exception protected String finishImpl(FacesContext context, String outcome) throws Exception
{ {
String newSpaceId = null; String newSpaceId = null;
CreateMultilingualPropertiesBean createMultilingualPropertiesBean = (CreateMultilingualPropertiesBean) FacesHelper.getManagedBean(context, "CreateMultilingualPropertiesBean"); CreateMultilingualPropertiesBean createMultilingualPropertiesBean = (CreateMultilingualPropertiesBean) FacesHelper.getManagedBean(context, "CreateMultilingualPropertiesBean");
if (this.createFrom.equals("scratch")) if (this.createFrom.equals("scratch"))
{ {
// create the space (just create a folder for now) // create the space (just create a folder for now)
@@ -96,19 +91,17 @@ public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
parentNodeRef = new NodeRef(Repository.getStoreRef(), nodeId); parentNodeRef = new NodeRef(Repository.getStoreRef(), nodeId);
} }
FileInfo fileInfo = fileFolderService.create(parentNodeRef, this.name, Repository.resolveToQName(this.spaceType)); FileInfo fileInfo = fileFolderService.create(parentNodeRef, this.name, Repository.resolveToQName(this.spaceType));
NodeRef nodeRef = fileInfo.getNodeRef(); NodeRef nodeRef = fileInfo.getNodeRef();
newSpaceId = nodeRef.getId(); newSpaceId = nodeRef.getId();
// apply the uifacets aspect - icon, title and description props // apply the uifacets aspect - icon, title and description props
Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(5); Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(2, 1.0f);
uiFacetsProps.put(ApplicationModel.PROP_ICON, this.icon); uiFacetsProps.put(ApplicationModel.PROP_ICON, this.icon);
// uiFacetsProps.put(ContentModel.PROP_TITLE, this.title); // uiFacetsProps.put(ContentModel.PROP_TITLE, this.title);
// uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description); // uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description);
// Ajout de l icone // Ajout de l icone
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps); this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps);
@@ -117,13 +110,14 @@ public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
this.nodeService.setProperty(nodeRef, ContentModel.PROP_TITLE, new MLText(language, this.title)); this.nodeService.setProperty(nodeRef, ContentModel.PROP_TITLE, new MLText(language, this.title));
this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, new MLText(language, this.description)); this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, new MLText(language, this.description));
// remember the created node // remember the created node
this.createdNode = nodeRef; this.createdNode = nodeRef;
// Passer le noeud en parametre afin de le recuperer dans un autre dialogue // Passer le noeud en parametre afin de le recuperer dans un autre dialogue
this.browseBean.setDocument(new Node(this.createdNode)); this.browseBean.setDocument(new Node(this.createdNode));
setTitle(""); setDescription(""); setName(""); setTitle("");
setDescription("");
setName("");
} }
else if (this.createFrom.equals("existing")) else if (this.createFrom.equals("existing"))
{ {
@@ -162,7 +156,6 @@ public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
newSpaceId = copiedNode.getId(); newSpaceId = copiedNode.getId();
// remember the created node // remember the created node
this.createdNode = copiedNode; this.createdNode = copiedNode;
} }
@@ -193,11 +186,9 @@ public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
} }
} }
return outcome; return outcome;
} }
/** /**
* @param preferences The UserPreferencesBean to set * @param preferences The UserPreferencesBean to set
*/ */
@@ -216,7 +207,6 @@ public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
} }
/** The user preferences bean reference */ /** The user preferences bean reference */
protected UserPreferencesBean preferences; protected UserPreferencesBean preferences;
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean; protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;

View File

@@ -249,7 +249,8 @@ public class CreateSpaceWizard extends BaseWizardBean
} }
} }
setTitle(""); setDescription(""); setTitle("");
setDescription("");
return outcome; return outcome;
} }

View File

@@ -321,16 +321,11 @@
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
pageSize="10" initialSortColumn="Name" initialSortDescending="false"> pageSize="10" initialSortColumn="Name" initialSortDescending="false">
<%-- Icon details view mode --%> <%-- Name and icon columns --%>
<a:column id="col20" primary="true" width="20" style="padding:2px;"> <a:column id="col21" primary="true" width="300" style="text-align:left">
<f:facet name="header"> <f:facet name="small-icon">
<h:outputText value=""/> <h:graphicImage url="/images/filetypes/_default.gif" width="16" height="16"/>
</f:facet> </f:facet>
<h:graphicImage url="/images/icons/space_small.gif" />
</a:column>
<%-- Name columns --%>
<a:column id="col21" width="300" style="text-align:left">
<f:facet name="header"> <f:facet name="header">
<a:sortLink label="#{msg.name}" value="Name" mode="case-insensitive" styleClass="header"/> <a:sortLink label="#{msg.name}" value="Name" mode="case-insensitive" styleClass="header"/>
</f:facet> </f:facet>
@@ -368,10 +363,11 @@
</tr> </tr>
</table> </table>
</a:panel> </a:panel>
<%-- Panel if the node has not the multinlingual aspect--%> <%-- Panel if the node has not the multinlingual aspect--%>
<a:panel label="#{msg.ml_content_info}" id="no-ml-info-panel" progressive="true" <a:panel label="#{msg.ml_content_info}" id="no-ml-info-panel" progressive="true"
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white"
rendered="#{DetailsBean.multilingual == false}" rendered="#{DocumentDetailsBean.multilingual == false}"
expanded='#{DocumentDetailsBean.panels["ml-info-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}"> expanded='#{DocumentDetailsBean.panels["ml-info-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
<h:outputText id="no-ml-msg" value="#{msg.not_multilingual}<br/><br/>" escape="false" /> <h:outputText id="no-ml-msg" value="#{msg.not_multilingual}<br/><br/>" escape="false" />
<%-- Actions add translation --%> <%-- Actions add translation --%>

View File

@@ -166,7 +166,7 @@
<f:facet name="header"> <f:facet name="header">
<h:outputText value=""/> <h:outputText value=""/>
</f:facet> </f:facet>
<h:graphicImage url="/images/icons/space_small.gif" /> <h:graphicImage url="/images/filetypes/_default.gif" />
</a:column> </a:column>
<%-- Name Columns --%> <%-- Name Columns --%>

View File

@@ -63,14 +63,14 @@ function validate()
<table cellpadding="2" cellspacing="2" border="0" width="100%"> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr> <tr>
<td colspan="3" class="wizardSectionHeading"> <td colspan="4" class="wizardSectionHeading">
</f:verbatim> </f:verbatim>
<h:outputText value="#{msg.properties}" /> <h:outputText value="#{msg.properties}" />
<f:verbatim> <f:verbatim>
</td> </td>
</tr> </tr>
<tr> <tr>
<td > <td>
</f:verbatim> </f:verbatim>
<f:verbatim> <f:verbatim>
</td> </td>
@@ -84,13 +84,13 @@ function validate()
<h:inputText id="title" value="#{CreateMultilingualPropertiesBean.title}" size="35" maxlength="1024" onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" /> <h:inputText id="title" value="#{CreateMultilingualPropertiesBean.title}" size="35" maxlength="1024" onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
<f:verbatim> <f:verbatim>
</td> </td>
<td> <td width=100%>
<f:verbatim> </f:verbatim>
<%-- existing properties --%> <%-- existing properties --%>
<h:selectOneMenu id="existingpropertiestitle" value="#{CreateMultilingualPropertiesBean.language}" style="width:150px" > <h:selectOneMenu id="existingpropertiestitle" value="#{CreateMultilingualPropertiesBean.language}" style="width:150px" >
<f:selectItems value="#{CreateMultilingualPropertiesBean.listAllTitlesProperties}" /> <f:selectItems value="#{CreateMultilingualPropertiesBean.listAllTitlesProperties}" />
</h:selectOneMenu> </h:selectOneMenu>
</f:verbatim> <f:verbatim>
</td> </td>
</tr> </tr>
@@ -107,41 +107,27 @@ function validate()
<f:verbatim> <f:verbatim>
</td> </td>
<td> <td>
<f:verbatim> </f:verbatim>
<%-- existing properties --%> <%-- existing properties --%>
<h:selectOneMenu id="existingproperties" value="#{CreateMultilingualPropertiesBean.language}" style="width:150px" > <h:selectOneMenu id="existingproperties" value="#{CreateMultilingualPropertiesBean.language}" style="width:150px" >
<f:selectItems value="#{CreateMultilingualPropertiesBean.listAllDescriptionsProperties}" /> <f:selectItems value="#{CreateMultilingualPropertiesBean.listAllDescriptionsProperties}" />
</h:selectOneMenu> </h:selectOneMenu>
</f:verbatim> <f:verbatim>
</td> </td>
</br>
</tr> </tr>
</table> </table>
</f:verbatim>
<table cellpadding="2" cellspacing="2" border="0" width="100%"> <table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr> <tr>
<td colspan="3" style="padding-left:22px"> <td>
</f:verbatim>
<h:outputText value="#{msg.properties_close}:" />
<td style="padding-left" >
<h:selectBooleanCheckbox value="#{CreateMultilingualPropertiesBean.add_new_properties}" id="editnewproperties" /> <h:selectBooleanCheckbox value="#{CreateMultilingualPropertiesBean.add_new_properties}" id="editnewproperties" />
<span style="vertical-align:20%"></span>
<h:outputText value=" " />
<h:selectOneMenu id="newlanguage" immediate="true" value="#{CreateMultilingualPropertiesBean.newlanguage}" style="width:80px" > <h:selectOneMenu id="newlanguage" immediate="true" value="#{CreateMultilingualPropertiesBean.newlanguage}" style="width:80px" >
<f:selectItems value="#{CreateMultilingualPropertiesBean.contentFilterLanguages}" /> <f:selectItems value="#{CreateMultilingualPropertiesBean.contentFilterLanguages}" />
</h:selectOneMenu> </h:selectOneMenu>
<f:verbatim>
<h:outputText value=" " />
<h:outputText value="#{msg.properties_close}" />
</td> </td>
</tr> </tr>
</table> </table>
</f:verbatim>

View File

@@ -32,47 +32,45 @@
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script> <script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
<script type="text/javascript"> <script type="text/javascript">
var finishButtonPressed = false; var finishButtonPressed = false;
window.onload = pageLoaded; window.onload = pageLoaded;
function pageLoaded() function pageLoaded()
{ {
document.getElementById("dialog:dialog-body:name").focus(); document.getElementById("dialog:dialog-body:name").focus();
document.getElementById("dialog").onsubmit = validate; document.getElementById("dialog").onsubmit = validate;
document.getElementById("dialog:finish-button").onclick = function() {finishButtonPressed = true; clear_dialog();} document.getElementById("dialog:finish-button").onclick = function() {finishButtonPressed = true; clear_dialog();}
checkButtonState(); checkButtonState();
} }
function checkButtonState() function checkButtonState()
{ {
if (document.getElementById("dialog:dialog-body:name").value.length == 0 ) if (document.getElementById("dialog:dialog-body:name").value.length == 0 )
{ {
document.getElementById("dialog:finish-button").disabled = true; document.getElementById("dialog:finish-button").disabled = true;
} }
else else
{ {
document.getElementById("dialog:finish-button").disabled = false; document.getElementById("dialog:finish-button").disabled = false;
} }
} }
function validate() function validate()
{ {
if (finishButtonPressed) if (finishButtonPressed)
{ {
finishButtonPressed = false; finishButtonPressed = false;
var retour = "";
var retour = ""; var val = document.getElementById("dialog:dialog-body:name");
var val = document.getElementById("dialog:dialog-body:name"); for(i=0;i < val.length;i++) if(val.charAt(i) != " ") {retour += val.charAt(i)}
for(i=0;i < val.length;i++) if(val.charAt(i) != " ") {retour += val.charAt(i)} return validateName(retour,
return validateName(retour, '</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" /><f:verbatim>', true);
'</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" /><f:verbatim>', }
true); else
} {
else return true;
{ }
return true; }
}
}
</script> </script>
@@ -136,38 +134,30 @@ onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState()
<f:verbatim> <f:verbatim>
</td> </td>
<td> <td>
<table border="0" cellpadding="0" cellspacing="0"><tr><td> <table border="0" cellpadding="0" cellspacing="0">
</f:verbatim> <tr>
<a:imagePickerRadioPanel id="space-icon" columns="6" spacing="4" value="#{DialogManager.bean.icon}" <td>
panelBorder="greyround" panelBgcolor="#F5F5F5"> </f:verbatim>
<a:listItems value="#{DialogManager.bean.icons}" /> <a:imagePickerRadioPanel id="space-icon" columns="6" spacing="4" value="#{DialogManager.bean.icon}"
</a:imagePickerRadioPanel> panelBorder="greyround" panelBgcolor="#F5F5F5">
<a:listItems value="#{DialogManager.bean.icons}" />
</a:imagePickerRadioPanel>
<f:verbatim>
</td>
</tr>
</table>
</td> </td>
</tr> </tr>
<tr>
<td></td><td colspan=2>
<td style="padding-left"> </f:verbatim>
<h:outputText value="#{msg.properties_close}:" /> <h:outputText value="#{msg.properties_close}:" style="padding-right:8px" />
<h:outputText value=" " />
<h:selectBooleanCheckbox value="#{CreateMultilingualSpaceDialog.edit}" id="Nedit" /> <h:selectBooleanCheckbox value="#{CreateMultilingualSpaceDialog.edit}" id="Nedit" />
</td>
<td>
<h:selectOneMenu id="newlanguage" immediate="true" value="#{CreateMultilingualPropertiesBean.newlanguage}" style="width:80px" > <h:selectOneMenu id="newlanguage" immediate="true" value="#{CreateMultilingualPropertiesBean.newlanguage}" style="width:80px" >
<f:selectItems value="#{CreateMultilingualPropertiesBean.contentFilterLanguages}" /> <f:selectItems value="#{CreateMultilingualPropertiesBean.contentFilterLanguages}" />
</h:selectOneMenu> </h:selectOneMenu>
</td> <f:verbatim>
</table>
</td> </td>
</tr> </tr>
</table> </table>
</f:verbatim>