Korrekturen an PublicPersonalProfile
git-svn-id: https://svn.libreccm.org/ccm/trunk@1166 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f796d6996d
commit
5428418dbc
|
|
@ -23,6 +23,7 @@ import com.arsdigita.cms.ContentPage;
|
|||
import com.arsdigita.cms.ExtraXMLGenerator;
|
||||
import com.arsdigita.cms.publicpersonalprofile.ContentGenerator;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileConfig;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfiles;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import java.math.BigDecimal;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -50,7 +51,7 @@ public class PublicPersonalProfile
|
|||
extends ContentPage
|
||||
implements CustomizedPreviewLink {
|
||||
|
||||
private static final PublicPersonalProfileConfig config = PublicPersonalProfileConfig.getConfig();
|
||||
private static final PublicPersonalProfileConfig config = PublicPersonalProfiles.getConfig();
|
||||
public static final String OWNER = "owner";
|
||||
public static final String PROFILE_URL = "profileUrl";
|
||||
public static final String LINK_LIST_NAME = "publicPersonalProfileNavItems";
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.arsdigita.cms.contentassets.RelatedLink;
|
|||
import com.arsdigita.cms.publicpersonalprofile.ContentGenerator;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileConfig;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileXmlGenerator;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfiles;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
|
|
@ -25,7 +26,7 @@ import java.lang.reflect.InvocationTargetException;
|
|||
public class PublicPersonalProfileExtraXmlGenerator implements ExtraXMLGenerator {
|
||||
|
||||
private static final PublicPersonalProfileConfig config =
|
||||
PublicPersonalProfileConfig.
|
||||
PublicPersonalProfiles.
|
||||
getConfig();
|
||||
public static final String SHOW_ITEM_PARAM = "showItem";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.contentassets.RelatedLink;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileConfig;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfiles;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.ui.UI;
|
||||
import com.arsdigita.xml.Element;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -17,8 +18,7 @@ import java.util.Map;
|
|||
public class PublicPersonalProfileXmlUtil {
|
||||
|
||||
private final com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileConfig config =
|
||||
PublicPersonalProfileConfig.
|
||||
getConfig();
|
||||
PublicPersonalProfiles.getConfig();
|
||||
|
||||
public void createNavigation(final PublicPersonalProfile profile,
|
||||
final Element root,
|
||||
|
|
@ -85,17 +85,23 @@ public class PublicPersonalProfileXmlUtil {
|
|||
navHome.addAttribute("isSelected", "false");
|
||||
}
|
||||
navHome.addAttribute("sortKey", "");
|
||||
<<<<<<< .mine
|
||||
String homeLabel = homeLabels.get(DispatcherHelper.getNegotiatedLocale().
|
||||
=======
|
||||
String homeLabel = homeLabels.get(GlobalizationHelper.
|
||||
getNegotiatedLocale().
|
||||
>>>>>>> .r1165
|
||||
getLanguage());
|
||||
if (homeLabel == null) {
|
||||
navHome.addAttribute("title", "Home");
|
||||
} else {
|
||||
navHome.addAttribute("title", homeLabel);
|
||||
}
|
||||
navHome.addAttribute("url", String.format("%s/%s",
|
||||
appUrl,
|
||||
profile.getProfileUrl()));
|
||||
//navHome.addAttribute("url", String.format("%s/%s",
|
||||
// appUrl,
|
||||
// profile.getProfileUrl()));
|
||||
navHome.addAttribute("url", String.format("/ccm/%s",
|
||||
UI.getConfig().getRootPage()));
|
||||
}
|
||||
|
||||
//Get the available Navigation items
|
||||
|
|
@ -117,9 +123,11 @@ public class PublicPersonalProfileXmlUtil {
|
|||
final Element homeElem =
|
||||
pathElem.newChildElement("nav:category",
|
||||
"http://ccm.redhat.com/london/navigation");
|
||||
homeElem.addAttribute("url", String.format("%s/%s",
|
||||
appUrl,
|
||||
profile.getProfileUrl()));
|
||||
//homeElem.addAttribute("url", String.format("%s/%s",
|
||||
// appUrl,
|
||||
// profile.getProfileUrl()));
|
||||
homeElem.addAttribute("url", String.format("/ccm/%s",
|
||||
UI.getConfig().getRootPage()));
|
||||
|
||||
//Get the related links of the profiles
|
||||
DataCollection links =
|
||||
|
|
@ -130,8 +138,7 @@ public class PublicPersonalProfileXmlUtil {
|
|||
String navLinkKey;
|
||||
Element navElem;
|
||||
while (links.next()) {
|
||||
link = (RelatedLink) DomainObjectFactory.newInstance(links.
|
||||
getDataObject());
|
||||
link = (RelatedLink) DomainObjectFactory.newInstance(links.getDataObject());
|
||||
|
||||
navLinkKey = link.getTitle();
|
||||
navItem = navItemMap.get(navLinkKey);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.PublicPersonalProfile;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfileConfig;
|
||||
import com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfiles;
|
||||
import com.arsdigita.cms.ui.authoring.ApplyWorkflowFormSection;
|
||||
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||
import com.arsdigita.cms.ui.authoring.LanguageWidget;
|
||||
|
|
@ -48,7 +49,7 @@ public class PublicPersonalProfileCreate extends PageCreate {
|
|||
|
||||
private static final String SELECTED_PERSON = "selectedPerson";
|
||||
private static final PublicPersonalProfileConfig config =
|
||||
PublicPersonalProfileConfig.getConfig();
|
||||
PublicPersonalProfiles.getConfig();
|
||||
|
||||
public PublicPersonalProfileCreate(final ItemSelectionModel itemModel,
|
||||
final CreationSelector parent) {
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ public class PublicPersonalProfileConfig extends AbstractConfig {
|
|||
private final Parameter showPersonInfoEverywhere;
|
||||
// private final Parameter contactType;
|
||||
|
||||
static {
|
||||
/*static {
|
||||
config.load();
|
||||
}
|
||||
}*/
|
||||
|
||||
public PublicPersonalProfileConfig() {
|
||||
personType =
|
||||
|
|
@ -90,7 +90,7 @@ public class PublicPersonalProfileConfig extends AbstractConfig {
|
|||
return (String) get(contactType);
|
||||
}*/
|
||||
|
||||
public static PublicPersonalProfileConfig getConfig() {
|
||||
/*public static PublicPersonalProfileConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@ public class PublicPersonalProfiles extends Application {
|
|||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.publicpersonalprofile.PublicPersonalProfile";
|
||||
private final static PublicPersonalProfileConfig config = PublicPersonalProfileConfig.getConfig();
|
||||
private final static PublicPersonalProfileConfig config = new PublicPersonalProfileConfig(); // PublicPersonalProfileConfig.getConfig();
|
||||
|
||||
static {
|
||||
config.load();
|
||||
}
|
||||
|
||||
public PublicPersonalProfiles(final DataObject dobj) {
|
||||
super(dobj);
|
||||
|
|
@ -35,4 +39,8 @@ public class PublicPersonalProfiles extends Application {
|
|||
public String getServletPath() {
|
||||
return "/profiles/";
|
||||
}
|
||||
|
||||
public static PublicPersonalProfileConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,8 +66,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
"http://www.arsdigita.com/PublicPersonalProfile/1.0";
|
||||
public static final String SELECTED_NAV_ITEM = "selectedNavItem";
|
||||
private final PublicPersonalProfileConfig config =
|
||||
PublicPersonalProfileConfig.
|
||||
getConfig();
|
||||
PublicPersonalProfiles.getConfig();
|
||||
|
||||
@Override
|
||||
protected void doService(final HttpServletRequest request,
|
||||
|
|
@ -174,8 +173,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
|
||||
profiles.next();
|
||||
PublicPersonalProfile profile =
|
||||
(PublicPersonalProfile) DomainObjectFactory.
|
||||
newInstance(profiles.getDataObject());
|
||||
(PublicPersonalProfile) DomainObjectFactory.newInstance(profiles.getDataObject());
|
||||
profiles.close();
|
||||
|
||||
if (config.getEmbedded()) {
|
||||
|
|
@ -190,8 +188,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
context = ContentItem.LIVE;
|
||||
}
|
||||
|
||||
final String url = String.format("/ccm%s", resolver.
|
||||
generateItemURL(state,
|
||||
final String url = String.format("/ccm%s", resolver.generateItemURL(state,
|
||||
profile,
|
||||
section,
|
||||
context));
|
||||
|
|
@ -213,7 +210,8 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
final DataCollection images = ItemImageAttachment.getImageAttachments(profile);
|
||||
if (!images.isEmpty()) {
|
||||
images.next();
|
||||
final Element profileImageElem = profileElem.newChildElement("profileImage");
|
||||
final Element profileImageElem = profileElem.newChildElement("ppp:profileImage",
|
||||
PPP_NS);
|
||||
|
||||
final Element attachmentElem = profileImageElem.newChildElement("imageAttachments");
|
||||
final ItemImageAttachment attachment = new ItemImageAttachment(images.getDataObject());
|
||||
|
|
@ -277,8 +275,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
|
||||
PublicPersonalProfileNavItemCollection navItems =
|
||||
new PublicPersonalProfileNavItemCollection();
|
||||
navItems.addLanguageFilter(GlobalizationHelper.
|
||||
getNegotiatedLocale().
|
||||
navItems.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
navItems.addKeyFilter(navPath);
|
||||
navItems.next();
|
||||
|
|
@ -329,8 +326,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
|
||||
links.next();
|
||||
final RelatedLink link =
|
||||
(RelatedLink) DomainObjectFactory.
|
||||
newInstance(links.getDataObject());
|
||||
(RelatedLink) DomainObjectFactory.newInstance(links.getDataObject());
|
||||
links.close();
|
||||
final ContentItem item = link.getTargetItem();
|
||||
final PublicPersonalProfileXmlGenerator generator =
|
||||
|
|
@ -346,8 +342,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
}
|
||||
}
|
||||
|
||||
PresentationManager presentationManager = Templating.
|
||||
getPresentationManager();
|
||||
PresentationManager presentationManager = Templating.getPresentationManager();
|
||||
presentationManager.servePage(document, request, response);
|
||||
}
|
||||
|
||||
|
|
@ -490,8 +485,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
|||
|
||||
final Document document = page.buildDocument(request, response);
|
||||
|
||||
final PresentationManager presentationManager = Templating.
|
||||
getPresentationManager();
|
||||
final PresentationManager presentationManager = Templating.getPresentationManager();
|
||||
presentationManager.servePage(document, request, response);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue