PublicPersonalProfile jetzt vollständig mehrsprachenfähig
git-svn-id: https://svn.libreccm.org/ccm/trunk@1384 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
b3b2306ce1
commit
e27f16659d
|
|
@ -15,10 +15,11 @@
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
// import com.arsdigita.cms.CMS;
|
// import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.contentassets.RelatedLink;
|
import com.arsdigita.cms.contentassets.RelatedLink;
|
||||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfiles;
|
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfiles;
|
||||||
// import com.arsdigita.dispatcher.DispatcherHelper;
|
// import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
|
|
@ -38,14 +39,15 @@ import java.util.Map;
|
||||||
public class PublicPersonalProfileXmlUtil {
|
public class PublicPersonalProfileXmlUtil {
|
||||||
|
|
||||||
private final com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileConfig config =
|
private final com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileConfig config =
|
||||||
PublicPersonalProfiles.getConfig();
|
PublicPersonalProfiles.
|
||||||
|
getConfig();
|
||||||
|
|
||||||
public void createNavigation(final PublicPersonalProfile profile,
|
public void createNavigation(final PublicPersonalProfile profile,
|
||||||
final Element root,
|
final Element root,
|
||||||
final String navPath,
|
final String navPath,
|
||||||
final String prefix,
|
final String prefix,
|
||||||
final String appPath,
|
final String appPath,
|
||||||
final boolean previewMode) {
|
final boolean previewMode) {
|
||||||
String homeLabelsStr = config.getHomeNavItemLabels();
|
String homeLabelsStr = config.getHomeNavItemLabels();
|
||||||
|
|
||||||
Map<String, String> homeLabels = new HashMap<String, String>();
|
Map<String, String> homeLabels = new HashMap<String, String>();
|
||||||
|
|
@ -55,7 +57,7 @@ public class PublicPersonalProfileXmlUtil {
|
||||||
homeLabelSplit = homeLabelEntry.split(":");
|
homeLabelSplit = homeLabelEntry.split(":");
|
||||||
if (homeLabelSplit.length == 2) {
|
if (homeLabelSplit.length == 2) {
|
||||||
homeLabels.put(homeLabelSplit[0].trim(),
|
homeLabels.put(homeLabelSplit[0].trim(),
|
||||||
homeLabelSplit[1].trim());
|
homeLabelSplit[1].trim());
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -70,12 +72,12 @@ public class PublicPersonalProfileXmlUtil {
|
||||||
|
|
||||||
Element navRoot =
|
Element navRoot =
|
||||||
root.newChildElement("nav:categoryMenu",
|
root.newChildElement("nav:categoryMenu",
|
||||||
"http://ccm.redhat.com/navigation");
|
"http://ccm.redhat.com/navigation");
|
||||||
navRoot.addAttribute("id", "categoryMenu");
|
navRoot.addAttribute("id", "categoryMenu");
|
||||||
|
|
||||||
Element navList =
|
Element navList =
|
||||||
navRoot.newChildElement("nav:category",
|
navRoot.newChildElement("nav:category",
|
||||||
"http://ccm.redhat.com/navigation");
|
"http://ccm.redhat.com/navigation");
|
||||||
navList.addAttribute("AbstractTree", "AbstractTree");
|
navList.addAttribute("AbstractTree", "AbstractTree");
|
||||||
navList.addAttribute("description", "");
|
navList.addAttribute("description", "");
|
||||||
navList.addAttribute("id", "");
|
navList.addAttribute("id", "");
|
||||||
|
|
@ -86,13 +88,13 @@ public class PublicPersonalProfileXmlUtil {
|
||||||
appUrl,
|
appUrl,
|
||||||
profile.getProfileUrl()));*/
|
profile.getProfileUrl()));*/
|
||||||
navList.addAttribute("url", String.format("/ccm/%s",
|
navList.addAttribute("url", String.format("/ccm/%s",
|
||||||
UI.getConfig().getRootPage()));
|
UI.getConfig().getRootPage()));
|
||||||
|
|
||||||
|
|
||||||
if (config.getShowHomeNavEntry()) {
|
if (config.getShowHomeNavEntry()) {
|
||||||
Element navHome =
|
Element navHome =
|
||||||
navList.newChildElement("nav:category",
|
navList.newChildElement("nav:category",
|
||||||
"http://ccm.redhat.com/navigation");
|
"http://ccm.redhat.com/navigation");
|
||||||
navHome.addAttribute("AbstractTree", "AbstractTree");
|
navHome.addAttribute("AbstractTree", "AbstractTree");
|
||||||
navHome.addAttribute("description", "");
|
navHome.addAttribute("description", "");
|
||||||
navHome.addAttribute("id", profile.getID().toString());
|
navHome.addAttribute("id", profile.getID().toString());
|
||||||
|
|
@ -103,26 +105,27 @@ public class PublicPersonalProfileXmlUtil {
|
||||||
}
|
}
|
||||||
navHome.addAttribute("sortKey", "");
|
navHome.addAttribute("sortKey", "");
|
||||||
|
|
||||||
String homeLabel = homeLabels.get(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
String homeLabel = homeLabels.get(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().getLanguage());
|
||||||
if (homeLabel == null) {
|
if (homeLabel == null) {
|
||||||
navHome.addAttribute("title", "Home");
|
navHome.addAttribute("title", "Home");
|
||||||
} else {
|
} else {
|
||||||
navHome.addAttribute("title", homeLabel);
|
navHome.addAttribute("title", homeLabel);
|
||||||
}
|
}
|
||||||
navHome.addAttribute("url", String.format("%s/%s",
|
navHome.addAttribute("url", String.format("%s/%s",
|
||||||
appUrl,
|
appUrl,
|
||||||
profile.getProfileUrl()));
|
profile.getProfileUrl()));
|
||||||
//navHome.addAttribute("url", String.format("/ccm/%s",
|
//navHome.addAttribute("url", String.format("/ccm/%s",
|
||||||
// UI.getConfig().getRootPage()));
|
// UI.getConfig().getRootPage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get the available Navigation items
|
//Get the available Navigation items
|
||||||
PublicPersonalProfileNavItemCollection navItems =
|
PublicPersonalProfileNavItemCollection navItems =
|
||||||
new PublicPersonalProfileNavItemCollection();
|
new PublicPersonalProfileNavItemCollection();
|
||||||
navItems.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().
|
navItems.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().
|
||||||
getLanguage());
|
getLanguage());
|
||||||
final Map<String, PublicPersonalProfileNavItem> navItemMap =
|
final Map<String, PublicPersonalProfileNavItem> navItemMap =
|
||||||
new HashMap<String, PublicPersonalProfileNavItem>();
|
new HashMap<String, PublicPersonalProfileNavItem>();
|
||||||
PublicPersonalProfileNavItem navItem;
|
PublicPersonalProfileNavItem navItem;
|
||||||
while (navItems.next()) {
|
while (navItems.next()) {
|
||||||
navItem = navItems.getNavItem();
|
navItem = navItems.getNavItem();
|
||||||
|
|
@ -130,34 +133,36 @@ public class PublicPersonalProfileXmlUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Element pathElem =
|
final Element pathElem =
|
||||||
root.newChildElement("nav:categoryPath",
|
root.newChildElement("nav:categoryPath",
|
||||||
"http://ccm.redhat.com/navigation");
|
"http://ccm.redhat.com/navigation");
|
||||||
final Element homeElem =
|
final Element homeElem =
|
||||||
pathElem.newChildElement("nav:category",
|
pathElem.newChildElement("nav:category",
|
||||||
"http://ccm.redhat.com/navigation");
|
"http://ccm.redhat.com/navigation");
|
||||||
//homeElem.addAttribute("url", String.format("%s/%s",
|
//homeElem.addAttribute("url", String.format("%s/%s",
|
||||||
// appUrl,
|
// appUrl,
|
||||||
// profile.getProfileUrl()));
|
// profile.getProfileUrl()));
|
||||||
homeElem.addAttribute("url", String.format("/ccm/%s",
|
homeElem.addAttribute("url", String.format("/ccm/%s",
|
||||||
UI.getConfig().getRootPage()));
|
UI.getConfig().getRootPage()));
|
||||||
|
|
||||||
final Element profileElem = pathElem.newChildElement("nav:category",
|
final Element profileElem =
|
||||||
"http://ccm.redhat.com/navigation");
|
pathElem.newChildElement("nav:category",
|
||||||
|
"http://ccm.redhat.com/navigation");
|
||||||
profileElem.addAttribute("url", String.format("%s/%s",
|
profileElem.addAttribute("url", String.format("%s/%s",
|
||||||
appUrl,
|
appUrl,
|
||||||
profile.getProfileUrl()));
|
profile.getProfileUrl()));
|
||||||
profileElem.addAttribute("title", profile.getOwner().getFullName());
|
profileElem.addAttribute("title", profile.getOwner().getFullName());
|
||||||
|
|
||||||
//Get the related links of the profiles
|
//Get the related links of the profiles
|
||||||
DataCollection links =
|
DataCollection links =
|
||||||
RelatedLink.getRelatedLinks(profile,
|
RelatedLink.getRelatedLinks(profile,
|
||||||
PublicPersonalProfile.LINK_LIST_NAME);
|
PublicPersonalProfile.LINK_LIST_NAME);
|
||||||
links.addOrder(Link.ORDER);
|
links.addOrder(Link.ORDER);
|
||||||
RelatedLink link;
|
RelatedLink link;
|
||||||
String navLinkKey;
|
String navLinkKey;
|
||||||
Element navElem;
|
Element navElem;
|
||||||
while (links.next()) {
|
while (links.next()) {
|
||||||
link = (RelatedLink) DomainObjectFactory.newInstance(links.getDataObject());
|
link = (RelatedLink) DomainObjectFactory.newInstance(links.
|
||||||
|
getDataObject());
|
||||||
|
|
||||||
navLinkKey = link.getTitle();
|
navLinkKey = link.getTitle();
|
||||||
navItem = navItemMap.get(navLinkKey);
|
navItem = navItemMap.get(navLinkKey);
|
||||||
|
|
@ -166,23 +171,34 @@ public class PublicPersonalProfileXmlUtil {
|
||||||
//ToDo
|
//ToDo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ContentItem targetItem = link.getTargetItem();
|
||||||
|
if (!(targetItem instanceof PublicPersonalProfile)
|
||||||
|
&& (targetItem instanceof ContentPage)) {
|
||||||
|
ContentPage targetPage = (ContentPage) targetItem;
|
||||||
|
if (!(targetPage.getContentBundle().hasInstance(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().getLanguage(),
|
||||||
|
false))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
navElem =
|
navElem =
|
||||||
navList.newChildElement("nav:category",
|
navList.newChildElement("nav:category",
|
||||||
"http://ccm.redhat.com/navigation");
|
"http://ccm.redhat.com/navigation");
|
||||||
navElem.addAttribute("AbstractTree", "AbstractTree");
|
navElem.addAttribute("AbstractTree", "AbstractTree");
|
||||||
navElem.addAttribute("description", "");
|
navElem.addAttribute("description", "");
|
||||||
//navHome.addAttribute("id", "");
|
//navHome.addAttribute("id", "");
|
||||||
if ((navPath != null) && navPath.equals(navLinkKey)) {
|
if ((navPath != null) && navPath.equals(navLinkKey)) {
|
||||||
navElem.addAttribute("isSelected", "true");
|
navElem.addAttribute("isSelected", "true");
|
||||||
final Element currentPathElem =
|
final Element currentPathElem =
|
||||||
pathElem.newChildElement("nav:category",
|
pathElem.newChildElement("nav:category",
|
||||||
"http://ccm.redhat.com/navigation");
|
"http://ccm.redhat.com/navigation");
|
||||||
currentPathElem.addAttribute("title", navItem.getLabel());
|
currentPathElem.addAttribute("title", navItem.getLabel());
|
||||||
currentPathElem.addAttribute("url",
|
currentPathElem.addAttribute("url",
|
||||||
String.format("%s/%s/%s",
|
String.format("%s/%s/%s",
|
||||||
appUrl,
|
appUrl,
|
||||||
profile.getProfileUrl(),
|
profile.getProfileUrl(),
|
||||||
navLinkKey));
|
navLinkKey));
|
||||||
} else {
|
} else {
|
||||||
navElem.addAttribute("isSelected", "false");
|
navElem.addAttribute("isSelected", "false");
|
||||||
}
|
}
|
||||||
|
|
@ -193,9 +209,9 @@ public class PublicPersonalProfileXmlUtil {
|
||||||
navElem.addAttribute("title", navItem.getLabel());
|
navElem.addAttribute("title", navItem.getLabel());
|
||||||
}
|
}
|
||||||
navElem.addAttribute("url", String.format("%s/%s/%s",
|
navElem.addAttribute("url", String.format("%s/%s/%s",
|
||||||
appUrl,
|
appUrl,
|
||||||
profile.getProfileUrl(),
|
profile.getProfileUrl(),
|
||||||
navLinkKey));
|
navLinkKey));
|
||||||
|
|
||||||
navElem.addAttribute("navItem", navLinkKey);
|
navElem.addAttribute("navItem", navLinkKey);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -236,6 +236,6 @@ public class PublicPersonalProfileCreate extends PageCreate {
|
||||||
String.format("version = '%s'", ContentItem.DRAFT));
|
String.format("version = '%s'", ContentItem.DRAFT));
|
||||||
}
|
}
|
||||||
|
|
||||||
return profileUrl;
|
return GenericPerson.urlSave(profileUrl).toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.CMS;
|
import com.arsdigita.cms.CMS;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ReusableImageAsset;
|
import com.arsdigita.cms.ReusableImageAsset;
|
||||||
import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
||||||
|
|
@ -162,17 +163,30 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
|
|
||||||
final Session session = SessionManager.getSession();
|
final Session session = SessionManager.getSession();
|
||||||
|
|
||||||
DataCollection profiles =
|
/*DataCollection profiles =
|
||||||
session.retrieve(
|
session.retrieve(
|
||||||
com.arsdigita.cms.contenttypes.PublicPersonalProfile.BASE_DATA_OBJECT_TYPE);
|
com.arsdigita.cms.contenttypes.PublicPersonalProfile.BASE_DATA_OBJECT_TYPE);
|
||||||
profiles.addFilter(String.format("profileUrl = '%s'",
|
profiles.addFilter(String.format("profileUrl = '%s'",
|
||||||
profileOwner));
|
profileOwner));
|
||||||
if (preview) {
|
if (preview) {
|
||||||
profiles.addFilter(String.format("version = '%s'",
|
profiles.addFilter(String.format("version = '%s'",
|
||||||
ContentItem.DRAFT));
|
ContentItem.DRAFT));
|
||||||
} else {
|
} else {
|
||||||
profiles.addFilter(String.format("version = '%s'",
|
profiles.addFilter(String.format("version = '%s'",
|
||||||
ContentItem.LIVE));
|
ContentItem.LIVE));
|
||||||
|
}*/
|
||||||
|
|
||||||
|
DataCollection profiles = getProfiles(session,
|
||||||
|
profileOwner,
|
||||||
|
preview,
|
||||||
|
GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().getLanguage());
|
||||||
|
|
||||||
|
if (profiles.isEmpty()) {
|
||||||
|
profiles = getProfiles(session,
|
||||||
|
profileOwner,
|
||||||
|
preview,
|
||||||
|
GlobalizationHelper.LANG_INDEPENDENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profiles.size() == 0) {
|
if (profiles.size() == 0) {
|
||||||
|
|
@ -200,24 +214,25 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
com.arsdigita.cms.SecurityManager securityManager =
|
com.arsdigita.cms.SecurityManager securityManager =
|
||||||
Utilities.
|
Utilities.
|
||||||
getSecurityManager(state);
|
getSecurityManager(state);
|
||||||
|
|
||||||
final boolean canEdit = securityManager.canAccess(
|
final boolean canEdit = securityManager.canAccess(
|
||||||
state.getRequest(),
|
state.getRequest(),
|
||||||
com.arsdigita.cms.SecurityManager.PREVIEW_PAGES,
|
com.arsdigita.cms.SecurityManager.PREVIEW_PAGES,
|
||||||
profile);
|
profile);
|
||||||
|
|
||||||
if (!canEdit) {
|
if (!canEdit) {
|
||||||
throw new AccessDeniedException("user " + Kernel.
|
throw new AccessDeniedException("user "
|
||||||
getContext().getParty().getOID()
|
+ Kernel.
|
||||||
+ " doesn't have the "
|
getContext().getParty().getOID()
|
||||||
+ com.arsdigita.cms.SecurityManager.EDIT_ITEM
|
+ " doesn't have the "
|
||||||
+ " privilege on "
|
+ com.arsdigita.cms.SecurityManager.EDIT_ITEM
|
||||||
+ profile.getOID().
|
+ " privilege on "
|
||||||
toString());
|
+ profile.getOID().
|
||||||
|
toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getEmbedded()) {
|
if (config.getEmbedded()) {
|
||||||
final ContentSection section =
|
final ContentSection section =
|
||||||
profile.getContentSection();
|
profile.getContentSection();
|
||||||
|
|
@ -392,8 +407,47 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
(RelatedLink) DomainObjectFactory.
|
(RelatedLink) DomainObjectFactory.
|
||||||
newInstance(links.getDataObject());
|
newInstance(links.getDataObject());
|
||||||
links.close();
|
links.close();
|
||||||
final ContentItem item =
|
ContentItem item =
|
||||||
link.getTargetItem();
|
link.getTargetItem();
|
||||||
|
|
||||||
|
if (item instanceof ContentPage) {
|
||||||
|
ContentPage contentPage =
|
||||||
|
(ContentPage) item;
|
||||||
|
logger.error("contentPage.getContentBundle().hasInstance(GlobalizationHelper.getNegotiatedLocale().getLanguage()) = "
|
||||||
|
+ contentPage.
|
||||||
|
getContentBundle().
|
||||||
|
hasInstance(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().
|
||||||
|
getLanguage()));
|
||||||
|
if (contentPage.getContentBundle().
|
||||||
|
hasInstance(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().
|
||||||
|
getLanguage())) {
|
||||||
|
contentPage =
|
||||||
|
(ContentPage) contentPage.
|
||||||
|
getContentBundle().
|
||||||
|
getInstance(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().
|
||||||
|
getLanguage());
|
||||||
|
item = (ContentItem) contentPage;
|
||||||
|
} else {
|
||||||
|
logger.error(
|
||||||
|
String.format(
|
||||||
|
"Item '%s' not found in a suitable language variant. Negotiated langauge: %s, langugage independent items allowed is %s, language independent code is %s ",
|
||||||
|
itemPath,
|
||||||
|
GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().
|
||||||
|
getLanguage(),
|
||||||
|
Kernel.getConfig().
|
||||||
|
languageIndependentItems(),
|
||||||
|
GlobalizationHelper.LANG_INDEPENDENT));
|
||||||
|
response.setStatus(
|
||||||
|
HttpServletResponse.SC_NOT_FOUND);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
final Element contentPanelElem = root.
|
final Element contentPanelElem = root.
|
||||||
newChildElement("cms:contentPanel",
|
newChildElement("cms:contentPanel",
|
||||||
CMS.CMS_XML_NS);
|
CMS.CMS_XML_NS);
|
||||||
|
|
@ -415,10 +469,42 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
|
|
||||||
final OID itemOid = OID.valueOf(itemPath);
|
final OID itemOid = OID.valueOf(itemPath);
|
||||||
try {
|
try {
|
||||||
final ContentItem item =
|
ContentItem item =
|
||||||
(ContentItem) DomainObjectFactory.
|
(ContentItem) DomainObjectFactory.
|
||||||
newInstance(itemOid);
|
newInstance(itemOid);
|
||||||
|
|
||||||
|
if (item instanceof ContentPage) {
|
||||||
|
ContentPage contentPage = (ContentPage) item;
|
||||||
|
logger.error("contentPage.getContentBundle().hasInstance(GlobalizationHelper.getNegotiatedLocale().getLanguage()) = "
|
||||||
|
+ contentPage.getContentBundle().
|
||||||
|
hasInstance(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().getLanguage()));
|
||||||
|
if (contentPage.getContentBundle().
|
||||||
|
hasInstance(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().getLanguage())) {
|
||||||
|
contentPage = (ContentPage) contentPage.
|
||||||
|
getContentBundle().getInstance(GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().
|
||||||
|
getLanguage());
|
||||||
|
item = (ContentItem) contentPage;
|
||||||
|
} else {
|
||||||
|
logger.error(
|
||||||
|
String.format(
|
||||||
|
"Item '%s' not found in a suitable language variant. Negotiated langauge: %s, langugage independent items allowed is %s, language independent code is %s ",
|
||||||
|
itemPath,
|
||||||
|
GlobalizationHelper.
|
||||||
|
getNegotiatedLocale().
|
||||||
|
getLanguage(),
|
||||||
|
Kernel.getConfig().
|
||||||
|
languageIndependentItems(),
|
||||||
|
GlobalizationHelper.LANG_INDEPENDENT));
|
||||||
|
response.setStatus(
|
||||||
|
HttpServletResponse.SC_NOT_FOUND);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
final Element contentPanelElem = root.
|
final Element contentPanelElem = root.
|
||||||
newChildElement("cms:contentPanel",
|
newChildElement("cms:contentPanel",
|
||||||
CMS.CMS_XML_NS);
|
CMS.CMS_XML_NS);
|
||||||
|
|
@ -608,4 +694,26 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
presentationManager.servePage(document, request, response);
|
presentationManager.servePage(document, request, response);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DataCollection getProfiles(final Session session,
|
||||||
|
final String profileOwner,
|
||||||
|
final boolean preview,
|
||||||
|
final String language) {
|
||||||
|
DataCollection profiles =
|
||||||
|
session.retrieve(
|
||||||
|
com.arsdigita.cms.contenttypes.PublicPersonalProfile.BASE_DATA_OBJECT_TYPE);
|
||||||
|
profiles.addFilter(String.format("profileUrl = '%s'",
|
||||||
|
profileOwner));
|
||||||
|
if (preview) {
|
||||||
|
profiles.addFilter(String.format("version = '%s'",
|
||||||
|
ContentItem.DRAFT));
|
||||||
|
} else {
|
||||||
|
profiles.addFilter(String.format("version = '%s'",
|
||||||
|
ContentItem.LIVE));
|
||||||
|
}
|
||||||
|
|
||||||
|
profiles.addFilter(String.format("language = '%s'", language));
|
||||||
|
|
||||||
|
return profiles;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ public class GenericPerson extends ContentPage implements
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace all special chars that are not yet replaced with a dash
|
// Replace all special chars that are not yet replaced with a dash
|
||||||
return out.replaceAll("[^A-Za-z0-9-]", "_");
|
return out.replaceAll("[^A-Za-z0-9-]", "_").toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue