acs-aem-tools icon indicating copy to clipboard operation
acs-aem-tools copied to clipboard

content find & replace global

Open Schikkeg opened this issue 11 years ago • 11 comments

A tool to Globally search & replace contents to helps during situation incorrect migration, Batch modification of content, clean up junk data injected from various Adblock browser plugins. Idea is same as [1] & incorporating any feedback recieved from acs.

[1] http://aemfaq.blogspot.com/2013/06/content-find-and-replace-globally.html

P.S:- This is my first effort to open community in hithub. Excuse & feel free to correct for any mistakes. As per guidelines creating the discussion issue with the community before checking in the code and development.

Schikkeg avatar Feb 06 '14 19:02 Schikkeg

Is this already part of acs-aem-tools? I wanted to build a similar tool :

  1. which is easy for authors/admins to find and replace some text on a content path.
  2. it will avoid these kind of requests coming back to developers.

Please let me know if you want any contribution on this. :100:

rajeshp avatar May 12 '14 13:05 rajeshp

Hi @rajeshp. It has not been contributed. I think it is a great idea and would be much welcome.

justinedelson avatar May 12 '14 13:05 justinedelson

Thanks @justinedelson. I will start working on it.

rajeshp avatar May 12 '14 13:05 rajeshp

It might be nice to have an option to create a package of all affected nodes prior to the replace. (version 2?)

While this is a great tool, one miscalculated find/replace could be devastating.

ACS AEM Commons has a PackageHelper service that makes creating packages from a list of paths quite easy.

davidjgonzalez avatar May 12 '14 13:05 davidjgonzalez

Sorry guys. I was ooo mar10 till may 4th, was busy so far with enablement & catching up. If rajeshhp already commited & initated implementation. I will trash mine & please ignore rest of comments.

  • Source code is ready to checkin including david suggestion of version2.
  • Attaching below screen mock for reference & any feedback let me know before commit the changes.

Before checkin there are few Queries namely

  • PackageHelper method builds package & never assemble. Should i assemble triggering jcrpackage method OR notify user they need to build a package (with link to package manager)?
  • For ui followed the standards done in jsp code display. Is there a commons project with ui Validation I shoud utilize.
  • How to run test cases?
  • How to write & run test cases for ui?
  • Any code style formatter recommended before commit?
  • Any acs standard protocol to create gh pages
  • Any acs standard protocol sandbox to validate

backup failure replace dry run

Schikkeg avatar May 26 '14 12:05 Schikkeg

@Schikkeg

PackageHelper method builds package & never assemble. Should i assemble triggering jcrpackage method OR notify user they need to build a package (with link to package manager)?

I vote for building the package (since it needs to happen before the replacement happens) .. the caveat is if its touching too much content, the cost to build the package could be good.

For ui followed the standards done in jsp code display. Is there a commons project with ui Validation I should utilize.

For UI we mainly just use CoralUI

How to run test cases?

What test cases do you mean? We usually use junit tests with Mockito as the mocking library.

How to write & run test cases for ui?

We dont have any UI integration tests.

Any code style formatter recommended before commit?

Yup - https://github.com/Adobe-Consulting-Services/coding-standards

Any acs standard protocol to create gh pages

Check the README: https://github.com/Adobe-Consulting-Services/adobe-consulting-services.github.io

Any acs standard protocol sandbox to validate

Not yet!

davidjgonzalez avatar May 27 '14 01:05 davidjgonzalez

I am not able to commit & giving 403 details below [1]. What are the steps to push my changes

[1] Administrator@WIN2K3-X64 ~/acs-aem-tools (master) $ git remote add original https://github.com/Adobe-Consulting-Services/acs-aem- tools.git

Administrator@WIN2K3-X64 ~/acs-aem-tools (master) $ git push original master Username for 'https://github.com': [email protected] Password for 'https://[email protected]@github.com': remote: Permission to Adobe-Consulting-Services/acs-aem-tools.git denied to schi [email protected]. fatal: unable to access 'https://github.com/Adobe-Consulting-Services/acs-aem-to ols.git/': The requested URL returned error: 403

Schikkeg avatar May 29 '14 03:05 Schikkeg

@Schikkeg You need to create a pull request from your fork/branch to this projects master branch. This lets everyone take a look, catch bugs, suggest improvements, etc. before the code is merged into master.

Checkout the contributing doc for more info: https://github.com/Adobe-Consulting-Services/acs-aem-tools/blob/master/CONTRIBUTING.md

davidjgonzalez avatar May 29 '14 03:05 davidjgonzalez

Did this work get anywhere???

Just in regard to the Parameters, I'm not sure if authors (users) are going to know the Search Component or Search Element.

I found the original script written a while back that had a query option so simply search for a String value in a given path (only 2 options required) by running the Xpath query using jcr:contains.

What do we think about this?

alisneaky avatar Mar 23 '15 06:03 alisneaky

@Schikkeg this is a very useful tool. If you get a chance please do send the pull request. I would really like to start using this utility.

andrewmkhoury avatar Jan 12 '17 17:01 andrewmkhoury