- Versuch der Problem mit der NPE beim ThreadPublishing zu beheben
- Verschiedene Kleinigkeiten git-svn-id: https://svn.libreccm.org/ccm/trunk@1466 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ee9cf3e769
commit
93ab00c608
|
|
@ -14,8 +14,11 @@ import com.arsdigita.domain.DomainObjectFactory;
|
|||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.util.UncheckedWrapperException;
|
||||
import com.arsdigita.web.RedirectSignal;
|
||||
import com.arsdigita.xml.Element;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
/**
|
||||
* Generates the extra XML output for a profile for the embedded view.
|
||||
|
|
@ -40,7 +43,21 @@ public class PublicPersonalProfileExtraXmlGenerator implements ExtraXMLGenerator
|
|||
|
||||
final PublicPersonalProfile profile = (PublicPersonalProfile) item;
|
||||
final String showItem = state.getRequest().getParameter(SHOW_ITEM_PARAM);
|
||||
|
||||
|
||||
if (!config.getEmbedded() && state.getRequestURI().contains(profile.getName())) {
|
||||
/*try {
|
||||
DispatcherHelper.forwardRequestByPath(getProfileUrl(profile),
|
||||
state.getRequest(),
|
||||
state.getResponse());
|
||||
return;
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedWrapperException(ex);
|
||||
} catch (ServletException ex) {
|
||||
throw new UncheckedWrapperException(ex);
|
||||
}*/
|
||||
throw new RedirectSignal(getProfileUrl(profile), true);
|
||||
}
|
||||
|
||||
if (config.getEmbedded()) {
|
||||
final Element navigation = element.newChildElement(
|
||||
"profileNavigation");
|
||||
|
|
@ -142,4 +159,32 @@ public class PublicPersonalProfileExtraXmlGenerator implements ExtraXMLGenerator
|
|||
public void addGlobalStateParams(final Page p) {
|
||||
//Nothing yet
|
||||
}
|
||||
|
||||
private String getProfileUrl(final PublicPersonalProfile profile) {
|
||||
final GenericPerson owner = profile.getOwner();
|
||||
final GenericPersonContactCollection contacts = owner.getContacts();
|
||||
|
||||
String homepage = null;
|
||||
while(contacts.next() && (homepage == null)) {
|
||||
homepage = getHomepageContactEntry(contacts.getContact());
|
||||
}
|
||||
|
||||
contacts.close();
|
||||
return homepage;
|
||||
}
|
||||
|
||||
private String getHomepageContactEntry(final GenericContact contact) {
|
||||
final GenericContactEntryCollection entries = contact.getContactEntries();
|
||||
|
||||
String homepage = null;
|
||||
while(entries.next()) {
|
||||
if ("homepage".equals(entries.getKey())) {
|
||||
homepage = entries.getValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
entries.close();
|
||||
return homepage;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@
|
|||
<xrd:property name="/object/contactentries/name"/>
|
||||
<xrd:property name="/object/contactentries/language"/>
|
||||
<xrd:property name="/object/contactentries/isDeleted"/>
|
||||
<xrd:property name="/object/contactentries/description"/>
|
||||
<xrd:property name="/object/contactentries/description"/>
|
||||
</xrd:attributes>
|
||||
<xrd:associations rule="include">
|
||||
<xrd:property name="/object/person"/>
|
||||
<xrd:property name="/object/address"/>
|
||||
<xrd:property name="/object/contactentries"/>
|
||||
<xrd:property name="/object/organizationalunit"/>
|
||||
<xrd:property name="/object/organizationalunit"/>
|
||||
</xrd:associations>
|
||||
</xrd:adapter>
|
||||
</xrd:context>
|
||||
|
|
|
|||
|
|
@ -759,7 +759,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
|||
|
||||
static void finish(Workflow workflow, ContentItem item, User user) throws
|
||||
TaskException {
|
||||
if (workflow != null) {
|
||||
if ((workflow != null) && (user != null)) {
|
||||
final Engine engine = Engine.getInstance(CMSEngine.CMS_ENGINE_TYPE);
|
||||
// ;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue