Package org.ametys.cms.content
Class CopyReport
java.lang.Object
org.ametys.cms.content.CopyReport
The report object, used internally to provide useful informations once
the whole duplication process has ended.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAvailable copy modestatic enumThe possible state of the copy -
Constructor Summary
ConstructorsConstructorDescriptionCopyReport(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
Modifier and TypeMethodDescriptionvoidaddAttachment(String relPath) Add an attachments to the copied attachments report listvoidaddReport(CopyReport report) Add a child report to the report./** Get the base content identifierIs the base content a reference table entry ?Get the base content title.Get the list of child copy reports.Get the list of the copied attachments.Get the error messageGet the name of the fallback view used for the copy.getMode()Get the mode of the copyGet the status of the copyGet the target content identifierbooleanIs the target content a reference table entry?Get the target content titleGet the name of the view used for the copy.voidNotify that the copy ended with an errorvoidNotify a copy successvoidnotifyContentCreation(String id, String title, boolean isRefTable) Notify information about the target content to the report.voidsetErrorMessage(I18nizableText errorMsg) Set the error messagevoidsetReferenceTable(boolean isRefTable) Set whether the base content is a reference table's entry.voidsetTargetContentTitle(String title) Set the target content title.
-
Constructor Details
-
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 Details
-
setReferenceTable
Set whether the base content is a reference table's entry.- Parameters:
isRefTable- true for reference table's entry.
-
setTargetContentTitle
Set the target content title.- Parameters:
title- The target content title.
-
notifyContentCreation
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
Notify a copy success -
notifyContentCopyError
Notify that the copy ended with an error -
setErrorMessage
Set the error message- Parameters:
errorMsg- the error message
-
getErrorMessage
Get the error message- Returns:
- the error message. Can be null.
-
addAttachment
Add an attachments to the copied attachments report list- Parameters:
relPath- The relative path where to copy
-
getStatus
Get the status of the copy- Returns:
- A copy state enum value
-
getMode
Get the mode of the copy- Returns:
- A cope mode enum value
-
getViewName
Get the name of the view used for the copy.- Returns:
- the view name
-
getFallbackViewName
Get the name of the fallback view used for the copy.- Returns:
- the fallback view name
-
getBaseContentId
/** Get the base content identifier- Returns:
- The identifier
-
getBaseContentTitle
Get the base content title.- Returns:
- The title or null (if unavailable)
-
getBaseContentIsReferenceTable
Is the base content a reference table entry ?- Returns:
- true if it is, null if unknown.
-
getTargetContentId
Get the target content identifier- Returns:
- The identifier
-
getTargetContentTitle
Get the target content title- Returns:
- The title
-
getTargetContentIsReferenceTable
Is the target content a reference table entry?- Returns:
- true if it is.
-
getChildReports
Get the list of child copy reports. Each child report denotes an inner copy- Returns:
- The list of copy reports.
-
getCopiedAttachments
Get the list of the copied attachments.- Returns:
- List of paths (relative to the root attachment node of the target content)
-
addReport
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
-