Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-8686

Example code variable name wrong in Sling API CRUD, updating a property

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • None
    • Documentation
    • None

    Description

      On the page: https://sling.apache.org/documentation/the-sling-engine/sling-api-crud-support.html#updating-a-property

       

      Paragraph: 

      Sling API CRUD

       

      The variable name myNode in the code example should probably be "myResource", if I understand the intention of the code correctly.

       

      Resource myResource = resourceResolver.getResource("/myresource"); ModifiableValueMap properties = *myNode*.adaptTo(ModifiableValueMap.class);

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            thomasmorf Thomas Morf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h

                Slack

                  Issue deployment