Yannick Pignot (European Commission) multilingual services

- EditionService for versioning of groups of translations
 - Quite a bit of trimming of whitespace that I have no intention of undoing.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5927 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-13 01:13:25 +00:00
parent 9abfab20ab
commit 35c3659f14
27 changed files with 5891 additions and 4335 deletions

View File

@@ -38,8 +38,40 @@ related_content=Related Content
deep_copy=Deep Copy deep_copy=Deep Copy
new_edition=New Edition new_edition=New Edition
new_edition_from=New Edition from this new_edition_from=New Edition from this
new_edition_tooltip=Create a new edition from this multilingual content.
properties_close=Edit multilingual properties when the dialog close properties_close=Edit multilingual properties when the dialog close
pivot_translation=Pivot translation pivot_translation=Pivot translation
edition=Edition
editions=Editions
current=Current
new_edition_wizard_title=New Edition Wizard
new_edition_wizard_desc=This wizard helps you to create a new edition of a multilingual document.
error_new_edition_wizard=Impossible to create a new edition from this multilingual document.
step1_choose_translation=Starting item
step1_choose_translation_desc=Step one, select the starting item from the list of translations
new_edition_choose_translation_title=Step One - Starting item
new_edition_choose_translation_desc=Choose the content item you want to create the new edition.
step2_edition_details=Edition Details
step2_edition_details_desc=Step two, edit the detail of the new edition
new_edition_details_title=Step Two - Edition Details
new_edition_details_desc=Enter information about the new edition.
step3_edition_summary=Summary
step3_edition_summary_desc=Step three, view the summary of the new edition
new_edition_summary_title=Step Three - Summary
new_edition_summary_desc=The information you entered is shown below.
new_edition_finish_instruction=To close this wizard and apply your changes click Finish.
edition_properties=Edition Properties
edition_notes=Edition Notes
modify_translation_properties=Modify translation properties when this wizard finishes.
translation_title=Translation title
translation_language=Translation language
translation_author=Translation author
new_edition_details=New edition details
create_new_edition_using=Create a new edition using
translations_checked_out_error=Cannot create a new edition because the following translations are checked out.
available_translations=Available translations
# Date Pattern # Date Pattern
date_pattern=d MMMM yyyy date_pattern=d MMMM yyyy

View File

@@ -646,6 +646,17 @@
</params> </params>
</action> </action>
<!-- Manage ml container details -->
<action id="new_edition">
<permissions>
<permission allow="true">Write</permission>
</permissions>
<label-id>new_edition</label-id>
<tooltip-id>new_edition_tooltip</tooltip-id>
<image>/images/icons/new_edition_icon.gif</image>
<action>wizard:newEdition</action>
</action>
<!-- the 'action-group' elements define unique blocks of actions that reference the actions <!-- the 'action-group' elements define unique blocks of actions that reference the actions
as defined above and can override or supply display elements for the group of actions --> as defined above and can override or supply display elements for the group of actions -->
<!-- the component is responsible for making the context Node object available with name <!-- the component is responsible for making the context Node object available with name
@@ -762,6 +773,7 @@
<action-group id="multilingual_details_actions"> <action-group id="multilingual_details_actions">
<action idref="add_translation" /> <action idref="add_translation" />
<action idref="add_translation_wc" /> <action idref="add_translation_wc" />
<action idref="new_edition" />
</action-group> </action-group>
<!-- Actions Menu for Space Details screen --> <!-- Actions Menu for Space Details screen -->

View File

@@ -489,6 +489,37 @@
</step> </step>
</wizard> </wizard>
<!-- Definition of the Start Workflow wizard -->
<wizard name="newEdition" managed-bean="NewEditionWizard"
title-id="new_edition_wizard_title"
description-id="new_edition_wizard_desc"
error-message-id="error_new_edition_wizard"
icon="/images/icons/new_edition_large.gif">
<step name="choose-translation"
title-id="step1_choose_translation"
description-id="step1_choose_translation_desc">
<page path="/jsp/ml/new-edition-wizard/choose-translation.jsp"
title-id="new_edition_choose_translation_title"
description-id="new_edition_choose_translation_desc"
instruction-id="default_instruction" />
</step>
<step name="edition-details"
title-id="step2_edition_details"
description-id="step2_edition_details_desc">
<page path="/jsp/ml/new-edition-wizard/edition-details.jsp"
title-id="new_edition_details_title"
description-id="new_edition_details_desc"
instruction-id="default_instruction" />
</step>
<step name="edition-summary"
title-id="step3_edition_summary"
description-id="step3_edition_summary_desc">
<page path="/jsp/ml/new-edition-wizard/edition-summary.jsp"
title-id="new_edition_summary_title"
description-id="new_edition_summary_desc"
instruction-id="new_edition_finish_instruction" />
</step>
</wizard>
</wizards> </wizards>
</config> </config>

View File

@@ -39,7 +39,7 @@ import org.alfresco.web.bean.repository.Node;
* If the node is not already Multilingual, locked, or if a translation exists for each available * If the node is not already Multilingual, locked, or if a translation exists for each available
* filter language, don't allow the action. * filter language, don't allow the action.
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class AddTranslationEvaluator implements ActionEvaluator public class AddTranslationEvaluator implements ActionEvaluator
{ {

View File

@@ -38,7 +38,7 @@ import org.alfresco.web.bean.repository.Node;
* troublesome. Spreading translations of the same semantic message among several * troublesome. Spreading translations of the same semantic message among several
* spaces could lead to confusion and problems. * spaces could lead to confusion and problems.
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class CutNodeEvaluator implements ActionEvaluator public class CutNodeEvaluator implements ActionEvaluator
{ {

View File

@@ -37,7 +37,7 @@ import org.alfresco.web.bean.repository.Node;
* *
* If the node is already Multilingual don't allow the action. * If the node is already Multilingual don't allow the action.
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class MakeMultilingualEvaluator implements ActionEvaluator public class MakeMultilingualEvaluator implements ActionEvaluator
{ {

View File

@@ -33,7 +33,7 @@ import org.alfresco.web.bean.repository.Node;
* *
* The action is available only if the node is a translation. * The action is available only if the node is a translation.
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class MultilingualDetailsEvaluator implements ActionEvaluator public class MultilingualDetailsEvaluator implements ActionEvaluator
{ {

View File

@@ -28,6 +28,8 @@ import java.io.Serializable;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@@ -45,6 +47,7 @@ import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransacti
import org.alfresco.service.cmr.coci.CheckOutCheckInService; import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.lock.LockService; import org.alfresco.service.cmr.lock.LockService;
import org.alfresco.service.cmr.ml.ContentFilterLanguagesService; import org.alfresco.service.cmr.ml.ContentFilterLanguagesService;
import org.alfresco.service.cmr.ml.EditionService;
import org.alfresco.service.cmr.ml.MultilingualContentService; import org.alfresco.service.cmr.ml.MultilingualContentService;
import org.alfresco.service.cmr.repository.ContentData; import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
@@ -62,7 +65,6 @@ import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.Utils; import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.Utils.URLMode; import org.alfresco.web.ui.common.Utils.URLMode;
import org.alfresco.web.ui.common.component.UIActionLink; import org.alfresco.web.ui.common.component.UIActionLink;
/** /**
* Backing bean providing access to the details of a document * Backing bean providing access to the details of a document
* *
@@ -75,16 +77,20 @@ public class DocumentDetailsBean extends BaseDetailsBean
private static final String MSG_HAS_FOLLOWING_CATEGORIES = "has_following_categories"; private static final String MSG_HAS_FOLLOWING_CATEGORIES = "has_following_categories";
private static final String MSG_NO_CATEGORIES_APPLIED = "no_categories_applied"; private static final String MSG_NO_CATEGORIES_APPLIED = "no_categories_applied";
private static final String MSG_SUCCESS_UNLOCK = "success_unlock"; private static final String MSG_SUCCESS_UNLOCK = "success_unlock";
private static final String MSG_CURRENT = "current";
private static final String MSG_ERROR_ASPECT_INLINEEDITABLE = "error_aspect_inlineeditable"; private static final String MSG_ERROR_ASPECT_INLINEEDITABLE = "error_aspect_inlineeditable";
private static final String MSG_ERROR_ASPECT_VERSIONING = "error_aspect_versioning"; private static final String MSG_ERROR_ASPECT_VERSIONING = "error_aspect_versioning";
private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify"; private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify";
private static final String MSG_ERROR_UPDATE_CATEGORY = "error_update_category"; private static final String MSG_ERROR_UPDATE_CATEGORY = "error_update_category";
private static final String ML_VERSION_PANEL_ID = "ml-versions-panel";
protected LockService lockService; protected LockService lockService;
protected VersionService versionService; protected VersionService versionService;
protected CheckOutCheckInService cociService; protected CheckOutCheckInService cociService;
protected MultilingualContentService multilingualContentService; protected MultilingualContentService multilingualContentService;
protected ContentFilterLanguagesService contentFilterLanguagesService; protected ContentFilterLanguagesService contentFilterLanguagesService;
protected EditionService editionService;
private NodeRef addedCategory; private NodeRef addedCategory;
private List categories; private List categories;
@@ -200,6 +206,20 @@ public class DocumentDetailsBean extends BaseDetailsBean
return getDocument().hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT); return getDocument().hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
} }
/**
* Save the state of the panel that was expanded/collapsed
*/
public void expandPanel(ActionEvent event)
{
super.expandPanel(event);
String id = event.getComponent().getId();
if(id.startsWith(ML_VERSION_PANEL_ID))
{
this.currentEditionCursorPosition = Integer.parseInt(id.substring("ml-versions-panel".length())) - 1;
}
}
/** /**
* Returns a list of objects representing the versions of the * Returns a list of objects representing the versions of the
* current document * current document
@@ -237,26 +257,195 @@ public class DocumentDetailsBean extends BaseDetailsBean
} }
/** /**
* Returns a list of objects representing the editions of the * The comparator to sort a version list according their version label ascending
*
* TODO add this code in the repository as Version Util class ?
*/
private Comparator versionComparator = new Comparator()
{
public int compare(Object o1, Object o2)
{
String label01 = ((Version) o1).getVersionLabel();
String label02 = ((Version) o2).getVersionLabel();
// sort the list ascending
return label02.compareTo(label01);
}
};
/** List of client light weight edition histories */
private List<SingleEditionBean> editionHistory = null;
/** For the client side iteration on the edition hitories list, it represents the index of the list */
private int currentEditionCursorPosition;
/**
* For the client side iteration on the edition hitories list, returns the number of editions.
*
* @return the number of edition of the current mlContainer
*/
public int getEditionSize()
{
// return the size of the list
return editionHistory.size();
}
/**
* Init the mlContainer histories and returns an empty list to fill a rich list value without content.
*
* @return an empty list
*/
public List getEmptyListAndInitEditions()
{
// this call ensures that the edition of the mlContainer must be
// re-initialized.
// remove each old mlContainer's translations of the panel list
List<String> panelsToRemove = new ArrayList<String>();
for(Map.Entry<String, Boolean> panel : panels.entrySet())
{
if(panel.getKey().startsWith(ML_VERSION_PANEL_ID))
{
//panels.remove(panel.getKey());
panelsToRemove.add(panel.getKey());
}
}
for(String panelId : panelsToRemove)
{
panels.remove(panelId);
}
// init the Edition histories
initEditionHistory();
currentEditionCursorPosition = -1;
return new ArrayList(0);
}
/**
* For the client side iteration on the edition hitories list,
* return the next edition history.
*
* @return a light weight representation of an edition history
*/
public SingleEditionBean getNextSingleEditionBean()
{
currentEditionCursorPosition++;
return getCurrentSingleEditionBean();
}
/**
* For the client side iteration on the edition hitories list,
* return the current edition history.
*
* @return a light weight representation of an edition history
*/
public SingleEditionBean getCurrentSingleEditionBean()
{
return editionHistory.get(currentEditionCursorPosition);
}
/**
* Constructs a list of objects representing the editions of the
* logical document * logical document
* *
* @return List of editions * @return List of editions
*/ */
public List getEditionHistory() @SuppressWarnings("unchecked")
private List<SingleEditionBean> initEditionHistory()
{ {
List<MapNode> editions = new ArrayList<MapNode>(); // get the mlContainer
NodeRef mlContainer = getDocumentMlContainer().getNodeRef();
if (getDocument().getType().equals(ContentModel.TYPE_MULTILINGUAL_CONTAINER)) // get all editions and sort them ascending according their version label
List<Version> orderedEditionList = new ArrayList<Version>(editionService.getEditions(mlContainer).getAllVersions());
Collections.sort(orderedEditionList, versionComparator);
// the list of Single Edition Bean to return
editionHistory = new ArrayList<SingleEditionBean>(orderedEditionList.size());
boolean firstEdition = true;
// for each edition, init a SingleEditionBean
for (Version edition : orderedEditionList)
{ {
SingleEditionBean editionBean = new SingleEditionBean();
MapNode clientEdition = new MapNode(edition.getFrozenStateNodeRef());
String editionLabel = edition.getVersionLabel();
if (firstEdition)
{
editionLabel += " (" + Application.getMessage(FacesContext.getCurrentInstance(), MSG_CURRENT) + ")";
} }
return editions; clientEdition.put("editionLabel", editionLabel);
clientEdition.put("editionNotes", edition.getDescription());
clientEdition.put("editionAuthor", edition.getCreator());
clientEdition.put("editionDate", edition.getCreatedDate());
// Set the edition of the edition bean
editionBean.setEdition(clientEdition);
// get translations
List<VersionHistory> translationHistories = null;
if (firstEdition)
{
// Get the translations because the current edition doesn't content link with its
// translation in the version store.
Map<Locale, NodeRef> translations = multilingualContentService.getTranslations(mlContainer);
translationHistories = new ArrayList<VersionHistory>(translations.size());
for (NodeRef translation : translations.values())
{
translationHistories.add(versionService.getVersionHistory(translation));
}
}
else
{
translationHistories = editionService.getVersionedTranslations(edition);
}
// add each translation in the SingleEditionBean
for (VersionHistory versionHistory : translationHistories)
{
// get the list of versions and sort them ascending according their version label
List<Version> orderedVersions = new ArrayList<Version>(versionHistory.getAllVersions());
Collections.sort(orderedVersions, versionComparator);
// the last version is the first version of the list
Version lastVersion = orderedVersions.get(0);
// get the properties of the lastVersion
Map<QName, Serializable> lastVersionProperties = editionService.getVersionedMetadatas(lastVersion);
Locale language = (Locale) lastVersionProperties.get(ContentModel.PROP_LOCALE);
// create a map node representation of the last version
MapNode clientLastVersion = new MapNode(lastVersion.getFrozenStateNodeRef());
clientLastVersion.put("versionName", lastVersionProperties.get(ContentModel.PROP_NAME));
clientLastVersion.put("versionDescription", lastVersionProperties.get(ContentModel.PROP_DESCRIPTION));
clientLastVersion.put("versionAuthor", lastVersionProperties.get(ContentModel.PROP_AUTHOR));
clientLastVersion.put("versionCreatedDate", lastVersionProperties.get(ContentModel.PROP_CREATED));
clientLastVersion.put("versionModifiedDate", lastVersionProperties.get(ContentModel.PROP_MODIFIED));
clientLastVersion.put("versionLanguage", this.contentFilterLanguagesService.convertToNewISOCode(language.getLanguage()).toUpperCase());
clientLastVersion.put("versionUrl", DownloadContentServlet.generateBrowserURL(lastVersion.getFrozenStateNodeRef(), clientLastVersion.getName()));
// add a translation of the editionBean
editionBean.addTranslations(clientLastVersion);
}
editionHistory.add(editionBean);
firstEdition = false;
}
return editionHistory;
} }
/** /**
* Returns a list of objects representing the translations of the * Returns a list of objects representing the translations of the current document
* current document
* *
* @return List of translations * @return List of translations
*/ */
@@ -816,19 +1005,29 @@ public class DocumentDetailsBean extends BaseDetailsBean
} }
/** /**
* @param multilingualContentService the multilingualContentService to set * @param multilingualContentService the multilingual ContentService to set
*/ */
public void setMultilingualContentService( public void setMultilingualContentService(MultilingualContentService multilingualContentService)
MultilingualContentService multilingualContentService)
{ {
this.multilingualContentService = multilingualContentService; this.multilingualContentService = multilingualContentService;
} }
/** /**
* @param contentFilterLanguagesService The ContentFilterLanguagesService to set. * @param contentFilterLanguagesService The Content Filter Languages Service to set.
*/ */
public void setContentFilterLanguagesService(ContentFilterLanguagesService contentFilterLanguagesService) public void setContentFilterLanguagesService(ContentFilterLanguagesService contentFilterLanguagesService)
{ {
this.contentFilterLanguagesService = contentFilterLanguagesService; this.contentFilterLanguagesService = contentFilterLanguagesService;
} }
/**
* @param EditionService The Edition Service to set.
*/
public void setEditionService(EditionService editionService)
{
this.editionService = editionService;
}
} }

View File

@@ -0,0 +1,71 @@
package org.alfresco.web.bean;
import java.util.ArrayList;
import java.util.List;
import org.alfresco.web.bean.repository.MapNode;
/**
* Util class which represents a light weight representation of an edition history for the
* client side needs.
*
* @author pignoya
*/
public class SingleEditionBean
{
/** The edition in a list */
private List<MapNode> edition = null;
/** The translation list of the edition */
private List<MapNode> translations = null;
/**
* @return
*/
public String getEditionLabel()
{
return (String) this.getEdition().get(0).get("editionLabel");
}
/**
* @return the edition
*/
public List<MapNode> getEdition()
{
return edition;
}
/**
* @param edition the edition to set
*/
public void setEdition(MapNode edition)
{
this.edition = new ArrayList<MapNode>(1);
translations = null;
this.edition.add(edition);
}
/**
* @return the translations
*/
public List<MapNode> getTranslations()
{
return translations;
}
/**
* @param translation the translations to add to the list
*/
public void addTranslations(MapNode translation)
{
if(this.translations == null)
{
this.translations = new ArrayList<MapNode>();
}
this.translations.add(translation);
}
}

View File

@@ -41,7 +41,7 @@ import org.alfresco.web.ui.repo.converter.LanguageConverter;
/** /**
* Generates a LANGUAGE selector component. * Generates a LANGUAGE selector component.
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class LanguageSelectorGenerator extends BaseComponentGenerator public class LanguageSelectorGenerator extends BaseComponentGenerator
{ {

View File

@@ -45,7 +45,7 @@ import org.alfresco.service.cmr.repository.NodeService;
* The list of languages must contains the languages of each of this <b>non-empty</b> * The list of languages must contains the languages of each of this <b>non-empty</b>
* translations. * translations.
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class MlContainerLanguageSelectorGenerator extends LanguageSelectorGenerator public class MlContainerLanguageSelectorGenerator extends LanguageSelectorGenerator
{ {

View File

@@ -45,7 +45,7 @@ import org.alfresco.web.ui.common.Utils;
* Dialog bean to add a new translation without content. I means, a new node is created * Dialog bean to add a new translation without content. I means, a new node is created
* but it doesn't content the propertie <code>{http://www.alfresco.org/model/content/1.0}content</code> * but it doesn't content the propertie <code>{http://www.alfresco.org/model/content/1.0}content</code>
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class AddTranslationWithoutContentDialog extends BaseDialogBean public class AddTranslationWithoutContentDialog extends BaseDialogBean
{ {

View File

@@ -151,8 +151,7 @@ public class AddTranslationlDialog extends AddContentDialog
return multilingualContentService; return multilingualContentService;
} }
public void setMultilingualContentService( public void setMultilingualContentService(MultilingualContentService multilingualContentService)
MultilingualContentService multilingualContentService)
{ {
this.multilingualContentService = multilingualContentService; this.multilingualContentService = multilingualContentService;
} }

View File

@@ -39,7 +39,7 @@ import org.alfresco.web.bean.repository.Node;
/** /**
* Dialog bean to edit an existing multilingual container. * Dialog bean to edit an existing multilingual container.
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class EditMLContainerDialog extends BaseDialogBean public class EditMLContainerDialog extends BaseDialogBean
{ {

View File

@@ -42,7 +42,7 @@ import org.alfresco.web.bean.repository.Node;
/** /**
* Dialog bean to make a node multilingual * Dialog bean to make a node multilingual
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class MakeMultilingualDialog extends BaseDialogBean public class MakeMultilingualDialog extends BaseDialogBean
{ {

View File

@@ -0,0 +1,447 @@
/*
* 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
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* 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:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.ml;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.version.VersionModel;
import org.alfresco.service.cmr.lock.LockService;
import org.alfresco.service.cmr.lock.LockStatus;
import org.alfresco.service.cmr.ml.ContentFilterLanguagesService;
import org.alfresco.service.cmr.ml.EditionService;
import org.alfresco.service.cmr.ml.MultilingualContentService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.version.Version;
import org.alfresco.service.cmr.version.VersionType;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.wizard.BaseWizardBean;
/**
* Wizard bean to create a new edition from an existing MLContainer.
*
* @author yanipig
*/
public class NewEditionWizard extends BaseWizardBean
{
protected EditionService editionService;
protected MultilingualContentService multilingualContentService;
protected ContentFilterLanguagesService contentFilterLanguagesService;
protected LockService lockService;
protected NodeRef mlContainerToVersion;
private List<SelectItem> selectableTranslations;
private String startingItemNodeString;
private String editionNotes;
private boolean minorChange;
private boolean otherProperties;
private List<SelectItem> translationCheckedOut;
private String language;
private String title;
private String author;
private boolean hasTranslationCheckedOut;
private NodeRef startingElement;
@Override
public void init(Map<String, String> parameters)
{
super.init(parameters);
// reset the fileds
startingItemNodeString = null;
editionNotes = null;
minorChange = true;
otherProperties = false;
translationCheckedOut = null;
language = "lang";
title = "title";
author = "author";
selectableTranslations = null;
// set the mlContainer to version
NodeRef currentNodeRef = this.browseBean.getDocument().getNodeRef();
if(ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(nodeService.getType(currentNodeRef)))
{
mlContainerToVersion = currentNodeRef;
}
else
{
mlContainerToVersion = multilingualContentService.getTranslationContainer(currentNodeRef);
}
translationCheckedOut = getTranslationCheckedOut();
hasTranslationCheckedOut = getHasTranslationCheckedOut();
}
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
// fill the edition properties
Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(1, 1.0f);
versionProperties.put(Version.PROP_DESCRIPTION, editionNotes);
if (minorChange)
{
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MINOR);
}
else
{
versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR);
}
// create the edition and get the reference of the new starting translation
NodeRef newPivot = editionService.createEdition(startingElement, versionProperties);
if (otherProperties == true)
{
this.browseBean.setDocument(new Node(newPivot));
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + AlfrescoNavigationHandler.DIALOG_PREFIX + "setContentProperties";
}
else
{
outcome = AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "browse";
}
return outcome;
}
/**
* Determines whether there are any translation checked out.
*
* @return true if there are translation checked out
*/
public boolean getHasTranslationCheckedOut()
{
hasTranslationCheckedOut = getTranslationCheckedOut().size() > 0;
return hasTranslationCheckedOut;
}
@Override
public boolean getFinishButtonDisabled()
{
return super.getFinishButtonDisabled() || hasTranslationCheckedOut;
}
@Override
public boolean getNextButtonDisabled()
{
return super.getNextButtonDisabled() || hasTranslationCheckedOut;
}
/**
* Return the list of cecked out document found in the mlContainer.
*
* @return the list of checked out translation
*/
public List<SelectItem> getTranslationCheckedOut()
{
if(translationCheckedOut == null )
{
// first call, init the list
this.translationCheckedOut = new ArrayList<SelectItem>();
// get all translations of the mlContainer
Map<Locale, NodeRef> translations = multilingualContentService.getTranslations(mlContainerToVersion);
// fill the select itms
for(Map.Entry<Locale, NodeRef> entry : translations.entrySet())
{
NodeRef nodeRef = entry.getValue();
if(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_LOCKABLE))
{
LockStatus lockStatus = lockService.getLockStatus(nodeRef);
if (lockStatus != LockStatus.NO_LOCK)
{
// if the node is locked, add it to the locked translation list
String name = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
Locale lang = (Locale) nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE);
String lockOwner = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_WORKING_COPY_OWNER);
this.translationCheckedOut.add(new SelectItem(
"(" + lang.getLanguage() + ")",
name,
lockOwner
));
}
}
}
}
return this.translationCheckedOut;
}
/**
* Return the list of available translations to begin the starting translations of the new edition.
*
* @return the list of available translations
*/
public List<SelectItem> getSelectableTranslations()
{
if(selectableTranslations == null)
{
// first call, init the list
selectableTranslations = new ArrayList<SelectItem>();
// get all translations of the mlContainer
Map<Locale, NodeRef> translations = multilingualContentService.getTranslations(mlContainerToVersion);
// fill the select items
for(Map.Entry<Locale, NodeRef> entry : translations.entrySet())
{
NodeRef nodeRef = entry.getValue();
//add each non empty translation
if(!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
{
String name = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
Locale lang = (Locale) nodeService.getProperty(nodeRef, ContentModel.PROP_LOCALE);
selectableTranslations.add(new SelectItem(
nodeRef.toString(),
name + " - " + contentFilterLanguagesService.getLabelByCode(lang.getLanguage())
));
}
}
}
return selectableTranslations;
}
/**
* @param multilingualContentService the Multilingual Content Service to set
*/
public void setMultilingualContentService(MultilingualContentService multilingualContentService)
{
this.multilingualContentService = multilingualContentService;
}
/**
* @param nodeService the Node Service to set
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* @param editionService the Edition Service to set
*/
public void setEditionService(EditionService editionService)
{
this.editionService = editionService;
}
/**
* @return the edition notes
*/
public String getEditionNotes()
{
return editionNotes;
}
/**
* @param editionNotes the edition notes to set
*/
public void setEditionNotes(String editionNotes)
{
this.editionNotes = editionNotes;
}
/**
* @return the minorChange get if the new edition is minor or not.
*/
public boolean isMinorChange()
{
return minorChange;
}
/**
* @param minorChange set if the new edition is minor or not.
*/
public void setMinorChange(boolean minorChange)
{
this.minorChange = minorChange;
}
/**
* @return the otherProperties, get if the edit details dialog must be set at the end of the wizard
*/
public boolean isOtherProperties()
{
return otherProperties;
}
/**
* @param otherProperties set as true, the edit details dialog must be set at the end of the wizard
*/
public void setOtherProperties(boolean otherProperties)
{
this.otherProperties = otherProperties;
}
/**
* @return the starting translation being the new pivot of tne new edition
*/
public String getStartingItemNodeString()
{
return startingItemNodeString;
}
/**
* @param startingItemNodeString the starting translation to set as the new pivot of tne new edition
*/
public void setStartingItemNodeString(String startingItemNodeString)
{
// get the starting point translation with its id
startingElement = new NodeRef(startingItemNodeString);
// set the futur properties of the new starting element (only usefull for the summary step)
setLanguage((Locale) nodeService.getProperty(startingElement, ContentModel.PROP_LOCALE));
setAuthor((String) nodeService.getProperty(startingElement, ContentModel.PROP_AUTHOR));
setTitle((String) nodeService.getProperty(startingElement, ContentModel.PROP_TITLE));
this.startingItemNodeString = startingItemNodeString;
}
/**
* @param contentFilterLanguagesService the Content Filter Languages Service to set
*/
public void setContentFilterLanguagesService(ContentFilterLanguagesService contentFilterLanguagesService)
{
this.contentFilterLanguagesService = contentFilterLanguagesService;
}
/**
* @param lockService the Lock Service to set
*/
public void setLockService(LockService lockService)
{
this.lockService = lockService;
}
/**
* @return the author
*/
public String getAuthor()
{
return author;
}
/**
* @param author the author to set
*/
public void setAuthor(String author)
{
this.author = author;
}
/**
* @return the language
*/
public String getLanguage()
{
return language;
}
/**
* @param language the language to set
*/
public void setLanguage(String language)
{
this.language = language;
}
/**
* @param language the language to set
*/
public void setLanguage(Locale locale)
{
this.language = locale.getLanguage();
}
/**
* @return the title
*/
public String getTitle()
{
return title;
}
/**
* @param title the title to set
*/
public void setTitle(String title)
{
this.title = title;
}
/**
* @return the versionLabel
*/
public String getVersionLabel()
{
String toReturn = "Version Label";
if(minorChange)
{
toReturn += " (minor change)";
}
return toReturn;
}
}

View File

@@ -41,7 +41,7 @@ import org.alfresco.web.bean.users.SpaceUsersBean;
* Component that holds a list of languages avalaiable to make a node multilingual. * Component that holds a list of languages avalaiable to make a node multilingual.
* *
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class UILanguageSelector extends UISelectOne public class UILanguageSelector extends UISelectOne
{ {

View File

@@ -35,7 +35,7 @@ import org.alfresco.web.app.servlet.FacesHelper;
/** /**
* Converter class to convert a Locale into a language libelle * Converter class to convert a Locale into a language libelle
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class LanguageConverter implements Converter public class LanguageConverter implements Converter
{ {

View File

@@ -34,7 +34,7 @@ import org.alfresco.web.ui.repo.component.UIMimeTypeSelector;
/** /**
* Tag class for the Language selector component * Tag class for the Language selector component
* *
* @author yanipig * @author Yannick Pignot
*/ */
public class LanguageSelectorTag extends HtmlComponentTag public class LanguageSelectorTag extends HtmlComponentTag
{ {

View File

@@ -1978,4 +1978,395 @@
</attribute> </attribute>
</tag> </tag>
<!-- output_text -->
<tag>
<name>outputTextExprEnable</name>
<tag-class>org.apache.myfaces.taglib.html.HtmlOutputTextTag</tag-class>
<body-content>JSP</body-content>
<description>
Renders the value of the associated UIOutput component. If this
element has an ID or CSS style properties, the text is wrapped in
a span element.
Unless otherwise specified, all attributes accept static values
or EL expressions.
</description>
<!-- UIOutput attributes -->
<!-- UIComponent attributes -->
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<description>
The developer-assigned ID of this component. The ID must be unique
within the scope of the tag's enclosing naming container (e.g.
h:form or f:subview). This value must be a static value.
</description>
</attribute>
<attribute>
<name>binding</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
Identifies a backing bean property (of type UIComponent or appropriate
subclass) to bind to this component instance. This value must be an
EL expression.
</description>
</attribute>
<attribute>
<name>rendered</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
A boolean value that indicates whether this component should be rendered.
Default value: true.
</description>
</attribute>
<attribute>
<name>value</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
The initial value of this component. This value is generally
set as a value-binding in the form #{myBean.myProperty}, where
myProperty can be any data-type of Java (also user-defined data-types),
if a converter for this data-type exists.
Special cases:
1) f:selectItems - value needs to bind to a list (or an array) of javax.faces.model.SelectItem-instances
2) components implementing UISelectMany (e.g. h:selectManyCheckbox) -
value needs to bind to a list (or an array) of values, where the values need to be
of the same data-type as the choices of the associated f:selectItems-component
3) components implementing UIData (e.g. h:dataTable) -
value needs to bind to a list (or an array) of values,
which will be iterated over when the data-table is processed
</description>
</attribute>
<attribute>
<name>converter</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
An expression that specifies the Converter for this component.
If the value binding expression is a String, the String is used
as an ID to look up a Converter. If the value binding expression
is a Converter, uses that instance as the converter.
The value can either be a static value (ID case only) or an EL expression.
</description>
</attribute>
<!-- HTML 4.0 universal attributes -->
<attribute>
<name>dir</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
</attribute>
<attribute>
<name>lang</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: The base language of this document.</description>
</attribute>
<attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: CSS styling instructions.</description>
</attribute>
<attribute>
<name>title</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
</attribute>
<attribute>
<name>styleClass</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
</attribute>
<!-- HTML 4.0 event-handler attributes -->
<attribute>
<name>onclick</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the element is clicked.</description>
</attribute>
<attribute>
<name>ondblclick</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the element is double-clicked.</description>
</attribute>
<attribute>
<name>onmousedown</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
</attribute>
<attribute>
<name>onmouseup</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is released over this element.</description>
</attribute>
<attribute>
<name>onmouseover</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
</attribute>
<attribute>
<name>onmousemove</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
</attribute>
<attribute>
<name>onmouseout</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
</attribute>
<attribute>
<name>onkeypress</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when a key is pressed over this element.</description>
</attribute>
<attribute>
<name>onkeydown</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when a key is pressed down over this element.</description>
</attribute>
<attribute>
<name>onkeyup</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when a key is released over this element.</description>
</attribute>
<attribute>
<name>escape</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
Indicates whether rendered markup should be escaped.
Default: true
</description>
</attribute>
</tag>
<!-- graphic_image -->
<tag>
<name>graphicImageExprEnable</name>
<tag-class>org.apache.myfaces.taglib.html.HtmlGraphicImageTag</tag-class>
<body-content>JSP</body-content>
<description>
Renders an HTML img element.
Unless otherwise specified, all attributes accept static values
or EL expressions.
</description>
<!-- UIGraphic attributes -->
<!-- UIComponent attributes -->
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<description>
The developer-assigned ID of this component. The ID must be unique
within the scope of the tag's enclosing naming container (e.g.
h:form or f:subview). This value must be a static value.
</description>
</attribute>
<attribute>
<name>binding</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
Identifies a backing bean property (of type UIComponent or appropriate
subclass) to bind to this component instance. This value must be an
EL expression.
</description>
</attribute>
<attribute>
<name>rendered</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
A boolean value that indicates whether this component should be rendered.
Default value: true.
</description>
</attribute>
<attribute>
<name>url</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
An alias for the "value" attribute.
</description>
</attribute>
<attribute>
<name>value</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>
The URL of the image. If the URL starts with a '/', it is relative
to the context path of the web application.
</description>
</attribute>
<!-- HTML 4.0 universal attributes -->
<attribute>
<name>dir</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: The direction of text display, either 'ltr' (left-to-right) or 'rtl' (right-to-left).</description>
</attribute>
<attribute>
<name>lang</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: The base language of this document.</description>
</attribute>
<attribute>
<name>style</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: CSS styling instructions.</description>
</attribute>
<attribute>
<name>title</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: An advisory title for this element. Often used by the user agent as a tooltip.</description>
</attribute>
<attribute>
<name>styleClass</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>The CSS class for this element. Corresponds to the HTML 'class' attribute.</description>
</attribute>
<!-- HTML 4.0 event-handler attributes -->
<attribute>
<name>onclick</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the element is clicked.</description>
</attribute>
<attribute>
<name>ondblclick</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the element is double-clicked.</description>
</attribute>
<attribute>
<name>onmousedown</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is pressed over this element.</description>
</attribute>
<attribute>
<name>onmouseup</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is released over this element.</description>
</attribute>
<attribute>
<name>onmouseover</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is moved into this element.</description>
</attribute>
<attribute>
<name>onmousemove</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is moved while it is in this element.</description>
</attribute>
<attribute>
<name>onmouseout</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when the pointing device is moves out of this element.</description>
</attribute>
<attribute>
<name>onkeypress</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when a key is pressed over this element.</description>
</attribute>
<attribute>
<name>onkeydown</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when a key is pressed down over this element.</description>
</attribute>
<attribute>
<name>onkeyup</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>HTML: Script to be invoked when a key is released over this element.</description>
</attribute>
<!-- The subset of HTML 4.0 img attributes that are supported by the JSF 1.1 specification -->
<attribute>
<name>alt</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>HTML: Specifies alternative text that can be used by a browser that can't show this element.</description>
</attribute>
<attribute>
<name>height</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>HTML: Overrides the natural height of this image, by specifying height in pixels.</description>
</attribute>
<attribute>
<name>ismap</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>HTML: Specifies server-side image map handling for this image.</description>
</attribute>
<attribute>
<name>longdesc</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>HTML: A link to a long description of the image.</description>
</attribute>
<!-- "name" attribute cannot be set directly by user -->
<!-- "src" attribute cannot be set directly, use "url" instead! -->
<attribute>
<name>usemap</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>HTML: Specifies an image map to use with this image.</description>
</attribute>
<attribute>
<name>width</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<type>java.lang.String</type>
<description>HTML: Overrides the natural width of this image, by specifying width in pixels.</description>
</attribute>
</tag>
</taglib> </taglib>

View File

@@ -1078,7 +1078,7 @@
</managed-property> </managed-property>
<managed-property> <managed-property>
<property-name>authenticationService</property-name> <property-name>authenticationService</property-name>
<value>#{AuthenticationService}</value> <value>#{authenticationService}</value>
</managed-property> </managed-property>
<managed-property> <managed-property>
<property-name>permissionService</property-name> <property-name>permissionService</property-name>
@@ -1359,6 +1359,10 @@
<property-name>contentFilterLanguagesService</property-name> <property-name>contentFilterLanguagesService</property-name>
<value>#{ContentFilterLanguagesService}</value> <value>#{ContentFilterLanguagesService}</value>
</managed-property> </managed-property>
<managed-property>
<property-name>editionService</property-name>
<value>#{EditionService}</value>
</managed-property>
</managed-bean> </managed-bean>
<managed-bean> <managed-bean>
@@ -2200,6 +2204,59 @@
</managed-property> </managed-property>
</managed-bean> </managed-bean>
<managed-bean>
<description>
The bean that backs up the New Edition Wizard
</description>
<managed-bean-name>NewEditionWizard</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.ml.NewEditionWizard</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>editionService</property-name>
<value>#{EditionService}</value>
</managed-property>
<managed-property>
<property-name>multilingualContentService</property-name>
<value>#{MultilingualContentService}</value>
</managed-property>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>contentFilterLanguagesService</property-name>
<value>#{ContentFilterLanguagesService}</value>
</managed-property>
<managed-property>
<property-name>lockService</property-name>
<value>#{LockService}</value>
</managed-property>
<managed-property>
<property-name>fileFolderService</property-name>
<value>#{FileFolderService}</value>
</managed-property>
<managed-property>
<property-name>searchService</property-name>
<value>#{SearchService}</value>
</managed-property>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>browseBean</property-name>
<value>#{BrowseBean}</value>
</managed-property>
<managed-property>
<property-name>dictionaryService</property-name>
<value>#{DictionaryService}</value>
</managed-property>
<managed-property>
<property-name>namespaceService</property-name>
<value>#{NamespaceService}</value>
</managed-property>
</managed-bean>
<managed-bean> <managed-bean>
<description> <description>
The bean that backs up the Cancel Workflow Dialog The bean that backs up the Cancel Workflow Dialog

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -36,7 +36,6 @@
<f:view> <f:view>
<%-- load a bundle of properties with I18N strings --%> <%-- load a bundle of properties with I18N strings --%>
<f:loadBundle basename="alfresco.messages.webclient" var="msg"/> <f:loadBundle basename="alfresco.messages.webclient" var="msg"/>
@@ -123,7 +122,6 @@
</f:facet> </f:facet>
</h:panelGroup> </h:panelGroup>
<%-- <%--
Multlingual details Multlingual details
--%> --%>
@@ -197,13 +195,167 @@
</a:richList> </a:richList>
</a:panel> </a:panel>
<div style="padding:4px"></div>
<%--
Editions details
--%>
<a:panel label="#{msg.editions}" id="ml-editions-panel" progressive="true"
border="white" bgcolor="white" titleBorder="lbgrey" expandedTitleBorder="dotted" titleBgcolor="white"
expanded='#{DocumentDetailsBean.panels["ml-editions-panel"]}' expandedActionListener="#{DocumentDetailsBean.expandPanel}">
<a:richList id="EditionTitle" viewMode="details" value="#{DocumentDetailsBean.emptyListAndInitEditions}"
var="ed" styleClass="recordSet" headerStyleClass="recordSetHeader"
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
initialSortDescending="true">
<%-- Icon details view mode --%>
<a:column id="col30" primary="true" width="20" style="padding:2px;">
<f:facet name="header">
<h:outputText value=""/>
</f:facet>
</a:column>
<%-- edition label --%>
<a:column id="col31" width="100" style="text-align:left">
<f:facet name="header">
<h:outputText value="#{msg.edition}" styleClass="header"/>
</f:facet>
</a:column>
<%-- edition notes --%>
<a:column id="col32" width="200" style="text-align:left">
<f:facet name="header">
<h:outputText value="#{msg.notes}" styleClass="header"/>
</f:facet>
</a:column>
<%-- edition author --%>
<a:column id="col33" style="text-align:left">
<f:facet name="header">
<h:outputText value="#{msg.author}" styleClass="header"/>
</f:facet>
</a:column>
<%-- edition date --%>
<a:column id="col34" style="text-align:left; white-space:nowrap">
<f:facet name="header">
<h:outputText value="#{msg.date}" styleClass="header"/>
</f:facet>
</a:column>
</a:richList>
<c:forEach var="idx" begin="1" end="${DocumentDetailsBean.editionSize}" >
<a:richList id="ml-editions-list${idx}" viewMode="details" value="#{DocumentDetailsBean.nextSingleEditionBean.edition}"
var="ed" styleClass="recordSet" headerStyleClass="recordSetHeader"
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt"
width="100%" initialSortColumn="editionLabel" initialSortDescending="true">
<%-- Icon details view mode --%>
<a:column id="column-edition-view-mode${idx}" primary="true" width="20" style="padding:2px;">
<a:graphicImageExprEnable id="edition-image${idx}" url="/images/icons/folder.gif" />
</a:column>
<%-- edition label --%>
<a:column id="column-edition-label${idx}" width="100" style="text-align:left">
<a:outputTextExprEnable id="edition-label${idx}" value="#{ed.editionLabel}"/>
</a:column>
<%-- edition notes --%>
<a:column id="column-edition-notes${idx}" width="200" style="text-align:left">
<a:outputTextExprEnable id="edition-notes${idx}" value="#{ed.editionNotes}" />
</a:column>
<%-- edition author --%>
<a:column id="column-edition-author${idx}" style="text-align:left">
<a:outputTextExprEnable id="edition-author${idx}" value="#{ed.editionAuthor}" />
</a:column>
<%-- edition date --%>
<a:column id="column-edition-date${idx}" style="text-align:left; white-space:nowrap">
<a:outputTextExprEnable id="edition-date${idx}" value="#{ed.editionDate}">
<a:convertXMLDate type="both" pattern="#{msg.date_pattern}" />
</a:outputTextExprEnable>
</a:column>
</a:richList>
<div style="padding-left:25">
<a:panel label="#{msg.related_content}" id="ml-versions-panel${idx}" progressive="true" expanded="false"
expandedActionListener="#{DocumentDetailsBean.expandPanel}" styleClass="nodeWorkflowInfoTitle" >
<a:richList id="ml-versions-list${idx}" viewMode="details" value="#{DocumentDetailsBean.currentSingleEditionBean.translations}"
var="tr" styleClass="recordSet" headerStyleClass="recordSetHeader"
rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"
pageSize="10" initialSortColumn="versionName" initialSortDescending="true" style="padding-left:12px;padding-top:10px;">
<%-- Icon details view mode --%>
<a:column id="column-view-mode${idx}" primary="true" width="20" style="padding:2px;">
<f:facet name="header">
<a:outputTextExprEnable id="translation-image-title${idx}" value="" styleClass="header"/>
</f:facet>
<a:graphicImageExprEnable id="translation-image${idx}" url="/images/filetypes/_default.gif" />
</a:column>
<%-- Versionned name --%>
<a:column id="column-name${idx}" width="100" style="text-align:left">
<f:facet name="header">
<a:sortLink id="sort-name${idx}" label="#{msg.name}" value="versionName" mode="case-insensitive" styleClass="header"/>
</f:facet>
<a:outputTextExprEnable id="translation-name${idx}" value="#{tr.versionName}"/>
</a:column>
<%-- Versionned description --%>
<a:column id="column-description${idx}" width="200" style="text-align:left">
<f:facet name="header">
<a:outputTextExprEnable id="desc-title${idx}" value="#{msg.description}" styleClass="header"/>
</f:facet>
<a:outputTextExprEnable id="translation-description${idx}" value="#{tr.versionDescription}" />
</a:column>
<%-- Versionned creation date --%>
<a:column id="column-creation-date${idx}" style="text-align:left; white-space:nowrap">
<f:facet name="header">
<a:sortLink id="sort-cr-date${idx}" label="#{msg.created}" value="versionCreatedDate" mode="case-insensitive" styleClass="header"/>
</f:facet>
<a:outputTextExprEnable id="translation-created-date${idx}" value="#{tr.versionCreatedDate}">
<a:convertXMLDate type="both" pattern="#{msg.date_pattern}" />
</a:outputTextExprEnable>
</a:column>
<%-- Versionned modified date --%>
<a:column id="column-modified-date${idx}" style="text-align:left; white-space:nowrap">
<f:facet name="header">
<a:sortLink id="sort-mod-date${idx}" label="#{msg.modified}" value="versionModifiedDate" mode="case-insensitive" styleClass="header"/>
</f:facet>
<a:outputTextExprEnable id="translation-modif-date${idx}" value="#{tr.versionModifiedDate}">
<a:convertXMLDate type="both" pattern="#{msg.date_pattern}" />
</a:outputTextExprEnable>
</a:column>
<%-- Versionned language --%>
<a:column id="column-language${idx}" style="text-align:left">
<f:facet name="header">
<a:sortLink id="sort-lang${idx}" label="#{msg.language}" value="versionLanguage" mode="case-insensitive" styleClass="header"/>
</f:facet>
<a:outputTextExprEnable id="translation-language${idx}" value="#{tr.versionLanguage}" />
</a:column>
<%-- view actions --%>
<a:column id="column-action${idx}" style="text-align: left">
<f:facet name="header">
<a:outputTextExprEnable id="translation-action${idx}" value="#{msg.actions}"/>
</f:facet>
<a:actionLink id="translation-link${idx}" value="#{msg.view}" href="#{tr.versionUrl}" target="new" />
</a:column>
</a:richList>
</a:panel>
</div>
</c:forEach>
</a:panel>
<td valign="top"> <td valign="top">
<% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %> <% PanelGenerator.generatePanelStart(out, request.getContextPath(), "greyround", "#F5F5F5"); %>
<table cellpadding="1" cellspacing="1" border="0" width="100%"> <table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr> <tr>

