MVC Controllers should be named beans
parent
8d674ac140
commit
83e65415de
|
|
@ -88,6 +88,9 @@ public abstract class AbstractMvcAssetEditStep implements MvcAssetEditStep {
|
||||||
@Inject
|
@Inject
|
||||||
private Models models;
|
private Models models;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private MvcAssetEditStepModel mvcAssetEditStepModel;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SelectedAssetModel assetModel;
|
private SelectedAssetModel assetModel;
|
||||||
|
|
||||||
|
|
@ -105,10 +108,9 @@ public abstract class AbstractMvcAssetEditStep implements MvcAssetEditStep {
|
||||||
|
|
||||||
private String stepPath;
|
private String stepPath;
|
||||||
|
|
||||||
private Map<String, String> titleValues;
|
// private Map<String, String> titleValues;
|
||||||
|
//
|
||||||
private List<String> unusedTitleLocales;
|
// private List<String> unusedTitleLocales;
|
||||||
|
|
||||||
protected void init() throws ContentSectionNotFoundException,
|
protected void init() throws ContentSectionNotFoundException,
|
||||||
AssetNotFoundException {
|
AssetNotFoundException {
|
||||||
contentSection = sectionsUi
|
contentSection = sectionsUi
|
||||||
|
|
@ -162,7 +164,11 @@ public abstract class AbstractMvcAssetEditStep implements MvcAssetEditStep {
|
||||||
)
|
)
|
||||||
.orElse("");
|
.orElse("");
|
||||||
|
|
||||||
titleValues = getAsset()
|
mvcAssetEditStepModel.setName(getName());
|
||||||
|
mvcAssetEditStepModel.setCanEdit(getCanEdit());
|
||||||
|
|
||||||
|
mvcAssetEditStepModel.setTitleValues(
|
||||||
|
getAsset()
|
||||||
.getTitle()
|
.getTitle()
|
||||||
.getValues()
|
.getValues()
|
||||||
.entrySet()
|
.entrySet()
|
||||||
|
|
@ -172,18 +178,21 @@ public abstract class AbstractMvcAssetEditStep implements MvcAssetEditStep {
|
||||||
entry -> entry.getKey().toString(),
|
entry -> entry.getKey().toString(),
|
||||||
entry -> entry.getValue()
|
entry -> entry.getValue()
|
||||||
)
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
final Set<Locale> titleLocales = getAsset()
|
final Set<Locale> titleLocales = getAsset()
|
||||||
.getTitle()
|
.getTitle()
|
||||||
.getAvailableLocales();
|
.getAvailableLocales();
|
||||||
|
|
||||||
unusedTitleLocales = globalizationHelper
|
mvcAssetEditStepModel.setUnusedTitleLocales(
|
||||||
|
globalizationHelper
|
||||||
.getAvailableLocales()
|
.getAvailableLocales()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(locale -> !titleLocales.contains(locale))
|
.filter(locale -> !titleLocales.contains(locale))
|
||||||
.map(Locale::toString)
|
.map(Locale::toString)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
|
||||||
models.put("activeAssetTab", "editTab");
|
models.put("activeAssetTab", "editTab");
|
||||||
models.put("stepPath", stepPath);
|
models.put("stepPath", stepPath);
|
||||||
|
|
@ -397,14 +406,13 @@ public abstract class AbstractMvcAssetEditStep implements MvcAssetEditStep {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getTitleValues() {
|
// public Map<String, String> getTitleValues() {
|
||||||
return Collections.unmodifiableMap(titleValues);
|
// return Collections.unmodifiableMap(titleValues);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public List<String> getUnusedTitleLocales() {
|
// public List<String> getUnusedTitleLocales() {
|
||||||
return Collections.unmodifiableList(unusedTitleLocales);
|
// return Collections.unmodifiableList(unusedTitleLocales);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/title/@add")
|
@Path("/title/@add")
|
||||||
@AuthorizationRequired
|
@AuthorizationRequired
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.librecms.ui.contentsections.assets;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("MvcAssetEditStepModel")
|
||||||
|
public class MvcAssetEditStepModel {
|
||||||
|
|
||||||
|
private boolean canEdit;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Map<String, String> titleValues;
|
||||||
|
|
||||||
|
private List<String> unusedTitleLocales;
|
||||||
|
|
||||||
|
public boolean getCanEdit() {
|
||||||
|
return canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCanEdit(final boolean canEdit) {
|
||||||
|
this.canEdit = canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getTitleValues() {
|
||||||
|
return Collections.unmodifiableMap(titleValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setTitleValues(final Map<String, String> titleValues) {
|
||||||
|
this.titleValues = new HashMap<>(titleValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedTitleLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedTitleLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUnusedTitleLocales(
|
||||||
|
final List<String> unusedTitleLocales
|
||||||
|
) {
|
||||||
|
this.unusedTitleLocales = new ArrayList<>(unusedTitleLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -30,12 +30,12 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.mvc.Controller;
|
import javax.mvc.Controller;
|
||||||
import javax.mvc.Models;
|
import javax.mvc.Models;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
@ -52,7 +52,6 @@ import javax.ws.rs.PathParam;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Path(MvcAssetEditSteps.PATH_PREFIX + "postaladdress-edit")
|
@Path(MvcAssetEditSteps.PATH_PREFIX + "postaladdress-edit")
|
||||||
@Controller
|
@Controller
|
||||||
@Named("CmsPostalAddressEditStep")
|
|
||||||
@MvcAssetEditStepDef(
|
@MvcAssetEditStepDef(
|
||||||
bundle = MvcAssetStepsConstants.BUNDLE,
|
bundle = MvcAssetStepsConstants.BUNDLE,
|
||||||
descriptionKey = "postaladdress.editstep.description",
|
descriptionKey = "postaladdress.editstep.description",
|
||||||
|
|
@ -76,11 +75,13 @@ public class PostalAddressEditStep extends AbstractMvcAssetEditStep {
|
||||||
@Inject
|
@Inject
|
||||||
private AssetPermissionsChecker assetPermissionsChecker;
|
private AssetPermissionsChecker assetPermissionsChecker;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private PostalAddressEditStepModel postalAddressEditStepModel;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Models models;
|
private Models models;
|
||||||
|
|
||||||
private Map<String, String> countries;
|
// private Map<String, String> countries;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends MvcAssetEditStep> getStepClass() {
|
public Class<? extends MvcAssetEditStep> getStepClass() {
|
||||||
return PostalAddressEditStep.class;
|
return PostalAddressEditStep.class;
|
||||||
|
|
@ -118,9 +119,32 @@ public class PostalAddressEditStep extends AbstractMvcAssetEditStep {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
countries = new LinkedHashMap<>();
|
final Map<String, String> countries = new LinkedHashMap<>();
|
||||||
countries.put("", "");
|
countries.put("", "");
|
||||||
countries.putAll(countriesMap);
|
countries.putAll(countriesMap);
|
||||||
|
postalAddressEditStepModel.setCountries(countries);
|
||||||
|
|
||||||
|
postalAddressEditStepModel.setAddress(getPostalAddress().getAddress());
|
||||||
|
postalAddressEditStepModel.setPostalCode(
|
||||||
|
getPostalAddress().getPostalCode()
|
||||||
|
);
|
||||||
|
postalAddressEditStepModel.setCity(getPostalAddress().getCity());
|
||||||
|
postalAddressEditStepModel.setState(postalAddressEditStepModel
|
||||||
|
.getState()
|
||||||
|
);
|
||||||
|
postalAddressEditStepModel.setIsoCountryCode(
|
||||||
|
getPostalAddress().getIsoCountryCode()
|
||||||
|
);
|
||||||
|
postalAddressEditStepModel.setCountry(
|
||||||
|
Optional
|
||||||
|
.ofNullable(getPostalAddress().getIsoCountryCode())
|
||||||
|
.map(code -> new Locale("", code))
|
||||||
|
.map(
|
||||||
|
locale -> locale.getDisplayCountry(
|
||||||
|
globalizationHelper.getNegotiatedLocale()
|
||||||
|
)
|
||||||
|
).orElse("")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
|
|
@ -160,34 +184,34 @@ public class PostalAddressEditStep extends AbstractMvcAssetEditStep {
|
||||||
return (PostalAddress) getAsset();
|
return (PostalAddress) getAsset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddress() {
|
// public String getAddress() {
|
||||||
return getPostalAddress().getAddress();
|
// return getPostalAddress().getAddress();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public String getPostalCode() {
|
// public String getPostalCode() {
|
||||||
return getPostalAddress().getPostalCode();
|
// return getPostalAddress().getPostalCode();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public String getCity() {
|
// public String getCity() {
|
||||||
return getPostalAddress().getCity();
|
// return getPostalAddress().getCity();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public String getState() {
|
// public String getState() {
|
||||||
return getPostalAddress().getState();
|
// return getPostalAddress().getState();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public String getIsoCountryCode() {
|
// public String getIsoCountryCode() {
|
||||||
return getPostalAddress().getIsoCountryCode();
|
// return getPostalAddress().getIsoCountryCode();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public String getCountry() {
|
// public String getCountry() {
|
||||||
if (getPostalAddress().getIsoCountryCode() == null) {
|
// if (getPostalAddress().getIsoCountryCode() == null) {
|
||||||
return "";
|
// return "";
|
||||||
} else {
|
// } else {
|
||||||
return new Locale("", getPostalAddress().getIsoCountryCode())
|
// return new Locale("", getPostalAddress().getIsoCountryCode())
|
||||||
.getDisplayCountry(globalizationHelper.getNegotiatedLocale());
|
// .getDisplayCountry(globalizationHelper.getNegotiatedLocale());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/properties")
|
@Path("/properties")
|
||||||
|
|
@ -231,10 +255,10 @@ public class PostalAddressEditStep extends AbstractMvcAssetEditStep {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getCountries() {
|
// public Map<String, String> getCountries() {
|
||||||
final LinkedHashMap<String, String> result = new LinkedHashMap<>();
|
// final LinkedHashMap<String, String> result = new LinkedHashMap<>();
|
||||||
result.putAll(countries);
|
// result.putAll(countries);
|
||||||
return result;
|
// return result;
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.librecms.ui.contentsections.assets;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("CmsPostalAddressEditStep")
|
||||||
|
public class PostalAddressEditStepModel {
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private String postalCode;
|
||||||
|
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
private String state;
|
||||||
|
|
||||||
|
private String isoCountryCode;
|
||||||
|
|
||||||
|
private String country;
|
||||||
|
|
||||||
|
private Map<String, String> countries;
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setAddress(final String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPostalCode() {
|
||||||
|
return postalCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setPostalCode(final String postalCode) {
|
||||||
|
this.postalCode = postalCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCity(final String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setState(final String state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIsoCountryCode() {
|
||||||
|
return isoCountryCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setIsoCountryCode(final String isoCountryCode) {
|
||||||
|
this.isoCountryCode = isoCountryCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCountry(final String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getCountries() {
|
||||||
|
return Collections.unmodifiableMap(countries);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCountries(final Map<String, String> countries) {
|
||||||
|
this.countries = new HashMap<>(countries);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -38,7 +38,6 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.mvc.Controller;
|
import javax.mvc.Controller;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
import javax.ws.rs.FormParam;
|
import javax.ws.rs.FormParam;
|
||||||
|
|
@ -54,7 +53,6 @@ import javax.ws.rs.PathParam;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Path(MvcAssetEditSteps.PATH_PREFIX + "sidenote-edit")
|
@Path(MvcAssetEditSteps.PATH_PREFIX + "sidenote-edit")
|
||||||
@Controller
|
@Controller
|
||||||
@Named("CmsSideNoteEditStep")
|
|
||||||
@MvcAssetEditStepDef(
|
@MvcAssetEditStepDef(
|
||||||
bundle = MvcAssetStepsConstants.BUNDLE,
|
bundle = MvcAssetStepsConstants.BUNDLE,
|
||||||
descriptionKey = "postaladdress.editstep.description",
|
descriptionKey = "postaladdress.editstep.description",
|
||||||
|
|
@ -78,17 +76,61 @@ public class SideNoteEditStep extends AbstractMvcAssetEditStep {
|
||||||
@Inject
|
@Inject
|
||||||
private AssetPermissionsChecker assetPermissionsChecker;
|
private AssetPermissionsChecker assetPermissionsChecker;
|
||||||
|
|
||||||
private Map<String, String> textValues;
|
@Inject
|
||||||
|
private SideNoteEditStepModel sideNoteEditStepModel;
|
||||||
private List<CmsEditorLocaleVariantRow> variants;
|
|
||||||
|
|
||||||
private List<String> unusedTextLocales;
|
|
||||||
|
|
||||||
|
// private Map<String, String> textValues;
|
||||||
|
//
|
||||||
|
// private List<CmsEditorLocaleVariantRow> variants;
|
||||||
|
//
|
||||||
|
// private List<String> unusedTextLocales;
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends MvcAssetEditStep> getStepClass() {
|
public Class<? extends MvcAssetEditStep> getStepClass() {
|
||||||
return SideNoteEditStep.class;
|
return SideNoteEditStep.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void init() throws ContentSectionNotFoundException,
|
||||||
|
AssetNotFoundException {
|
||||||
|
super.init();
|
||||||
|
|
||||||
|
sideNoteEditStepModel.setTextValues(
|
||||||
|
getSideNote()
|
||||||
|
.getText()
|
||||||
|
.getValues()
|
||||||
|
.entrySet()
|
||||||
|
.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
entry -> entry.getKey().toString(),
|
||||||
|
entry -> entry.getValue()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
final Set<Locale> textLocales = getSideNote()
|
||||||
|
.getText()
|
||||||
|
.getAvailableLocales();
|
||||||
|
sideNoteEditStepModel.setUnusedTextLocales(
|
||||||
|
globalizationHelper
|
||||||
|
.getAvailableLocales()
|
||||||
|
.stream()
|
||||||
|
.filter(locale -> !textLocales.contains(locale))
|
||||||
|
.map(Locale::toString)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
|
||||||
|
sideNoteEditStepModel.setVariants(
|
||||||
|
getSideNote()
|
||||||
|
.getText()
|
||||||
|
.getValues()
|
||||||
|
.entrySet()
|
||||||
|
.stream()
|
||||||
|
.map(this::buildVariantRow)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@AuthorizationRequired
|
@AuthorizationRequired
|
||||||
|
|
@ -109,35 +151,6 @@ public class SideNoteEditStep extends AbstractMvcAssetEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetPermissionsChecker.canEditAsset(getAsset())) {
|
if (assetPermissionsChecker.canEditAsset(getAsset())) {
|
||||||
textValues = getSideNote()
|
|
||||||
.getText()
|
|
||||||
.getValues()
|
|
||||||
.entrySet()
|
|
||||||
.stream()
|
|
||||||
.collect(
|
|
||||||
Collectors.toMap(
|
|
||||||
entry -> entry.getKey().toString(),
|
|
||||||
entry -> entry.getValue()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
final Set<Locale> textLocales = getSideNote()
|
|
||||||
.getText()
|
|
||||||
.getAvailableLocales();
|
|
||||||
unusedTextLocales = globalizationHelper
|
|
||||||
.getAvailableLocales()
|
|
||||||
.stream()
|
|
||||||
.filter(locale -> !textLocales.contains(locale))
|
|
||||||
.map(Locale::toString)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
variants = getSideNote()
|
|
||||||
.getText()
|
|
||||||
.getValues()
|
|
||||||
.entrySet()
|
|
||||||
.stream()
|
|
||||||
.map(this::buildVariantRow)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
return "org/librecms/ui/contentsection/assets/sidenote/edit-sidenote.xhtml";
|
return "org/librecms/ui/contentsection/assets/sidenote/edit-sidenote.xhtml";
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -151,18 +164,18 @@ public class SideNoteEditStep extends AbstractMvcAssetEditStep {
|
||||||
public SideNote getSideNote() {
|
public SideNote getSideNote() {
|
||||||
return (SideNote) getAsset();
|
return (SideNote) getAsset();
|
||||||
}
|
}
|
||||||
|
//
|
||||||
public Map<String, String> getTextValues() {
|
// public Map<String, String> getTextValues() {
|
||||||
return Collections.unmodifiableMap(textValues);
|
// return Collections.unmodifiableMap(textValues);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public List<CmsEditorLocaleVariantRow> getVariants() {
|
// public List<CmsEditorLocaleVariantRow> getVariants() {
|
||||||
return Collections.unmodifiableList(variants);
|
// return Collections.unmodifiableList(variants);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public List<String> getUnusedTextLocales() {
|
// public List<String> getUnusedTextLocales() {
|
||||||
return Collections.unmodifiableList(unusedTextLocales);
|
// return Collections.unmodifiableList(unusedTextLocales);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("/text/add")
|
@Path("/text/add")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.librecms.ui.contentsections.assets;
|
||||||
|
|
||||||
|
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("CmsSideNoteEditStep")
|
||||||
|
public class SideNoteEditStepModel {
|
||||||
|
|
||||||
|
private Map<String, String> textValues;
|
||||||
|
|
||||||
|
private List<CmsEditorLocaleVariantRow> variants;
|
||||||
|
|
||||||
|
private List<String> unusedTextLocales;
|
||||||
|
|
||||||
|
public Map<String, String> getTextValues() {
|
||||||
|
return Collections.unmodifiableMap(textValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setTextValues(final Map<String, String> textValues) {
|
||||||
|
this.textValues = new HashMap<>(textValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CmsEditorLocaleVariantRow> getVariants() {
|
||||||
|
return Collections.unmodifiableList(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setVariants(final List<CmsEditorLocaleVariantRow> variants) {
|
||||||
|
this.variants = new ArrayList<>(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedTextLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedTextLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUnusedTextLocales(final List<String> unusedTextLocales) {
|
||||||
|
this.unusedTextLocales = new ArrayList<>(unusedTextLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -92,7 +92,7 @@ public class PublishStepModel {
|
||||||
return assignedLifecycleDescription;
|
return assignedLifecycleDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setAssignedLifecylceDescription(
|
protected void setAssignedLifecycleDescription(
|
||||||
final String assignedLifecycleDescription
|
final String assignedLifecycleDescription
|
||||||
) {
|
) {
|
||||||
this.assignedLifecycleDescription = assignedLifecycleDescription;
|
this.assignedLifecycleDescription = assignedLifecycleDescription;
|
||||||
|
|
|
||||||
|
|
@ -33,15 +33,11 @@ import org.librecms.ui.contentsections.documents.DocumentUi;
|
||||||
import org.librecms.ui.contentsections.documents.MvcAuthoringStepDef;
|
import org.librecms.ui.contentsections.documents.MvcAuthoringStepDef;
|
||||||
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -63,7 +59,6 @@ import javax.ws.rs.PathParam;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Path(MvcAuthoringSteps.PATH_PREFIX + "article-basicproperties")
|
@Path(MvcAuthoringSteps.PATH_PREFIX + "article-basicproperties")
|
||||||
@Controller
|
@Controller
|
||||||
@Named("CmsArticlePropertiesStep")
|
|
||||||
@MvcAuthoringStepDef(
|
@MvcAuthoringStepDef(
|
||||||
bundle = ArticleStepsConstants.BUNDLE,
|
bundle = ArticleStepsConstants.BUNDLE,
|
||||||
descriptionKey = "authoringsteps.basicproperties.description",
|
descriptionKey = "authoringsteps.basicproperties.description",
|
||||||
|
|
@ -105,22 +100,90 @@ public class MvcArticlePropertiesStep extends AbstractMvcAuthoringStep {
|
||||||
@Inject
|
@Inject
|
||||||
private ItemPermissionChecker itemPermissionChecker;
|
private ItemPermissionChecker itemPermissionChecker;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private MvcArticlePropertiesStepModel articlePropertiesStepModel;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Models models;
|
private Models models;
|
||||||
|
|
||||||
private Map<String, String> titleValues;
|
// private Map<String, String> titleValues;
|
||||||
|
//
|
||||||
private List<String> unusedTitleLocales;
|
// private List<String> unusedTitleLocales;
|
||||||
|
//
|
||||||
private Map<String, String> descriptionValues;
|
// private Map<String, String> descriptionValues;
|
||||||
|
//
|
||||||
private List<String> unusedDescriptionLocales;
|
// private List<String> unusedDescriptionLocales;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<MvcArticlePropertiesStep> getStepClass() {
|
public Class<MvcArticlePropertiesStep> getStepClass() {
|
||||||
return MvcArticlePropertiesStep.class;
|
return MvcArticlePropertiesStep.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
protected void init() throws ContentSectionNotFoundException,
|
||||||
|
DocumentNotFoundException {
|
||||||
|
super.init();
|
||||||
|
|
||||||
|
articlePropertiesStepModel.setName(getDocument().getDisplayName());
|
||||||
|
|
||||||
|
articlePropertiesStepModel.setCanEdit(getCanEdit());
|
||||||
|
|
||||||
|
final Set<Locale> titleLocales = getDocument()
|
||||||
|
.getTitle()
|
||||||
|
.getAvailableLocales();
|
||||||
|
|
||||||
|
articlePropertiesStepModel.setTitleValues(
|
||||||
|
getDocument()
|
||||||
|
.getTitle()
|
||||||
|
.getValues()
|
||||||
|
.entrySet()
|
||||||
|
.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
entry -> entry.getKey().toString(),
|
||||||
|
entry -> entry.getValue()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
articlePropertiesStepModel.setUnusedTitleLocales(
|
||||||
|
globalizationHelper
|
||||||
|
.getAvailableLocales()
|
||||||
|
.stream()
|
||||||
|
.filter(locale -> !titleLocales.contains(locale))
|
||||||
|
.map(Locale::toString)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
|
||||||
|
articlePropertiesStepModel.setDescriptionValues(
|
||||||
|
getDocument()
|
||||||
|
.getDescription()
|
||||||
|
.getValues()
|
||||||
|
.entrySet()
|
||||||
|
.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
entry -> entry.getKey().toString(),
|
||||||
|
entry -> entry.getValue()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
final Set<Locale> descriptionLocales = getDocument()
|
||||||
|
.getDescription()
|
||||||
|
.getAvailableLocales();
|
||||||
|
|
||||||
|
articlePropertiesStepModel.setUnusedDescriptionLocales(
|
||||||
|
globalizationHelper
|
||||||
|
.getAvailableLocales()
|
||||||
|
.stream()
|
||||||
|
.filter(locale -> !descriptionLocales.contains(locale))
|
||||||
|
.map(Locale::toString)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/")
|
@Path("/")
|
||||||
@AuthorizationRequired
|
@AuthorizationRequired
|
||||||
|
|
@ -140,52 +203,51 @@ public class MvcArticlePropertiesStep extends AbstractMvcAuthoringStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemPermissionChecker.canEditItem(getDocument())) {
|
if (itemPermissionChecker.canEditItem(getDocument())) {
|
||||||
titleValues = getDocument()
|
// titleValues = getDocument()
|
||||||
.getTitle()
|
// .getTitle()
|
||||||
.getValues()
|
// .getValues()
|
||||||
.entrySet()
|
// .entrySet()
|
||||||
.stream()
|
// .stream()
|
||||||
.collect(
|
// .collect(
|
||||||
Collectors.toMap(
|
// Collectors.toMap(
|
||||||
entry -> entry.getKey().toString(),
|
// entry -> entry.getKey().toString(),
|
||||||
entry -> entry.getValue()
|
// entry -> entry.getValue()
|
||||||
)
|
// )
|
||||||
);
|
// );
|
||||||
|
|
||||||
final Set<Locale> titleLocales = getDocument()
|
|
||||||
.getTitle()
|
|
||||||
.getAvailableLocales();
|
|
||||||
|
|
||||||
unusedTitleLocales = globalizationHelper
|
|
||||||
.getAvailableLocales()
|
|
||||||
.stream()
|
|
||||||
.filter(locale -> !titleLocales.contains(locale))
|
|
||||||
.map(Locale::toString)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
descriptionValues = getDocument()
|
|
||||||
.getDescription()
|
|
||||||
.getValues()
|
|
||||||
.entrySet()
|
|
||||||
.stream()
|
|
||||||
.collect(
|
|
||||||
Collectors.toMap(
|
|
||||||
entry -> entry.getKey().toString(),
|
|
||||||
entry -> entry.getValue()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
final Set<Locale> descriptionLocales = getDocument()
|
|
||||||
.getDescription()
|
|
||||||
.getAvailableLocales();
|
|
||||||
|
|
||||||
unusedDescriptionLocales = globalizationHelper
|
|
||||||
.getAvailableLocales()
|
|
||||||
.stream()
|
|
||||||
.filter(locale -> !descriptionLocales.contains(locale))
|
|
||||||
.map(Locale::toString)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
|
// final Set<Locale> titleLocales = getDocument()
|
||||||
|
// .getTitle()
|
||||||
|
// .getAvailableLocales();
|
||||||
|
//
|
||||||
|
// unusedTitleLocales = globalizationHelper
|
||||||
|
// .getAvailableLocales()
|
||||||
|
// .stream()
|
||||||
|
// .filter(locale -> !titleLocales.contains(locale))
|
||||||
|
// .map(Locale::toString)
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
//
|
||||||
|
// descriptionValues = getDocument()
|
||||||
|
// .getDescription()
|
||||||
|
// .getValues()
|
||||||
|
// .entrySet()
|
||||||
|
// .stream()
|
||||||
|
// .collect(
|
||||||
|
// Collectors.toMap(
|
||||||
|
// entry -> entry.getKey().toString(),
|
||||||
|
// entry -> entry.getValue()
|
||||||
|
// )
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// final Set<Locale> descriptionLocales = getDocument()
|
||||||
|
// .getDescription()
|
||||||
|
// .getAvailableLocales();
|
||||||
|
//
|
||||||
|
// unusedDescriptionLocales = globalizationHelper
|
||||||
|
// .getAvailableLocales()
|
||||||
|
// .stream()
|
||||||
|
// .filter(locale -> !descriptionLocales.contains(locale))
|
||||||
|
// .map(Locale::toString)
|
||||||
|
// .collect(Collectors.toList());
|
||||||
return "org/librecms/ui/contenttypes/article/article-basic-properties.xhtml";
|
return "org/librecms/ui/contenttypes/article/article-basic-properties.xhtml";
|
||||||
} else {
|
} else {
|
||||||
return documentUi.showAccessDenied(
|
return documentUi.showAccessDenied(
|
||||||
|
|
@ -197,14 +259,14 @@ public class MvcArticlePropertiesStep extends AbstractMvcAuthoringStep {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Gets the display name of the current article.
|
// * Gets the display name of the current article.
|
||||||
*
|
// *
|
||||||
* @return The display name of the current article.
|
// * @return The display name of the current article.
|
||||||
*/
|
// */
|
||||||
public String getName() {
|
// public String getName() {
|
||||||
return getDocument().getDisplayName();
|
// return getDocument().getDisplayName();
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the name of the current article.
|
* Updates the name of the current article.
|
||||||
|
|
@ -256,23 +318,7 @@ public class MvcArticlePropertiesStep extends AbstractMvcAuthoringStep {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the values of the localized title of the article.
|
|
||||||
*
|
|
||||||
* @return The values of the localized title of the article.
|
|
||||||
*/
|
|
||||||
public Map<String, String> getTitleValues() {
|
|
||||||
return Collections.unmodifiableMap(titleValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the locales for which no localized title has been defined yet.
|
|
||||||
*
|
|
||||||
* @return The locales for which no localized title has been defined yet.
|
|
||||||
*/
|
|
||||||
public List<String> getUnusedTitleLocales() {
|
|
||||||
return Collections.unmodifiableList(unusedTitleLocales);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a localized title of the article.
|
* Updates a localized title of the article.
|
||||||
|
|
@ -407,24 +453,7 @@ public class MvcArticlePropertiesStep extends AbstractMvcAuthoringStep {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the locales for which no localized description has been defined yet.
|
|
||||||
*
|
|
||||||
* @return The locales for which no localized description has been defined
|
|
||||||
* yet.
|
|
||||||
*/
|
|
||||||
public List<String> getUnusedDescriptionLocales() {
|
|
||||||
return Collections.unmodifiableList(unusedDescriptionLocales);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the values of the localized decrription of the article.
|
|
||||||
*
|
|
||||||
* @return The values of the localized description of the article.
|
|
||||||
*/
|
|
||||||
public Map<String, String> getDescriptionValues() {
|
|
||||||
return Collections.unmodifiableMap(descriptionValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a localized description to the article.
|
* Adds a localized description to the article.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.librecms.ui.contenttypes;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("CmsArticlePropertiesStep")
|
||||||
|
public class MvcArticlePropertiesStepModel {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private boolean canEdit;
|
||||||
|
|
||||||
|
private Map<String, String> titleValues;
|
||||||
|
|
||||||
|
private List<String> unusedTitleLocales;
|
||||||
|
|
||||||
|
private Map<String, String> descriptionValues;
|
||||||
|
|
||||||
|
private List<String> unusedDescriptionLocales;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getCanEdit() {
|
||||||
|
return canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCanEdit(final boolean canEdit) {
|
||||||
|
this.canEdit = canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getTitleValues() {
|
||||||
|
return Collections.unmodifiableMap(titleValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitleValues(final Map<String, String> titleValues) {
|
||||||
|
this.titleValues = new HashMap<>(titleValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedTitleLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedTitleLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnusedTitleLocales(List<String> unusedTitleLocales) {
|
||||||
|
this.unusedTitleLocales = new ArrayList<>(unusedTitleLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, String> getDescriptionValues() {
|
||||||
|
return Collections.unmodifiableMap(descriptionValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescriptionValues(
|
||||||
|
final Map<String, String> descriptionValues
|
||||||
|
) {
|
||||||
|
this.descriptionValues = new HashMap<>(descriptionValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedDescriptionLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedDescriptionLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnusedDescriptionLocales(
|
||||||
|
final List<String> unusedDescriptionLocales
|
||||||
|
) {
|
||||||
|
this.unusedDescriptionLocales = new ArrayList<>(
|
||||||
|
unusedDescriptionLocales
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -39,7 +39,6 @@ import javax.ws.rs.Path;
|
||||||
|
|
||||||
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
import org.librecms.ui.contentsections.documents.MvcAuthoringSteps;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
@ -47,7 +46,6 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
import javax.ws.rs.FormParam;
|
import javax.ws.rs.FormParam;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
|
|
@ -56,7 +54,6 @@ import javax.ws.rs.PathParam;
|
||||||
|
|
||||||
import org.librecms.ui.contentsections.documents.MvcAuthoringStepDef;
|
import org.librecms.ui.contentsections.documents.MvcAuthoringStepDef;
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -67,7 +64,6 @@ import java.util.StringTokenizer;
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
@Path(MvcAuthoringSteps.PATH_PREFIX + "article-text")
|
@Path(MvcAuthoringSteps.PATH_PREFIX + "article-text")
|
||||||
@Controller
|
@Controller
|
||||||
@Named("CmsArticleTextBodyStep")
|
|
||||||
@MvcAuthoringStepDef(
|
@MvcAuthoringStepDef(
|
||||||
bundle = ArticleStepsConstants.BUNDLE,
|
bundle = ArticleStepsConstants.BUNDLE,
|
||||||
descriptionKey = "authoringsteps.text.description",
|
descriptionKey = "authoringsteps.text.description",
|
||||||
|
|
@ -100,14 +96,16 @@ public class MvcArticleTextBodyStep extends AbstractMvcAuthoringStep {
|
||||||
@Inject
|
@Inject
|
||||||
private ItemPermissionChecker itemPermissionChecker;
|
private ItemPermissionChecker itemPermissionChecker;
|
||||||
|
|
||||||
private Map<String, String> textValues;
|
@Inject
|
||||||
|
private MvcArticleTextBodyStepModel articleTextBodyStepModel;
|
||||||
private List<CmsEditorLocaleVariantRow> variants;
|
|
||||||
|
|
||||||
private List<String> unusedLocales;
|
|
||||||
|
|
||||||
private String selectedLocale;
|
|
||||||
|
|
||||||
|
// private Map<String, String> textValues;
|
||||||
|
//
|
||||||
|
// private List<CmsEditorLocaleVariantRow> variants;
|
||||||
|
//
|
||||||
|
// private List<String> unusedLocales;
|
||||||
|
//
|
||||||
|
// private String selectedLocale;
|
||||||
@Override
|
@Override
|
||||||
public Class<MvcArticleTextBodyStep> getStepClass() {
|
public Class<MvcArticleTextBodyStep> getStepClass() {
|
||||||
return MvcArticleTextBodyStep.class;
|
return MvcArticleTextBodyStep.class;
|
||||||
|
|
@ -142,31 +140,31 @@ public class MvcArticleTextBodyStep extends AbstractMvcAuthoringStep {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Get all localized values of the main text.
|
// * Get all localized values of the main text.
|
||||||
*
|
// *
|
||||||
* @return The localized values of the main text.
|
// * @return The localized values of the main text.
|
||||||
*/
|
// */
|
||||||
public Map<String, String> getTextValues() {
|
// public Map<String, String> getTextValues() {
|
||||||
return Collections.unmodifiableMap(textValues);
|
// return Collections.unmodifiableMap(textValues);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public List<CmsEditorLocaleVariantRow> getVariants() {
|
// public List<CmsEditorLocaleVariantRow> getVariants() {
|
||||||
return Collections.unmodifiableList(variants);
|
// return Collections.unmodifiableList(variants);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Gets the locales for which the main text has not been defined yet.
|
// * Gets the locales for which the main text has not been defined yet.
|
||||||
*
|
// *
|
||||||
* @return The locales for which the main text has not been defined yet.
|
// * @return The locales for which the main text has not been defined yet.
|
||||||
*/
|
// */
|
||||||
public List<String> getUnusedLocales() {
|
// public List<String> getUnusedLocales() {
|
||||||
return Collections.unmodifiableList(unusedLocales);
|
// return Collections.unmodifiableList(unusedLocales);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public String getSelectedLocale() {
|
// public String getSelectedLocale() {
|
||||||
return selectedLocale;
|
// return selectedLocale;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a localized main text.
|
* Adds a localized main text.
|
||||||
|
|
@ -274,7 +272,9 @@ public class MvcArticleTextBodyStep extends AbstractMvcAuthoringStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemPermissionChecker.canEditItem(getArticle())) {
|
if (itemPermissionChecker.canEditItem(getArticle())) {
|
||||||
selectedLocale = new Locale(localeParam).toString();
|
articleTextBodyStepModel.setSelectedLocale(
|
||||||
|
new Locale(localeParam).toString()
|
||||||
|
);
|
||||||
|
|
||||||
return "org/librecms/ui/contenttypes/article/article-text/edit.xhtml";
|
return "org/librecms/ui/contenttypes/article/article-text/edit.xhtml";
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -379,7 +379,11 @@ public class MvcArticleTextBodyStep extends AbstractMvcAuthoringStep {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
if (itemPermissionChecker.canEditItem(getArticle())) {
|
if (itemPermissionChecker.canEditItem(getArticle())) {
|
||||||
textValues = getArticle()
|
articleTextBodyStepModel.setCanEdit(
|
||||||
|
itemPermissionChecker.canEditItem(getArticle())
|
||||||
|
);
|
||||||
|
articleTextBodyStepModel.setTextValues(
|
||||||
|
getArticle()
|
||||||
.getText()
|
.getText()
|
||||||
.getValues()
|
.getValues()
|
||||||
.entrySet()
|
.entrySet()
|
||||||
|
|
@ -389,25 +393,30 @@ public class MvcArticleTextBodyStep extends AbstractMvcAuthoringStep {
|
||||||
entry -> entry.getKey().toString(),
|
entry -> entry.getKey().toString(),
|
||||||
entry -> entry.getValue()
|
entry -> entry.getValue()
|
||||||
)
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
variants = getArticle()
|
articleTextBodyStepModel.setVariants(
|
||||||
|
getArticle()
|
||||||
.getText()
|
.getText()
|
||||||
.getValues()
|
.getValues()
|
||||||
.entrySet()
|
.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.map(this::buildVariantRow)
|
.map(this::buildVariantRow)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
|
||||||
final Set<Locale> locales = getArticle()
|
final Set<Locale> locales = getArticle()
|
||||||
.getText()
|
.getText()
|
||||||
.getAvailableLocales();
|
.getAvailableLocales();
|
||||||
unusedLocales = globalizationHelper
|
articleTextBodyStepModel.setUnusedLocales(
|
||||||
|
globalizationHelper
|
||||||
.getAvailableLocales()
|
.getAvailableLocales()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(locale -> !locales.contains(locale))
|
.filter(locale -> !locales.contains(locale))
|
||||||
.map(Locale::toString)
|
.map(Locale::toString)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021 LibreCCM Foundation.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library 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
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
package org.librecms.ui.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.ui.contentsections.documents.CmsEditorLocaleVariantRow;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@Named("CmsArticleTextBodyStep")
|
||||||
|
public class MvcArticleTextBodyStepModel {
|
||||||
|
|
||||||
|
private boolean canEdit;
|
||||||
|
|
||||||
|
private Map<String, String> textValues;
|
||||||
|
|
||||||
|
private List<CmsEditorLocaleVariantRow> variants;
|
||||||
|
|
||||||
|
private List<String> unusedLocales;
|
||||||
|
|
||||||
|
private String selectedLocale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all localized values of the main text.
|
||||||
|
*
|
||||||
|
* @return The localized values of the main text.
|
||||||
|
*/
|
||||||
|
public Map<String, String> getTextValues() {
|
||||||
|
return Collections.unmodifiableMap(textValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setTextValues(final Map<String, String> textValues) {
|
||||||
|
this.textValues = new HashMap<>(textValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the locales for which the main text has not been defined yet.
|
||||||
|
*
|
||||||
|
* @return The locales for which the main text has not been defined yet.
|
||||||
|
*/
|
||||||
|
public List<CmsEditorLocaleVariantRow> getVariants() {
|
||||||
|
return Collections.unmodifiableList(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setVariants(final List<CmsEditorLocaleVariantRow> variants) {
|
||||||
|
this.variants = new ArrayList<>(variants);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getUnusedLocales() {
|
||||||
|
return Collections.unmodifiableList(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUnusedLocales(final List<String> unusedLocales) {
|
||||||
|
this.unusedLocales = new ArrayList<>(unusedLocales);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSelectedLocale() {
|
||||||
|
return selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setSelectedLocale(final String selectedLocale) {
|
||||||
|
this.selectedLocale = selectedLocale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getCanEdit() {
|
||||||
|
return canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCanEdit(final boolean canEdit) {
|
||||||
|
this.canEdit = canEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
<ui:define name="editStep">
|
<ui:define name="editStep">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>#{CmsAssetsStepsDefaultMessagesBundle.getMessage('postaladdress.editstep.header', [CmsPostalAddressEditStep.name])}</h2>
|
<h2>#{CmsAssetsStepsDefaultMessagesBundle.getMessage('postaladdress.editstep.header', [MvcAssetEditStepModel.name])}</h2>
|
||||||
|
|
||||||
<h3>#{CmsAssetsStepsDefaultMessagesBundle['editstep.name.header']}</h3>
|
<h3>#{CmsAssetsStepsDefaultMessagesBundle['editstep.name.header']}</h3>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<pre class="mr-2">#{CmsPostalAddressEditStep.name}</pre>
|
<pre class="mr-2">#{MvcAssetEditStepModel.name}</pre>
|
||||||
<c:if test="#{CmsPostalAddressEditStep.canEdit}">
|
<c:if test="#{MvcAssetEditStepModel.canEdit}">
|
||||||
<button class="btn btn-primary btn-sm"
|
<button class="btn btn-primary btn-sm"
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
data-target="#name-edit-dialog"
|
data-target="#name-edit-dialog"
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
</c:if>
|
</c:if>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<c:if test="#{CmsPostalAddressEditStep.canEdit}">
|
<c:if test="#{MvcAssetEditStepModel.canEdit}">
|
||||||
<div aria-hidden="true"
|
<div aria-hidden="true"
|
||||||
aria-labelledby="name-edit-dialog-title"
|
aria-labelledby="name-edit-dialog-title"
|
||||||
class="modal fade"
|
class="modal fade"
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
name="name"
|
name="name"
|
||||||
pattern="^([a-zA-Z0-9_-]*)$"
|
pattern="^([a-zA-Z0-9_-]*)$"
|
||||||
required="true"
|
required="true"
|
||||||
value="#{CmsPostalAddressEditStep.name}"
|
value="#{MvcAssetEditStepModel.name}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
@ -94,10 +94,10 @@
|
||||||
editDialogValueLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.edit.value.label']}"
|
editDialogValueLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.edit.value.label']}"
|
||||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@postaladdress-edit/title/@edit"
|
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@postaladdress-edit/title/@edit"
|
||||||
editorId="title-editor"
|
editorId="title-editor"
|
||||||
hasUnusedLocales="#{!CmsPostalAddressEditStep.unusedTitleLocales.isEmpty()}"
|
hasUnusedLocales="#{!MvcAssetEditStepModel.unusedTitleLocales.isEmpty()}"
|
||||||
headingLevel="3"
|
headingLevel="3"
|
||||||
objectIdentifier="#{CmsSelectedAssetModel.assetPath}"
|
objectIdentifier="#{CmsSelectedAssetModel.assetPath}"
|
||||||
readOnly="#{!CmsPostalAddressEditStep.canEdit}"
|
readOnly="#{!MvcAssetEditStepModel.canEdit}"
|
||||||
removeButtonLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove']}"
|
removeButtonLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove']}"
|
||||||
removeDialogCancelLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.cancel']}"
|
removeDialogCancelLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.cancel']}"
|
||||||
removeDialogSubmitLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.submit']}"
|
removeDialogSubmitLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.submit']}"
|
||||||
|
|
@ -105,13 +105,13 @@
|
||||||
removeDialogTitle="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.title']}"
|
removeDialogTitle="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.title']}"
|
||||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@postaladdress-edit/title/@remove"
|
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@postaladdress-edit/title/@remove"
|
||||||
title="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.header']}"
|
title="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.header']}"
|
||||||
unusedLocales="#{CmsPostalAddressEditStep.unusedTitleLocales}"
|
unusedLocales="#{MvcAssetEditStepModel.unusedTitleLocales}"
|
||||||
values="#{CmsPostalAddressEditStep.titleValues}"
|
values="#{MvcAssetEditStepModel.titleValues}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<h3>#{CmsAssetsStepsDefaultMessagesBundle['postaladdress.editstep.properties.header']}</h3>
|
<h3>#{CmsAssetsStepsDefaultMessagesBundle['postaladdress.editstep.properties.header']}</h3>
|
||||||
|
|
||||||
<c:if test="#{CmsPostalAddressEditStep.canEdit}">
|
<c:if test="#{MvcAssetEditStepModel.canEdit}">
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<button class="btn btn-primary"
|
<button class="btn btn-primary"
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@
|
||||||
|
|
||||||
<ui:define name="editStep">
|
<ui:define name="editStep">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h2>#{CmsAssetsStepsDefaultMessagesBundle.getMessage('sidenote.editstep.header', [CmsSideNoteEditStep.name])}</h2>
|
<h2>#{CmsAssetsStepsDefaultMessagesBundle.getMessage('sidenote.editstep.header', [MvcAssetEditStepModel.name])}</h2>
|
||||||
|
|
||||||
|
|
||||||
<h3>#{CmsAssetsStepsDefaultMessagesBundle['editstep.name.header']}</h3>
|
<h3>#{CmsAssetsStepsDefaultMessagesBundle['editstep.name.header']}</h3>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<pre class="mr-2">#{CmsSideNoteEditStep.name}</pre>
|
<pre class="mr-2">#{MvcAssetEditStepModel.name}</pre>
|
||||||
<c:if test="#{CmsSideNoteEditStep.canEdit}">
|
<c:if test="#{MvcAssetEditStepModel.canEdit}">
|
||||||
<button class="btn btn-primary btn-sm"
|
<button class="btn btn-primary btn-sm"
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
data-target="#name-edit-dialog"
|
data-target="#name-edit-dialog"
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
</c:if>
|
</c:if>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<c:if test="#{CmsSideNoteEditStep.canEdit}">
|
<c:if test="#{MvcAssetEditStepModel.canEdit}">
|
||||||
<div aria-hidden="true"
|
<div aria-hidden="true"
|
||||||
aria-labelledby="name-edit-dialog-title"
|
aria-labelledby="name-edit-dialog-title"
|
||||||
class="modal fade"
|
class="modal fade"
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
name="name"
|
name="name"
|
||||||
pattern="^([a-zA-Z0-9_-]*)$"
|
pattern="^([a-zA-Z0-9_-]*)$"
|
||||||
required="true"
|
required="true"
|
||||||
value="#{CmsSideNoteEditStep.name}"
|
value="#{MvcAssetEditStepModel.name}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
@ -96,10 +96,10 @@
|
||||||
editDialogValueLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.edit.value.label']}"
|
editDialogValueLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.edit.value.label']}"
|
||||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit/title/@edit"
|
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit/title/@edit"
|
||||||
editorId="title-editor"
|
editorId="title-editor"
|
||||||
hasUnusedLocales="#{!CmsSideNoteEditStep.unusedTitleLocales.isEmpty()}"
|
hasUnusedLocales="#{!MvcAssetEditStepModel.unusedTitleLocales.isEmpty()}"
|
||||||
headingLevel="3"
|
headingLevel="3"
|
||||||
objectIdentifier="#{CmsSelectedAssetModel.assetPath}"
|
objectIdentifier="#{CmsSelectedAssetModel.assetPath}"
|
||||||
readOnly="#{!CmsSideNoteEditStep.canEdit}"
|
readOnly="#{!MvcAssetEditStepModel.canEdit}"
|
||||||
removeButtonLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove']}"
|
removeButtonLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove']}"
|
||||||
removeDialogCancelLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.cancel']}"
|
removeDialogCancelLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.cancel']}"
|
||||||
removeDialogSubmitLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.submit']}"
|
removeDialogSubmitLabel="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.submit']}"
|
||||||
|
|
@ -107,29 +107,29 @@
|
||||||
removeDialogTitle="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.title']}"
|
removeDialogTitle="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.remove.title']}"
|
||||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit/title/@remove"
|
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit/title/@remove"
|
||||||
title="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.header']}"
|
title="#{CmsAssetsStepsDefaultMessagesBundle['editstep.title.header']}"
|
||||||
unusedLocales="#{CmsSideNoteEditStep.unusedTitleLocales}"
|
unusedLocales="#{MvcAssetEditStepModel.unusedTitleLocales}"
|
||||||
values="#{CmsSideNoteEditStep.titleValues}"
|
values="#{MvcAssetEditStepModel.titleValues}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<c:if test="#{CmsSideNoteEditStep.canEdit}">
|
<c:if test="#{MvcAssetEditStepModel.canEdit}">
|
||||||
<librecms:cmsEditor
|
<librecms:cmsEditor
|
||||||
addButtonLabel="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.sidenote.text.editor.add_variant']}"
|
addButtonLabel="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.sidenote.text.editor.add_variant']}"
|
||||||
addDialogLocaleSelectHelp="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.add.locale.help']}"
|
addDialogLocaleSelectHelp="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.add.locale.help']}"
|
||||||
addDialogLocaleSelectLabel="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.add.locale.label']}"
|
addDialogLocaleSelectLabel="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.add.locale.label']}"
|
||||||
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSideNoteEditStep.assetPath}/@sidenote-edit/text/add"
|
addMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit/text/add"
|
||||||
editDialogValueHelp="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.edit.value.help']}"
|
editDialogValueHelp="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.edit.value.help']}"
|
||||||
editDialogValueLabel="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.edit.value.label']}"
|
editDialogValueLabel="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.text.editor.edit.value.label']}"
|
||||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSideNoteEditStep.assetPath}/@sidenote-edit/text/edit"
|
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit/text/edit"
|
||||||
editorId="sidenote-text-editor"
|
editorId="sidenote-text-editor"
|
||||||
hasUnusedLocales="#{!CmsSideNoteEditStep.unusedTextLocales.isEmpty()}"
|
hasUnusedLocales="#{!CmsSideNoteEditStep.unusedTextLocales.isEmpty()}"
|
||||||
headingLevel="3"
|
headingLevel="3"
|
||||||
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
|
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
|
||||||
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSideNoteEditStep.assetPath}/@sidenote-edit/text/remove"
|
removeMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit/text/remove"
|
||||||
title="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.editstep.text.header']}"
|
title="#{CmsAssetsStepsDefaultMessagesBundle['sidenote.editstep.text.header']}"
|
||||||
unusedLocales="#{CmsSideNoteEditStep.unusedTextLocales}"
|
unusedLocales="#{CmsSideNoteEditStep.unusedTextLocales}"
|
||||||
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSideNoteEditStep.assetPath}/@sidenote-edit-resources/text/variants"
|
variantUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit-resources/text/variants"
|
||||||
variants="#{CmsSideNoteEditStep.variants}"
|
variants="#{CmsSideNoteEditStep.variants}"
|
||||||
wordCountUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSideNoteEditStep.assetPath}/@sidenote-edit-resources/text/variants/wordcount"
|
wordCountUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/assets/#{CmsSelectedAssetModel.assetPath}/@sidenote-edit-resources/text/variants/wordcount"
|
||||||
/>
|
/>
|
||||||
</c:if>
|
</c:if>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue