Enhancements for localisation in several authoring step

git-svn-id: https://svn.libreccm.org/ccm/trunk@2763 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-07-17 13:47:03 +00:00
parent 4cdc5b3cd5
commit bca01fc9ee
32 changed files with 890 additions and 975 deletions

View File

@ -39,9 +39,9 @@ import javax.imageio.ImageIO;
import org.apache.log4j.Logger;
/**
* <p>An {@link com.arsdigita.cms.Asset asset} representing an image. An
* ImageAsset is deleted when its parent content item is deleted and is not
* intended to be reused between content items..</p>
* <p>
* An {@link com.arsdigita.cms.Asset asset} representing an image. An ImageAsset is deleted when its
* parent content item is deleted and is not intended to be reused between content items..</p>
*
* @see com.arsdigita.cms.ReusableImageAsset
* @see com.arsdigita.cms.BinaryAsset
@ -54,8 +54,7 @@ import org.apache.log4j.Logger;
*/
public class ImageAsset extends BinaryAsset {
public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.ImageAsset";
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.ImageAsset";
public static final String CONTENT = "content";
public static final String HEIGHT = "height";
public static final String WIDTH = "width";
@ -71,23 +70,18 @@ public class ImageAsset extends BinaryAsset {
}
/**
* Constructor. The contained
* <code>DataObject</code> is retrieved from the persistent storage
* mechanism with an
* <code>OID</code> specified by <i>oid</i>.
* Constructor. The contained <code>DataObject</code> is retrieved from the persistent storage
* mechanism with an <code>OID</code> specified by <i>oid</i>.
*
* @param oid The <code>OID</code> for the retrieved
* <code>DataObject</code>.
* @param oid The <code>OID</code> for the retrieved <code>DataObject</code>.
*/
public ImageAsset(OID oid) throws DataObjectNotFoundException {
super(oid);
}
/**
* Constructor. The contained
* <code>DataObject</code> is retrieved from the persistent storage
* mechanism with an
* <code>OID</code> specified by <i>id</i> and
* Constructor. The contained <code>DataObject</code> is retrieved from the persistent storage
* mechanism with an <code>OID</code> specified by <i>id</i> and
* <code>ImageAsset.BASE_DATA_OBJECT_TYPE</code>.
*
* @param id The <code>id</code> for the retrieved <code>DataObject</code>.
@ -106,8 +100,8 @@ public class ImageAsset extends BinaryAsset {
}
/**
* @return the base PDL object type for this item. Child classes should
* override this method to return the correct value
* @return the base PDL object type for this item. Child classes should override this method to
* return the correct value
*/
@Override
public String getBaseDataObjectType() {
@ -149,9 +143,8 @@ public class ImageAsset extends BinaryAsset {
}
/**
* Load the image asset from the specified file. Automatically guesses the
* mime type of the file. If the file is a jpeg, tries to automatically
* determine width and height, as well.
* Load the image asset from the specified file. Automatically guesses the mime type of the
* file. If the file is a jpeg, tries to automatically determine width and height, as well.
*
* @param fileName The original name of the file
* @param file The actual file on the server
@ -226,8 +219,9 @@ public class ImageAsset extends BinaryAsset {
* Find all images whose name matches the specified keyword
*
* @param keyword a String keyword
* @param context the context for the retrieved items. Should be
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
* @param context the context for the retrieved items. Should be {@link ContentItem#DRAFT} or
* {@link ContentItem#LIVE}
*
* @return a collection of images whose name matches the keyword
*/
public static ImageAssetCollection getImagesByKeyword(
@ -246,6 +240,7 @@ public class ImageAsset extends BinaryAsset {
* Find all images whose name matches the specified keyword
*
* @param keyword a String keyword
*
* @return a collection of images whose name matches the keyword
*/
public static ImageAssetCollection getImagesByKeyword(String keyword) {
@ -253,11 +248,11 @@ public class ImageAsset extends BinaryAsset {
}
/**
* Resize this ImageAsset proportional to maxThumbnailWidth, if this
* ImageAsset is wider then maxThumbnailWidth. Else just return this
* ImageAsset.
* Resize this ImageAsset proportional to maxThumbnailWidth, if this ImageAsset is wider then
* maxThumbnailWidth. Else just return this ImageAsset.
*
* @param maxThumbnailWidth max image width
*
* @return
*/
public ImageAsset proportionalResizeToWidth(int maxThumbnailWidth) {
@ -278,12 +273,16 @@ public class ImageAsset extends BinaryAsset {
ByteArrayOutputStream scaledImageBuffer = new ByteArrayOutputStream();
java.awt.Image scaledImage = origImage.getScaledInstance(maxThumbnailWidth, -1, java.awt.Image.SCALE_SMOOTH);
java.awt.Image scaledImage = origImage.getScaledInstance(maxThumbnailWidth, -1,
java.awt.Image.SCALE_SMOOTH);
BufferedImage scaledBufImage = new BufferedImage(scaledImage.getWidth(null), scaledImage.getHeight(null), origImage.getType());
BufferedImage scaledBufImage = new BufferedImage(scaledImage.getWidth(null),
scaledImage.getHeight(null),
origImage.getType());
scaledBufImage.getGraphics().drawImage(scaledImage, 0, 0, null);
ImageIO.write(scaledBufImage, this.getMimeType().getFileExtension(), scaledImageBuffer);
ImageIO.write(scaledBufImage, this.getMimeType().getFileExtension(),
scaledImageBuffer);
imageAsset.setContent(scaledImageBuffer.toByteArray());
imageAsset.setWidth(new BigDecimal(scaledImage.getWidth(null)));
@ -303,6 +302,7 @@ public class ImageAsset extends BinaryAsset {
* Extract filename from path
*
* @param fileName
*
* @return filename
*/
protected String extractFilename(String fileName) {
@ -326,4 +326,5 @@ public class ImageAsset extends BinaryAsset {
setWidth(new BigDecimal(image.getWidth()));
setHeight(new BigDecimal(image.getHeight()));
}
}

View File

@ -128,8 +128,8 @@ public class GenericContactAddressSheet extends Table implements TableActionList
case 0:
return address.getTitle();
case 1:
return ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.delete_address.button_label");
return new Label(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.delete_address.button_label"));
default:
return null;
}
@ -208,7 +208,7 @@ public class GenericContactAddressSheet extends Table implements TableActionList
contact);
if (canEdit) {
final ControlLink link = new ControlLink(new Label((GlobalizedMessage) value));
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.person.confirm_remove"));
return link;

View File

@ -156,8 +156,8 @@ public class GenericContactPersonSheet extends Table implements TableActionListe
case 0:
return m_person.getFullName();
case 1:
return ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericcontact.delete_person").localize();
return new Label(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericcontact.delete_person"));
default:
return null;
}
@ -238,14 +238,13 @@ public class GenericContactPersonSheet extends Table implements TableActionListe
contact);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label)value);
link.setConfirmation(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.contact.person"
+ ".confirm_remove"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return (Label) value;
}
}

View File

@ -109,6 +109,7 @@ public class GenericContactTypeTable extends Table implements TableActionListene
.getSelectedObject(state);
return new GenericContactTypeTableModel(table, state, contacttype);
}
}
/**
@ -120,8 +121,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene
final private int MAX_DESC_LENGTH = 25;
private Table m_table;
private RelationAttribute m_contacttype;
private GenericContactTypeCollection m_contacttypeCollection = new
GenericContactTypeCollection();
private GenericContactTypeCollection m_contacttypeCollection
= new GenericContactTypeCollection();
private GenericContactTypeTableModel(Table t,
PageState ps,
@ -139,8 +140,8 @@ public class GenericContactTypeTable extends Table implements TableActionListene
/**
* Check collection for the existence of another row.
*
* If exists, fetch the value of current GenericPersonEntryCollection object
* into m_comntact class variable.
* If exists, fetch the value of current GenericPersonEntryCollection object into m_comntact
* class variable.
*/
public boolean nextRow() {
@ -157,6 +158,7 @@ public class GenericContactTypeTable extends Table implements TableActionListene
/**
* Return the
*
* @see com.arsdigita.bebop.table.TableModel#getElementAt(int)
*/
public Object getElementAt(int columnIndex) {
@ -166,8 +168,7 @@ public class GenericContactTypeTable extends Table implements TableActionListene
case 1:
return m_contacttypeCollection.getName();
case 2:
return new Label(GlobalizationUtil.globalize("cms.ui.delete")
);
return new Label(GlobalizationUtil.globalize("cms.ui.delete"));
default:
return null;
}
@ -180,11 +181,11 @@ public class GenericContactTypeTable extends Table implements TableActionListene
public Object getKeyAt(int columnIndex) {
return m_contacttype.getKey();
}
}
/**
* Check for the permissions to edit item and put either a Label or
* a ControlLink accordingly.
* Check for the permissions to edit item and put either a Label or a ControlLink accordingly.
*/
private class EditCellRenderer extends LockableImpl implements TableCellRenderer {
@ -193,8 +194,7 @@ public class GenericContactTypeTable extends Table implements TableActionListene
int row, int column) {
SecurityManager sm = Utilities.getSecurityManager(state);
RelationAttribute contacttype = (RelationAttribute)
m_itemModel.getSelectedObject(state);
RelationAttribute contacttype = (RelationAttribute) m_itemModel.getSelectedObject(state);
// boolean canEdit = sm.canAccess(state.getRequest(),
// SecurityManager.EDIT_ITEM,
@ -206,11 +206,11 @@ public class GenericContactTypeTable extends Table implements TableActionListene
// return new Label(value.toString());
// }
}
}
/**
* Check for the permissions to delete item and put either a Label or
* a ControlLink accordingly.
* Check for the permissions to delete item and put either a Label or a ControlLink accordingly.
*/
private class DeleteCellRenderer extends LockableImpl implements TableCellRenderer {
@ -219,14 +219,13 @@ public class GenericContactTypeTable extends Table implements TableActionListene
int row, int column) {
SecurityManager sm = Utilities.getSecurityManager(state);
RelationAttribute contacttype = (RelationAttribute)
m_itemModel.getSelectedObject(state);
RelationAttribute contacttype = (RelationAttribute) m_itemModel.getSelectedObject(state);
// boolean canDelete = sm.canAccess(state.getRequest(),
// SecurityManager.DELETE_ITEM,
// contacttype);
// if (canDelete) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label)value);
link.setConfirmation(ContenttypesGlobalizationUtil
.globalize(
"cms.contenttypes.ui.contacttype.confirm_delete")
@ -236,20 +235,20 @@ public class GenericContactTypeTable extends Table implements TableActionListene
// return new Label(value.toString());
// }
}
}
/**
* Provide implementation to TableActionListener method.
* Code that comes into picture when a link on the table is clicked.
* Handles edit and delete event.
* Provide implementation to TableActionListener method. Code that comes into picture when a
* link on the table is clicked. Handles edit and delete event.
*/
public void cellSelected(TableActionEvent evt) {
PageState state = evt.getPageState();
// Get selected GenericContactType
RelationAttribute contacttype = new RelationAttribute(new
BigDecimal(evt.getRowKey().toString()));
RelationAttribute contacttype = new RelationAttribute(new BigDecimal(evt.getRowKey()
.toString()));
// Get selected column
TableColumn col = getColumnModel().get(evt.getColumn().intValue());
@ -266,10 +265,10 @@ public class GenericContactTypeTable extends Table implements TableActionListene
}
/**
* provide Implementation to TableActionListener method.
* Does nothing in our case.
* provide Implementation to TableActionListener method. Does nothing in our case.
*/
public void headSelected(TableActionEvent e) {
throw new UnsupportedOperationException("Not Implemented");
}
}

View File

@ -313,10 +313,10 @@ public class GenericOrganizationalUnitContactTable extends Table implements
SecurityManager.EDIT_ITEM,
orgaunit);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
return link;
} else {
return new Label(value.toString());
return new Label("");
}
}
}
@ -344,14 +344,14 @@ public class GenericOrganizationalUnitContactTable extends Table implements
SecurityManager.DELETE_ITEM,
orgaunit);
if (canDelete) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(ContenttypesGlobalizationUtil.
globalize(
"cms.contenttypes.ui.genericorgaunit.confirm_delete")
);
return link;
} else {
return new Label(value.toString());
return new Label("");
}
}
}

View File

@ -174,7 +174,7 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitsTable
GlobalizationHelper.getNegotiatedLocale().
getLanguage()).getTitle();
case 1:
return customizer.getDeleteLabel();
return new Label(customizer.getDeleteLabel());
case 2:
return customizer.getUpLabel();
case 3:
@ -254,7 +254,7 @@ public class GenericOrganizationalUnitSubordinateOrgaUnitsTable
orgaunit);
if (canEdit) {
final ControlLink link = new ControlLink(value.toString());
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(customizer.getConfirmRemoveLabel());
return link;
} else {

View File

@ -160,7 +160,7 @@ public class GenericOrganizationalUnitSuperiorOrgaUnitsTable extends Table {
case 0:
return superiorOrgaUnits.getTitle();
case 1:
return customizer.getDeleteLabel();
return new Label(customizer.getDeleteLabel());
case 2:
return customizer.getUpLabel();
case 3:
@ -236,12 +236,11 @@ public class GenericOrganizationalUnitSuperiorOrgaUnitsTable extends Table {
orgaunit);
if (canEdit) {
final ControlLink link = new ControlLink(value.toString());
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(customizer.getConfirmRemoveLabel());
return link;
} else {
final Label label = new Label("");
return label;
return new Label("");
}
}

View File

@ -314,12 +314,12 @@ public class GenericPersonContactTable extends Table implements
SecurityManager.DELETE_ITEM,
person);
if (canDelete) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(ContenttypesGlobalizationUtil.
globalize("cms.contenttypes.ui.person.confirm_delete"));
return link;
} else {
return new Label((GlobalizedMessage) value);
return new Label("");
}
}
}

View File

@ -141,8 +141,8 @@ public class SciPublicationsAboutDiscussesTable extends Table implements TableAc
case 0:
return discussed.getTitle();
case 1:
return SciPublicationsAboutGlobalizationUtil.globalize(
"com.arsdigita.cms.contentassets.about.discusses.publication.remove");
return new Label(SciPublicationsAboutGlobalizationUtil.globalize(
"com.arsdigita.cms.contentassets.about.discusses.publication.remove"));
default:
return null;
}
@ -215,12 +215,12 @@ public class SciPublicationsAboutDiscussesTable extends Table implements TableAc
discussing);
if (canEdit) {
final ControlLink link = new ControlLink(new Label((GlobalizedMessage) value));
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(SciPublicationsAboutGlobalizationUtil.globalize(
"com.arsdigita.cms.contentassets.about.discusses.publication.remove.confirm"));
return link;
} else {
return new Label(value.toString());
return new Label("");
}
}

View File

@ -141,8 +141,8 @@ public class SciPublicationsAboutDiscussingTable extends Table implements TableA
case 0:
return discussing.getTitle();
case 1:
return SciPublicationsAboutGlobalizationUtil.globalize(
"com.arsdigita.cms.contentassets.about.discussing.publication.remove");
return new Label(SciPublicationsAboutGlobalizationUtil.globalize(
"com.arsdigita.cms.contentassets.about.discussing.publication.remove"));
default:
return null;
}
@ -152,6 +152,7 @@ public class SciPublicationsAboutDiscussingTable extends Table implements TableA
public Object getKeyAt(final int columnIndex) {
return discussing.getID();
}
}
private class PublicationCellRenderer extends LockableImpl implements TableCellRenderer {
@ -214,12 +215,12 @@ public class SciPublicationsAboutDiscussingTable extends Table implements TableA
discussed);
if (canEdit) {
final ControlLink link = new ControlLink(new Label((GlobalizedMessage) value));
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(SciPublicationsAboutGlobalizationUtil.globalize(
"com.arsdigita.cms.contentassets.about.discussing.publication.remove.confirm"));
return link;
} else {
return new Label(value.toString());
return new Label("");
}
}

View File