View File

@@ -0,0 +1,54 @@
<%--
* 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
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* 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:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<%@ page import="org.alfresco.web.ui.common.PanelGenerator" %>
<h:panelGroup rendered="#{WizardManager.bean.hasTranslationCheckedOut == true}">
<f:verbatim>
<%PanelGenerator.generatePanelStart(out, request.getContextPath(), "yellowInner", "#ffffcc");%>
<table><tr><td>
</f:verbatim>
<h:graphicImage url="/images/icons/info_icon.gif" />
<f:verbatim>
</td><td>
</f:verbatim>
<h:outputText value="#{msg.translations_checked_out_error}" />
<f:verbatim>
</td></tr></table>
<%PanelGenerator.generatePanelEnd(out, request.getContextPath(), "yellowInner");%>
</f:verbatim>
</h:panelGroup>
<h:panelGrid columns="1" styleClass="workflowSelection" rendered="#{WizardManager.bean.hasTranslationCheckedOut == false}">
<h:outputText value="#{msg.available_translations}:" style="font-weight:bold;"/>
<h:selectOneRadio id="selected-translations" value="#{WizardManager.bean.startingItemNodeString}"
layout="pageDirection">
<f:selectItems value="#{WizardManager.bean.selectableTranslations}" />
</h:selectOneRadio>
</h:panelGrid>

