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
master
parent
91c2b394a5
commit
4121b7a83d
|
|
@ -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()));
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -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");
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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)",
|
||||
|
|
|
|||
Loading…
Reference in New Issue