@ -156,9 +156,9 @@ public class LibrarySignaturesTable extends Table {
case 2:
return librarySignatures.get(LibrarySignature.LIBRARY_LINK);
case 3:
return LibrarySignaturesGlobalizationUtil.globalize("scipublications.librarysignatures.edit");
return new Label(LibrarySignaturesGlobalizationUtil.globalize("scipublications.librarysignatures.edit"));
case 4:
return LibrarySignaturesGlobalizationUtil.globalize("scipublications.librarysignatures.delete");
return new Label(LibrarySignaturesGlobalizationUtil.globalize("scipublications.librarysignatures.delete"));
default:
return null;
}
@ -193,25 +193,10 @@ public class LibrarySignaturesTable extends Table {
publication);
if (canEdit) {
final ControlLink link;
if (value instanceof GlobalizedMessage) {
link = new ControlLink(new Label((GlobalizedMessage) value));
} else if (value == null) {
return new Label("???");
} else {
link = new ControlLink(value.toString());
}
final ControlLink link= new ControlLink((Label) value);
return link;
} else {
final Label label;
if (value instanceof GlobalizedMessage) {
label = new Label((GlobalizedMessage) value);
} else if (value == null) {
return new Label("???");
} else {
label = new Label(value.toString());
}
return label;
return new Label("");
}
}
@ -239,23 +224,12 @@ public class LibrarySignaturesTable extends Table {
publication);
if (canEdit) {
final ControlLink link;
if (value instanceof GlobalizedMessage) {
link = new ControlLink(new Label((GlobalizedMessage) value));
} else {
link = new ControlLink(value.toString());
}
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(LibrarySignaturesGlobalizationUtil.globalize(
"scipublications.librarysignatures.delete.confirm"));
return link;
} else {
final Label label;
if (value instanceof GlobalizedMessage) {
label = new Label((GlobalizedMessage) value);
} else {
label = new Label(value.toString());
}
return label;
return new Label("");
}
}

View File

@ -161,8 +161,8 @@ public class SciPublicationsPersonsPersonTable extends Table implements TableAct
case 1:
return relation;
case 2:
return globalisationUtil.globalize(
"com.arsdigita.cms.contentassets.publication_persons.person.remove");
return new Label(globalisationUtil.globalize(
"com.arsdigita.cms.contentassets.publication_persons.person.remove"));
default:
return null;
}
@ -230,28 +230,12 @@ public class SciPublicationsPersonsPersonTable extends Table implements TableAct
final int row,
final int column) {
final GlobalizedMessage relation = new GlobalizedMessage((String) value,
final GlobalizedMessage relation = new GlobalizedMessage(
(String) value,
SciPublicationsPersonsService.RELATION_ATTRIBUTE,
new RelationAttributeResourceBundleControl());
return new Label(relation);
// final String relation = (String) value;
//
// final RelationAttributeCollection relations = new RelationAttributeCollection(
// SciPublicationsPersonsService.RELATION_ATTRIBUTE,
// relation);
// relations.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage());
// if (relations.isEmpty()) {
// return new Label(relation);
// } else {
// relations.next();
// final String label = relations.getName();
// relations.close();
// return new Label(label);
// }
//return new Label(value.toString());
}
}
@ -275,12 +259,12 @@ public class SciPublicationsPersonsPersonTable extends Table implements TableAct
publication);
if (canEdit) {
final ControlLink link = new ControlLink(new Label((GlobalizedMessage) value));
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(globalisationUtil.globalize(
"com.arsdigita.cms.contentassets.publications_persons.person.remove.confirm"));
return link;
} else {
return new Label((GlobalizedMessage) value);
return new Label("");
}
}

View File

@ -73,23 +73,28 @@ public class PublicationTypeAssetTable extends Table {
columnModel.add(new TableColumn(
0,
PublicationTypeAssetGlobalizationUtil.globalize("scipublications.publication_type_asset.type"),
PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.type"),
TABLE_COL_TYPE));
columnModel.add(new TableColumn(
1,
PublicationTypeAssetGlobalizationUtil.globalize("scipublications.publication_type_asset.isbn"),
PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.isbn"),
TABLE_COL_ISBN));
columnModel.add(new TableColumn(
2,
PublicationTypeAssetGlobalizationUtil.globalize("scipublications.publication_type_asset.misc"),
PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.misc"),
TABLE_COL_MISC));
columnModel.add(new TableColumn(
3,
PublicationTypeAssetGlobalizationUtil.globalize("scipublications.publication_type_asset.edit"),
PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.edit"),
TABLE_COL_EDIT));
columnModel.add(new TableColumn(
4,
PublicationTypeAssetGlobalizationUtil.globalize("scipublications.publication_type_asset.delete"),
PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.delete"),
TABLE_COL_DEL));
setModelBuilder(new ModelBuilder(itemModel));
@ -150,11 +155,11 @@ public class PublicationTypeAssetTable extends Table {
case 2:
return typeAssets.get(PublicationTypeAsset.MISC);
case 3:
return PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.edit");
return new Label(PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.edit"));
case 4:
return PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.delete");
return new Label(PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.delete"));
default:
return null;
}
@ -189,25 +194,11 @@ public class PublicationTypeAssetTable extends Table {
publication);
if (canEdit) {
final ControlLink link;
if (value instanceof GlobalizedMessage) {
link = new ControlLink(new Label((GlobalizedMessage) value));
} else if (value == null) {
return new Label("???");
} else {
link = new ControlLink(value.toString());
}
final ControlLink link = new ControlLink((Label) value);
return link;
} else {
final Label label;
if (value instanceof GlobalizedMessage) {
label = new Label((GlobalizedMessage) value);
} else if (value == null) {
return new Label("???");
} else {
label = new Label(value.toString());
}
return label;
return new Label("");
}
}
@ -235,23 +226,12 @@ public class PublicationTypeAssetTable extends Table {
publication);
if (canEdit) {
final ControlLink link;
if (value instanceof GlobalizedMessage) {
link = new ControlLink(new Label((GlobalizedMessage) value));
} else {
link = new ControlLink(value.toString());
}
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationTypeAssetGlobalizationUtil.globalize(
"scipublications.publication_type_asset.delete.confirm"));
return link;
} else {
final Label label;
if (value instanceof GlobalizedMessage) {
label = new Label((GlobalizedMessage) value);
} else {
label = new Label(value.toString());
}
return label;
return new Label("");
}
}
@ -268,7 +248,8 @@ public class PublicationTypeAssetTable extends Table {
public void cellSelected(final TableActionEvent event) {
final PageState state = event.getPageState();
final PublicationTypeAsset asset = new PublicationTypeAsset(new BigDecimal(event.getRowKey().toString()));
final PublicationTypeAsset asset = new PublicationTypeAsset(new BigDecimal(event
.getRowKey().toString()));
final TableColumn column = getColumnModel().get(event.getColumn().intValue());
@ -286,4 +267,5 @@ public class PublicationTypeAssetTable extends Table {
}
}
}

View File

@ -234,7 +234,7 @@ public class SciPublicationsMovieDirectorSheet
movie);
if (canEdit) {
final ControlLink link = new ControlLink((Label)value);
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(globalisationUtil.globalize(
"publications.dramaticarts.ui.movie.director.remove.confirm"));
return link;

View File

@ -152,9 +152,8 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet
case 0:
return collectedVolume.getTitle();
case 1:
return PublicationGlobalizationUtil.globalize(
"publications.ui.articleInCollectedVolume.collectedVolume.remove").
localize();
return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.articleInCollectedVolume.collectedVolume.remove"));
default:
return null;
}
@ -244,15 +243,14 @@ public class ArticleInCollectedVolumeCollectedVolumeSheet
article);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(
PublicationGlobalizationUtil.globalize(
"publications.ui.articleInCollectedVolume.collectedVolume."
+ "confirm_remove"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}

View File

@ -142,9 +142,8 @@ public class ArticleInJournalJournalSheet
case 0:
return journal.getTitle();
case 1:
return PublicationGlobalizationUtil.globalize(
"publications.ui.articleInCollectedVolume.collectedVolume.remove").
localize();
return new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.articleInCollectedVolume.collectedVolume.remove"));
default:
return null;
}
@ -227,15 +226,13 @@ public class ArticleInJournalJournalSheet
article);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(
(String) PublicationGlobalizationUtil.globalize(
"publication.ui.articleInJournal.journal.confirm_remove").
localize());
PublicationGlobalizationUtil.globalize(
"publication.ui.articleInJournal.journal.confirm_remove"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -53,8 +53,7 @@ public class CollectedVolumeArticlesTable
extends Table
implements TableActionListener {
private static final Logger s_log =
Logger.getLogger(
private static final Logger s_log = Logger.getLogger(
CollectedVolumeArticlesTable.class);
private final String TABLE_COL_EDIT = "table_col_edit";
private final String TABLE_COL_DEL = "table_col_del";
@ -117,13 +116,13 @@ public class CollectedVolumeArticlesTable
@Override
public TableModel makeModel(Table table, PageState state) {
table.getRowSelectionModel().clearSelection(state);
CollectedVolume collectedVolume =
(CollectedVolume) m_itemModel.getSelectedObject(
CollectedVolume collectedVolume = (CollectedVolume) m_itemModel.getSelectedObject(
state);
return new CollectedVolumeArticlesTableModel(table,
state,
collectedVolume);
}
}
private class CollectedVolumeArticlesTableModel implements TableModel {
@ -176,6 +175,7 @@ public class CollectedVolumeArticlesTable
public Object getKeyAt(int columnIndex) {
return m_article.getID();
}
}
private class EditCellRenderer
@ -190,8 +190,7 @@ public class CollectedVolumeArticlesTable
Object key,
int row,
int col) {
SecurityManager securityManager =
Utilities.getSecurityManager(state);
SecurityManager securityManager = Utilities.getSecurityManager(state);
CollectedVolume collectedVolume = (CollectedVolume) m_itemModel.
getSelectedObject(state);
@ -213,8 +212,7 @@ public class CollectedVolumeArticlesTable
ContentSection section = article.getContentSection();//CMS.getContext().getContentSection();
ItemResolver resolver = section.getItemResolver();
Link link =
new Link(value.toString(),
Link link = new Link(value.toString(),
resolver.generateItemURL(state,
article,
section,
@ -236,6 +234,7 @@ public class CollectedVolumeArticlesTable
return label;
}
}
}
private class DeleteCellRenderer
@ -250,10 +249,8 @@ public class CollectedVolumeArticlesTable
Object key,
int row,
int col) {
SecurityManager securityManager =
Utilities.getSecurityManager(state);
CollectedVolume collectedVolume =
(CollectedVolume) m_itemModel.getSelectedObject(
SecurityManager securityManager = Utilities.getSecurityManager(state);
CollectedVolume collectedVolume = (CollectedVolume) m_itemModel.getSelectedObject(
state);
boolean canEdit = securityManager.canAccess(
@ -262,15 +259,15 @@ public class CollectedVolumeArticlesTable
collectedVolume);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.collected_volume.articles.confirm_remove"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}
private class UpCellRenderer
@ -296,6 +293,7 @@ public class CollectedVolumeArticlesTable
return link;
}
}
}
private class DownCellRenderer
@ -312,11 +310,9 @@ public class CollectedVolumeArticlesTable
int row,
int col) {
CollectedVolume collectedVolume =
(CollectedVolume) m_itemModel.getSelectedObject(
CollectedVolume collectedVolume = (CollectedVolume) m_itemModel.getSelectedObject(
state);
ArticleInCollectedVolumeCollection articles =
collectedVolume.getArticles();
ArticleInCollectedVolumeCollection articles = collectedVolume.getArticles();
if ((articles.size() - 1) == row) {
s_log.debug("Row is last row in table, don't show down link");
@ -327,21 +323,19 @@ public class CollectedVolumeArticlesTable
return link;
}
}
}
@Override
public void cellSelected(TableActionEvent event) {
PageState state = event.getPageState();
ArticleInCollectedVolume article =
new ArticleInCollectedVolume(
ArticleInCollectedVolume article = new ArticleInCollectedVolume(
new BigDecimal(event.getRowKey().toString()));
CollectedVolume collectedVolume =
(CollectedVolume) m_itemModel.getSelectedObject(state);
CollectedVolume collectedVolume = (CollectedVolume) m_itemModel.getSelectedObject(state);
ArticleInCollectedVolumeCollection articles =
collectedVolume.getArticles();
ArticleInCollectedVolumeCollection articles = collectedVolume.getArticles();
TableColumn column = getColumnModel().get(event.getColumn().intValue());
@ -359,4 +353,5 @@ public class CollectedVolumeArticlesTable
public void headSelected(TableActionEvent event) {
//Nothing to do.
}
}

View File

@ -231,13 +231,12 @@ public class ExpertiseOrdererSheet
expertise);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publication.ui.expertise.orderer.remove.confirm"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -231,13 +231,12 @@ public class ExpertiseOrganizationSheet
expertise);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publication.ui.expertise.organization.remove.confirm"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -142,9 +142,8 @@ public class GenericOrganizationalUnitPublicationsTable
case 0:
return publications.getPublication().getTitle();
case 1:
return PublicationGlobalizationUtil.globalize(
"genericorganizationalunit.ui.publications.remove").
localize();
return new Label(PublicationGlobalizationUtil.globalize(
"genericorganizationalunit.ui.publications.remove"));
default:
return null;
}
@ -219,13 +218,12 @@ public class GenericOrganizationalUnitPublicationsTable
orgaunit);
if (canEdit) {
final ControlLink link = new ControlLink(value.toString());
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"genericorganizationalunit.ui.publications.remove.confirm"));
return link;
} else {
final Label label = new Label(value.toString());
return label;
return new Label("");
}
}

View File

@ -242,13 +242,12 @@ public class InProceedingsProceedingsSheet
inProceedings);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.inProceedings.proceedings.confirm_remove"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -242,13 +242,12 @@ public class InternetArticleOrganizationSheet
article);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.internetarticle.organization.remove.confirm"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -112,13 +112,13 @@ public class JournalArticlesTable
@Override
public TableModel makeModel(Table table, PageState state) {
table.getRowSelectionModel().clearSelection(state);
Journal collectedVolume =
(Journal) m_itemModel.getSelectedObject(
Journal collectedVolume = (Journal) m_itemModel.getSelectedObject(
state);
return new JournalArticlesTableModel(table,
state,
collectedVolume);
}
}
private class JournalArticlesTableModel implements TableModel {
@ -170,6 +170,7 @@ public class JournalArticlesTable
public Object getKeyAt(int columnIndex) {
return m_article.getID();
}
}
private class EditCellRenderer
@ -184,8 +185,7 @@ public class JournalArticlesTable
Object key,
int row,
int col) {
com.arsdigita.cms.SecurityManager securityManager =
Utilities.getSecurityManager(state);
com.arsdigita.cms.SecurityManager securityManager = Utilities.getSecurityManager(state);
Journal journal = (Journal) m_itemModel.getSelectedObject(state);
boolean canEdit = securityManager.canAccess(
@ -205,8 +205,7 @@ public class JournalArticlesTable
}
ContentSection section = article.getContentSection();//CMS.getContext().getContentSection();
ItemResolver resolver = section.getItemResolver();
Link link =
new Link(String.format("%s (%s)",
Link link = new Link(String.format("%s (%s)",
value.toString(),
article.getLanguage()),
resolver.generateItemURL(state,
@ -231,6 +230,7 @@ public class JournalArticlesTable
return label;
}
}
}
private class DeleteCellRenderer extends LockableImpl implements
@ -255,14 +255,15 @@ public class JournalArticlesTable
com.arsdigita.cms.SecurityManager.DELETE_ITEM,
journal);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"cms.contenttypes.ui.journal.articles.confirm_delete"));
return link;
} else {
return new Label(value.toString());
return new Label("");
}
}
}
private class UpCellRenderer
@ -289,6 +290,7 @@ public class JournalArticlesTable
return link;
}
}
}
private class DownCellRenderer
@ -318,6 +320,7 @@ public class JournalArticlesTable
return link;
}
}
}
@Override
@ -353,4 +356,5 @@ public class JournalArticlesTable
public void headSelected(TableActionEvent event) {
//Nothing to do
}
}

View File

@ -234,13 +234,12 @@ public class ProceedingsOrganizerSheet
proceedings);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.proceedings.organizer.remove.confirm"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -269,13 +269,12 @@ public class ProceedingsPapersTable
proceedings);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.proceedings.paper.confirm_remove"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -309,7 +309,7 @@ public class PublicationAuthorsTable
ControlLink link = new ControlLink((Label) value);
return link;
} else {
return (Label) value;
return new Label("");
}
}
@ -342,7 +342,7 @@ public class PublicationAuthorsTable
"publications.ui.authors.author.confirm_remove"));
return link;
} else {
return (Label) value;
return new Label("");
}
}

View File

@ -167,8 +167,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
final int row,
final int column) {
final com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state);
final GenericOrganizationalUnit orgaunit =
new GenericOrganizationalUnit(
final GenericOrganizationalUnit orgaunit = new GenericOrganizationalUnit(
(BigDecimal) key);
final boolean canEdit = securityManager.canAccess(
@ -211,9 +210,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
final int row,
final int column) {
final com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state);
final Publication publication =
(Publication) itemModel.getSelectedObject(state);
final Publication publication = (Publication) itemModel.getSelectedObject(state);
boolean canEdit = securityManager.canAccess(
state.getRequest(),
@ -221,13 +218,12 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
publication);
if (canEdit) {
final ControlLink link = new ControlLink(value.toString());
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.orgaunits.remove.confirm"));
return link;
} else {
final Label label = new Label("");
return label;
return new Label("");
}
}
@ -239,8 +235,7 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
public void cellSelected(final TableActionEvent event) {
final PageState state = event.getPageState();
final GenericOrganizationalUnit orgaunit =
new GenericOrganizationalUnit(
final GenericOrganizationalUnit orgaunit = new GenericOrganizationalUnit(
new BigDecimal(event.getRowKey().toString()));
final Publication publication = (Publication) itemModel.
getSelectedObject(state);
@ -264,4 +259,5 @@ public class PublicationGenericOrganizationalUnitsTable extends Table {
}
}
}

View File

@ -95,13 +95,13 @@ public class PublicationWithPublisherSetPublisherSheet
@Override
public TableModel makeModel(final Table table, final PageState state) {
table.getRowSelectionModel().clearSelection(state);
PublicationWithPublisher publication =
(PublicationWithPublisher) itemModel.
PublicationWithPublisher publication = (PublicationWithPublisher) itemModel.
getSelectedObject(state);
return new PublicationWithPublisherSetPublisherSheetModel(table,
state,
publication);
}
}
private class PublicationWithPublisherSetPublisherSheetModel
@ -159,6 +159,7 @@ public class PublicationWithPublisherSetPublisherSheet
public Object getKeyAt(final int columnIndex) {
return publisher.getID();
}
}
private class EditCellRenderer
@ -173,10 +174,8 @@ public class PublicationWithPublisherSetPublisherSheet
Object key,
int row,
int column) {
com.arsdigita.cms.SecurityManager securityManager =
CMS.getSecurityManager(state);
PublicationWithPublisher publication =
(PublicationWithPublisher) itemModel.
com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state);
PublicationWithPublisher publication = (PublicationWithPublisher) itemModel.
getSelectedObject(state);
boolean canEdit = securityManager.canAccess(state.getRequest(),
@ -193,8 +192,7 @@ public class PublicationWithPublisherSetPublisherSheet
ContentSection section = publisher.getContentSection();//CMS.getContext().getContentSection();
ItemResolver resolver = section.getItemResolver();
Link link =
new Link(value.toString(),
Link link = new Link(value.toString(),
resolver.generateItemURL(state,
publisher,
section,
@ -214,6 +212,7 @@ public class PublicationWithPublisherSetPublisherSheet
return label;
}
}
}
private class DeleteCellRenderer
@ -228,10 +227,8 @@ public class PublicationWithPublisherSetPublisherSheet
Object key,
int row,
int col) {
com.arsdigita.cms.SecurityManager securityManager =
CMS.getSecurityManager(state);
PublicationWithPublisher publication =
(PublicationWithPublisher) itemModel.
com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state);
PublicationWithPublisher publication = (PublicationWithPublisher) itemModel.
getSelectedObject(
state);
@ -241,23 +238,22 @@ public class PublicationWithPublisherSetPublisherSheet
publication);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.with_publisher.publisher.remove.confirm"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}
@Override
public void cellSelected(final TableActionEvent event) {
PageState state = event.getPageState();
PublicationWithPublisher publication =
(PublicationWithPublisher) itemModel.
PublicationWithPublisher publication = (PublicationWithPublisher) itemModel.
getSelectedObject(state);
TableColumn column = getColumnModel().get(event.getColumn().intValue());
@ -273,4 +269,5 @@ public class PublicationWithPublisherSetPublisherSheet
public void headSelected(final TableActionEvent event) {
//Nothing to do
}
}

View File

@ -52,10 +52,11 @@ import org.apache.log4j.Logger;
*
* @author Jens Pelzetter
*/
public class SeriesEditshipTable extends Table implements TableActionListener {
private static final Logger s_log =
Logger.getLogger(SeriesEditshipTable.class);
private static final Logger s_log = Logger.getLogger(SeriesEditshipTable.class);
private final String TABLE_COL_EDIT = "table_col_edit";
private final String TABLE_COL_EDIT_EDITSHIP = "table_col_edit_editship";
private final String TABLE_COL_DEL = "table_col_del";
@ -134,10 +135,10 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
public TableModel makeModel(Table table, PageState state) {
table.getRowSelectionModel().clearSelection(state);
Series series =
(Series) m_itemModel.getSelectedObject(state);
Series series = (Series) m_itemModel.getSelectedObject(state);
return new SeriesEditshipTableModel(table, state, series);
}
}
private class SeriesEditshipTableModel implements TableModel {
@ -211,6 +212,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
public Object getKeyAt(int columnIndex) {
return m_editor.getID();
}
}
private class EditCellRenderer
@ -226,8 +228,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
Object key,
int row,
int col) {
SecurityManager securityManager =
CMS.getSecurityManager(state);
SecurityManager securityManager = CMS.getSecurityManager(state);
Series series = (Series) m_itemModel.getSelectedObject(state);
boolean canEdit = securityManager.canAccess(
@ -247,8 +248,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
}
ContentSection section = editor.getContentSection();//CMS.getContext().getContentSection();
ItemResolver resolver = section.getItemResolver();
Link link =
new Link(String.format("%s",
Link link = new Link(String.format("%s",
value.toString(),
editor.getLanguage()),
resolver.generateItemURL(state,
@ -273,6 +273,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
return label;
}
}
}
private class EditEditshipCellRenderer
@ -287,8 +288,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
Object key,
int row,
int col) {
SecurityManager securityManager =
CMS.getSecurityManager(state);
SecurityManager securityManager = CMS.getSecurityManager(state);
Series series = (Series) m_itemModel.getSelectedObject(state);
boolean canEdit = securityManager.canAccess(
@ -297,13 +297,13 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
series);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}
private class DeleteCellRenderer
@ -319,8 +319,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
Object key,
int row,
int col) {
SecurityManager securityManager =
Utilities.getSecurityManager(state);
SecurityManager securityManager = Utilities.getSecurityManager(state);
Series series = (Series) m_itemModel.getSelectedObject(state);
boolean canDelete = securityManager.canAccess(
@ -329,15 +328,15 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
series);
if (canDelete) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.series.editship.remove.confirm"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}
/*
@ -400,8 +399,7 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
public void cellSelected(TableActionEvent event) {
PageState state = event.getPageState();
GenericPerson editor =
new GenericPerson(new BigDecimal(event.getRowKey().
GenericPerson editor = new GenericPerson(new BigDecimal(event.getRowKey().
toString()));
Series series = (Series) m_itemModel.getSelectedObject(state);
@ -443,4 +441,5 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
public void headSelected(TableActionEvent event) {
//Nothing to do here.
}
}

View File

@ -257,9 +257,9 @@ public class SeriesVolumesTable extends Table {
series);
if (canEdit) {
return new ControlLink(value.toString());
return new ControlLink((Label)value);
} else {
return new Label(value.toString());
return new Label("");
}
}
@ -284,13 +284,12 @@ public class SeriesVolumesTable extends Table {
series);
if (canDelete) {
final ControlLink link = new ControlLink(value.toString());
final ControlLink link = new ControlLink((Label) value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.series.volumes.remove.confirm"));
return link;
} else {
final Label label = new Label(value.toString());
return label;
return new Label("");
}
}

View File

@ -234,13 +234,12 @@ public class UnPublishedOrganizationSheet
unPublished);
if (canEdit) {
ControlLink link = new ControlLink(value.toString());
ControlLink link = new ControlLink((Label)value);
link.setConfirmation(PublicationGlobalizationUtil.globalize(
"publications.ui.unpublished.organization.confirm_remove"));
return link;
} else {
Label label = new Label(value.toString());
return label;
return new Label("");
}
}
}

View File

@ -171,8 +171,8 @@ public class SciProjectSponsorSheet extends Table {
final int row,
final int column) {
final com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state);
final GenericOrganizationalUnit sponsor =
new GenericOrganizationalUnit((BigDecimal) key);
final GenericOrganizationalUnit sponsor
= new GenericOrganizationalUnit((BigDecimal) key);
final boolean canEdit = securityManager.canAccess(
state.getRequest(),
@ -220,11 +220,10 @@ public class SciProjectSponsorSheet extends Table {
project);
if (canEdit) {
final ControlLink link = new ControlLink(value.toString());
final ControlLink link = new ControlLink((Label) value);
return link;
} else {
final Label label = new Label(value.toString());
return label;
return (Label) value;
}
}
@ -242,15 +241,15 @@ public class SciProjectSponsorSheet extends Table {
final int row,
final int column) {
final com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state);
final GenericOrganizationalUnit sponsor =
new GenericOrganizationalUnit((BigDecimal) key);
final GenericOrganizationalUnit sponsor
= new GenericOrganizationalUnit((BigDecimal) key);
final boolean canEdit = securityManager.canAccess(
state.getRequest(),
com.arsdigita.cms.SecurityManager.EDIT_ITEM,
sponsor);
if (canEdit) {
final ControlLink link = new ControlLink(value.toString());
final ControlLink link = new ControlLink((Label)value);
link.setConfirmation(SciProjectGlobalizationUtil.globalize(
"sciproject.ui.sponsor.remove.confirm"));
return link;
@ -360,4 +359,5 @@ public class SciProjectSponsorSheet extends Table {
}
}
}