Package org.ametys.plugins.repository
Interface CopiableAmetysObject
- All Superinterfaces:
AmetysObject
- All Known Implementing Classes:
AbstractProgram
,AbstractProgramPart
,AbstractSurveyElement
,AbstractTraversableProgramPart
,Container
,Course
,CourseList
,CoursePart
,DefaultContent
,DefaultPage
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,DefaultZone
,DefaultZoneItem
,JCRResource
,JCRResourcesCollection
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,Person
,Program
,Site
,SubProgram
,Survey
,SurveyPage
,SurveyQuestion
Copiable
AmetysObject
.-
Method Summary
Modifier and TypeMethodDescriptioncopyTo
(ModifiableTraversableAmetysObject parent, String name) Copy the currentAmetysObject
to the given object.copyTo
(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) Copy the currentAmetysObject
to the given object if it is not in the restriction list.Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Method Details
-
copyTo
AmetysObject copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException Copy the currentAmetysObject
to the given object. Be careful, this method save changes.- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied object- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
AmetysObject copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException Copy the currentAmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied objectrestrictTo
- A restrict list ofCopiableAmetysObject
authorized to be copied- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-