- 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-94f89814c4df
master
jensp 2014-02-11 14:03:55 +00:00
parent 9f8705134e
commit d7360e8ae7
2 changed files with 19 additions and 18 deletions

View File

@ -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();
@ -94,7 +94,8 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
*/
@Override
protected void beforeSave() {
if(isNew() || getSortKey() == null || getSortKey() == 0) {
if ((isNew() || getSortKey() == null || getSortKey() == 0)
&& (get(ITEM) != null)) {
setSortKey(getNextSortKey(getItem()));
}
super.beforeSave();
@ -212,8 +213,7 @@ public class ItemImageAttachment extends ACSObject implements CustomCopy {
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);
}
}

View File

@ -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,