From 75bacac675f31808b31446e16395b098ce247753 Mon Sep 17 00:00:00 2001 From: quasi Date: Thu, 18 Nov 2010 20:16:59 +0000 Subject: [PATCH] RelatedLink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RelatedLink kann nun auf einfache Weise abgeleitet werden, um eine spezialisierte Version zu erzeugen. Dazu muß der RelatedLinkInitializer abgeleitet werden und die Methoden getAuthoringStep(), getAuthoringStepLabel() und getAuthoringStepDescription() überschrieben werden. Außerdem muß RelatedLinkPropertiesStep abgeleitet und die Methoden-Variablen m_linkListName und m_contentType angepaßt werden. git-svn-id: https://svn.libreccm.org/ccm/trunk@624 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/contentassets/ui/RelatedLinkPropertiesStep.java | 6 +++++- .../cms/contentassets/ui/RelatedLinkPropertyForm.java | 5 +++-- .../com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java index 5c3c337cd..2546ec287 100755 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java @@ -18,6 +18,7 @@ import com.arsdigita.bebop.Component; import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.contenttypes.ui.LinkPropertiesStep; @@ -29,6 +30,7 @@ import com.arsdigita.cms.contenttypes.ui.LinkTable; public class RelatedLinkPropertiesStep extends LinkPropertiesStep { protected String m_linkListName = ""; + protected ContentType m_contentType = null; /** * Constructor. Creates a RelatedLinkPropertiesStep given an @@ -48,6 +50,7 @@ public class RelatedLinkPropertiesStep extends LinkPropertiesStep { * Sets a RelatedLinkSelectionModel as the * LinkSelectionModel for this authoring step. */ + @Override protected void setLinkSelectionModel() { setLinkSelectionModel( new RelatedLinkSelectionModel(getLinkParam())); @@ -83,7 +86,8 @@ public class RelatedLinkPropertiesStep extends LinkPropertiesStep { protected FormSection getEditSheet() { return new RelatedLinkPropertyForm(getItemSelectionModel(), getLinkSelectionModel(), - m_linkListName); + m_linkListName, + m_contentType); } } diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java index 3099bbf38..b3985c4f3 100755 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java @@ -67,13 +67,14 @@ public class RelatedLinkPropertyForm extends LinkPropertyForm { public RelatedLinkPropertyForm(ItemSelectionModel itemModel, LinkSelectionModel link, String linkListName) { - super(itemModel, link); + this(itemModel, link, linkListName, null); } public RelatedLinkPropertyForm(ItemSelectionModel itemModel, - LinkSelectionModel link, ContentType contentType) { + LinkSelectionModel link, String linkListName, ContentType contentType) { super(itemModel, link, contentType); + m_linkListName = linkListName; } @Override diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java index a3c053618..45b864c09 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java @@ -173,7 +173,7 @@ public class LinkPropertyForm extends FormSection add(m_targetURI); add(new Label("Content Item:")); - m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, m_itemModel.getContentType()); + m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, m_contentType); m_itemSearch.getSearchButton().setOnFocus("toggle_link_fields(true)"); m_itemSearch.getClearButton().setOnFocus("toggle_link_fields(true)"); add(m_itemSearch);