mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -103,6 +103,7 @@
|
||||
<param name="id">#{actionContext.id}</param>
|
||||
</params>
|
||||
</action>
|
||||
|
||||
<!-- Edit document action to open using normal HTTP access or inline Edit if set -->
|
||||
<action id="edit_doc_http">
|
||||
<permissions>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
icon="/images/icons/make_ml_large.gif" title-id="make_multilingual"
|
||||
description-id="make_multilingual_description" error-message-id="error_make_multilingual_dialog" />
|
||||
|
||||
<!-- Definition of the add translation dialog dialog -->
|
||||
<!-- Definition of the add translation dialog dialog -->
|
||||
<dialog name="addTranslationWithoutContent" page="/jsp/ml/add-translation-without-content.jsp" managed-bean="AddTranslationWithoutContentDialog"
|
||||
icon="/images/icons/add_tranlsation_wc_large.gif" title-id="add_translation_wc"
|
||||
description-id="add_translation_wc_description" error-message-id="error_add_translation_wc_dialog" />
|
||||
@@ -29,7 +29,7 @@
|
||||
<!-- Content and Space Dialogs -->
|
||||
|
||||
<!-- 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"
|
||||
description-id="create_space_description" error-message-id="error_create_space_dialog" />
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
icon="/images/icons/create_space_large.gif" title-id="create_multilingual_space"
|
||||
description-id="create_multilingual_space_description" error-message-id="error_create_space_dialog" />
|
||||
|
||||
<!-- Definition of the create multilingual properties dialog -->
|
||||
<!-- Definition of the create multilingual properties dialog -->
|
||||
<dialog name="createMultilingualProperties" page="/jsp/spaces/ml/create-multilingual-properties-dialog.jsp" managed-bean="CreateMultilingualPropertiesDialog"
|
||||
icon="/images/icons/create_space_large.gif" title-id="create_multilingual_space"
|
||||
description-id="create_multilingual_space_description" error-message-id="error_create_multilingual_space_dialog" />
|
||||
|
@@ -308,16 +308,16 @@
|
||||
title-id="create_web_content_title" description-id="create_web_content_desc"
|
||||
icon="/images/icons/new_content_large.gif">
|
||||
<step name="details"
|
||||
title-id="create_web_content_details_title"
|
||||
description-id="create_content_step1_desc">
|
||||
title-id="create_web_content_details_title"
|
||||
description-id="create_content_step1_desc">
|
||||
<page path="/jsp/wcm/create-web-content-wizard/details.jsp"
|
||||
title-id="create_web_content_details_step_title"
|
||||
description-id="create_content_step1_desc"
|
||||
instruction-id="default_instruction" />
|
||||
</step>
|
||||
<step name="content"
|
||||
title-id="create_web_content_enter_content_title"
|
||||
description-id="create_content_step2_desc">
|
||||
title-id="create_web_content_enter_content_title"
|
||||
description-id="create_content_step2_desc">
|
||||
<condition if="#{CreateWebContentWizard.mimeType == 'text/html'}">
|
||||
<page path="/jsp/wcm/create-web-content-wizard/create-html.jsp"
|
||||
title-id="create_web_content_enter_content_step_title"
|
||||
@@ -338,11 +338,11 @@
|
||||
</step>
|
||||
<step name="summary" title-id="summary" description-id="summary_step_description">
|
||||
<condition if="#{CreateWebContentWizard.mimeType == 'text/xml'}">
|
||||
<page path="/jsp/wcm/create-web-content-wizard/summary.jsp"
|
||||
title-id="summary"
|
||||
description-id="create_web_content_summary_desc"
|
||||
instruction-id="content_finish_instruction" />
|
||||
</condition>
|
||||
<page path="/jsp/wcm/create-web-content-wizard/summary.jsp"
|
||||
title-id="summary"
|
||||
description-id="create_web_content_summary_desc"
|
||||
instruction-id="content_finish_instruction" />
|
||||
</condition>
|
||||
<page path="/jsp/wizard/summary.jsp"
|
||||
title-id="summary"
|
||||
description-id="summary_desc"
|
||||
@@ -472,5 +472,4 @@
|
||||
</wizards>
|
||||
</config>
|
||||
|
||||
</alfresco-config>
|
||||
|
||||
</alfresco-config>
|
@@ -42,183 +42,189 @@ import org.alfresco.web.app.servlet.FacesHelper;
|
||||
|
||||
public class CreateMultilingualPropertiesBean
|
||||
{
|
||||
/** binding with edit of Other Options */
|
||||
private String language = null;
|
||||
private String newlanguage = null;
|
||||
private String title = null;
|
||||
private String description = null;
|
||||
protected boolean add_new_properties = false;
|
||||
/** binding with edit of Other Options */
|
||||
private String language = null;
|
||||
private String newlanguage = null;
|
||||
private String title = null;
|
||||
private String description = null;
|
||||
protected boolean add_new_properties = false;
|
||||
|
||||
/** The NodeService to be used by the bean */
|
||||
protected NodeService nodeService;
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
/** The NodeService to be used by the bean */
|
||||
protected NodeService nodeService;
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
|
||||
|
||||
/**
|
||||
* @param nodeService The NodeService to set.
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public String getLanguage()
|
||||
{
|
||||
return this.language;
|
||||
}
|
||||
|
||||
public void setLanguage(String x)
|
||||
{
|
||||
this.language = x;
|
||||
Application.setLanguage(FacesContext.getCurrentInstance(), this.language);
|
||||
}
|
||||
|
||||
public void setNewlanguage(String x)
|
||||
{
|
||||
this.newlanguage = x;
|
||||
}
|
||||
|
||||
public String getNewlanguage()
|
||||
{
|
||||
return this.newlanguage;
|
||||
}
|
||||
|
||||
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
public UserPreferencesBean getUserPreferencesBean()
|
||||
{
|
||||
return preferences;
|
||||
}
|
||||
|
||||
public void setTitle(String x)
|
||||
{
|
||||
this.title = x;
|
||||
}
|
||||
|
||||
public void setDescription(String x)
|
||||
{
|
||||
this.description = x;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return this.description;
|
||||
}
|
||||
|
||||
|
||||
// Display the list of all multilingual properties
|
||||
public SelectItem[] getListAllDescriptionsProperties()
|
||||
{
|
||||
MLPropertyInterceptor.setMLAware(true);
|
||||
BrowseBean browseBean = (BrowseBean) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "BrowseBean");
|
||||
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef nodeRef = browseBean.getDocument().getNodeRef();
|
||||
|
||||
if(nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null)
|
||||
/**
|
||||
* @param nodeService The NodeService to set.
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
List<SelectItem> sel = new ArrayList<SelectItem>();
|
||||
|
||||
if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) instanceof MLText)
|
||||
{
|
||||
MLText descriptions = (MLText) nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION);
|
||||
|
||||
for(Map.Entry<Locale, String> description : descriptions.entrySet())
|
||||
{
|
||||
sel.add(new SelectItem(description.getKey().toString(), description.getValue().toString()));
|
||||
}
|
||||
|
||||
MLPropertyInterceptor.setMLAware(false);
|
||||
|
||||
// Create the table
|
||||
SelectItem[] items = new SelectItem[sel.size()];
|
||||
|
||||
// Copy into table
|
||||
sel.toArray(items);
|
||||
|
||||
if(sel.size() > 0)
|
||||
{
|
||||
return items;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
else
|
||||
|
||||
public String getLanguage()
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("")}; return elements;
|
||||
return this.language;
|
||||
}
|
||||
}
|
||||
|
||||
// Display the list of all multilingual properties
|
||||
public SelectItem[] getListAllTitlesProperties()
|
||||
{
|
||||
MLPropertyInterceptor.setMLAware(true);
|
||||
BrowseBean browseBean = (BrowseBean) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "BrowseBean");
|
||||
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef nodeRef = browseBean.getDocument().getNodeRef();
|
||||
|
||||
if(nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null)
|
||||
public void setLanguage(String x)
|
||||
{
|
||||
List<SelectItem> sel = new ArrayList<SelectItem>();
|
||||
|
||||
if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) instanceof MLText)
|
||||
{
|
||||
MLText descriptions = (MLText) nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE);
|
||||
|
||||
for(Map.Entry<Locale, String> description : descriptions.entrySet())
|
||||
{
|
||||
sel.add(new SelectItem(description.getKey().toString(), description.getValue()));
|
||||
}
|
||||
|
||||
MLPropertyInterceptor.setMLAware(false);
|
||||
// Create the table
|
||||
SelectItem[] items = new SelectItem[sel.size()];
|
||||
// Copy into table
|
||||
sel.toArray(items);
|
||||
|
||||
if(sel.size() > 0)
|
||||
{
|
||||
return items;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
this.language = x;
|
||||
Application.setLanguage(FacesContext.getCurrentInstance(), this.language);
|
||||
}
|
||||
else
|
||||
|
||||
public void setNewlanguage(String x)
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
this.newlanguage = x;
|
||||
}
|
||||
}
|
||||
|
||||
public SelectItem[] getContentFilterLanguages()
|
||||
{
|
||||
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 String getNewlanguage()
|
||||
{
|
||||
return this.newlanguage;
|
||||
}
|
||||
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
public UserPreferencesBean getUserPreferencesBean()
|
||||
{
|
||||
return preferences;
|
||||
}
|
||||
|
||||
public void setTitle(String x)
|
||||
{
|
||||
this.title = x;
|
||||
}
|
||||
|
||||
public void setDescription(String x)
|
||||
{
|
||||
this.description = x;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return this.description;
|
||||
}
|
||||
|
||||
// Display the list of all multilingual properties
|
||||
public SelectItem[] getListAllDescriptionsProperties()
|
||||
{
|
||||
MLPropertyInterceptor.setMLAware(true);
|
||||
BrowseBean browseBean = (BrowseBean)FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), BrowseBean.BEAN_NAME);
|
||||
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef nodeRef = browseBean.getDocument().getNodeRef();
|
||||
|
||||
if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null)
|
||||
{
|
||||
List<SelectItem> sel = new ArrayList<SelectItem>();
|
||||
|
||||
if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) instanceof MLText)
|
||||
{
|
||||
MLText descriptions = (MLText) nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION);
|
||||
|
||||
for(Map.Entry<Locale, String> description : descriptions.entrySet())
|
||||
{
|
||||
sel.add(new SelectItem(description.getKey().toString(), description.getValue().toString()));
|
||||
}
|
||||
|
||||
MLPropertyInterceptor.setMLAware(false);
|
||||
|
||||
// Create the table
|
||||
SelectItem[] items = new SelectItem[sel.size()];
|
||||
|
||||
// Copy into table
|
||||
sel.toArray(items);
|
||||
|
||||
if(sel.size() > 0)
|
||||
{
|
||||
return items;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("")}; return elements;
|
||||
}
|
||||
}
|
||||
|
||||
// Display the list of all multilingual properties
|
||||
public SelectItem[] getListAllTitlesProperties()
|
||||
{
|
||||
MLPropertyInterceptor.setMLAware(true);
|
||||
BrowseBean browseBean = (BrowseBean) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "BrowseBean");
|
||||
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef nodeRef = browseBean.getDocument().getNodeRef();
|
||||
|
||||
if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) != null)
|
||||
{
|
||||
List<SelectItem> sel = new ArrayList<SelectItem>();
|
||||
|
||||
if (nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION) instanceof MLText)
|
||||
{
|
||||
MLText descriptions = (MLText) nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE);
|
||||
|
||||
for(Map.Entry<Locale, String> description : descriptions.entrySet())
|
||||
{
|
||||
sel.add(new SelectItem(description.getKey().toString(), description.getValue()));
|
||||
}
|
||||
|
||||
MLPropertyInterceptor.setMLAware(false);
|
||||
// Create the table
|
||||
SelectItem[] items = new SelectItem[sel.size()];
|
||||
// Copy into table
|
||||
sel.toArray(items);
|
||||
|
||||
if(sel.size() > 0)
|
||||
{
|
||||
return items;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectItem[] elements = { new SelectItem("","")}; return elements;
|
||||
}
|
||||
}
|
||||
|
||||
public SelectItem[] getContentFilterLanguages()
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -262,32 +262,31 @@ public class DocumentDetailsBean extends BaseDetailsBean
|
||||
public List getTranslations()
|
||||
{
|
||||
List<MapNode> translations = new ArrayList<MapNode>();
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
for (Map.Entry entry : translationsMap.entrySet())
|
||||
{
|
||||
NodeRef nodeRef = (NodeRef) entry.getValue();
|
||||
|
||||
|
||||
// create a map node representation of the translation
|
||||
MapNode mapNode = new MapNode(nodeRef);
|
||||
|
||||
|
||||
Locale locale = (Locale) nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE);
|
||||
|
||||
|
||||
String lgge = (locale != null) ?
|
||||
// convert the locale into new ISO codes
|
||||
contentFilterLanguagesService.convertToNewISOCode(locale.getLanguage()).toUpperCase()
|
||||
: null ;
|
||||
: null;
|
||||
|
||||
mapNode.put("name", nodeService.getProperty(nodeRef, ContentModel.PROP_NAME));
|
||||
mapNode.put("language", lgge);
|
||||
mapNode.put("url", DownloadContentServlet.generateBrowserURL(nodeRef, mapNode.getName()));
|
||||
|
||||
|
||||
// add the client side version to the list
|
||||
translations.add(mapNode);
|
||||
}
|
||||
@@ -789,7 +788,6 @@ public class DocumentDetailsBean extends BaseDetailsBean
|
||||
return new Node(multilingualContentService.getTranslationContainer(nodeRef));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the lock service instance the bean should use
|
||||
*
|
||||
@@ -824,16 +822,16 @@ public class DocumentDetailsBean extends BaseDetailsBean
|
||||
* @param multilingualContentService the multilingualContentService to set
|
||||
*/
|
||||
public void setMultilingualContentService(
|
||||
MultilingualContentService multilingualContentService)
|
||||
MultilingualContentService multilingualContentService)
|
||||
{
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param contentFilterLanguagesService The ContentFilterLanguagesService to set.
|
||||
*/
|
||||
public void setContentFilterLanguagesService(ContentFilterLanguagesService contentFilterLanguagesService)
|
||||
{
|
||||
this.contentFilterLanguagesService = contentFilterLanguagesService;
|
||||
this.contentFilterLanguagesService = contentFilterLanguagesService;
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,6 @@ import org.alfresco.web.ui.common.Utils;
|
||||
*/
|
||||
public class AddTranslationWithoutContentDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
public static String LOCALE_REGEX = "%locale%";
|
||||
public static String EMPTY_DOCUMENT_EXTENSION = "." + LOCALE_REGEX + "_properties";
|
||||
|
||||
@@ -65,7 +64,6 @@ public class AddTranslationWithoutContentDialog extends BaseDialogBean
|
||||
private String language;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
@@ -76,7 +74,6 @@ public class AddTranslationWithoutContentDialog extends BaseDialogBean
|
||||
description = null;
|
||||
author = null;
|
||||
language = null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,7 +130,6 @@ public class AddTranslationWithoutContentDialog extends BaseDialogBean
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the author
|
||||
*/
|
||||
|
@@ -45,7 +45,6 @@ import org.alfresco.web.bean.repository.Node;
|
||||
*/
|
||||
public class AddTranslationlDialog extends AddContentDialog
|
||||
{
|
||||
|
||||
private MultilingualContentService multilingualContentService;
|
||||
private UserPreferencesBean userPreferencesBean;
|
||||
|
||||
@@ -58,6 +57,7 @@ public class AddTranslationlDialog extends AddContentDialog
|
||||
// languages available in the ML container yet
|
||||
private SelectItem[] unusedLanguages;
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @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());
|
||||
setFileName(null);
|
||||
unusedLanguages = null;
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -79,7 +78,6 @@ public class AddTranslationlDialog extends AddContentDialog
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
|
||||
// add the new file to the repository
|
||||
outcome = super.finishImpl(context, outcome);
|
||||
|
||||
@@ -94,7 +92,6 @@ public class AddTranslationlDialog extends AddContentDialog
|
||||
@Override
|
||||
protected String getDefaultFinishOutcome()
|
||||
{
|
||||
|
||||
return "showDocDetails";
|
||||
}
|
||||
|
||||
@@ -139,7 +136,7 @@ public class AddTranslationlDialog extends AddContentDialog
|
||||
* Set the Multilingual container where the translation will be associated.
|
||||
*
|
||||
* @param mlContainer mlContainer is a MLDocument, the the MLContainer will
|
||||
* become it's own MLContainer
|
||||
* become it's own MLContainer
|
||||
*/
|
||||
public void setMlContainer(NodeRef mlContainer)
|
||||
{
|
||||
@@ -149,15 +146,17 @@ public class AddTranslationlDialog extends AddContentDialog
|
||||
{
|
||||
type = nodeService.getType(mlContainer);
|
||||
|
||||
if(ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(type)){
|
||||
if(ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(type))
|
||||
{
|
||||
this.mlContainer = mlContainer;
|
||||
}
|
||||
else if(ContentModel.TYPE_CONTENT.equals(type)
|
||||
&& nodeService.hasAspect(mlContainer, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT)){
|
||||
|
||||
else if (ContentModel.TYPE_CONTENT.equals(type)
|
||||
&& nodeService.hasAspect(mlContainer, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT))
|
||||
{
|
||||
this.mlContainer = multilingualContentService.getTranslationContainer(mlContainer);
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
this.mlContainer = null;
|
||||
}
|
||||
}
|
||||
@@ -179,7 +178,6 @@ public class AddTranslationlDialog extends AddContentDialog
|
||||
|
||||
public SelectItem[] getUnusedLanguages()
|
||||
{
|
||||
|
||||
if(unusedLanguages == null)
|
||||
{
|
||||
unusedLanguages = userPreferencesBean.getAvailablesContentFilterLanguages(getMlContainer(), false);
|
||||
@@ -189,15 +187,15 @@ public class AddTranslationlDialog extends AddContentDialog
|
||||
}
|
||||
|
||||
public MultilingualContentService getMultilingualContentService()
|
||||
{
|
||||
return multilingualContentService;
|
||||
}
|
||||
{
|
||||
return multilingualContentService;
|
||||
}
|
||||
|
||||
public void setMultilingualContentService(
|
||||
MultilingualContentService multilingualContentService)
|
||||
{
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
public void setMultilingualContentService(
|
||||
MultilingualContentService multilingualContentService)
|
||||
{
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
|
||||
public UserPreferencesBean getUserPreferencesBean()
|
||||
{
|
||||
|
@@ -43,54 +43,50 @@ import org.alfresco.web.bean.repository.Node;
|
||||
*/
|
||||
public class EditMLContainerDialog extends BaseDialogBean
|
||||
{
|
||||
|
||||
MultilingualContentService multilingualContentService;
|
||||
|
||||
|
||||
private Node editableNode;
|
||||
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
|
||||
this.editableNode = initEditableNode();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "ok");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
// get the container node ref
|
||||
NodeRef container = editableNode.getNodeRef();
|
||||
|
||||
|
||||
// get the modified properties
|
||||
Map<String, Object> editProperties = this.editableNode.getProperties();
|
||||
|
||||
|
||||
// modify the properties of the container with the user modified properties
|
||||
for(Map.Entry<String, Object> entry : editProperties.entrySet())
|
||||
{
|
||||
QName qname = QName.createQName(entry.getKey());
|
||||
|
||||
|
||||
nodeService.setProperty(container, qname, (Serializable) entry.getValue());
|
||||
}
|
||||
|
||||
return outcome;
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init the editable Node
|
||||
*/
|
||||
@@ -99,25 +95,26 @@ public class EditMLContainerDialog extends BaseDialogBean
|
||||
return new Node(
|
||||
multilingualContentService.getTranslationContainer(
|
||||
this.browseBean.getDocument().getNodeRef())
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the editableNode
|
||||
*/
|
||||
public Node getEditableNode() {
|
||||
public Node getEditableNode()
|
||||
{
|
||||
return editableNode;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||
{
|
||||
this.browseBean.getDocument().reset();
|
||||
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean getters and setters
|
||||
|
||||
@@ -127,7 +124,7 @@ public class EditMLContainerDialog extends BaseDialogBean
|
||||
public MultilingualContentService getMultilingualContentService() {
|
||||
return multilingualContentService;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param multilingualContentService the multilingualContentService to set
|
||||
*/
|
||||
@@ -135,6 +132,4 @@ public class EditMLContainerDialog extends BaseDialogBean
|
||||
MultilingualContentService multilingualContentService) {
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -46,213 +46,215 @@ import org.alfresco.web.bean.repository.Node;
|
||||
*/
|
||||
public class MakeMultilingualDialog extends BaseDialogBean
|
||||
{
|
||||
private MultilingualContentService multilingualContentService;
|
||||
|
||||
private MultilingualContentService multilingualContentService;
|
||||
private UserPreferencesBean userPreferencesBean;
|
||||
|
||||
private UserPreferencesBean userPreferencesBean;
|
||||
/** if needed, add a new translation with content after this dialog closed */
|
||||
public static final String OPT_ADD_WITH_CONTENT = "ADD_WITH_CONTENT";
|
||||
/** if needed, add a new translation without content after this dialog closed */
|
||||
public static final String OPT_ADD_WITHOUT_CONTENT = "ADD_WITHOUT_CONTENT";
|
||||
|
||||
/** if needed, add a new translation with content after this dialog closed */
|
||||
public static final String OPT_ADD_WITH_CONTENT = "ADD_WITH_CONTENT";
|
||||
/** if needed, add a new translation without content after this dialog closed */
|
||||
public static final String OPT_ADD_WITHOUT_CONTENT = "ADD_WITHOUT_CONTENT";
|
||||
// The author is a mandatory properties
|
||||
private String author;
|
||||
|
||||
// The author is a mandatory properties
|
||||
private String author;
|
||||
// The langage of the node to make multilingual
|
||||
private String language;
|
||||
|
||||
// The langage of the node to make multilingual
|
||||
private String language;
|
||||
// set to true, a new translation will be added at the end of this dialog
|
||||
private boolean addTranslationAfter = true;
|
||||
|
||||
// set to true, a new translation will be added at the end of this dialog
|
||||
private boolean addTranslationAfter = true;
|
||||
// set if the new translation to add will be an empty document or not
|
||||
private String addingMode = OPT_ADD_WITH_CONTENT;
|
||||
|
||||
// set if the new translation to add will be an empty document or not
|
||||
private String addingMode = OPT_ADD_WITH_CONTENT;
|
||||
|
||||
// the node to edit
|
||||
protected Node editableNode;
|
||||
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
// setup the editable node
|
||||
this.editableNode = initEditableNode();
|
||||
|
||||
NodeRef nodeRef = this.editableNode.getNodeRef();
|
||||
|
||||
// propose the author and the language of the content for the properties of the MLContainer
|
||||
if(this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == true
|
||||
&& this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR) != null)
|
||||
{
|
||||
setAuthor((String) this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR));
|
||||
}
|
||||
else
|
||||
{
|
||||
setAuthor("");
|
||||
}
|
||||
|
||||
if(this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCALIZED) == true
|
||||
&& this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE) != null)
|
||||
{
|
||||
setLanguage(((Locale) this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE)).toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
setLanguage(null);
|
||||
}
|
||||
|
||||
addTranslationAfter = false;
|
||||
addingMode = OPT_ADD_WITH_CONTENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init the editable Node
|
||||
*/
|
||||
protected Node initEditableNode()
|
||||
{
|
||||
return new Node(this.browseBean.getDocument().getNodeRef());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#finishImpl(javax.faces.context.FacesContext, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
Locale loc = I18NUtil.parseLocale(getLanguage());
|
||||
|
||||
NodeRef nodeRef = this.editableNode.getNodeRef();
|
||||
|
||||
// make this node multilingual
|
||||
NodeRef mlContainer = multilingualContentService.makeTranslation(nodeRef, loc);
|
||||
|
||||
// set the local of the current node.
|
||||
nodeService.setProperty(nodeRef, ContentModel.PROP_LOCALE, getLanguage());
|
||||
|
||||
// if the author of the node is not set, set it with the default author name of
|
||||
// the new ML Container
|
||||
String nodeAuthor = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR);
|
||||
if(nodeAuthor == null || nodeAuthor.length() < 1)
|
||||
nodeService.setProperty(nodeRef, ContentModel.PROP_AUTHOR, getAuthor());
|
||||
|
||||
// set properties of the ml container
|
||||
nodeService.setProperty(mlContainer, ContentModel.PROP_AUTHOR, getAuthor());
|
||||
nodeService.setProperty(mlContainer, ContentModel.PROP_LOCALE, getLanguage());
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#doPostCommitProcessing(javax.faces.context.FacesContext, java.lang.String)
|
||||
*/
|
||||
@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();
|
||||
|
||||
// go to the set add translation dialog if asked
|
||||
// to otherwise just return
|
||||
if (this.addTranslationAfter)
|
||||
{
|
||||
if(addingMode.equalsIgnoreCase(OPT_ADD_WITHOUT_CONTENT))
|
||||
{
|
||||
return "dialog:addTranslationWithoutContent";
|
||||
}
|
||||
else
|
||||
{
|
||||
AddTranslationlDialog dialog = (AddTranslationlDialog) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "AddTranslationDialog");
|
||||
dialog.start(null);
|
||||
return "addTranslation";
|
||||
}
|
||||
}
|
||||
// close the dialog
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled()
|
||||
{
|
||||
return !(author != null && author.length() > 0 && language != null);
|
||||
}
|
||||
// the node to edit
|
||||
protected Node editableNode;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean getters and setters
|
||||
@Override
|
||||
public void init(Map<String, String> parameters)
|
||||
{
|
||||
super.init(parameters);
|
||||
|
||||
/**
|
||||
* Returns the node being edited
|
||||
*
|
||||
* @return The node being edited
|
||||
*/
|
||||
public Node getEditableNode()
|
||||
{
|
||||
return this.editableNode;
|
||||
}
|
||||
// setup the editable node
|
||||
this.editableNode = initEditableNode();
|
||||
|
||||
/**
|
||||
* @return the author of the new created MLContainer
|
||||
*/
|
||||
public String getAuthor()
|
||||
{
|
||||
return author;
|
||||
}
|
||||
NodeRef nodeRef = this.editableNode.getNodeRef();
|
||||
|
||||
/**
|
||||
* @param author the author of new created MLContainer
|
||||
*/
|
||||
public void setAuthor(String author)
|
||||
{
|
||||
this.author = author;
|
||||
}
|
||||
// propose the author and the language of the content for the properties of the MLContainer
|
||||
if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_AUTHOR) == true
|
||||
&& this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR) != null)
|
||||
{
|
||||
setAuthor((String) this.nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR));
|
||||
}
|
||||
else
|
||||
{
|
||||
setAuthor("");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return if a new translation must be added after this dialog closes
|
||||
*/
|
||||
public boolean isAddTranslationAfter()
|
||||
{
|
||||
return addTranslationAfter;
|
||||
}
|
||||
if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCALIZED) == true
|
||||
&& this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE) != null)
|
||||
{
|
||||
setLanguage(((Locale) this.nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE)).toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
setLanguage(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param addTranslationAfter set to true, a new translation will be added after this dialog closes
|
||||
*/
|
||||
public void setAddTranslationAfter(boolean addTranslationAfter)
|
||||
{
|
||||
this.addTranslationAfter = addTranslationAfter;
|
||||
}
|
||||
addTranslationAfter = false;
|
||||
addingMode = OPT_ADD_WITH_CONTENT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init the editable Node
|
||||
*/
|
||||
protected Node initEditableNode()
|
||||
{
|
||||
return new Node(this.browseBean.getDocument().getNodeRef());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#finishImpl(javax.faces.context.FacesContext, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
Locale loc = I18NUtil.parseLocale(getLanguage());
|
||||
|
||||
NodeRef nodeRef = this.editableNode.getNodeRef();
|
||||
|
||||
// make this node multilingual
|
||||
NodeRef mlContainer = multilingualContentService.makeTranslation(nodeRef, loc);
|
||||
|
||||
// set the local of the current node.
|
||||
nodeService.setProperty(nodeRef, ContentModel.PROP_LOCALE, getLanguage());
|
||||
|
||||
// if the author of the node is not set, set it with the default author name of
|
||||
// the new ML Container
|
||||
String nodeAuthor = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_AUTHOR);
|
||||
if (nodeAuthor == null || nodeAuthor.length() < 1)
|
||||
nodeService.setProperty(nodeRef, ContentModel.PROP_AUTHOR, getAuthor());
|
||||
|
||||
// set properties of the ml container
|
||||
nodeService.setProperty(mlContainer, ContentModel.PROP_AUTHOR, getAuthor());
|
||||
nodeService.setProperty(mlContainer, ContentModel.PROP_LOCALE, getLanguage());
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.bean.dialog.BaseDialogBean#doPostCommitProcessing(javax.faces.context.FacesContext, java.lang.String)
|
||||
*/
|
||||
@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();
|
||||
|
||||
// go to the set add translation dialog if asked
|
||||
// to otherwise just return
|
||||
if (this.addTranslationAfter)
|
||||
{
|
||||
if(addingMode.equalsIgnoreCase(OPT_ADD_WITHOUT_CONTENT))
|
||||
{
|
||||
return "dialog:addTranslationWithoutContent";
|
||||
}
|
||||
else
|
||||
{
|
||||
AddTranslationlDialog dialog = (AddTranslationlDialog) FacesHelper.getManagedBean(FacesContext.getCurrentInstance(), "AddTranslationDialog");
|
||||
dialog.start(null);
|
||||
return "addTranslation";
|
||||
}
|
||||
}
|
||||
|
||||
// close the dialog
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getFinishButtonDisabled()
|
||||
{
|
||||
return !(author != null && author.length() > 0 && language != null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the language of the translation
|
||||
*/
|
||||
public String getLanguage()
|
||||
{
|
||||
return language;
|
||||
}
|
||||
// ------------------------------------------------------------------------------
|
||||
// Bean getters and setters
|
||||
|
||||
/**
|
||||
* @param language the language of the translation
|
||||
*/
|
||||
public void setLanguage(String language)
|
||||
{
|
||||
this.language = language;
|
||||
}
|
||||
/**
|
||||
* Returns the node being edited
|
||||
*
|
||||
* @return The node being edited
|
||||
*/
|
||||
public Node getEditableNode()
|
||||
{
|
||||
return this.editableNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param editableNode the node will become a multilingual
|
||||
*/
|
||||
public void setEditableNode(Node editableNode)
|
||||
{
|
||||
this.editableNode = editableNode;
|
||||
}
|
||||
/**
|
||||
* @return the author of the new created MLContainer
|
||||
*/
|
||||
public String getAuthor()
|
||||
{
|
||||
return author;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param author the author of new created MLContainer
|
||||
*/
|
||||
public void setAuthor(String author)
|
||||
{
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return if a new translation must be added after this dialog closes
|
||||
*/
|
||||
public boolean isAddTranslationAfter()
|
||||
{
|
||||
return addTranslationAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param addTranslationAfter set to true, a new translation will be added after this dialog closes
|
||||
*/
|
||||
public void setAddTranslationAfter(boolean addTranslationAfter)
|
||||
{
|
||||
this.addTranslationAfter = addTranslationAfter;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the language of the translation
|
||||
*/
|
||||
public String getLanguage()
|
||||
{
|
||||
return language;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param language the language of the translation
|
||||
*/
|
||||
public void setLanguage(String language)
|
||||
{
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param editableNode the node will become a multilingual
|
||||
*/
|
||||
public void setEditableNode(Node editableNode)
|
||||
{
|
||||
this.editableNode = editableNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
public String getAddingMode() {
|
||||
public String getAddingMode()
|
||||
{
|
||||
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,
|
||||
* 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;
|
||||
}
|
||||
|
||||
@@ -273,16 +276,13 @@ public class MakeMultilingualDialog extends BaseDialogBean
|
||||
}
|
||||
|
||||
public void setMultilingualContentService(
|
||||
MultilingualContentService multilingualContentService)
|
||||
{
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
MultilingualContentService multilingualContentService)
|
||||
{
|
||||
this.multilingualContentService = multilingualContentService;
|
||||
}
|
||||
|
||||
public void setUserPreferencesBean(UserPreferencesBean userPreferencesBean)
|
||||
{
|
||||
this.userPreferencesBean = userPreferencesBean;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -29,44 +29,37 @@ import javax.faces.context.FacesContext;
|
||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||
import org.alfresco.web.app.Application;
|
||||
|
||||
|
||||
public class CreateMultilingualPropertiesDialog extends CreateMultilingualPropertiesWizard
|
||||
{
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "create_multilingual_space");
|
||||
}
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "create_multilingual_space");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultCancelOutcome()
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
|
||||
@Override
|
||||
protected String getDefaultCancelOutcome()
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
|
||||
|
||||
// return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultFinishOutcome()
|
||||
{
|
||||
// return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
|
||||
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||
{
|
||||
// do nothing by default, subclasses can override if necessary
|
||||
|
||||
return outcome;
|
||||
}
|
||||
// return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultFinishOutcome()
|
||||
{
|
||||
// return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
|
||||
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||
{
|
||||
// do nothing by default, subclasses can override if necessary
|
||||
return outcome;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -41,62 +41,58 @@ import org.alfresco.web.bean.UserPreferencesBean;
|
||||
|
||||
public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
|
||||
{
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
MLText title, description;
|
||||
|
||||
// bind to the bean
|
||||
CreateMultilingualPropertiesBean createMultilingualPropertiesBean = (CreateMultilingualPropertiesBean) FacesHelper.getManagedBean(context, "CreateMultilingualPropertiesBean");
|
||||
UserPreferencesBean userPreferencesBean = (UserPreferencesBean) FacesHelper.getManagedBean(context, "UserPreferencesBean");
|
||||
|
||||
if (this.createFrom.equals("scratch"))
|
||||
{
|
||||
MLText title, description;
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef nodeRef = this.browseBean.getDocument().getNodeRef();
|
||||
// Add aspect (PropertyMap is a extension of HashMap with key LOCALE)
|
||||
PropertyMap properties = new PropertyMap();
|
||||
|
||||
// bind to the bean
|
||||
CreateMultilingualPropertiesBean createMultilingualPropertiesBean = (CreateMultilingualPropertiesBean) FacesHelper.getManagedBean(context, "CreateMultilingualPropertiesBean");
|
||||
UserPreferencesBean userPreferencesBean = (UserPreferencesBean) FacesHelper.getManagedBean(context, "UserPreferencesBean");
|
||||
// Modification du casting de l objet r<>cup<75>r<EFBFBD> des getters de MLText en Text
|
||||
MLPropertyInterceptor.setMLAware(true);
|
||||
|
||||
if (this.createFrom.equals("scratch"))
|
||||
{
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef nodeRef = this.browseBean.getDocument().getNodeRef();
|
||||
// Add aspect (PropertyMap is a extension of HashMap with key LOCALE)
|
||||
PropertyMap properties = new PropertyMap();
|
||||
// MLText is a HashMap composed by key and description The Function addValue is the same that the function put() but the key is the Locale value
|
||||
Serializable oTitle = nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE);
|
||||
Serializable oDescription = nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION);
|
||||
|
||||
// Modification du casting de l objet r<>cup<75>r<EFBFBD> des getters de MLText en Text
|
||||
MLPropertyInterceptor.setMLAware(true);
|
||||
if(oTitle instanceof MLText)
|
||||
{
|
||||
title = (MLText) oTitle;
|
||||
}
|
||||
else
|
||||
{
|
||||
title = new MLText();
|
||||
title.addValue(I18NUtil.parseLocale(userPreferencesBean.getContentFilterLanguage()), oTitle.toString());
|
||||
}
|
||||
|
||||
// MLText is a HashMap composed by key and description The Function addValue is the same that the function put() but the key is the Locale value
|
||||
Serializable oTitle = nodeService.getProperty(nodeRef, ContentModel.PROP_TITLE);
|
||||
Serializable oDescription = nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION);
|
||||
if(oDescription instanceof MLText)
|
||||
{
|
||||
description = (MLText) oDescription;
|
||||
}
|
||||
else
|
||||
{
|
||||
description = new MLText();
|
||||
title.addValue(I18NUtil.parseLocale(userPreferencesBean.getContentFilterLanguage()), oDescription.toString());
|
||||
}
|
||||
|
||||
title.addValue(I18NUtil.parseLocale(createMultilingualPropertiesBean.getNewlanguage()), createMultilingualPropertiesBean.getTitle());
|
||||
description.addValue(I18NUtil.parseLocale(createMultilingualPropertiesBean.getNewlanguage()), createMultilingualPropertiesBean.getDescription());
|
||||
|
||||
if(oTitle instanceof MLText)
|
||||
{
|
||||
title = (MLText) oTitle;
|
||||
}
|
||||
else
|
||||
{
|
||||
title = new MLText();
|
||||
title.addValue(I18NUtil.parseLocale(userPreferencesBean.getContentFilterLanguage()), oTitle.toString());
|
||||
}
|
||||
properties.put(ContentModel.PROP_TITLE, title);
|
||||
properties.put(ContentModel.PROP_DESCRIPTION, description);
|
||||
|
||||
|
||||
|
||||
if(oDescription instanceof MLText)
|
||||
{
|
||||
description = (MLText) oDescription;
|
||||
}
|
||||
else
|
||||
{
|
||||
description = new MLText();
|
||||
title.addValue(I18NUtil.parseLocale(userPreferencesBean.getContentFilterLanguage()), oDescription.toString());
|
||||
}
|
||||
|
||||
title.addValue(I18NUtil.parseLocale(createMultilingualPropertiesBean.getNewlanguage()), createMultilingualPropertiesBean.getTitle());
|
||||
description.addValue(I18NUtil.parseLocale(createMultilingualPropertiesBean.getNewlanguage()), createMultilingualPropertiesBean.getDescription());
|
||||
|
||||
properties.put(ContentModel.PROP_TITLE, title);
|
||||
properties.put(ContentModel.PROP_DESCRIPTION, description);
|
||||
|
||||
|
||||
// Ajout de l'aspect multilingue sur le titre
|
||||
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, properties);
|
||||
/*
|
||||
// Ajout de l'aspect multilingue sur le titre
|
||||
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, properties);
|
||||
/*
|
||||
MLText descriptionss = (MLText) nodeService.getProperty(nodeRef, ContentModel.PROP_DESCRIPTION);
|
||||
|
||||
List<SelectItem> sel = new ArrayList();
|
||||
@@ -108,53 +104,51 @@ public class CreateMultilingualPropertiesWizard extends CreateSpaceWizard
|
||||
|
||||
SelectItem[] items = new SelectItem[sel.size()];
|
||||
sel.toArray(items);
|
||||
*/
|
||||
// Modification du casting de l objet r<>cup<75>r<EFBFBD> des getters de MLText en Text
|
||||
MLPropertyInterceptor.setMLAware(false);
|
||||
}
|
||||
else if (this.createFrom.equals("existing"))
|
||||
{
|
||||
}
|
||||
else if (this.createFrom.equals("template"))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
if (createMultilingualPropertiesBean.isAdd_new_properties())
|
||||
{
|
||||
createMultilingualPropertiesBean.setTitle("");
|
||||
createMultilingualPropertiesBean.setDescription("");
|
||||
createMultilingualPropertiesBean.setAdd_new_properties(false);
|
||||
|
||||
return "dialog:createMultilingualProperties";
|
||||
}
|
||||
else
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
|
||||
}
|
||||
*/
|
||||
// Modification du casting de l objet r<>cup<75>r<EFBFBD> des getters de MLText en Text
|
||||
MLPropertyInterceptor.setMLAware(false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param preferences The UserPreferencesBean to set
|
||||
*/
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
else if (this.createFrom.equals("existing"))
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the preferences of the user
|
||||
*/
|
||||
public UserPreferencesBean getUserPreferencesBean()
|
||||
else if (this.createFrom.equals("template"))
|
||||
{
|
||||
return preferences;
|
||||
}
|
||||
|
||||
if (createMultilingualPropertiesBean.isAdd_new_properties())
|
||||
{
|
||||
createMultilingualPropertiesBean.setTitle("");
|
||||
createMultilingualPropertiesBean.setDescription("");
|
||||
createMultilingualPropertiesBean.setAdd_new_properties(false);
|
||||
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;
|
||||
return "dialog:createMultilingualProperties";
|
||||
}
|
||||
else
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param preferences The UserPreferencesBean to set
|
||||
*/
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the preferences of the user
|
||||
*/
|
||||
public UserPreferencesBean getUserPreferencesBean()
|
||||
{
|
||||
return preferences;
|
||||
}
|
||||
|
||||
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;
|
||||
}
|
||||
|
||||
|
@@ -32,64 +32,58 @@ import org.alfresco.web.bean.CreateMultilingualPropertiesBean;
|
||||
|
||||
public class CreateMultilingualSpaceDialog extends CreateMultilingualSpaceWizard
|
||||
{
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
// ------------------------------------------------------------------------------
|
||||
// Wizard implementation
|
||||
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
@Override
|
||||
public String getFinishButtonLabel()
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "create_multilingual_space");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultCancelOutcome()
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultFinishOutcome()
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
|
||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||
{
|
||||
// do nothing by default, subclasses can override if necessary
|
||||
if(isEdit())
|
||||
{
|
||||
return Application.getMessage(FacesContext.getCurrentInstance(), "create_multilingual_space");
|
||||
return "dialog:createMultilingualProperties";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultCancelOutcome()
|
||||
else
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultFinishOutcome()
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
public void setCreateMultilingualPropertiesBean(CreateMultilingualPropertiesBean x)
|
||||
{
|
||||
this.createMultilingualPropertiesBean = x;
|
||||
}
|
||||
|
||||
public boolean isEdit()
|
||||
{
|
||||
return this.edit;
|
||||
}
|
||||
|
||||
public void setEdit(boolean x)
|
||||
{
|
||||
this.edit=x;
|
||||
}
|
||||
|
||||
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
||||
{
|
||||
// do nothing by default, subclasses can override if necessary
|
||||
if(isEdit())
|
||||
{
|
||||
return "dialog:createMultilingualProperties";
|
||||
}
|
||||
else
|
||||
{
|
||||
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
|
||||
}
|
||||
}
|
||||
private boolean edit;
|
||||
|
||||
public CreateMultilingualPropertiesBean getCreateMultilingualPropertiesBean(){return this.createMultilingualPropertiesBean;}
|
||||
|
||||
public void setCreateMultilingualPropertiesBean(CreateMultilingualPropertiesBean x)
|
||||
{
|
||||
this.createMultilingualPropertiesBean = x;
|
||||
}
|
||||
|
||||
public boolean isEdit()
|
||||
{
|
||||
return this.edit;
|
||||
}
|
||||
|
||||
public void setEdit(boolean x)
|
||||
{
|
||||
this.edit=x;
|
||||
}
|
||||
|
||||
|
||||
private boolean edit;
|
||||
|
||||
public CreateMultilingualPropertiesBean getCreateMultilingualPropertiesBean(){return this.createMultilingualPropertiesBean;}
|
||||
|
||||
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;
|
||||
|
||||
}
|
||||
|
||||
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;
|
||||
}
|
@@ -48,177 +48,167 @@ import org.alfresco.web.bean.UserPreferencesBean;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
|
||||
|
||||
public class CreateMultilingualSpaceWizard extends CreateSpaceWizard
|
||||
{
|
||||
protected boolean showOtherProperties = true;
|
||||
|
||||
protected boolean showOtherProperties = true;
|
||||
/**
|
||||
* @return Determines whether the edit properties dialog should be
|
||||
* shown when this one ends
|
||||
*/
|
||||
public boolean isShowOtherProperties()
|
||||
{
|
||||
return this.showOtherProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param showOthers Sets whether the edit properties dialog is shown
|
||||
*/
|
||||
public void setShowOtherProperties(boolean showOthers)
|
||||
{
|
||||
this.showOtherProperties = showOthers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Determines whether the edit properties dialog should be
|
||||
* shown when this one ends
|
||||
*/
|
||||
public boolean isShowOtherProperties()
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
String newSpaceId = null;
|
||||
CreateMultilingualPropertiesBean createMultilingualPropertiesBean = (CreateMultilingualPropertiesBean) FacesHelper.getManagedBean(context, "CreateMultilingualPropertiesBean");
|
||||
|
||||
if (this.createFrom.equals("scratch"))
|
||||
{
|
||||
return this.showOtherProperties;
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef parentNodeRef;
|
||||
|
||||
String nodeId = this.navigator.getCurrentNodeId();
|
||||
|
||||
if (nodeId == null)
|
||||
{
|
||||
parentNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
|
||||
}
|
||||
else
|
||||
{
|
||||
parentNodeRef = new NodeRef(Repository.getStoreRef(), nodeId);
|
||||
}
|
||||
|
||||
FileInfo fileInfo = fileFolderService.create(parentNodeRef, this.name, Repository.resolveToQName(this.spaceType));
|
||||
NodeRef nodeRef = fileInfo.getNodeRef();
|
||||
newSpaceId = nodeRef.getId();
|
||||
|
||||
// apply the uifacets aspect - icon, title and description props
|
||||
Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(2, 1.0f);
|
||||
|
||||
uiFacetsProps.put(ApplicationModel.PROP_ICON, this.icon);
|
||||
// uiFacetsProps.put(ContentModel.PROP_TITLE, this.title);
|
||||
// uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description);
|
||||
|
||||
// Ajout de l icone
|
||||
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps);
|
||||
|
||||
Locale language = I18NUtil.parseLocale(createMultilingualPropertiesBean.getNewlanguage());
|
||||
|
||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_TITLE, new MLText(language, this.title));
|
||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, new MLText(language, this.description));
|
||||
|
||||
// remember the created node
|
||||
this.createdNode = nodeRef;
|
||||
// Passer le noeud en parametre afin de le recuperer dans un autre dialogue
|
||||
this.browseBean.setDocument(new Node(this.createdNode));
|
||||
|
||||
setTitle("");
|
||||
setDescription("");
|
||||
setName("");
|
||||
}
|
||||
else if (this.createFrom.equals("existing"))
|
||||
{
|
||||
// copy the selected space and update the name, description and icon
|
||||
NodeRef sourceNode = this.existingSpaceId;
|
||||
NodeRef parentSpace = new NodeRef(Repository.getStoreRef(), this.navigator.getCurrentNodeId());
|
||||
|
||||
// copy from existing
|
||||
NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef();
|
||||
|
||||
Locale usrLocale = I18NUtil.parseLocale(getUserPreferencesBean().getContentFilterLanguage());
|
||||
|
||||
// also need to set the new title, description and icon properties
|
||||
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, new MLText(usrLocale, this.title));
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, new MLText(usrLocale, this.description));
|
||||
this.nodeService.setProperty(copiedNode, ApplicationModel.PROP_ICON, this.icon);
|
||||
|
||||
newSpaceId = copiedNode.getId();
|
||||
|
||||
// remember the created node
|
||||
this.createdNode = copiedNode;
|
||||
}
|
||||
else if (this.createFrom.equals("template"))
|
||||
{
|
||||
// copy the selected space and update the name, description and icon
|
||||
NodeRef sourceNode = new NodeRef(Repository.getStoreRef(), this.templateSpaceId);
|
||||
NodeRef parentSpace = new NodeRef(Repository.getStoreRef(), this.navigator.getCurrentNodeId());
|
||||
|
||||
// copy from the template
|
||||
NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef();
|
||||
// also need to set the new title, description and icon properties
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, this.title);
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description);
|
||||
this.nodeService.setProperty(copiedNode, ApplicationModel.PROP_ICON, this.icon);
|
||||
|
||||
newSpaceId = copiedNode.getId();
|
||||
|
||||
// remember the created node
|
||||
this.createdNode = copiedNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param showOthers Sets whether the edit properties dialog is shown
|
||||
*/
|
||||
public void setShowOtherProperties(boolean showOthers)
|
||||
// if the user selected to save the space as a template space copy the new
|
||||
// space to the templates folder
|
||||
if (this.saveAsTemplate)
|
||||
{
|
||||
this.showOtherProperties = showOthers;
|
||||
// get hold of the Templates node
|
||||
DynamicNamespacePrefixResolver namespacePrefixResolver = new DynamicNamespacePrefixResolver(null);
|
||||
namespacePrefixResolver.registerNamespace(NamespaceService.APP_MODEL_PREFIX, NamespaceService.APP_MODEL_1_0_URI);
|
||||
|
||||
String xpath = Application.getRootPath(FacesContext.getCurrentInstance()) + "/" +
|
||||
Application.getGlossaryFolderName(FacesContext.getCurrentInstance()) + "/" +
|
||||
Application.getSpaceTemplatesFolderName(FacesContext.getCurrentInstance());
|
||||
|
||||
NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
|
||||
List<NodeRef> templateNodeList = this.searchService.selectNodes(
|
||||
rootNodeRef,
|
||||
xpath, null, namespacePrefixResolver, false);
|
||||
if (templateNodeList.size() == 1)
|
||||
{
|
||||
// get the first item in the list as we from test above there is only one!
|
||||
NodeRef templateNode = templateNodeList.get(0);
|
||||
NodeRef sourceNode = new NodeRef(Repository.getStoreRef(), newSpaceId);
|
||||
// copy this to the template location
|
||||
fileFolderService.copy(sourceNode, templateNode, this.templateName);
|
||||
}
|
||||
}
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
String newSpaceId = null;
|
||||
CreateMultilingualPropertiesBean createMultilingualPropertiesBean = (CreateMultilingualPropertiesBean) FacesHelper.getManagedBean(context, "CreateMultilingualPropertiesBean");
|
||||
/**
|
||||
* @param preferences The UserPreferencesBean to set
|
||||
*/
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the preferences of the user
|
||||
*/
|
||||
public UserPreferencesBean getUserPreferencesBean()
|
||||
{
|
||||
return preferences;
|
||||
}
|
||||
|
||||
|
||||
if (this.createFrom.equals("scratch"))
|
||||
{
|
||||
// create the space (just create a folder for now)
|
||||
NodeRef parentNodeRef;
|
||||
|
||||
String nodeId = this.navigator.getCurrentNodeId();
|
||||
|
||||
if (nodeId == null)
|
||||
{
|
||||
parentNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
|
||||
}
|
||||
else
|
||||
{
|
||||
parentNodeRef = new NodeRef(Repository.getStoreRef(), nodeId);
|
||||
}
|
||||
|
||||
|
||||
FileInfo fileInfo = fileFolderService.create(parentNodeRef, this.name, Repository.resolveToQName(this.spaceType));
|
||||
NodeRef nodeRef = fileInfo.getNodeRef();
|
||||
newSpaceId = nodeRef.getId();
|
||||
|
||||
// apply the uifacets aspect - icon, title and description props
|
||||
Map<QName, Serializable> uiFacetsProps = new HashMap<QName, Serializable>(5);
|
||||
|
||||
uiFacetsProps.put(ApplicationModel.PROP_ICON, this.icon);
|
||||
// uiFacetsProps.put(ContentModel.PROP_TITLE, this.title);
|
||||
// uiFacetsProps.put(ContentModel.PROP_DESCRIPTION, this.description);
|
||||
|
||||
|
||||
// Ajout de l icone
|
||||
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, uiFacetsProps);
|
||||
|
||||
Locale language = I18NUtil.parseLocale(createMultilingualPropertiesBean.getNewlanguage());
|
||||
|
||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_TITLE, new MLText(language, this.title));
|
||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, new MLText(language, this.description));
|
||||
|
||||
|
||||
// remember the created node
|
||||
this.createdNode = nodeRef;
|
||||
// Passer le noeud en parametre afin de le recuperer dans un autre dialogue
|
||||
this.browseBean.setDocument(new Node(this.createdNode));
|
||||
|
||||
setTitle(""); setDescription(""); setName("");
|
||||
}
|
||||
else if (this.createFrom.equals("existing"))
|
||||
{
|
||||
// copy the selected space and update the name, description and icon
|
||||
NodeRef sourceNode = this.existingSpaceId;
|
||||
NodeRef parentSpace = new NodeRef(Repository.getStoreRef(), this.navigator.getCurrentNodeId());
|
||||
|
||||
// copy from existing
|
||||
NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef();
|
||||
|
||||
Locale usrLocale = I18NUtil.parseLocale(getUserPreferencesBean().getContentFilterLanguage());
|
||||
|
||||
// also need to set the new title, description and icon properties
|
||||
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, new MLText(usrLocale, this.title));
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, new MLText(usrLocale, this.description));
|
||||
this.nodeService.setProperty(copiedNode, ApplicationModel.PROP_ICON, this.icon);
|
||||
|
||||
newSpaceId = copiedNode.getId();
|
||||
|
||||
// remember the created node
|
||||
this.createdNode = copiedNode;
|
||||
}
|
||||
else if (this.createFrom.equals("template"))
|
||||
{
|
||||
// copy the selected space and update the name, description and icon
|
||||
NodeRef sourceNode = new NodeRef(Repository.getStoreRef(), this.templateSpaceId);
|
||||
NodeRef parentSpace = new NodeRef(Repository.getStoreRef(), this.navigator.getCurrentNodeId());
|
||||
|
||||
// copy from the template
|
||||
NodeRef copiedNode = this.fileFolderService.copy(sourceNode, parentSpace, this.name).getNodeRef();
|
||||
// also need to set the new title, description and icon properties
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_TITLE, this.title);
|
||||
this.nodeService.setProperty(copiedNode, ContentModel.PROP_DESCRIPTION, this.description);
|
||||
this.nodeService.setProperty(copiedNode, ApplicationModel.PROP_ICON, this.icon);
|
||||
|
||||
newSpaceId = copiedNode.getId();
|
||||
|
||||
|
||||
// remember the created node
|
||||
this.createdNode = copiedNode;
|
||||
}
|
||||
|
||||
// if the user selected to save the space as a template space copy the new
|
||||
// space to the templates folder
|
||||
if (this.saveAsTemplate)
|
||||
{
|
||||
// get hold of the Templates node
|
||||
DynamicNamespacePrefixResolver namespacePrefixResolver = new DynamicNamespacePrefixResolver(null);
|
||||
namespacePrefixResolver.registerNamespace(NamespaceService.APP_MODEL_PREFIX, NamespaceService.APP_MODEL_1_0_URI);
|
||||
|
||||
String xpath = Application.getRootPath(FacesContext.getCurrentInstance()) + "/" +
|
||||
Application.getGlossaryFolderName(FacesContext.getCurrentInstance()) + "/" +
|
||||
Application.getSpaceTemplatesFolderName(FacesContext.getCurrentInstance());
|
||||
|
||||
NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
|
||||
List<NodeRef> templateNodeList = this.searchService.selectNodes(
|
||||
rootNodeRef,
|
||||
xpath, null, namespacePrefixResolver, false);
|
||||
if (templateNodeList.size() == 1)
|
||||
{
|
||||
// get the first item in the list as we from test above there is only one!
|
||||
NodeRef templateNode = templateNodeList.get(0);
|
||||
NodeRef sourceNode = new NodeRef(Repository.getStoreRef(), newSpaceId);
|
||||
// copy this to the template location
|
||||
fileFolderService.copy(sourceNode, templateNode, this.templateName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param preferences The UserPreferencesBean to set
|
||||
*/
|
||||
public void setUserPreferencesBean(UserPreferencesBean preferences)
|
||||
{
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return the preferences of the user
|
||||
*/
|
||||
public UserPreferencesBean getUserPreferencesBean()
|
||||
{
|
||||
return preferences;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;
|
||||
/** The user preferences bean reference */
|
||||
protected UserPreferencesBean preferences;
|
||||
protected CreateMultilingualPropertiesBean createMultilingualPropertiesBean;
|
||||
}
|
||||
|
||||
|
@@ -249,7 +249,8 @@ public class CreateSpaceWizard extends BaseWizardBean
|
||||
}
|
||||
}
|
||||
|
||||
setTitle(""); setDescription("");
|
||||
setTitle("");
|
||||
setDescription("");
|
||||
|
||||
return outcome;
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<%--
|
||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
||||
|
||||
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
@@ -15,11 +15,11 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* As a special exception to the terms and conditions of version 2.0 of
|
||||
* the GPL, you may redistribute this Program in connection with Free/Libre
|
||||
* and Open Source Software ("FLOSS") applications as described in Alfresco's
|
||||
* FLOSS exception. You should have recieved a copy of the text describing
|
||||
* the FLOSS exception, and it is also available here:
|
||||
* http://www.alfresco.com/legal/licensing"
|
||||
--%>
|
||||
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
|
||||
@@ -39,44 +39,44 @@
|
||||
<f:view>
|
||||
<%
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
|
||||
|
||||
// set locale for JSF framework usage
|
||||
fc.getViewRoot().setLocale(Application.getLanguage(fc));
|
||||
%>
|
||||
|
||||
|
||||
<%-- load a bundle of properties with I18N strings --%>
|
||||
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
|
||||
|
||||
|
||||
<h:form acceptcharset="UTF-8" id="document-details">
|
||||
|
||||
|
||||
<%-- Main outer table --%>
|
||||
<table cellspacing="0" cellpadding="2">
|
||||
|
||||
|
||||
<%-- Title bar --%>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<%@ include file="../parts/titlebar.jsp" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<%-- Main area --%>
|
||||
<tr valign="top">
|
||||
<%-- Shelf --%>
|
||||
<td>
|
||||
<%@ include file="../parts/shelf.jsp" %>
|
||||
</td>
|
||||
|
||||
|
||||
<%-- Work Area --%>
|
||||
<td width="100%">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<%-- Breadcrumb --%>
|
||||
<%@ include file="../parts/breadcrumb.jsp" %>
|
||||
|
||||
|
||||
<%-- Status and Actions --%>
|
||||
<tr>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_4.gif)" width="4"></td>
|
||||
<td bgcolor="#dfe6ed">
|
||||
|
||||
|
||||
<%-- Status and Actions inner contents table --%>
|
||||
<%-- Generally this consists of an icon, textual summary and actions for the current object --%>
|
||||
<table cellspacing="4" cellpadding="0" width="100%">
|
||||
@@ -101,7 +101,7 @@
|
||||
</a:panel>
|
||||
<div class="mainSubText"><h:outputText id="doc-details" value="#{msg.documentdetails_description}" /></div>
|
||||
</td>
|
||||
|
||||
|
||||
<%-- Navigation --%>
|
||||
<td align=right>
|
||||
<a:actionLink id="act-prev" value="#{msg.previous_item}" image="/images/icons/nav_prev.gif" showLink="false" actionListener="#{DocumentDetailsBean.previousItem}" action="showDocDetails">
|
||||
@@ -117,24 +117,24 @@
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<%-- separator row with gradient shadow --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_7.gif" width="4" height="9"></td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/statuspanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/statuspanel_9.gif" width="4" height="9"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<%-- Error Messages --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width=4></td>
|
||||
<td>
|
||||
<%-- messages tag to show messages not handled by other specific message tags --%>
|
||||
<%-- messages tag to show messages not handled by other specific message tags --%>
|
||||
<a:errors message="" infoClass="statusWarningText" errorClass="statusErrorText" />
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width=4></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<%-- Details --%>
|
||||
<tr valign=top>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_4.gif)" width="4"></td>
|
||||
@@ -169,9 +169,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</a:panel>
|
||||
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
|
||||
<a:panel label="#{msg.view_links}" id="preview-panel" progressive="true"
|
||||
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white"
|
||||
expanded='#{DocumentDetailsBean.panels["preview-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
@@ -200,9 +200,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
</a:panel>
|
||||
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
|
||||
<h:panelGroup id="props-panel-facets">
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
|
||||
@@ -235,13 +235,13 @@
|
||||
</td>
|
||||
<td>
|
||||
<%-- properties for the doc --%>
|
||||
<r:propertySheetGrid id="document-props" value="#{DocumentDetailsBean.document}" var="documentProps"
|
||||
columns="1" mode="view" labelStyleClass="propertiesLabel"
|
||||
<r:propertySheetGrid id="document-props" value="#{DocumentDetailsBean.document}" var="documentProps"
|
||||
columns="1" mode="view" labelStyleClass="propertiesLabel"
|
||||
externalConfig="true" />
|
||||
<h:outputText id="no-inline-msg" value="<br/>#{msg.not_inline_editable}<br/><br/>"
|
||||
rendered="#{DocumentDetailsBean.inlineEditable == false}" escape="false" />
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="eval_inline">
|
||||
<a:actionLink id="make-inline" value="#{msg.allow_inline_editing}"
|
||||
<a:actionLink id="make-inline" value="#{msg.allow_inline_editing}"
|
||||
action="#{DocumentDetailsBean.applyInlineEditable}"
|
||||
rendered="#{DocumentDetailsBean.inlineEditable == false}" />
|
||||
</r:permissionEvaluator>
|
||||
@@ -272,7 +272,7 @@
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<r:propertySheetGrid id="document-props-locked" value="#{DocumentDetailsBean.document}" var="documentProps"
|
||||
<r:propertySheetGrid id="document-props-locked" value="#{DocumentDetailsBean.document}" var="documentProps"
|
||||
columns="1" mode="view" labelStyleClass="propertiesLabel" externalConfig="true" />
|
||||
<h:outputText id="no-inline-msg2" value="<br/>#{msg.not_inline_editable}<br/>"
|
||||
rendered="#{DocumentDetailsBean.inlineEditable == false}" escape="false" />
|
||||
@@ -281,97 +281,93 @@
|
||||
</tr>
|
||||
</table>
|
||||
</a:panel>
|
||||
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
<%-- Multlingual properties --%>
|
||||
<h:panelGroup id="ml-props-panel-facets">
|
||||
|
||||
<%-- Multlingual properties --%>
|
||||
<h:panelGroup id="ml-props-panel-facets">
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
|
||||
<a:actionLink id="titleLinkMl" value="#{msg.modify}" showLink="false" image="/images/icons/edit_properties.gif"
|
||||
action="dialog:editMlContainer" />
|
||||
</r:permissionEvaluator>
|
||||
</f:facet>
|
||||
</h:panelGroup>
|
||||
|
||||
<%-- Panel if the node has the multinlingual aspect--%>
|
||||
<a:panel label="#{msg.ml_content_info}" facetsId="ml-props-panel-facets" id="ml-info-panel" progressive="true"
|
||||
</h:panelGroup>
|
||||
|
||||
<%-- Panel if the node has the multinlingual aspect--%>
|
||||
<a:panel label="#{msg.ml_content_info}" facetsId="ml-props-panel-facets" id="ml-info-panel" progressive="true"
|
||||
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" rendered="#{DocumentDetailsBean.multilingual}"
|
||||
expanded='#{DocumentDetailsBean.panels["ml-info-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
|
||||
<%-- properties for Ml container --%>
|
||||
<div style="padding:4px"></div>
|
||||
<h:outputText value="#{msg.properties}" styleClass="nodeWorkflowInfoTitle" style="padding:20px;"/>
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
<r:propertySheetGrid id="ml-container-props-sheet" value="#{DocumentDetailsBean.documentMlContainer}"
|
||||
var="mlContainerProps" columns="1" labelStyleClass="propertiesLabel"
|
||||
|
||||
<%-- properties for Ml container --%>
|
||||
<div style="padding:4px"></div>
|
||||
<h:outputText value="#{msg.properties}" styleClass="nodeWorkflowInfoTitle" style="padding:20px;"/>
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
<r:propertySheetGrid id="ml-container-props-sheet" value="#{DocumentDetailsBean.documentMlContainer}"
|
||||
var="mlContainerProps" columns="1" labelStyleClass="propertiesLabel"
|
||||
externalConfig="true" cellpadding="2" cellspacing="2" mode="view"/>
|
||||
|
||||
|
||||
<div style="padding:8px"></div>
|
||||
|
||||
<a:panel label="#{msg.related_translations}" id="related-translation-panel" progressive="true"
|
||||
|
||||
|
||||
<div style="padding:8px"></div>
|
||||
|
||||
<a:panel label="#{msg.related_translations}" id="related-translation-panel" progressive="true"
|
||||
expanded='#{DocumentDetailsBean.panels["related-translation-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}" styleClass="nodeWorkflowInfoTitle">
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
<%-- list of translations --%>
|
||||
<a:richList id="TranslationList" viewMode="details" value="#{DocumentDetailsBean.translations}"
|
||||
var="r" styleClass="recordSet" headerStyleClass="recordSetHeader"
|
||||
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
||||
pageSize="10" initialSortColumn="Name" initialSortDescending="false">
|
||||
|
||||
<%-- Icon details view mode --%>
|
||||
<a:column id="col20" primary="true" width="20" style="padding:2px;">
|
||||
<f:facet name="header">
|
||||
<h:outputText value=""/>
|
||||
</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">
|
||||
<a:sortLink label="#{msg.name}" value="Name" mode="case-insensitive" styleClass="header"/>
|
||||
</f:facet>
|
||||
<a:actionLink id="view-name" value="#{r.name}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
<%-- Language columns --%>
|
||||
<a:column id="col22" width="50" style="text-align:left">
|
||||
<f:facet name="header">
|
||||
<a:sortLink label="#{msg.language}" value="language" mode="case-insensitive" styleClass="header"/>
|
||||
</f:facet>
|
||||
<a:actionLink id="view-language" value="#{r.language}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
<%-- view actions --%>
|
||||
<a:column id="col25" style="text-align: left">
|
||||
<f:facet name="header">
|
||||
<h:outputText value="#{msg.actions}"/>
|
||||
</f:facet>
|
||||
<a:actionLink id="view-link" value="#{msg.view}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
<a:dataPager styleClass="pager" />
|
||||
</a:richList>
|
||||
</a:panel>
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
<%-- list of translations --%>
|
||||
<a:richList id="TranslationList" viewMode="details" value="#{DocumentDetailsBean.translations}"
|
||||
var="r" styleClass="recordSet" headerStyleClass="recordSetHeader"
|
||||
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
||||
pageSize="10" initialSortColumn="Name" initialSortDescending="false">
|
||||
|
||||
<%-- Name and icon columns --%>
|
||||
<a:column id="col21" primary="true" width="300" style="text-align:left">
|
||||
<f:facet name="small-icon">
|
||||
<h:graphicImage url="/images/filetypes/_default.gif" width="16" height="16"/>
|
||||
</f:facet>
|
||||
<f:facet name="header">
|
||||
<a:sortLink label="#{msg.name}" value="Name" mode="case-insensitive" styleClass="header"/>
|
||||
</f:facet>
|
||||
<a:actionLink id="view-name" value="#{r.name}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
<%-- Language columns --%>
|
||||
<a:column id="col22" width="50" style="text-align:left">
|
||||
<f:facet name="header">
|
||||
<a:sortLink label="#{msg.language}" value="language" mode="case-insensitive" styleClass="header"/>
|
||||
</f:facet>
|
||||
<a:actionLink id="view-language" value="#{r.language}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
<%-- view actions --%>
|
||||
<a:column id="col25" style="text-align: left">
|
||||
<f:facet name="header">
|
||||
<h:outputText value="#{msg.actions}"/>
|
||||
</f:facet>
|
||||
<a:actionLink id="view-link" value="#{msg.view}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
<a:dataPager styleClass="pager" />
|
||||
</a:richList>
|
||||
</a:panel>
|
||||
<%-- Actions add translation --%>
|
||||
<table width="100%" cellspacing="2" cellpadding="15" border="0" align="center">
|
||||
<tr>
|
||||
<td>
|
||||
<a:actionLink id="act-add-trans-with-c" value="#{msg.add_translation}" action="addTranslation" actionListener="#{AddTranslationDialog.start}" showLink="true" image="/images/icons/add_tranlsation.gif" />
|
||||
<a:actionLink id="act-add-trans-with-c" value="#{msg.add_translation}" action="addTranslation" actionListener="#{AddTranslationDialog.start}" showLink="true" image="/images/icons/add_tranlsation.gif" />
|
||||
</td>
|
||||
<td>
|
||||
<a:actionLink id="act-add-trans-without-c" value="#{msg.add_translation_wc}" action="dialog:addTranslationWithoutContent" showLink="true" image="/images/icons/add_tranlsation_wc.gif" />
|
||||
<a:actionLink id="act-add-trans-without-c" value="#{msg.add_translation_wc}" action="dialog:addTranslationWithoutContent" showLink="true" image="/images/icons/add_tranlsation_wc.gif" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</a:panel>
|
||||
<%-- 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>
|
||||
|
||||
<%-- Panel if the node has not the multinlingual aspect--%>
|
||||
<a:panel label="#{msg.ml_content_info}" id="no-ml-info-panel" progressive="true"
|
||||
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}">
|
||||
<h:outputText id="no-ml-msg" value="#{msg.not_multilingual}<br/><br/>" escape="false" />
|
||||
<%-- Actions add translation --%>
|
||||
@@ -383,13 +379,13 @@
|
||||
</tr>
|
||||
</table>
|
||||
</a:panel>
|
||||
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
<h:panelGroup id="workflow-panel-facets">
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
|
||||
<a:actionLink id="titleLink2" value="#{msg.title_edit_simple_workflow}" showLink="false"
|
||||
<a:actionLink id="titleLink2" value="#{msg.title_edit_simple_workflow}" showLink="false"
|
||||
image="/images/icons/Change_details.gif" action="editSimpleWorkflow"
|
||||
rendered="#{DocumentDetailsBean.approveStepName != null}" />
|
||||
</r:permissionEvaluator>
|
||||
@@ -398,11 +394,11 @@
|
||||
<a:panel label="#{msg.workflows}" id="workflow-panel" facetsId="workflow-panel-facets" progressive="true"
|
||||
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white"
|
||||
expanded='#{DocumentDetailsBean.panels["workflow-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
<r:nodeWorkflowInfo id="workflow-info" value="#{DocumentDetailsBean.document}" />
|
||||
<r:nodeWorkflowInfo id="workflow-info" value="#{DocumentDetailsBean.document}" />
|
||||
</a:panel>
|
||||
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
|
||||
<h:panelGroup id="category-panel-facets">
|
||||
<f:facet name="title">
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write">
|
||||
@@ -414,33 +410,33 @@
|
||||
<a:panel label="#{msg.category}" id="category-panel" facetsId="category-panel-facets" progressive="true"
|
||||
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" rendered="#{DocumentDetailsBean.categorised}"
|
||||
expanded='#{DocumentDetailsBean.panels["category-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
<h:outputText id="category-overview" value="#{DocumentDetailsBean.categoriesOverviewHTML}"
|
||||
<h:outputText id="category-overview" value="#{DocumentDetailsBean.categoriesOverviewHTML}"
|
||||
escape="false" />
|
||||
</a:panel>
|
||||
<a:panel label="#{msg.category}" id="no-category-panel" progressive="true"
|
||||
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white"
|
||||
rendered="#{DocumentDetailsBean.categorised == false}"
|
||||
expanded='#{DocumentDetailsBean.panels["category-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
<h:outputText id="no-category-msg" value="#{msg.not_in_category}<br/><br/>"
|
||||
<h:outputText id="no-category-msg" value="#{msg.not_in_category}<br/><br/>"
|
||||
escape="false"/>
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="eval_cat">
|
||||
<a:actionLink id="make-classifiable" value="#{msg.allow_categorization}"
|
||||
<a:actionLink id="make-classifiable" value="#{msg.allow_categorization}"
|
||||
action="#{DocumentDetailsBean.applyClassifiable}"
|
||||
rendered="#{DocumentDetailsBean.locked == false}" />
|
||||
</r:permissionEvaluator>
|
||||
</a:panel>
|
||||
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
|
||||
<a:panel label="#{msg.version_history}" id="version-history-panel" progressive="true"
|
||||
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" rendered="#{DocumentDetailsBean.versionable}"
|
||||
expanded='#{DocumentDetailsBean.panels["version-history-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
|
||||
<a:richList id="versionHistoryList" viewMode="details" value="#{DocumentDetailsBean.versionHistory}"
|
||||
var="r" styleClass="recordSet" headerStyleClass="recordSetHeader"
|
||||
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
||||
|
||||
<a:richList id="versionHistoryList" viewMode="details" value="#{DocumentDetailsBean.versionHistory}"
|
||||
var="r" styleClass="recordSet" headerStyleClass="recordSetHeader"
|
||||
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
|
||||
pageSize="10" initialSortColumn="versionLabel" initialSortDescending="false">
|
||||
|
||||
|
||||
<%-- Primary column for details view mode --%>
|
||||
<a:column id="col1" primary="true" width="100" style="padding:2px;text-align:left">
|
||||
<f:facet name="header">
|
||||
@@ -448,7 +444,7 @@
|
||||
</f:facet>
|
||||
<a:actionLink id="label" value="#{r.versionLabel}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
|
||||
<%-- Version notes columns --%>
|
||||
<a:column id="col2" width="200" style="text-align:left">
|
||||
<f:facet name="header">
|
||||
@@ -456,7 +452,7 @@
|
||||
</f:facet>
|
||||
<h:outputText id="notes" value="#{r.notes}" />
|
||||
</a:column>
|
||||
|
||||
|
||||
<%-- Description columns --%>
|
||||
<a:column id="col3" style="text-align:left">
|
||||
<f:facet name="header">
|
||||
@@ -464,7 +460,7 @@
|
||||
</f:facet>
|
||||
<h:outputText id="author" value="#{r.author}" />
|
||||
</a:column>
|
||||
|
||||
|
||||
<%-- Created Date column for details view mode --%>
|
||||
<a:column id="col4" style="text-align:left; white-space:nowrap">
|
||||
<f:facet name="header">
|
||||
@@ -474,7 +470,7 @@
|
||||
<a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />
|
||||
</h:outputText>
|
||||
</a:column>
|
||||
|
||||
|
||||
<%-- view the contents of the specific version --%>
|
||||
<a:column id="col5" style="text-align: left">
|
||||
<f:facet name="header">
|
||||
@@ -482,7 +478,7 @@
|
||||
</f:facet>
|
||||
<a:actionLink id="view-link" value="#{msg.view}" href="#{r.url}" target="new" />
|
||||
</a:column>
|
||||
|
||||
|
||||
<a:dataPager styleClass="pager" />
|
||||
</a:richList>
|
||||
</a:panel>
|
||||
@@ -493,14 +489,14 @@
|
||||
<h:outputText id="no-history-msg" value="#{msg.not_versioned}<br/><br/>" escape="false" />
|
||||
<r:permissionEvaluator value="#{DocumentDetailsBean.document}" allow="Write" id="eval_ver">
|
||||
<a:actionLink id="make-versionable" value="#{msg.allow_versioning}"
|
||||
action="#{DocumentDetailsBean.applyVersionable}"
|
||||
action="#{DocumentDetailsBean.applyVersionable}"
|
||||
rendered="#{DocumentDetailsBean.locked == false}" />
|
||||
</r:permissionEvaluator>
|
||||
</a:panel>
|
||||
</td>
|
||||
|
||||
|
||||
<td valign="top">
|
||||
|
||||
|
||||
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
|
||||
<table cellpadding="1" cellspacing="1" border="0" width="100%">
|
||||
<tr>
|
||||
@@ -510,9 +506,9 @@
|
||||
</tr>
|
||||
</table>
|
||||
<% PanelGenerator.generatePanelEnd(out, request.getContextPath(), "greyround"); %>
|
||||
|
||||
|
||||
<div style="padding:4px"></div>
|
||||
|
||||
|
||||
<%-- Document Actions --%>
|
||||
<a:panel label="#{msg.actions}" id="actions-panel" border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white" style="text-align:center"
|
||||
progressive="true" expanded='#{DocumentDetailsBean.panels["actions-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
|
||||
@@ -524,21 +520,21 @@
|
||||
</td>
|
||||
<td style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_6.gif)" width="4"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<%-- separator row with bottom panel graphics --%>
|
||||
<tr>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_7.gif" width="4" height="4"></td>
|
||||
<td width="100%" align="center" style="background-image: url(<%=request.getContextPath()%>/images/parts/whitepanel_8.gif)"></td>
|
||||
<td><img src="<%=request.getContextPath()%>/images/parts/whitepanel_9.gif" width="4" height="4"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</h:form>
|
||||
|
||||
|
||||
</f:view>
|
||||
|
||||
</r:page>
|
@@ -166,10 +166,10 @@
|
||||
<f:facet name="header">
|
||||
<h:outputText value=""/>
|
||||
</f:facet>
|
||||
<h:graphicImage url="/images/icons/space_small.gif" />
|
||||
<h:graphicImage url="/images/filetypes/_default.gif" />
|
||||
</a:column>
|
||||
|
||||
<%-- Name Columns --%>
|
||||
<%-- Name Columns --%>
|
||||
<a:column id="col21" width="300" style="text-align:left">
|
||||
<f:facet name="header">
|
||||
<a:sortLink label="#{msg.name}" value="Name" mode="case-insensitive" styleClass="header"/>
|
||||
|
@@ -63,14 +63,14 @@ function validate()
|
||||
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="3" class="wizardSectionHeading">
|
||||
<td colspan="4" class="wizardSectionHeading">
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.properties}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
@@ -84,13 +84,13 @@ function validate()
|
||||
<h:inputText id="title" value="#{CreateMultilingualPropertiesBean.title}" size="35" maxlength="1024" onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState();" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
<f:verbatim>
|
||||
<td width=100%>
|
||||
</f:verbatim>
|
||||
<%-- existing properties --%>
|
||||
<h:selectOneMenu id="existingpropertiestitle" value="#{CreateMultilingualPropertiesBean.language}" style="width:150px" >
|
||||
<f:selectItems value="#{CreateMultilingualPropertiesBean.listAllTitlesProperties}" />
|
||||
</h:selectOneMenu>
|
||||
</f:verbatim>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -107,41 +107,27 @@ function validate()
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
<f:verbatim>
|
||||
</f:verbatim>
|
||||
<%-- existing properties --%>
|
||||
<h:selectOneMenu id="existingproperties" value="#{CreateMultilingualPropertiesBean.language}" style="width:150px" >
|
||||
<f:selectItems value="#{CreateMultilingualPropertiesBean.listAllDescriptionsProperties}" />
|
||||
</h:selectOneMenu>
|
||||
</f:verbatim>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
|
||||
</br>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</f:verbatim>
|
||||
|
||||
<table cellpadding="2" cellspacing="2" border="0" width="100%">
|
||||
<tr>
|
||||
<td colspan="3" style="padding-left:22px">
|
||||
|
||||
|
||||
<td style="padding-left" >
|
||||
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.properties_close}:" />
|
||||
<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" >
|
||||
<f:selectItems value="#{CreateMultilingualPropertiesBean.contentFilterLanguages}" />
|
||||
</h:selectOneMenu>
|
||||
|
||||
<h:outputText value=" " />
|
||||
<h:outputText value="#{msg.properties_close}" />
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</f:verbatim>
|
@@ -32,47 +32,45 @@
|
||||
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/validation.js"> </script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var finishButtonPressed = false;
|
||||
window.onload = pageLoaded;
|
||||
|
||||
function pageLoaded()
|
||||
{
|
||||
document.getElementById("dialog:dialog-body:name").focus();
|
||||
document.getElementById("dialog").onsubmit = validate;
|
||||
document.getElementById("dialog:finish-button").onclick = function() {finishButtonPressed = true; clear_dialog();}
|
||||
checkButtonState();
|
||||
}
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("dialog:dialog-body:name").value.length == 0 )
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
|
||||
var retour = "";
|
||||
var val = document.getElementById("dialog:dialog-body:name");
|
||||
for(i=0;i < val.length;i++) if(val.charAt(i) != " ") {retour += val.charAt(i)}
|
||||
return validateName(retour,
|
||||
'</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" /><f:verbatim>',
|
||||
true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var finishButtonPressed = false;
|
||||
window.onload = pageLoaded;
|
||||
|
||||
function pageLoaded()
|
||||
{
|
||||
document.getElementById("dialog:dialog-body:name").focus();
|
||||
document.getElementById("dialog").onsubmit = validate;
|
||||
document.getElementById("dialog:finish-button").onclick = function() {finishButtonPressed = true; clear_dialog();}
|
||||
checkButtonState();
|
||||
}
|
||||
|
||||
function checkButtonState()
|
||||
{
|
||||
if (document.getElementById("dialog:dialog-body:name").value.length == 0 )
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("dialog:finish-button").disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
function validate()
|
||||
{
|
||||
if (finishButtonPressed)
|
||||
{
|
||||
finishButtonPressed = false;
|
||||
var retour = "";
|
||||
var val = document.getElementById("dialog:dialog-body:name");
|
||||
for(i=0;i < val.length;i++) if(val.charAt(i) != " ") {retour += val.charAt(i)}
|
||||
return validateName(retour,
|
||||
'</f:verbatim><a:outputText value="#{msg.validation_invalid_character}" /><f:verbatim>', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -136,38 +134,30 @@ onkeyup="javascript:checkButtonState();" onchange="javascript:checkButtonState()
|
||||
<f:verbatim>
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
|
||||
</f:verbatim>
|
||||
<a:imagePickerRadioPanel id="space-icon" columns="6" spacing="4" value="#{DialogManager.bean.icon}"
|
||||
panelBorder="greyround" panelBgcolor="#F5F5F5">
|
||||
<a:listItems value="#{DialogManager.bean.icons}" />
|
||||
</a:imagePickerRadioPanel>
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
</f:verbatim>
|
||||
<a:imagePickerRadioPanel id="space-icon" columns="6" spacing="4" value="#{DialogManager.bean.icon}"
|
||||
panelBorder="greyround" panelBgcolor="#F5F5F5">
|
||||
<a:listItems value="#{DialogManager.bean.icons}" />
|
||||
</a:imagePickerRadioPanel>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<td style="padding-left">
|
||||
<h:outputText value="#{msg.properties_close}:" />
|
||||
<h:outputText value=" " />
|
||||
<tr>
|
||||
<td></td><td colspan=2>
|
||||
</f:verbatim>
|
||||
<h:outputText value="#{msg.properties_close}:" style="padding-right:8px" />
|
||||
<h:selectBooleanCheckbox value="#{CreateMultilingualSpaceDialog.edit}" id="Nedit" />
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<h:selectOneMenu id="newlanguage" immediate="true" value="#{CreateMultilingualPropertiesBean.newlanguage}" style="width:80px" >
|
||||
<f:selectItems value="#{CreateMultilingualPropertiesBean.contentFilterLanguages}" />
|
||||
</h:selectOneMenu>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
<f:verbatim>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</f:verbatim>
|
Reference in New Issue
Block a user