View File

@@ -0,0 +1,53 @@
<%--
* 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
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* 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:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;" width="100%" rowClasses="wizardSectionHeading">
<h:outputText value="#{msg.edition_properties}" escape="false" />
</h:panelGrid>
<h:panelGrid style="padding-top: 2px;" columns="1">
<h:outputText value="#{msg.edition_notes}" />
<h:inputTextarea value="#{WizardManager.bean.editionNotes}" rows="2" cols="50"/>
</h:panelGrid>
<h:panelGrid style="padding-top: 2px;" columns="2">
<h:selectBooleanCheckbox id="add_translation" value="#{WizardManager.bean.minorChange}" immediate="false"/>
<h:outputText value="#{msg.minor_change}" />
</h:panelGrid>
<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;" width="100%" rowClasses="wizardSectionHeading">
<h:outputText value="#{msg.other_properties}" escape="false" />
</h:panelGrid>
<h:panelGrid style="padding-top: 2px;" columns="2">
<h:selectBooleanCheckbox id="add_translation" value="#{WizardManager.bean.otherProperties}" immediate="false"/>
<h:outputText value="#{msg.modify_translation_properties}" />
</h:panelGrid>

View File

@@ -0,0 +1,58 @@
<%--
* 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
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* 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:
* http://www.alfresco.com/legal/licensing"
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>
<h:panelGrid columns="1" styleClass="workflowSelection">
<h:panelGrid columns="1">
<h:outputText value="#{msg.create_new_edition_using}" style="font-weight:bold;"/>
</h:panelGrid>
<h:panelGrid columns="2" style="padding-left: 10px;">
<h:outputText value="#{msg.translation_title}:" />
<h:outputText value="#{WizardManager.bean.title}" style="font-style:italic;"/>
<h:outputText value="#{msg.translation_language}:" />
<h:outputText value="#{WizardManager.bean.language}" style="font-style:italic;"/>
<h:outputText value="#{msg.translation_author}:" />
<h:outputText value="#{WizardManager.bean.author}" style="font-style:italic;"/>
</h:panelGrid>
</h:panelGrid>
<h:outputText id="padding1" styleClass="paddingRow" value="&nbsp;" escape="false" />
<h:outputText id="padding2" styleClass="paddingRow" value="&nbsp;" escape="false" />
<h:panelGrid columns="1" styleClass="workflowSelection">
<h:panelGrid columns="1">
<h:outputText value="#{msg.new_edition_details}" style="font-weight:bold;"/>
</h:panelGrid>
<h:panelGrid columns="2" style="padding-left: 10px;">
<h:outputText value="#{msg.version}:"/>
<h:outputText value="#{WizardManager.bean.versionLabel}" style="font-style:italic;"/>
<h:outputText value="#{msg.version_notes}:"/>
<h:outputText value="#{WizardManager.bean.editionNotes}" style="font-style:italic;"/>
</h:panelGrid>
</h:panelGrid>