Globalisierung eingerichtet.
git-svn-id: https://svn.libreccm.org/ccm/trunk@454 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
0410f15079
commit
fe681cfcbc
|
|
@ -1,8 +1,9 @@
|
|||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.cms.contentassets.ui.FileDescriptionForm;
|
||||
import com.arsdigita.bebop.FormSection;
|
||||
import com.arsdigita.runtime.AbstractConfig;
|
||||
import com.arsdigita.util.parameter.ClassParameter;
|
||||
import com.arsdigita.util.parameter.SpecificClassParameter;
|
||||
import com.arsdigita.util.parameter.BooleanParameter;
|
||||
import com.arsdigita.util.parameter.Parameter;
|
||||
|
||||
|
|
@ -15,12 +16,11 @@ public class FileAttachmentConfig extends AbstractConfig {
|
|||
* Constructor, don't use is directly!
|
||||
*/
|
||||
public FileAttachmentConfig() {
|
||||
editFormClass = new ClassParameter ("com.arsdigita.cms.contentassets.file_edit_form",
|
||||
|
||||
editFormClass = new SpecificClassParameter ("com.arsdigita.cms.contentassets.file_edit_form",
|
||||
Parameter.REQUIRED,
|
||||
FileDescriptionForm.class
|
||||
// TODO move *private* class ContentSectionConfig.SpecificClassParameter to c.a.util.parameter
|
||||
// so we can use it here.
|
||||
// , FormSection.class
|
||||
FileDescriptionForm.class,
|
||||
FormSection.class
|
||||
);
|
||||
showAssetID = new BooleanParameter("com.arsdigita.cms.contentassets.file_show_asset_id",
|
||||
Parameter.OPTIONAL,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Copyright (C) 2010 Peter Boy (pb@zes.uni-remen.de)
|
||||
*
|
||||
* The contents of this file are subject to the Open Software License v2.1
|
||||
* (the "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
* http://rhea.redhat.com/licenses/osl2.1.html.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contentassets;
|
||||
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
/**
|
||||
* Service routine tp provide localized versions of key strings for the
|
||||
* FileAttachment UI and messages.
|
||||
*
|
||||
* @author pb
|
||||
* @version $Id: $
|
||||
*/
|
||||
public class FileAttachmentGlobalize {
|
||||
|
||||
|
||||
/**
|
||||
* The label for the authoring step
|
||||
*/
|
||||
public static GlobalizedMessage AuthoringStepLabel() {
|
||||
return new GlobalizedMessage(
|
||||
"com.arsdigita.cms.contentassets.file_attachment_label",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
/**
|
||||
* The description for the authoring step
|
||||
*/
|
||||
public static GlobalizedMessage AuthoringStepDescription() {
|
||||
return new GlobalizedMessage(
|
||||
"com.arsdigita.cms.contentassets.file_attachment_description",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
/**
|
||||
* Label for File Type selection box.
|
||||
*/
|
||||
public static GlobalizedMessage FileTypeLabel() {
|
||||
return new GlobalizedMessage(
|
||||
"com.arsdigita.cms.contentassets.file_type_label",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
/**
|
||||
* Label for File Type selection box.
|
||||
*/
|
||||
public static GlobalizedMessage NoFilesAssociatedMsg() {
|
||||
return new GlobalizedMessage(
|
||||
"com.arsdigita.cms.contentassets.no_files_associated_msg",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
/**
|
||||
* Label for File Type selection box.
|
||||
*/
|
||||
public static GlobalizedMessage UploadNewFileLabel() {
|
||||
return new GlobalizedMessage(
|
||||
"com.arsdigita.cms.contentassets.upload_new_file_label",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,6 @@ import com.arsdigita.domain.xml.TraversalHandler;
|
|||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
import com.arsdigita.kernel.URLService;
|
||||
import com.arsdigita.runtime.DomainInitEvent;
|
||||
import com.arsdigita.runtime.LegacyInitEvent;
|
||||
import com.arsdigita.search.MetadataProviderRegistry;
|
||||
import com.arsdigita.xml.XML;
|
||||
|
||||
|
|
@ -32,47 +31,24 @@ import com.arsdigita.xml.XML;
|
|||
* @version $Revision: 1.1 $ $Date: 2004/12/15 15:37:51 $
|
||||
* @version $Id: FileAttachmentInitializer.java 1262 2006-07-17 08:15:45Z cgyg9330 $
|
||||
**/
|
||||
|
||||
public class FileAttachmentInitializer extends ContentAssetInitializer {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public FileAttachmentInitializer() {
|
||||
super("ccm-cms-assets-fileattachment.pdl.mf");
|
||||
}
|
||||
|
||||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/"
|
||||
+ "cms/contentassets/FileAttachment.xml";
|
||||
}
|
||||
/**
|
||||
* Initializes content asset by parsing traversal xml file and registering
|
||||
* the specified steps in a transient storage which may be modified during
|
||||
* operation and has to be re-initialized each system startup).
|
||||
* Essential part of initializing the systems domain coupling machinery.
|
||||
|
||||
public String getProperty() {
|
||||
return "fileAttachments";
|
||||
}
|
||||
|
||||
public String getBaseType() {
|
||||
return ContentPage.BASE_DATA_OBJECT_TYPE;
|
||||
}
|
||||
|
||||
public Class getAuthoringStep() {
|
||||
return FileAttachmentsStep.class;
|
||||
}
|
||||
|
||||
public GlobalizedMessage getAuthoringStepLabel() {
|
||||
return new GlobalizedMessage(
|
||||
"com.arsdigita.cms.contentassets.file_attachment_label",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
public GlobalizedMessage getAuthoringStepDescription() {
|
||||
return new GlobalizedMessage(
|
||||
"com.arsdigita.cms.contentassets.file_attachment_description",
|
||||
"com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
public int getAuthoringStepSortKey() {
|
||||
return 2; // XXX config param please
|
||||
}
|
||||
|
||||
// public void init(LegacyInitEvent evt) {
|
||||
* @param evt
|
||||
*/
|
||||
@Override
|
||||
public void init(DomainInitEvent evt) {
|
||||
super.init(evt);
|
||||
|
||||
|
|
@ -95,10 +71,74 @@ public class FileAttachmentInitializer extends ContentAssetInitializer {
|
|||
MetadataProviderRegistry.registerAdapter(
|
||||
FileAttachment.BASE_DATA_OBJECT_TYPE,
|
||||
new FileAttachmentMetadataProvider());
|
||||
|
||||
XML.parseResource(
|
||||
"/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/"
|
||||
+ "FileAttachment-search.xml",
|
||||
new TraversalHandler());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The base type against which the asset is defined,
|
||||
* typically com.arsdigita.cms.ContentPage
|
||||
*/
|
||||
public String getBaseType() {
|
||||
return ContentPage.BASE_DATA_OBJECT_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path to the XML file defintions for the
|
||||
* asset,
|
||||
* eg /WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/FileAttachments.xml
|
||||
*/
|
||||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/"
|
||||
+ "cms/contentassets/FileAttachment.xml";
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the association between the item
|
||||
* and the asset, eg 'fileAttachments'.
|
||||
*/
|
||||
public String getProperty() {
|
||||
return "fileAttachments";
|
||||
}
|
||||
|
||||
/**
|
||||
* The class of the authoring kit step
|
||||
*/
|
||||
public Class getAuthoringStep() {
|
||||
return FileAttachmentsStep.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The label for the authoring step
|
||||
* @deprecated has to be replaced to provide LabelKey, see contgentAssetInitializer
|
||||
*/
|
||||
public GlobalizedMessage getAuthoringStepLabel() {
|
||||
return FileAttachmentGlobalize.AuthoringStepLabel();
|
||||
// return new GlobalizedMessage(
|
||||
// "com.arsdigita.cms.contentassets.file_attachment_label",
|
||||
// "com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
/**
|
||||
* The description for the authoring step
|
||||
* @deprecated has to be replaced to provide DesciptionKey, see contgentAssetInitializer
|
||||
*/
|
||||
public GlobalizedMessage getAuthoringStepDescription() {
|
||||
return FileAttachmentGlobalize.AuthoringStepDescription();
|
||||
// return new GlobalizedMessage(
|
||||
// "com.arsdigita.cms.contentassets.file_attachment_description",
|
||||
// "com.arsdigita.cms.contentassets.FileAttachmentResources");
|
||||
}
|
||||
|
||||
/**
|
||||
* The sort key for the authoring step
|
||||
*/
|
||||
public int getAuthoringStepSortKey() {
|
||||
return 2; // XXX config param please
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,7 @@
|
|||
com.arsdigita.cms.contentassets.file_attachment_label=Attach files
|
||||
com.arsdigita.cms.contentassets.file_attachment_description=Attach files
|
||||
cms.contentassets.file_attachment_label=Attach files
|
||||
cms.contentassets.file_attachment_description=Attach files
|
||||
cms.contentassets.file_type_label=File Type:
|
||||
cms.contentassets.no_files_associated_msg=This item does not have any associated files.
|
||||
cms.contentassets.upload_new_file_label=Upload a new file
|
||||
cms.contentassets.tableheader_file=File
|
||||
cms.contentassets.tableheader_description=Description
|
||||
|
|
|
|||
|
|
@ -1,2 +1,7 @@
|
|||
com.arsdigita.cms.contentassets.file_attachment_label=Dateien anf\u00FCgen
|
||||
com.arsdigita.cms.contentassets.file_attachment_description=Dateien anf\u00FCgen
|
||||
cms.contentassets.file_attachment_label=Dateien anf\u00FCgen
|
||||
cms.contentassets.file_attachment_description=Dateien anf\u00FCgen
|
||||
cms.contentassets.file_type_label=Datei Typ:
|
||||
cms.contentassets.no_files_associated_msg=Diesem Dokument sind keine Dateien zum Download zugeordnet.
|
||||
cms.contentassets.upload_new_file_label=Neue Datei hochladen
|
||||
cms.contentassets.tableheader_file=Datei
|
||||
cms.contentassets.tableheader_description=Beschreibung
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ public class FileAttachmentURLFinder implements URLFinder {
|
|||
private static final AssetURLFinder s_assetFinder = new AssetURLFinder();
|
||||
|
||||
/**
|
||||
*
|
||||
* find URL for a file attachment by finding its article
|
||||
* Find URL for a file attachment by finding its article
|
||||
*
|
||||
* @param oid the OID of the file attachment
|
||||
* @param content the context of the search (ie draft/live)
|
||||
|
|
@ -74,8 +73,7 @@ public class FileAttachmentURLFinder implements URLFinder {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* find URL for the live context of a file attachment. Delegates to
|
||||
* Find URL for the live context of a file attachment. Delegates to
|
||||
* AssetURLFinder.
|
||||
*
|
||||
* @param oid the OID of the file attachment
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.arsdigita.web.URL;
|
|||
|
||||
/**
|
||||
*
|
||||
* Builds a table model of contacts
|
||||
* Builds a table model of ( copy and paste error:) contacts
|
||||
*
|
||||
* @author Richard Su (richard.su@alum.mit.edu)
|
||||
* @version $Id: FileAttachmentModelBuilder.java 1592 2007-06-21 16:48:55Z lbcfrancois $
|
||||
|
|
@ -40,6 +40,7 @@ public class FileAttachmentModelBuilder extends AbstractTableModelBuilder {
|
|||
|
||||
private Table m_table;
|
||||
private ItemSelectionModel m_model;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
|||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contentassets.FileAttachment;
|
||||
import com.arsdigita.cms.contentassets.FileAttachmentGlobalize;
|
||||
import com.arsdigita.cms.ui.FileUploadSection;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.mimetypes.ImageMimeType;
|
||||
|
|
@ -123,7 +124,8 @@ public class FileAttachmentUpload extends Form
|
|||
// Add the widgets
|
||||
public void addWidgets() {
|
||||
m_fileUploadSection =
|
||||
new FileUploadSection("File Type:", "file",
|
||||
new FileUploadSection(FileAttachmentGlobalize.FileTypeLabel(),
|
||||
"file",
|
||||
ImageMimeType.MIME_IMAGE_JPEG);
|
||||
m_fileUploadSection.getFileUploadWidget()
|
||||
.addValidationListener(new NotNullValidationListener());
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
|||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contentassets.FileAttachment;
|
||||
import com.arsdigita.cms.contentassets.FileAttachmentGlobalize;
|
||||
import com.arsdigita.cms.ui.CMSContainer;
|
||||
import com.arsdigita.cms.ui.SecurityPropertyEditor;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
|
|
@ -70,7 +71,7 @@ public class FileAttachmentsStep extends SecurityPropertyEditor {
|
|||
m_fileList = new FileAttachmentsTable(m_item, m_fileModel);
|
||||
m_display = new CMSContainer();
|
||||
//Main label
|
||||
Label mainLabel = new Label("This item does not have any associated files.");
|
||||
Label mainLabel = new Label(FileAttachmentGlobalize.NoFilesAssociatedMsg());
|
||||
mainLabel.setFontWeight(Label.ITALIC);
|
||||
mainLabel.addPrintListener( new PrintListener() {
|
||||
public void prepare(PrintEvent event) {
|
||||
|
|
@ -81,7 +82,7 @@ public class FileAttachmentsStep extends SecurityPropertyEditor {
|
|||
Label mainTarget = (Label) event.getTarget();
|
||||
if (files.isEmpty()) {
|
||||
mainTarget.setLabel(
|
||||
"This item does not have any associated files.");
|
||||
FileAttachmentGlobalize.NoFilesAssociatedMsg());
|
||||
} else {
|
||||
mainTarget.setLabel("");
|
||||
}
|
||||
|
|
@ -94,7 +95,11 @@ public class FileAttachmentsStep extends SecurityPropertyEditor {
|
|||
|
||||
// The upload form.
|
||||
m_uploadForm = new FileAttachmentUpload(m_item);
|
||||
add("upload", "Upload a new file",
|
||||
add("upload",
|
||||
// XXX todo: use of tostring() is ugly and not supported API. add method
|
||||
// has to be refactored to accept a GlobalizedMessage as Parameter instead
|
||||
// of a plain string for the Label (2. parameter) !
|
||||
FileAttachmentGlobalize.UploadNewFileLabel().toString(),
|
||||
new WorkflowLockedComponentAccess(m_uploadForm, m_item),
|
||||
m_uploadForm.getSaveCancelSection().getCancelButton());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
/*
|
||||
* Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* The contents of this file are subject to the Open Software License v2.1
|
||||
* (the "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
* http://rhea.redhat.com/licenses/osl2.1.html.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contentassets.ui;
|
||||
|
||||
import com.arsdigita.bebop.ColumnPanel;
|
||||
|
|
|
|||
Loading…
Reference in New Issue