Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • Sling Eclipse IDE 1.0.0
    • IDE
    • None

    Description

      I think that it's important for the user to know what Slingclipse is doing, especially since it uses some heuristics to detect Sling-based projects.

      My first thoughts would be:

      • from a UI point of view start with something simple like a text-only console . The subclipse console is a good starting point, we can simply log things like

      ADD $SLING_URL $PROJECT/$RESOURCE 200 OK
      REMOVE $SLING_URL $PROJECT/$RESOURCE 500 Internal Server Error

      • from an implementation point of view we could use something like a command pattern ( SaveResource command, DeleteResourceCommand ) . This would have the benefit of allowing this logging easily + encapsulating the operations for batching, handling of offline operations, redo etc.

      Thoughts? I'm willing to look into this, at least for a first iteration.

      Attachments

        1. SLING-2634-1.diff
          33 kB
          rmuntean
        2. SLING-2634-2.diff
          4 kB
          rmuntean
        3. SLING-2634-proof-of-design.diff
          16 kB
          rmuntean

        Activity

          rmuntean rmuntean created issue -
          asanso Antonio Sanso added a comment -

          rmuntean I am not sure I really caught your subclipse example.

          For the Command pattern idea it was actually my first implementation but it did not really combined well with the declarative services (or at least my command pattern implementation )

          asanso Antonio Sanso added a comment - rmuntean I am not sure I really caught your subclipse example. For the Command pattern idea it was actually my first implementation but it did not really combined well with the declarative services (or at least my command pattern implementation )
          rmuntean rmuntean added a comment -

          In reply to comment #1:
          > rmuntean I am not sure I really caught your subclipse example.

          There's a screenshot of the SVN console view at http://fossies.org/unix/privat/subclipse-1.6.18.tar.gz:a/subclipse-1.6.18/org.tigris.subversion.subclipse.doc/html/reference/svn-console.html . It logs all operations and their results.
          >
          > For the Command pattern idea it was actually my first implementation but it did
          > not really combined well with the declarative services (or at least my command
          > pattern implementation )

          Right, I need to see how/if this would work ...

          Anyway, if you have other ideas on how to show the operations which we perform to the user I'm open to them. I simply want to know what slingclipse does without using a http proxy

          rmuntean rmuntean added a comment - In reply to comment #1: > rmuntean I am not sure I really caught your subclipse example. There's a screenshot of the SVN console view at http://fossies.org/unix/privat/subclipse-1.6.18.tar.gz:a/subclipse-1.6.18/org.tigris.subversion.subclipse.doc/html/reference/svn-console.html . It logs all operations and their results. > > For the Command pattern idea it was actually my first implementation but it did > not really combined well with the declarative services (or at least my command > pattern implementation ) Right, I need to see how/if this would work ... Anyway, if you have other ideas on how to show the operations which we perform to the user I'm open to them. I simply want to know what slingclipse does without using a http proxy
          asanso Antonio Sanso added a comment -

          >There's a screenshot of the SVN console view at http://fossies.org/unix/privat/subclipse-1.6.18.tar.gz:a/subclipse-1.6.18/org.tigris.subversion.subclipse.doc/html/reference/svn-console.html .

          Cool, I like it and think it would fit great..... Thanks...

          asanso Antonio Sanso added a comment - >There's a screenshot of the SVN console view at http://fossies.org/unix/privat/subclipse-1.6.18.tar.gz:a/subclipse-1.6.18/org.tigris.subversion.subclipse.doc/html/reference/svn-console.html . Cool, I like it and think it would fit great..... Thanks...
          klcodanr Dan Klco added a comment -

          An interesting way to do that might be to create a SLF4J logger which logs to the console on INFO and logs to the console + Eclipse event log in errors and warnings.

          klcodanr Dan Klco added a comment - An interesting way to do that might be to create a SLF4J logger which logs to the console on INFO and logs to the console + Eclipse event log in errors and warnings.
          rmuntean rmuntean made changes -
          Field Original Value New Value
          Attachment SLING-2634-proof-of-design.diff [ 12552130 ]
          rmuntean rmuntean added a comment -

          I've worked a little on exposing the internals of the operations and their result for logging.

          I have the following high-level approach:

          • no logging dependency added to the http bundle as this is expected to be embeddable and used outside Eclipse
          • added a tracer class using the platform debug API supplied by Eclipse to the base bundle, which is an Eclipse plugin anyway
          • as a proof-of-design ( not even tested properly ) I made the Repository return Command objects to be executed which expose the Result after the execution ; this was done only for the addFileInfo command

          I've made only minimal changes ( and still have some whitespace diffs in , sorry ) since I want to validate the high-level approach with you and only then complete the implementation.

          rmuntean rmuntean added a comment - I've worked a little on exposing the internals of the operations and their result for logging. I have the following high-level approach: no logging dependency added to the http bundle as this is expected to be embeddable and used outside Eclipse added a tracer class using the platform debug API supplied by Eclipse to the base bundle, which is an Eclipse plugin anyway as a proof-of-design ( not even tested properly ) I made the Repository return Command objects to be executed which expose the Result after the execution ; this was done only for the addFileInfo command I've made only minimal changes ( and still have some whitespace diffs in , sorry ) since I want to validate the high-level approach with you and only then complete the implementation.
          asanso Antonio Sanso made changes -
          Assignee Antonio Sanso [ asanso ]
          asanso Antonio Sanso added a comment -

          rmuntean I definitely like the approach! So +1 on complete it.
          I wonder how you would like to shape as well for not void methods... e.g.

          public String listChildrenNode(String path,ResponseType responseType) {

          asanso Antonio Sanso added a comment - rmuntean I definitely like the approach! So +1 on complete it. I wonder how you would like to shape as well for not void methods... e.g. public String listChildrenNode(String path,ResponseType responseType) {
          rmuntean rmuntean added a comment -

          Perhaps we could model a bit after the j.u.c.Future

          interface Result<T> {
          	T get() throws RepositoryException;
          	boolean isSuccess();
          }
          

          the get() method would return the result or , in case of failure, throw the underlying exception . That means that we expect the repositories to not throw any exceptions themselves.

          rmuntean rmuntean added a comment - Perhaps we could model a bit after the j.u.c.Future interface Result<T> { T get() throws RepositoryException; boolean isSuccess(); } the get() method would return the result or , in case of failure, throw the underlying exception . That means that we expect the repositories to not throw any exceptions themselves.
          rmuntean rmuntean made changes -
          Attachment SLING-2634-1.diff [ 12552309 ]
          rmuntean rmuntean added a comment -

          Initial patch which moves to a Command/Result execution model. The changes performed by the SlingclipseListener are traced . Feel free to use the information below for tracing and/or to add it to the wiki

          Tracing

          The operations of the slingclipse plugin are instrumented using the Eclipse Platform Debug apis. To enable debugging add create a .options file with the following content

          org.apache.sling.slingclipse/debug=true{code]
          
          and then update your eclipse.ini file to contain the following string
          
          

          -debug
          /path/to/.options

          
          

          The tracing logs will be located in your workspace location at .metadata/trace.log .

          rmuntean rmuntean added a comment - Initial patch which moves to a Command/Result execution model. The changes performed by the SlingclipseListener are traced . Feel free to use the information below for tracing and/or to add it to the wiki Tracing The operations of the slingclipse plugin are instrumented using the Eclipse Platform Debug apis. To enable debugging add create a .options file with the following content org.apache.sling.slingclipse/debug= true {code] and then update your eclipse.ini file to contain the following string -debug /path/to/.options The tracing logs will be located in your workspace location at .metadata/trace.log .
          asanso Antonio Sanso added a comment -

          Thanks for your patch Robert!!
          I have applied it in revision #1406638
          I have also modified the wiki accordingly. I think we can track the possible console feature as another JIRA as a nice to have.

          asanso Antonio Sanso added a comment - Thanks for your patch Robert!! I have applied it in revision #1406638 I have also modified the wiki accordingly. I think we can track the possible console feature as another JIRA as a nice to have.
          asanso Antonio Sanso made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rmuntean rmuntean made changes -
          Attachment SLING-2634-2.diff [ 12552629 ]
          rmuntean rmuntean added a comment -

          Thanks for applying the patch, Antonio. Here's a another small patch which adds tracing to the import wizard as well. I'll submit other patches on separate sub-tasks.

          rmuntean rmuntean added a comment - Thanks for applying the patch, Antonio. Here's a another small patch which adds tracing to the import wizard as well. I'll submit other patches on separate sub-tasks.
          asanso Antonio Sanso added a comment -

          Thanks for your patch Robert!!
          I have applied it in revision #1406949

          asanso Antonio Sanso added a comment - Thanks for your patch Robert!! I have applied it in revision #1406949
          gmcdonald Gavin McDonald made changes -
          Workflow no-reopen-closed,doc-test-required [ 12731548 ] Copy of no-reopen-closed,doc-test-required [ 12765180 ]
          gmcdonald Gavin McDonald made changes -
          Workflow Copy of no-reopen-closed,doc-test-required [ 12765180 ] no-reopen-closed,doc-test-required [ 12767927 ]
          gmcdonald Gavin McDonald made changes -
          Reporter Robert Munteanu [ rmuntean ] Robert Munteanu [ rombert ]
          gmcdonald Gavin McDonald made changes -
          Workflow no-reopen-closed,doc-test-required [ 12767927 ] re-open possible,doc-test-required [ 12790236 ]
          gmcdonald Gavin McDonald made changes -
          Workflow re-open possible,doc-test-required [ 12790236 ] no-reopen-closed,doc-test-required [ 12792825 ]
          rombert Robert Munteanu made changes -
          Component/s IDE [ 12320908 ]
          Component/s Extensions [ 12312240 ]
          Fix Version/s Sling Eclipse IDE 1.0.0 [ 12324873 ]
          stefanegli Stefan Egli made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

          People

            asanso Antonio Sanso
            rombert Robert Munteanu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: