core icon indicating copy to clipboard operation
core copied to clipboard

Copied FileAssets not indexed..

Open rosselet opened this issue 14 years ago • 3 comments

To reproduce using demo site: 1.create copy directory /images/templates into /images/icons

  1. create template "asset copy test" with

set($showSubgalleryTitle=false)

set($showPhotoTitle = false)

set ($thumbnailWidth = "150")

set ($thumbnailHeight = "150")

< h1> EXISTING assets </h1>

photoGallery("/images/template")

</hr> < h1> COPIED assets </h1>

photoGallery("/images/icons/template")

  1. create html page "asset_test.html" with this template

  2. view page - shows all from existing, NONE from COPIED. (view as admin, otherwise broken links shown for images)

  3. rebuild fileAsset index and view page again.

    COPIED assets are now visible.

rosselet avatar Nov 26 '12 22:11 rosselet

Great - that was fast :) Does this fix indexing when copying just a fileAsset or just when copying an entire folder ? I've experienced the same problem when just copying a single image from one folder to another... would that perhaps involve FileAssetAPIImpl.java.. or FileAPIImpl.java-s "copy" functions? (still working my way through the codebase... )

rosselet avatar Nov 27 '12 21:11 rosselet

would it not be more efficient to reindex only the target folder after copying.. ie (for FolderFactoryImpl.java)

APILocator.getContentletAPI().refreshContentUnderFolder(newFolder);

I've tested locally and this seems to work fine, also similar logic for BrowserAjax.java: using:

APILocator.getContentletAPI().refreshContentUnderFolder(parent);

instead of the reindex(structure) call in both places to reindex all fileAssets..

rosselet avatar Nov 29 '12 00:11 rosselet

I do not see this working on master. I even started clean starter, did complete re-index and did whole process again and could not get it to work. I got same results as original bug report... only saw copied assets after re-index. Reporting new issue: https://github.com/dotCMS/dotCMS/issues/1685

DeanGonzalez avatar Dec 07 '12 15:12 DeanGonzalez