Änderungen an RelatedLinks für die Publikationen einer Abteilung oder eines Projektes und an RelatedLink: RelatedLink verarbeitet jetzt nur noch RelatedLinks mit dem linkListName 'NONE'. Um andere linkListNames zu verwenden muss RelatedLink abgeleitet werden.
git-svn-id: https://svn.libreccm.org/ccm/trunk@912 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c56d97ba77
commit
eb680c69ca
|
|
@ -3,7 +3,9 @@
|
|||
|
||||
<!-- First off the adapters for ContentItemPanel -->
|
||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contentassets.RelatedLink" extends="com.arsdigita.cms.contenttypes.Link">
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contentassets.RelatedLink"
|
||||
extends="com.arsdigita.cms.contenttypes.Link"
|
||||
traversalClass="com.arsdigita.cms.contentassets.RelatedLinkTraversalAdapter">
|
||||
<xrd:associations rule="include">
|
||||
<xrd:property name="/object/targetItem/imageAttachments"/>
|
||||
<xrd:property name="/object/targetItem/imageAttachments/image"/>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
|||
|
||||
public class RelatedLinkInitializer extends ContentAssetInitializer {
|
||||
|
||||
protected RelatedLinkInitializer(final String manifestFile) {
|
||||
super(manifestFile);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.cms.ContentBundle;
|
||||
import com.arsdigita.cms.contenttypes.LinkTraversalAdapter;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.domain.SimpleDomainObjectTraversalAdapter;
|
||||
import com.arsdigita.persistence.metadata.Property;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class RelatedLinkTraversalAdapter extends LinkTraversalAdapter {
|
||||
|
||||
public RelatedLinkTraversalAdapter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public RelatedLinkTraversalAdapter(
|
||||
SimpleDomainObjectTraversalAdapter adapter) {
|
||||
super(adapter);
|
||||
}
|
||||
|
||||
public String getLinkListName() {
|
||||
return "NONE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processProperty(DomainObject obj,
|
||||
String path,
|
||||
Property prop,
|
||||
String context) {
|
||||
DomainObject nObj = obj;
|
||||
|
||||
if (obj instanceof ContentBundle) {
|
||||
|
||||
nObj = ((ContentBundle) obj).negotiate(DispatcherHelper.getRequest().
|
||||
getLocales());
|
||||
}
|
||||
|
||||
if (nObj instanceof RelatedLink) {
|
||||
RelatedLink link = (RelatedLink) nObj;
|
||||
if (getLinkListName().equals(link.getLinkListName())) {
|
||||
return super.processProperty(nObj, path, prop, context);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return super.processProperty(nObj, path, prop, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@ import com.arsdigita.persistence.metadata.Property;
|
|||
import com.arsdigita.domain.SimpleDomainObjectTraversalAdapter;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
|
||||
|
||||
/**
|
||||
* An adapter for Links allowing pluggable
|
||||
* assets to extend the traversal.
|
||||
|
|
@ -36,10 +35,10 @@ import com.arsdigita.domain.DomainObject;
|
|||
* @author Sören Bernstein (Quasimodo)
|
||||
*/
|
||||
public class LinkTraversalAdapter
|
||||
extends ContentItemTraversalAdapter {
|
||||
extends ContentItemTraversalAdapter {
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(LinkTraversalAdapter.class);
|
||||
Logger.getLogger(LinkTraversalAdapter.class);
|
||||
|
||||
public LinkTraversalAdapter() {
|
||||
super();
|
||||
|
|
@ -54,6 +53,7 @@ public class LinkTraversalAdapter
|
|||
* to the asset's adapter, otherwise delegates to
|
||||
* the content item's primary adapter
|
||||
*/
|
||||
@Override
|
||||
public boolean processProperty(DomainObject obj,
|
||||
String path,
|
||||
Property prop,
|
||||
|
|
@ -63,11 +63,11 @@ public class LinkTraversalAdapter
|
|||
|
||||
if (obj instanceof ContentBundle) {
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Found a link to a content bundle. Resolve this link to negotiated language.");
|
||||
}
|
||||
s_log.debug(
|
||||
"Found a link to a content bundle. Resolve this link to negotiated language.");
|
||||
|
||||
nObj = ((ContentBundle) obj).negotiate(DispatcherHelper.getRequest().getLocales());
|
||||
nObj = ((ContentBundle) obj).negotiate(DispatcherHelper.getRequest().
|
||||
getLocales());
|
||||
}
|
||||
|
||||
return super.processProperty(nObj, path, prop, context);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
model com.arsdigita.cms.contentassets;
|
||||
|
||||
object type SciDepartmentPublicationLink extends RelatedLink {
|
||||
|
||||
reference key (ct_sciorga_department_publication_link.publication_link_id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
model com.arsdigita.cms.contentassets;
|
||||
|
||||
object type SciOrganizationPublicationLink extends RelatedLink {
|
||||
|
||||
reference key (ct_sciorga_organization_publication_link.publication_link_id);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
model com.arsdigita.cms.contentassets;
|
||||
|
||||
object type SciProjectPublicationLink extends RelatedLink {
|
||||
|
||||
reference key (ct_sciorga_project_publication_link.publication_link_id);
|
||||
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
<table name="inits"/>
|
||||
<table name="acs_objects"/>
|
||||
<table name="cms_items"/>
|
||||
<table name="cms_related_links"/>
|
||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
</requires>
|
||||
<provides>
|
||||
|
|
@ -14,6 +15,9 @@
|
|||
<initializer class="com.arsdigita.cms.contenttypes.SciDepartmentInitializer"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.SciProjectInitializer"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.SciMemberInitializer"/>
|
||||
<initializer class="com.arsdigita.cms.contentassets.SciOrganizationPublicationLinkInitializer"/>
|
||||
<initializer class="com.arsdigita.cms.contentassets.SciDepartmentPublicationLinkInitializer"/>
|
||||
<initializer class="com.arsdigita.cms.contentassets.SciProjectPublicationLinkInitializer"/>
|
||||
</provides>
|
||||
<scripts>
|
||||
<schema directory="ccm-sci-types-organization"/>
|
||||
|
|
@ -21,5 +25,8 @@
|
|||
<data class="com.arsdigita.cms.contenttypes.SciDepartmentLoader"/>
|
||||
<data class="com.arsdigita.cms.contenttypes.SciProjectLoader"/>
|
||||
<data class="com.arsdigita.cms.contenttypes.SciMemberLoader"/>
|
||||
<data class="com.arsdigita.cms.contentassets.SciOrganizationPublicationLinkLoader"/>
|
||||
<data class="com.arsdigita.cms.contentassets.SciDepartmentPublicationLinkLoader"/>
|
||||
<data class="com.arsdigita.cms.contentassets.SciProjectPublicationLinkLoader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciDepartmentPublicationLink extends RelatedLink {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contentassets.SciDepartmentPublicationLink";
|
||||
|
||||
public SciDepartmentPublicationLink() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
public SciDepartmentPublicationLink(BigDecimal id) {
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public SciDepartmentPublicationLink(OID oid) {
|
||||
super(oid);
|
||||
}
|
||||
|
||||
public SciDepartmentPublicationLink(DataObject dobj) {
|
||||
super(dobj);
|
||||
}
|
||||
|
||||
public SciDepartmentPublicationLink(String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciDepartmentPublicationLinkInitializer extends RelatedLinkInitializer {
|
||||
|
||||
public SciDepartmentPublicationLinkInitializer() {
|
||||
super("empty.pdl.mf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/SciDepartmentPublicationLink.xml";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciDepartmentPublicationLinkLoader extends RelatedLinkLoader {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.domain.SimpleDomainObjectTraversalAdapter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciDepartmentPublicationLinkTraversalAdapter
|
||||
extends RelatedLinkTraversalAdapter {
|
||||
|
||||
public SciDepartmentPublicationLinkTraversalAdapter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SciDepartmentPublicationLinkTraversalAdapter(
|
||||
SimpleDomainObjectTraversalAdapter adapter) {
|
||||
super(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLinkListName() {
|
||||
return "SciDepartmentPublications";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciOrganizationPublicationLink extends RelatedLink {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contentassets.SciOrganizationPublicationLink";
|
||||
|
||||
public SciOrganizationPublicationLink() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
public SciOrganizationPublicationLink(BigDecimal id) {
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public SciOrganizationPublicationLink(OID oid) {
|
||||
super(oid);
|
||||
}
|
||||
|
||||
public SciOrganizationPublicationLink(DataObject dobj) {
|
||||
super(dobj);
|
||||
}
|
||||
|
||||
public SciOrganizationPublicationLink(String type) {
|
||||
super(type);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciOrganizationPublicationLinkInitializer extends RelatedLinkInitializer {
|
||||
|
||||
public SciOrganizationPublicationLinkInitializer() {
|
||||
super("empty.pdl.mf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/SciOrganizationPublicationLink.xml";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciOrganizationPublicationLinkLoader extends RelatedLinkLoader {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.domain.SimpleDomainObjectTraversalAdapter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciOrganizationPublicationLinkTraversalAdapter
|
||||
extends RelatedLinkTraversalAdapter {
|
||||
|
||||
public SciOrganizationPublicationLinkTraversalAdapter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SciOrganizationPublicationLinkTraversalAdapter(
|
||||
SimpleDomainObjectTraversalAdapter adapter) {
|
||||
super(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLinkListName() {
|
||||
return "SciOrganizationPublications";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciProjectPublicationLink extends RelatedLink {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.contentassets.SciProjectPublicationLink";
|
||||
|
||||
public SciProjectPublicationLink() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
public SciProjectPublicationLink(BigDecimal id) {
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public SciProjectPublicationLink(OID oid) {
|
||||
super(oid);
|
||||
}
|
||||
|
||||
public SciProjectPublicationLink(DataObject dobj) {
|
||||
super(dobj);
|
||||
}
|
||||
|
||||
public SciProjectPublicationLink(String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciProjectPublicationLinkInitializer extends RelatedLinkInitializer {
|
||||
|
||||
public SciProjectPublicationLinkInitializer() {
|
||||
super("empty.pdl.mf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/SciProjectPublicationLink.xml";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciProjectPublicationLinkLoader extends RelatedLinkLoader {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.domain.SimpleDomainObjectTraversalAdapter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciProjectPublicationLinkTraversalAdapter
|
||||
extends RelatedLinkTraversalAdapter {
|
||||
|
||||
public SciProjectPublicationLinkTraversalAdapter() {
|
||||
super();
|
||||
}
|
||||
|
||||
public SciProjectPublicationLinkTraversalAdapter(
|
||||
SimpleDomainObjectTraversalAdapter adapter) {
|
||||
super(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLinkListName() {
|
||||
return "SciProjectPublications";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contentassets.SciDepartmentPublicationLink;
|
||||
import com.arsdigita.cms.contentassets.ui.RelatedLinkPropertyForm;
|
||||
import com.arsdigita.cms.contenttypes.Link;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciDepartmentPublicationLinkPropertyForm extends RelatedLinkPropertyForm {
|
||||
|
||||
public SciDepartmentPublicationLinkPropertyForm(ItemSelectionModel itemModel,
|
||||
LinkSelectionModel linkModel,
|
||||
String linkListName) {
|
||||
this(itemModel, linkModel, linkListName, null);
|
||||
}
|
||||
|
||||
public SciDepartmentPublicationLinkPropertyForm(ItemSelectionModel itemModel,
|
||||
LinkSelectionModel linkModel,
|
||||
String linkListName,
|
||||
ContentType contentType) {
|
||||
super(itemModel, linkModel, linkListName, contentType);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Link createLink(PageState state) {
|
||||
ContentItem item = getContentItem(state);
|
||||
Assert.exists(item, ContentItem.class);
|
||||
SciDepartmentPublicationLink link = new SciDepartmentPublicationLink();
|
||||
|
||||
link.setLinkOwner(item);
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormSection;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contentassets.ui.RelatedLinkPropertiesStep;
|
||||
|
|
@ -40,6 +41,14 @@ public class SciDepartmentPublicationsStep extends RelatedLinkPropertiesStep {
|
|||
super.setLinkSelectionModel();
|
||||
linkListName = "SciDepartmentPublications";
|
||||
contentType = ContentType.findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.Publication");
|
||||
"com.arsdigita.cms.contenttypes.Publication");
|
||||
}
|
||||
|
||||
protected FormSection getEditSheet() {
|
||||
return new SciDepartmentPublicationLinkPropertyForm(
|
||||
getItemSelectionModel(),
|
||||
getLinkSelectionModel(),
|
||||
linkListName,
|
||||
contentType);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,8 +104,9 @@ public abstract class SciOrganizationBasePanel
|
|||
return false;
|
||||
}
|
||||
final MemberListItem other = (MemberListItem) obj;
|
||||
if (this.member != other.member && (this.member == null || !this.member.
|
||||
equals(other.member))) {
|
||||
if (this.member != other.member && (this.member == null
|
||||
|| !this.member.equals(
|
||||
other.member))) {
|
||||
return false;
|
||||
}
|
||||
if ((this.role == null) ? (other.role != null)
|
||||
|
|
@ -348,11 +349,11 @@ public abstract class SciOrganizationBasePanel
|
|||
pageNumber = normalizePageNumber(pageCount, pageNumber);
|
||||
|
||||
createPaginatorElement(
|
||||
parent, pageNumber, pageCount, begin, end, count, membersWithoutDoubles.
|
||||
size());
|
||||
List<MemberListItem> membersWithoutDoublesToShow = membersWithoutDoubles.
|
||||
subList((int) begin,
|
||||
(int) end);
|
||||
parent, pageNumber, pageCount, begin, end, count,
|
||||
membersWithoutDoubles.size());
|
||||
List<MemberListItem> membersWithoutDoublesToShow =
|
||||
membersWithoutDoubles.subList((int) begin,
|
||||
(int) end);
|
||||
|
||||
Element membersWithoutDoublesElem = parent.newChildElement(
|
||||
"members");
|
||||
|
|
@ -482,10 +483,20 @@ public abstract class SciOrganizationBasePanel
|
|||
Integer year1;
|
||||
Integer year2;
|
||||
|
||||
if ((o1 == null) && o2 == null) {
|
||||
return 0;
|
||||
} else if ((o1 == null) && (o2 != null)) {
|
||||
return -1;
|
||||
} else if ((o1 != null) && o2 == null) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
year1 = (Integer) o1.get("yearOfPublication");
|
||||
year2 = (Integer) o2.get("yearOfPublication");
|
||||
|
||||
if (year1.compareTo(year2) == 0) {
|
||||
|
||||
if (year1.compareTo(year2)
|
||||
== 0) {
|
||||
String title1;
|
||||
String title2;
|
||||
|
||||
|
|
@ -522,6 +533,10 @@ public abstract class SciOrganizationBasePanel
|
|||
Element publicationElem;
|
||||
ContentItemXMLRenderer renderer;
|
||||
|
||||
if (publication == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
publicationElem = parent.newChildElement("publications");
|
||||
|
||||
renderer = new ContentItemXMLRenderer(publicationElem);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contentassets.SciProjectPublicationLink;
|
||||
import com.arsdigita.cms.contentassets.ui.RelatedLinkPropertyForm;
|
||||
import com.arsdigita.cms.contenttypes.Link;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciProjectPublicationLinkPropertyForm extends RelatedLinkPropertyForm {
|
||||
|
||||
public SciProjectPublicationLinkPropertyForm(ItemSelectionModel itemModel,
|
||||
LinkSelectionModel linkModel,
|
||||
String linkListName) {
|
||||
this(itemModel, linkModel, linkListName, null);
|
||||
}
|
||||
|
||||
public SciProjectPublicationLinkPropertyForm(ItemSelectionModel itemModel,
|
||||
LinkSelectionModel linkModel,
|
||||
String linkListName,
|
||||
ContentType contentType) {
|
||||
super(itemModel, linkModel, linkListName, contentType);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Link createLink(PageState state) {
|
||||
ContentItem item = getContentItem(state);
|
||||
Assert.exists(item, ContentItem.class);
|
||||
SciProjectPublicationLink link = new SciProjectPublicationLink();
|
||||
|
||||
link.setLinkOwner(item);
|
||||
|
||||
return link;
|
||||
}
|
||||
}
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormSection;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contentassets.ui.RelatedLinkPropertiesStep;
|
||||
|
|
@ -42,4 +43,13 @@ public class SciProjectPublicationsStep extends RelatedLinkPropertiesStep {
|
|||
contentType = ContentType.findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.Publication");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FormSection getEditSheet() {
|
||||
return new SciProjectPublicationLinkPropertyForm(
|
||||
getItemSelectionModel(),
|
||||
getLinkSelectionModel(),
|
||||
linkListName,
|
||||
contentType);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue