Java-Teil für verbessertes Link-Handling bei den Persönlichen Publikations- und Projektlisten
git-svn-id: https://svn.libreccm.org/ccm/trunk@1234 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
b4258bf9ef
commit
72256c3177
|
|
@ -25,12 +25,15 @@ import com.arsdigita.cms.contenttypes.PublicPersonalProfileNavItemCollection;
|
||||||
import com.arsdigita.cms.contenttypes.PublicPersonalProfileXmlUtil;
|
import com.arsdigita.cms.contenttypes.PublicPersonalProfileXmlUtil;
|
||||||
import com.arsdigita.cms.dispatcher.CMSDispatcher;
|
import com.arsdigita.cms.dispatcher.CMSDispatcher;
|
||||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
|
import com.arsdigita.cms.dispatcher.XMLGenerator;
|
||||||
import com.arsdigita.cms.publicpersonalprofile.ui.PublicPersonalProfileNavItemsAddForm;
|
import com.arsdigita.cms.publicpersonalprofile.ui.PublicPersonalProfileNavItemsAddForm;
|
||||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.domain.DomainObjectFactory;
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
import com.arsdigita.globalization.GlobalizationHelper;
|
import com.arsdigita.globalization.GlobalizationHelper;
|
||||||
import com.arsdigita.persistence.DataCollection;
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
import com.arsdigita.persistence.Session;
|
import com.arsdigita.persistence.Session;
|
||||||
import com.arsdigita.persistence.SessionManager;
|
import com.arsdigita.persistence.SessionManager;
|
||||||
import com.arsdigita.templating.PresentationManager;
|
import com.arsdigita.templating.PresentationManager;
|
||||||
|
|
@ -110,6 +113,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
boolean preview = false;
|
boolean preview = false;
|
||||||
String profileOwner = "";
|
String profileOwner = "";
|
||||||
String navPath = null;
|
String navPath = null;
|
||||||
|
String itemPath = null;
|
||||||
|
|
||||||
Page page;
|
Page page;
|
||||||
|
|
||||||
|
|
@ -132,11 +136,17 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
if (pathTokens.length > 2) {
|
if (pathTokens.length > 2) {
|
||||||
navPath = pathTokens[2];
|
navPath = pathTokens[2];
|
||||||
}
|
}
|
||||||
|
if (pathTokens.length > 3) {
|
||||||
|
itemPath = pathTokens[3];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
profileOwner = pathTokens[0];
|
profileOwner = pathTokens[0];
|
||||||
if (pathTokens.length > 1) {
|
if (pathTokens.length > 1) {
|
||||||
navPath = pathTokens[1];
|
navPath = pathTokens[1];
|
||||||
}
|
}
|
||||||
|
if (pathTokens.length > 2) {
|
||||||
|
itemPath = pathTokens[2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,6 +268,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
generator.generateXML(state, root, "");
|
generator.generateXML(state, root, "");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if (itemPath == null) {
|
||||||
final DataCollection links =
|
final DataCollection links =
|
||||||
RelatedLink.getRelatedLinks(profile,
|
RelatedLink.getRelatedLinks(profile,
|
||||||
PublicPersonalProfile.LINK_LIST_NAME);
|
PublicPersonalProfile.LINK_LIST_NAME);
|
||||||
|
|
@ -339,6 +350,31 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet {
|
||||||
|
|
||||||
navItems.close();
|
navItems.close();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (config.getShowPersonInfoEverywhere()) {
|
||||||
|
generateProfileOwnerXml(profileElem, owner,
|
||||||
|
state);
|
||||||
|
}
|
||||||
|
|
||||||
|
final OID itemOid = OID.valueOf(itemPath);
|
||||||
|
try {
|
||||||
|
final ContentItem item = (ContentItem) DomainObjectFactory.newInstance(itemOid);
|
||||||
|
|
||||||
|
final PublicPersonalProfileXmlGenerator generator =
|
||||||
|
new PublicPersonalProfileXmlGenerator(
|
||||||
|
item);
|
||||||
|
generator.generateXML(state, root, "");
|
||||||
|
|
||||||
|
} catch (DataObjectNotFoundException ex) {
|
||||||
|
logger.error(String.format(
|
||||||
|
"Item '%s' not found: ",
|
||||||
|
itemPath),
|
||||||
|
ex);
|
||||||
|
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue