From 4121b7a83dce531cbfe59274dfa8db0904e47fc9 Mon Sep 17 00:00:00 2001 From: jensp Date: Mon, 18 Feb 2013 16:19:44 +0000 Subject: [PATCH] Various fixes for the following tickets: - 1551: The URL created internally for a text asset (body text of an article) could be longer than 200 characters. Now the URL is trimmed to fit into the length limit definied in PDL. - 1556: The links of content items in various tables were wrong. They were pointing to the wrong content section because CMS.getContext().getContentSection() was used to get the content section (which is the current content section). Instead the content section returned by item.getContentSection() has to be used to create correct links. git-svn-id: https://svn.libreccm.org/ccm/trunk@2073 8810af33-2d31-482b-a856-94f89814c4df --- .../ui/GenericContactPersonSheet.java | 2 +- ...GenericOrganizationalUnitContactTable.java | 2 +- ...GenericOrganizationalUnitPersonsTable.java | 2 +- ...zationalUnitSubordinateOrgaUnitsTable.java | 3 +- ...anizationalUnitSuperiorOrgaUnitsTable.java | 3 +- .../ui/GenericPersonContactTable.java | 2 +- .../ui/GenericPersonOrgaUnitsTable.java | 2 +- .../cms/dispatcher/SimpleXMLGenerator.java | 30 ++++++++++--------- .../cms/ui/authoring/GenericArticleBody.java | 7 +++++ .../domain/DomainObjectTraversal.java | 4 +-- ...InCollectedVolumeCollectedVolumeSheet.java | 8 +++-- .../ui/ArticleInJournalJournalSheet.java | 2 +- .../ui/CollectedVolumeArticlesTable.java | 2 +- .../ui/ExpertiseOrdererSheet.java | 2 +- .../ui/ExpertiseOrganizationSheet.java | 2 +- ...icOrganizationalUnitPublicationsTable.java | 8 +++-- .../ui/InProceedingsProceedingsSheet.java | 2 +- .../ui/InternetArticleOrganizationSheet.java | 2 +- .../contenttypes/ui/JournalArticlesTable.java | 2 +- .../ui/OrganizationPublicationsTable.java | 2 +- .../ui/PersonPublicationsTable.java | 2 +- .../ui/ProceedingsOrganizerSheet.java | 2 +- .../ui/ProceedingsPapersTable.java | 2 +- .../ui/PublicationAuthorsTable.java | 2 +- ...cationGenericOrganizationalUnitsTable.java | 8 +++-- .../ui/PublicationSeriesTable.java | 2 +- ...icationWithPublisherSetPublisherSheet.java | 2 +- .../ui/PublisherPublicationsTable.java | 2 +- .../contenttypes/ui/SeriesEditshipTable.java | 2 +- .../contenttypes/ui/SeriesVolumesTable.java | 2 +- .../ui/UnPublishedOrganizationSheet.java | 2 +- 31 files changed, 68 insertions(+), 49 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java index 7ac79ae16..1aa35706f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java @@ -189,7 +189,7 @@ public class GenericContactPersonSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = person.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); return new Link(value.toString(), resolver.generateItemURL(state, person, section, person.getVersion())); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java index 1df71202c..546d56037 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java @@ -265,7 +265,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements } catch (DataObjectNotFoundException ex) { return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = contact.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java index 919644a32..78ef96691 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java @@ -244,7 +244,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements ex); return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = person.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s", diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java index 58f100788..be5fb9648 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSubordinateOrgaUnitsTable.java @@ -195,8 +195,7 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitsTable subordinateOrgaUnit); if (canEdit) { - final ContentSection section = CMS.getContext(). - getContentSection(); + final ContentSection section = subordinateOrgaUnit.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link(value.toString(), diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java index 072eac5b3..76324e160 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitSuperiorOrgaUnitsTable.java @@ -182,8 +182,7 @@ public class GenericOrganizationalUnitSuperiorOrgaUnitsTable extends Table { superiorOrgaUnit); if (canEdit) { - final ContentSection section = CMS.getContext(). - getContentSection(); + final ContentSection section = superiorOrgaUnit.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link(value.toString(), resolver.generateItemURL(state, diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java index ba16ff8b4..f0bf2a36f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonContactTable.java @@ -257,7 +257,7 @@ public class GenericPersonContactTable extends Table implements } catch (DataObjectNotFoundException ex) { return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = contact.getContentSection(); //CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java index 5a487de7a..b7844c1b2 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonOrgaUnitsTable.java @@ -136,7 +136,7 @@ public class GenericPersonOrgaUnitsTable extends Table { //final com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state); final GenericOrganizationalUnit orgaUnit = new GenericOrganizationalUnit((BigDecimal) key); - final ContentSection section = CMS.getContext().getContentSection(); + final ContentSection section = orgaUnit.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link(value.toString(), resolver.generateItemURL(state, diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java index 9b5b47529..b0514815a 100755 --- a/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java +++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/SimpleXMLGenerator.java @@ -129,7 +129,7 @@ public class SimpleXMLGenerator implements XMLGenerator { * @param useContext The use context */ public void generateXML(final PageState state, final Element parent, final String useContext) { - final long start = System.nanoTime(); + //final long start = System.nanoTime(); //ContentSection section = CMS.getContext().getContentSection(); ContentItem item = getContentItem(state); @@ -193,7 +193,7 @@ public class SimpleXMLGenerator implements XMLGenerator { content = cache.get(item.getOID()); } else { - content = startElement(useContext); + content = startElement(useContext); final ContentItemXMLRenderer renderer = new ContentItemXMLRenderer(content); @@ -202,13 +202,13 @@ public class SimpleXMLGenerator implements XMLGenerator { renderer.setWrapObjects(false); renderer.setRevisitFullObject(true); - System.out.printf("Prepared renderer in %d ms\n", (System.nanoTime() - start) - / 1000000); + //System.out.printf("Prepared renderer in %d ms\n", (System.nanoTime() - start) + // / 1000000); renderer.walk(item, ADAPTER_CONTEXT); - System.out.printf("Rendered standard item xml in %d ms\n", (System.nanoTime() - start) - / 1000000); + //System.out.printf("Rendered standard item xml in %d ms\n", (System.nanoTime() - start) + // / 1000000); //parent.addContent(content); @@ -220,23 +220,25 @@ public class SimpleXMLGenerator implements XMLGenerator { * 2011-10-23 jensp: It is now possible to disable the use of * extra XML. */ - final long extraXMLStart = System.nanoTime(); + //final long extraXMLStart = System.nanoTime(); if (useExtraXml) { for (ExtraXMLGenerator generator : item.getExtraXMLGenerators()) { generator.setListMode(listMode); generator.generateXML(item, content, state); } } - System.out. - printf("Rendered ExtraXML in %d ms\n", (System.nanoTime() - extraXMLStart) / 1000000); - System.out.printf(" -----\n"); - - cache.put(item.getOID(), content); +// System.out. +// printf("Rendered ExtraXML in %d ms\n", (System.nanoTime() - extraXMLStart) / 1000000); +// System.out.printf(" -----\n"); + + if (USE_CACHE) { + cache.put(item.getOID(), content); + } } - + parent.addContent(content); - System.out.printf("Rendered item in %d ms\n\n", (System.nanoTime() - start) / 1000000); + //System.out.printf("Rendered item in %d ms\n\n", (System.nanoTime() - start) / 1000000); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/authoring/GenericArticleBody.java b/ccm-cms/src/com/arsdigita/cms/ui/authoring/GenericArticleBody.java index ea8699086..f9619d686 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/authoring/GenericArticleBody.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/authoring/GenericArticleBody.java @@ -105,7 +105,14 @@ public class GenericArticleBody extends TextAssetBody { protected TextAsset createTextAsset(PageState s) { GenericArticle item = getGenericArticle(s); TextAsset t = new TextAsset(); + final int nameLen = item.getName().length(); + final int idLen = item.getID().toString().length(); + final int len = nameLen + 6 + idLen; + if (len < 200) { t.setName(item.getName() + "_text_" + item.getID()); + } else { + t.setName(item.getName().substring(0, 200 - (len - 200)) + "_text_" + item.getID()); + } // no need - cg. Text doesn't need a security context, // and ownership of text is recorded in text_pages // t.setParent(item); diff --git a/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java b/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java index d9ed991a7..2975504f2 100755 --- a/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java +++ b/ccm-core/src/com/arsdigita/domain/DomainObjectTraversal.java @@ -380,7 +380,7 @@ public abstract class DomainObjectTraversal { final String path, final String context, final OID oid) { - final long start = System.nanoTime(); + //final long start = System.nanoTime(); final String propName = prop.getName(); //System.out.printf("Processing property %30s...\n", propName); @@ -478,7 +478,7 @@ public abstract class DomainObjectTraversal { //System.out.printf("\tProcssed assoc in %3d ms.\n ", (System.nanoTime() - assocStart) / 1000000); } - System.out.printf("Processed property %30s in %3d ms.\n", propName, (System.nanoTime() - start) / 1000000); + //System.out.printf("Processed property %30s in %3d ms.\n", propName, (System.nanoTime() - start) / 1000000); } protected void walkDataAssociations(final DomainObjectTraversalAdapter adapter, diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeSheet.java index 81aae611c..449a3e814 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeSheet.java @@ -112,6 +112,7 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet article); } + } private class ArticleInCollectedVolumeCollectedVolumeSheetModel @@ -166,6 +167,7 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet public Object getKeyAt(int columnIndex) { return collectedVolume.getID(); } + } private class EditCellRenderer @@ -197,8 +199,7 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet } catch (ObjectNotFoundException ex) { return new Label(value.toString()); } - ContentSection section = - CMS.getContext().getContentSection(); + ContentSection section = collectedVolume.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(value.toString(), resolver.generateItemURL(state, @@ -219,6 +220,7 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet return label; } } + } private class DeleteCellRenderer @@ -255,6 +257,7 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet return label; } } + } @Override @@ -276,4 +279,5 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet public void headSelected(TableActionEvent event) { //Nothing to do } + } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalSheet.java index fcb18c60f..053b57e2d 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalSheet.java @@ -183,7 +183,7 @@ public class ArticleInJournalJournalSheet } catch (ObjectNotFoundException ex) { return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = journal.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(journal.getTitle(), diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java index b10b1eed0..97a464648 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticlesTable.java @@ -213,7 +213,7 @@ public class CollectedVolumeArticlesTable return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = article.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(value.toString(), diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java index 72efcd75c..3fe3b77ac 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererSheet.java @@ -161,7 +161,7 @@ public class ExpertiseOrdererSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = orderer.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java index 5864998e8..872bac273 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationSheet.java @@ -162,7 +162,7 @@ public class ExpertiseOrganizationSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = orga.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPublicationsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPublicationsTable.java index 7c5353ace..98289bb60 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPublicationsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPublicationsTable.java @@ -88,6 +88,7 @@ public class GenericOrganizationalUnitPublicationsTable return new Model(table, state, orgaunit); } + } private class Model implements TableModel { @@ -137,6 +138,7 @@ public class GenericOrganizationalUnitPublicationsTable public Object getKeyAt(int columnIndex) { return publications.getPublication().getID(); } + } private class EditCellRenderer @@ -160,8 +162,7 @@ public class GenericOrganizationalUnitPublicationsTable publication); if (canEdit) { - final ContentSection section = CMS.getContext(). - getContentSection(); + final ContentSection section = publication.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link(value.toString(), resolver.generateItemURL( @@ -175,6 +176,7 @@ public class GenericOrganizationalUnitPublicationsTable return label; } } + } private class DeleteCellRenderer @@ -211,6 +213,7 @@ public class GenericOrganizationalUnitPublicationsTable return label; } } + } private class ActionListener implements TableActionListener { @@ -238,5 +241,6 @@ public class GenericOrganizationalUnitPublicationsTable public void headSelected(final TableActionEvent event) { //Nothing } + } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsSheet.java index 7b7744e97..620df9d2f 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsSheet.java @@ -192,7 +192,7 @@ public class InProceedingsProceedingsSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = proceedings.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationSheet.java index 44ddfdd7a..05ccd85f0 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationSheet.java @@ -168,7 +168,7 @@ public class InternetArticleOrganizationSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = organization.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticlesTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticlesTable.java index f26350b98..a99c4eb6f 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticlesTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticlesTable.java @@ -207,7 +207,7 @@ public class JournalArticlesTable ex); return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = article.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/OrganizationPublicationsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/OrganizationPublicationsTable.java index 094bda4af..66021eefd 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/OrganizationPublicationsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/OrganizationPublicationsTable.java @@ -145,7 +145,7 @@ public class OrganizationPublicationsTable extends Table { // publication); //if (canEdit) { - final ContentSection section = CMS.getContext().getContentSection(); + final ContentSection section = publication.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link(value.toString(), resolver.generateItemURL(state, diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java index 7b122ab66..31a14e839 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java @@ -145,7 +145,7 @@ public class PersonPublicationsTable extends Table { // publication); //if (canEdit) { - final ContentSection section = CMS.getContext().getContentSection(); + final ContentSection section = publication.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link(value.toString(), resolver.generateItemURL(state, diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerSheet.java index 0cce4254c..fe0d2483c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerSheet.java @@ -165,7 +165,7 @@ public class ProceedingsOrganizerSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = organizer.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(value.toString(), diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersTable.java index 62818b29a..dc9de26be 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersTable.java @@ -217,7 +217,7 @@ public class ProceedingsPapersTable return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = inProceedings.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", value.toString(), diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorsTable.java index 766512459..2f278423c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorsTable.java @@ -244,7 +244,7 @@ public class PublicationAuthorsTable return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = author.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(value.toString(), diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java index 7ef26af7d..53c411044 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationGenericOrganizationalUnitsTable.java @@ -81,6 +81,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { getSelectedObject(state); return new Model(table, state, publication); } + } private class Model implements TableModel { @@ -127,6 +128,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { public Object getKeyAt(final int columnIndex) { return orgaunits.getID(); } + } private class EditCellRenderer @@ -152,8 +154,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { com.arsdigita.cms.SecurityManager.EDIT_ITEM, orgaunit); if (canEdit) { - final ContentSection section = CMS.getContext(). - getContentSection(); + final ContentSection section = orgaunit.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link( String.format("%s (%s)", @@ -172,6 +173,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { return label; } } + } private class DeleteCellRenderer @@ -208,6 +210,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { return label; } } + } private class ActionListener implements TableActionListener { @@ -239,5 +242,6 @@ public class PublicationGenericOrganizationalUnitsTable extends Table { public void headSelected(final TableActionEvent event) { //Nothing yet } + } } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java index e71b7efc8..aac6d03e2 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesTable.java @@ -194,7 +194,7 @@ public class PublicationSeriesTable return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = series.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java index 23c3cce74..121f08ddb 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherSheet.java @@ -171,7 +171,7 @@ public class PublicationWithPublisherSetPublisherSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = publisher.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(value.toString(), diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java index f68ad52a0..f89765a1f 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublisherPublicationsTable.java @@ -142,7 +142,7 @@ public class PublisherPublicationsTable extends Table { // publication); //if (canEdit) { - final ContentSection section = CMS.getContext().getContentSection(); + final ContentSection section = publication.getContentSection();//CMS.getContext().getContentSection(); final ItemResolver resolver = section.getItemResolver(); final Link link = new Link(value.toString(), resolver.generateItemURL(state, diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java index fd981aa5e..3d6ca24b1 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipTable.java @@ -247,7 +247,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener { ex); return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = editor.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java index 8c2f4f25b..6afd570f9 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesVolumesTable.java @@ -211,7 +211,7 @@ public class SeriesVolumesTable extends Table implements TableActionListener { return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = volume.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s", diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java index d31c2df88..239bedcba 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationSheet.java @@ -167,7 +167,7 @@ public class UnPublishedOrganizationSheet return new Label(value.toString()); } - ContentSection section = CMS.getContext().getContentSection(); + ContentSection section = organization.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); Link link = new Link(String.format("%s (%s)",