public void copyCategories ( CmsObject cms , CmsResource fromResource , String toResourceSitePath ) throws CmsException { List < CmsCategory > categories = readResourceCategories ( cms , fromResource ) ; for ( CmsCategory category : categories ) { addResourceToCategory ( cms , toResourceSitePath , category ) ; } }
Adds all categories from one resource to another skipping categories that are not available for the resource copied to .