Package org.ametys.cms.content
Class CopyReport
- java.lang.Object
-
- org.ametys.cms.content.CopyReport
-
public final class CopyReport extends Object
The report object, used internally to provide useful informations once the whole duplication process has ended.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CopyReport.CopyMode
Available copy modestatic class
CopyReport.CopyState
The possible state of the copy
-
Field Summary
Fields Modifier and Type Field Description private String
_baseContentId
private Boolean
_baseContentIsReferenceTable
private String
_baseContentTitle
private List<String>
_copiedAttachments
private String
_fallbackViewName
private List<CopyReport>
_innerReports
private CopyReport.CopyMode
_mode
private CopyReport.CopyState
_state
private String
_targetContentId
private boolean
_targetContentIsReferenceTable
private String
_targetContentTitle
private String
_viewName
-
Constructor Summary
Constructors Constructor Description CopyReport(String baseContentId, Boolean baseContentIsRefTable, String viewName, String fallbackViewName, CopyReport.CopyMode copyMode)
Constructor.CopyReport(String baseContentId, String baseContentTitle, Boolean baseContentIsRefTable, String viewName, String fallbackViewName, CopyReport.CopyMode copyMode)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttachment(String relPath)
Add an attachments to the copied attachments report listvoid
addReport(CopyReport report)
Add a child report to the report.String
getBaseContentId()
/** Get the base content identifierBoolean
getBaseContentIsReferenceTable()
Is the base content a reference table entry ?String
getBaseContentTitle()
Get the base content title.List<CopyReport>
getChildReports()
Get the list of child copy reports.List<String>
getCopiedAttachments()
Get the list of the copied attachments.String
getFallbackViewName()
Get the name of the fallback view used for the copy.CopyReport.CopyMode
getMode()
Get the mode of the copyCopyReport.CopyState
getStatus()
Get the status of the copyString
getTargetContentId()
Get the target content identifierboolean
getTargetContentIsReferenceTable()
Is the target content a reference table entry?String
getTargetContentTitle()
Get the target content titleString
getViewName()
Get the name of the view used for the copy.void
notifyContentCopyError()
Notify that the copy ended with an errorvoid
notifyContentCopySuccess()
Notify a copy successvoid
notifyContentCreation(String id, String title, boolean isRefTable)
Notify information about the target content to the report.void
setReferenceTable(boolean isRefTable)
Set whether the base content is a reference table's entry.void
setTargetContentTitle(String title)
Set the target content title.
-
-
-
Field Detail
-
_fallbackViewName
private String _fallbackViewName
-
_baseContentId
private String _baseContentId
-
_baseContentTitle
private String _baseContentTitle
-
_baseContentIsReferenceTable
private Boolean _baseContentIsReferenceTable
-
_mode
private CopyReport.CopyMode _mode
-
_targetContentId
private String _targetContentId
-
_targetContentTitle
private String _targetContentTitle
-
_targetContentIsReferenceTable
private boolean _targetContentIsReferenceTable
-
_innerReports
private List<CopyReport> _innerReports
-
_copiedAttachments
private List<String> _copiedAttachments
-
_state
private CopyReport.CopyState _state
-
-
Constructor Detail
-
CopyReport
public CopyReport(String baseContentId, Boolean baseContentIsRefTable, String viewName, String fallbackViewName, CopyReport.CopyMode copyMode)
Constructor. If the title of the base content if available, should be used.- Parameters:
baseContentId
- The content id of the base contentbaseContentIsRefTable
- Indicates if the base content is a reference table's entry (can be null if unavailable)viewName
- The view namefallbackViewName
- The fallback view name. Use for legacy purpose.copyMode
- The mode of copy
-
CopyReport
public CopyReport(String baseContentId, String baseContentTitle, Boolean baseContentIsRefTable, String viewName, String fallbackViewName, CopyReport.CopyMode copyMode)
Constructor.- Parameters:
baseContentId
- The content id of the base contentbaseContentTitle
- The title of the base contentbaseContentIsRefTable
- Indicates if the base content is a reference table's entryviewName
- The view namefallbackViewName
- The fallback view name. Use for legacy purpose.copyMode
- The mode of copy
-
-
Method Detail
-
setReferenceTable
public void setReferenceTable(boolean isRefTable)
Set whether the base content is a reference table's entry.- Parameters:
isRefTable
- true for reference table's entry.
-
setTargetContentTitle
public void setTargetContentTitle(String title)
Set the target content title.- Parameters:
title
- The target content title.
-
notifyContentCreation
public void notifyContentCreation(String id, String title, boolean isRefTable)
Notify information about the target content to the report.- Parameters:
id
- The content idtitle
- The content titleisRefTable
- Indicates if the target content is a reference table's entry.
-
notifyContentCopySuccess
public void notifyContentCopySuccess()
Notify a copy success
-
notifyContentCopyError
public void notifyContentCopyError()
Notify that the copy ended with an error
-
addAttachment
public void addAttachment(String relPath)
Add an attachments to the copied attachments report list- Parameters:
relPath
- The relative path where to copy
-
getStatus
public CopyReport.CopyState getStatus()
Get the status of the copy- Returns:
- A copy state enum value
-
getMode
public CopyReport.CopyMode getMode()
Get the mode of the copy- Returns:
- A cope mode enum value
-
getViewName
public String getViewName()
Get the name of the view used for the copy.- Returns:
- the view name
-
getFallbackViewName
public String getFallbackViewName()
Get the name of the fallback view used for the copy.- Returns:
- the fallback view name
-
getBaseContentId
public String getBaseContentId()
/** Get the base content identifier- Returns:
- The identifier
-
getBaseContentTitle
public String getBaseContentTitle()
Get the base content title.- Returns:
- The title or null (if unavailable)
-
getBaseContentIsReferenceTable
public Boolean getBaseContentIsReferenceTable()
Is the base content a reference table entry ?- Returns:
- true if it is, null if unknown.
-
getTargetContentId
public String getTargetContentId()
Get the target content identifier- Returns:
- The identifier
-
getTargetContentTitle
public String getTargetContentTitle()
Get the target content title- Returns:
- The title
-
getTargetContentIsReferenceTable
public boolean getTargetContentIsReferenceTable()
Is the target content a reference table entry?- Returns:
- true if it is.
-
getChildReports
public List<CopyReport> getChildReports()
Get the list of child copy reports. Each child report denotes an inner copy- Returns:
- The list of copy reports.
-
getCopiedAttachments
public List<String> getCopiedAttachments()
Get the list of the copied attachments.- Returns:
- List of paths (relative to the root attachment node of the target content)
-
addReport
public void addReport(CopyReport report)
Add a child report to the report. This must be done when an copy is requested- Parameters:
report
- The report of the copy to add
-
-