Bild für ein persönliches Profil steht jetzt immer zur Verfügung
git-svn-id: https://svn.libreccm.org/ccm/trunk@1151 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
11db7b8f05
commit
2072ad4e9c
|
|
@ -10,6 +10,13 @@
|
||||||
extends="com.arsdigita.cms.ContentPage">
|
extends="com.arsdigita.cms.ContentPage">
|
||||||
<xrd:attributes rule="exclude">
|
<xrd:attributes rule="exclude">
|
||||||
<xrd:property name="/object/profileUrl"/>
|
<xrd:property name="/object/profileUrl"/>
|
||||||
|
<xrd:property name="/object/owner/contacts/ancestors"/>
|
||||||
|
<xrd:property name="/object/owner/contacts/isDeleted"/>
|
||||||
|
<xrd:property name="/object/owner/contacts/version"/>
|
||||||
|
<xrd:property name="/object/owner/address/ancestors"/>
|
||||||
|
<xrd:property name="/object/owner/address/isDeleted"/>
|
||||||
|
<xrd:property name="/object/owner/address/version"/>
|
||||||
|
|
||||||
</xrd:attributes>
|
</xrd:attributes>
|
||||||
|
|
||||||
<xrd:associations rule="include">
|
<xrd:associations rule="include">
|
||||||
|
|
|
||||||
|
|
@ -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.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
|
import com.arsdigita.cms.ReusableImageAsset;
|
||||||
import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
import com.arsdigita.cms.contentassets.ItemImageAttachment;
|
||||||
import com.arsdigita.cms.contentassets.RelatedLink;
|
import com.arsdigita.cms.contentassets.RelatedLink;
|
||||||
import com.arsdigita.cms.contenttypes.GenericAddress;
|
import com.arsdigita.cms.contenttypes.GenericAddress;
|
||||||
|
|
@ -210,9 +211,28 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
final DataCollection images = ItemImageAttachment.getImageAttachments(profile);
|
final DataCollection images = ItemImageAttachment.getImageAttachments(profile);
|
||||||
if (!images.isEmpty()) {
|
if (!images.isEmpty()) {
|
||||||
images.next();
|
images.next();
|
||||||
final Element imageElem = profileElem.newChildElement("profileImage");
|
final Element profileImageElem = profileElem.newChildElement("profileImage");
|
||||||
ItemImageAttachment attachment = new ItemImageAttachment(images.getDataObject());
|
|
||||||
//imageElem.addAttribute("oid", attachment.getImage().getOID().toString());
|
final Element attachmentElem = profileImageElem.newChildElement("imageAttachments");
|
||||||
|
final ItemImageAttachment attachment = new ItemImageAttachment(images.getDataObject());
|
||||||
|
attachmentElem.addAttribute("oid", attachment.getOID().toString());
|
||||||
|
final Element caption = attachmentElem.newChildElement("caption");
|
||||||
|
caption.setText(attachment.getCaption());
|
||||||
|
final ReusableImageAsset image = attachment.getImage();
|
||||||
|
final Element imageElem = attachmentElem.newChildElement("image");
|
||||||
|
imageElem.addAttribute("oid", image.getOID().toString());
|
||||||
|
final Element widthElem = imageElem.newChildElement("width");
|
||||||
|
widthElem.setText(image.getWidth().toString());
|
||||||
|
final Element heightElem = imageElem.newChildElement("height");
|
||||||
|
heightElem.setText(image.getHeight().toString());
|
||||||
|
final Element descElem = imageElem.newChildElement("description");
|
||||||
|
descElem.setText(image.getDescription());
|
||||||
|
final Element nameElem = imageElem.newChildElement("name");
|
||||||
|
nameElem.setText(image.getName());
|
||||||
|
final Element idElem = imageElem.newChildElement("id");
|
||||||
|
idElem.setText(image.getID().toString());
|
||||||
|
final Element displayNameElem = imageElem.newChildElement("displayName");
|
||||||
|
displayNameElem.setText(image.getDisplayName());
|
||||||
|
|
||||||
images.close();
|
images.close();
|
||||||
}
|
}
|
||||||
|
|
@ -237,17 +257,6 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
profile);
|
profile);
|
||||||
generator.generateXML(state, root, "");
|
generator.generateXML(state, root, "");
|
||||||
|
|
||||||
//generateProfileOwnerXml(profileElem, owner, state);
|
|
||||||
|
|
||||||
/*DataCollection relatedLinks = RelatedLink.getRelatedLinks(profile, "NONE");
|
|
||||||
if (relatedLinks.size() > 0) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
DataCollection notes = Note.getNotes(profile);
|
|
||||||
if (notes.size() > 0) {
|
|
||||||
|
|
||||||
} */
|
|
||||||
} else {
|
} else {
|
||||||
final DataCollection links =
|
final DataCollection links =
|
||||||
RelatedLink.getRelatedLinks(profile,
|
RelatedLink.getRelatedLinks(profile,
|
||||||
|
|
@ -343,118 +352,6 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private void createNavigation(final PublicPersonalProfile profile,
|
|
||||||
final Element root,
|
|
||||||
final String navPath) {
|
|
||||||
String homeLabelsStr = config.getHomeNavItemLabels();
|
|
||||||
|
|
||||||
Map<String, String> homeLabels = new HashMap<String, String>();
|
|
||||||
String[] homeLabelsArry = homeLabelsStr.split(",");
|
|
||||||
String[] homeLabelSplit;
|
|
||||||
for (String homeLabelEntry : homeLabelsArry) {
|
|
||||||
homeLabelSplit = homeLabelEntry.split(":");
|
|
||||||
if (homeLabelSplit.length == 2) {
|
|
||||||
homeLabels.put(homeLabelSplit[0].trim(),
|
|
||||||
homeLabelSplit[1].trim());
|
|
||||||
} else {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Element navRoot =
|
|
||||||
root.newChildElement("nav:categoryMenu",
|
|
||||||
"http://ccm.redhat.com/london/navigation");
|
|
||||||
navRoot.addAttribute("id", "categoryMenu");
|
|
||||||
|
|
||||||
Element navList =
|
|
||||||
navRoot.newChildElement("nav:category",
|
|
||||||
"http://ccm.redhat.com/london/navigation");
|
|
||||||
navList.addAttribute("AbstractTree", "AbstractTree");
|
|
||||||
navList.addAttribute("description", "");
|
|
||||||
navList.addAttribute("id", "");
|
|
||||||
navList.addAttribute("isSelected", "true");
|
|
||||||
navList.addAttribute("sortKey", "");
|
|
||||||
navList.addAttribute("title", "publicPersonalProfileNavList");
|
|
||||||
navList.addAttribute("url", String.format("/ccm/%s",
|
|
||||||
profile.getProfileUrl()));
|
|
||||||
|
|
||||||
Element navHome =
|
|
||||||
navList.newChildElement("nav:category",
|
|
||||||
"http://ccm.redhat.com/london/navigation");
|
|
||||||
navHome.addAttribute("AbstractTree", "AbstractTree");
|
|
||||||
navHome.addAttribute("description", "");
|
|
||||||
navHome.addAttribute("id", profile.getID().toString());
|
|
||||||
if (navPath == null) {
|
|
||||||
navHome.addAttribute("isSelected", "true");
|
|
||||||
} else {
|
|
||||||
navHome.addAttribute("isSelected", "false");
|
|
||||||
}
|
|
||||||
navHome.addAttribute("sortKey", "");
|
|
||||||
String homeLabel = homeLabels.get(DispatcherHelper.getNegotiatedLocale().
|
|
||||||
getLanguage());
|
|
||||||
if (homeLabel == null) {
|
|
||||||
navHome.addAttribute("title", "Home");
|
|
||||||
} else {
|
|
||||||
navHome.addAttribute("title", homeLabel);
|
|
||||||
}
|
|
||||||
navHome.addAttribute("url", String.format("/ccm/profiles/%s",
|
|
||||||
profile.getProfileUrl()));
|
|
||||||
|
|
||||||
//Get the available Navigation items
|
|
||||||
PublicPersonalProfileNavItemCollection navItems =
|
|
||||||
new PublicPersonalProfileNavItemCollection();
|
|
||||||
navItems.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
|
|
||||||
getLanguage());
|
|
||||||
final Map<String, PublicPersonalProfileNavItem> navItemMap =
|
|
||||||
new HashMap<String, PublicPersonalProfileNavItem>();
|
|
||||||
PublicPersonalProfileNavItem navItem;
|
|
||||||
while (navItems.next()) {
|
|
||||||
navItem = navItems.getNavItem();
|
|
||||||
navItemMap.put(navItem.getKey(), navItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Get the related links of the profiles
|
|
||||||
DataCollection links =
|
|
||||||
RelatedLink.getRelatedLinks(profile,
|
|
||||||
PublicPersonalProfile.LINK_LIST_NAME);
|
|
||||||
links.addOrder(Link.ORDER);
|
|
||||||
RelatedLink link;
|
|
||||||
String navLinkKey;
|
|
||||||
Element navElem;
|
|
||||||
while (links.next()) {
|
|
||||||
link = (RelatedLink) DomainObjectFactory.newInstance(links.
|
|
||||||
getDataObject());
|
|
||||||
|
|
||||||
navLinkKey = link.getTitle();
|
|
||||||
navItem = navItemMap.get(navLinkKey);
|
|
||||||
|
|
||||||
if (navItem == null) {
|
|
||||||
//ToDo
|
|
||||||
}
|
|
||||||
|
|
||||||
navElem =
|
|
||||||
navList.newChildElement("nav:category",
|
|
||||||
"http://ccm.redhat.com/london/navigation");
|
|
||||||
navElem.addAttribute("AbstractTree", "AbstractTree");
|
|
||||||
navElem.addAttribute("description", "");
|
|
||||||
//navHome.addAttribute("id", "");
|
|
||||||
if ((navPath != null) && navPath.equals(navLinkKey)) {
|
|
||||||
navElem.addAttribute("isSelected", "true");
|
|
||||||
} else {
|
|
||||||
navElem.addAttribute("isSelected", "false");
|
|
||||||
}
|
|
||||||
navElem.addAttribute("sortKey", "");
|
|
||||||
if (navItem == null) {
|
|
||||||
navElem.addAttribute("title", navLinkKey);
|
|
||||||
} else {
|
|
||||||
navElem.addAttribute("title", navItem.getLabel());
|
|
||||||
}
|
|
||||||
navElem.addAttribute("url", String.format("/ccm/profiles/%s/%s",
|
|
||||||
profile.getProfileUrl(),
|
|
||||||
navLinkKey));
|
|
||||||
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
private void generateProfileOwnerXml(final Element profileElem,
|
private void generateProfileOwnerXml(final Element profileElem,
|
||||||
final GenericPerson owner,
|
final GenericPerson owner,
|
||||||
final PageState state) {
|
final PageState state) {
|
||||||
|
|
@ -486,10 +383,6 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
|
|
||||||
if (owner.hasContacts()) {
|
if (owner.hasContacts()) {
|
||||||
final GenericPersonContactCollection contacts = owner.getContacts();
|
final GenericPersonContactCollection contacts = owner.getContacts();
|
||||||
//final String contactType = config.getContactType();
|
|
||||||
|
|
||||||
/*contacts.addFilter(String.format("link.link_key = '%s'",
|
|
||||||
contactType));*/
|
|
||||||
|
|
||||||
if (contacts.size() > 0) {
|
if (contacts.size() > 0) {
|
||||||
contacts.next();
|
contacts.next();
|
||||||
|
|
@ -564,12 +457,6 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
|
|
||||||
final Form form = new Form("PublicPersonalProfileAdmin");
|
final Form form = new Form("PublicPersonalProfileAdmin");
|
||||||
|
|
||||||
//form.add(new Label("Admin"));
|
|
||||||
|
|
||||||
//final Label label = new Label("for PublicPersonalProfile");
|
|
||||||
|
|
||||||
//form.add(label);
|
|
||||||
|
|
||||||
page.setClassAttr("adminPage");
|
page.setClassAttr("adminPage");
|
||||||
|
|
||||||
final StringParameter navItemKeyParam = new StringParameter(
|
final StringParameter navItemKeyParam = new StringParameter(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue