- Docmgr still used old content section name, changed to new name info
- Publishing did not work if an image was attached due to a bug in the ItemImageAttachment, maybe caused by the changes made in r2418 to make sorting images attachment possible. git-svn-id: https://svn.libreccm.org/ccm/trunk@2517 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
9f8705134e
commit
d7360e8ae7
|
|
@ -36,7 +36,6 @@ import java.math.BigDecimal;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* @version $Revision: #3 $ $Date: 2004/04/08 $
|
||||
* @version $Id: $
|
||||
*
|
||||
* @author unknown
|
||||
|
|
@ -61,7 +60,8 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
/**
|
||||
* Data object type for this domain object
|
||||
*/
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contentassets.ItemImageAttachment";
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.contentassets.ItemImageAttachment";
|
||||
private static final Logger s_log = Logger.getLogger(ItemImageAttachment.class);
|
||||
private static final ItemImageAttachmentConfig s_config = ItemImageAttachmentConfig.instanceOf();
|
||||
|
||||
|
|
@ -92,15 +92,16 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
/**
|
||||
* Before saving this object, make sure SORTKEY is set
|
||||
*/
|
||||
@Override
|
||||
protected void beforeSave() {
|
||||
if(isNew() || getSortKey() == null || getSortKey() == 0) {
|
||||
setSortKey(getNextSortKey(getItem()));
|
||||
}
|
||||
super.beforeSave();
|
||||
}
|
||||
@Override
|
||||
protected void beforeSave() {
|
||||
if ((isNew() || getSortKey() == null || getSortKey() == 0)
|
||||
&& (get(ITEM) != null)) {
|
||||
setSortKey(getNextSortKey(getItem()));
|
||||
}
|
||||
super.beforeSave();
|
||||
}
|
||||
|
||||
public static ItemImageAttachment retrieve(OID oid) {
|
||||
public static ItemImageAttachment retrieve(OID oid) {
|
||||
return (ItemImageAttachment) DomainObjectFactory.newInstance(oid);
|
||||
}
|
||||
|
||||
|
|
@ -204,16 +205,15 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
*/
|
||||
@Override
|
||||
public boolean copyProperty(final CustomCopy source,
|
||||
final Property property,
|
||||
final ItemCopier copier) {
|
||||
final Property property,
|
||||
final ItemCopier copier) {
|
||||
String attribute = property.getName();
|
||||
if (ItemCopier.VERSION_COPY == copier.getCopyType()
|
||||
&& IMAGE.equals(attribute)) {
|
||||
&& IMAGE.equals(attribute)) {
|
||||
ItemImageAttachment attachment = (ItemImageAttachment) source;
|
||||
ReusableImageAsset image = attachment.getImage();
|
||||
|
||||
ReusableImageAsset liveImage =
|
||||
(ReusableImageAsset) image.getLiveVersion();
|
||||
ReusableImageAsset liveImage = (ReusableImageAsset) image.getLiveVersion();
|
||||
|
||||
if (null == liveImage) {
|
||||
liveImage = (ReusableImageAsset) image.createLiveVersion();
|
||||
|
|
@ -254,13 +254,14 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the next sort key for the list of {@link ItemImageAttachment}s for an
|
||||
* item.
|
||||
* Get the next sort key for the list of {@link ItemImageAttachment}s for an item.
|
||||
*
|
||||
* @param item The {@link ContentItem} the list of images is looked up for
|
||||
*
|
||||
* @return the next sortkey, basically length of the list + 1
|
||||
*/
|
||||
public static Integer getNextSortKey(ContentItem item) {
|
||||
return new Integer((int) ItemImageAttachment.getImageAttachments(item).size() + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public final class DocMgrConfig extends AbstractConfig {
|
|||
private Parameter m_contentSection = new StringParameter
|
||||
("com.arsdigita.cms.docmgr.content_section",
|
||||
Parameter.REQUIRED,
|
||||
"main");
|
||||
"info");
|
||||
private Parameter m_legacyFolderName = new StringParameter
|
||||
("com.arsdigita.cms.docmgr.legacy_folder_name",
|
||||
Parameter.REQUIRED,
|
||||
|
|
|
|||
Loading…
Reference in New Issue