11 Replies Latest reply: Sep 27, 2007 3:36 AM by EddieR RSS

    New Announcement in this forum

    119596
      I just saw, that Jan created a new announcement on top of this forum. Good !

      =>

      If you have java code to display on the forum, surround it with tags and the output formatter will format the code for you with syntax highlighting and with indentation intact. See thread Re: Where can I find the JAR-File of the JDAPI-demo FormDumper ? for an example.
      It works for PLSQL code as well.
        • 1. Re: New Announcement in this forum
          EddieR
          I didn't spot that, but I noticed this post. So much for announcements ;-). Anyway, the tags were translated in Jan's post into whatever output the forum now gives to those tags, so we don't know what the tags actually are.


          Here's an example of how to use them...

          [code]    /**
               * Dump a form to the output stream
               */
              public void dumpForm(String filename) throws Exception {
                  FormModule fmb = FormModule.open(filename);
                  System.out.println("Dumping module " + fmb.getName());[/code]
          gets translated to...
              /**
               * Dump a form to the output stream
               */
              public void dumpForm(String filename) throws Exception {
                  FormModule fmb = FormModule.open(filename);
                  System.out.println("Dumping module " + fmb.getName());
          • 2. Re: New Announcement in this forum
            221488
            I had the hard brackets working at one point using entities &91;code&93; but then they went away again. I have used curly ones {} now to show the concept.
            jwh
            I see how you have done with empty b tags after and before the hard brackets. How long time did it take you to figure that out?
            • 3. Re: New Announcement in this forum
              275888
              <br><br><br>
              <pre>
              [<b></b>code<b></b>]

              /**<br>
                   <br>* Get the ProgramPhases which are assigned to this ConnectorUsage.<br>
                   <br>* @param the concerned connectorUsageId int value<br>
                   <br>* @param context The current ApplicationContext.<br>
                   <br>* @return List list of ProgramPhase objects.<br>
                   <br>*/
                   <br>public List getProgramPhases(int connectorUsageId, ApplicationContext context) throws Exception
                   <br>{
                   <br>     List args = new ArrayList();
                   <br>     args.add(new Integer(connectorUsageId));
              <br>
                   <br>     return (List) SQLDataAccess.executePreparedQuery(
                   <br>          selectProgramPhasesByConnectorUsageByIdSQL,
                   <br>          args,
                   <br>          new SQLBuildPhasePersister().new ProgramPhaseListResultSetHandler(),
                   <br>          getConnection(),
                   <br>          context);
                   <br>}

              [<b></b>/code<b></b>]
              </pre>
              <br><br><br>
              • 4. Re: New Announcement in this forum
                275888
                    
                
                           /**<br>
                      <br>* Get the ProgramPhases which are assigned to this ConnectorUsage.<br>
                      <br>* @param the concerned connectorUsageId int value<br>
                      <br>* @param context The current ApplicationContext.<br>
                      <br>* @return List list of ProgramPhase objects.<br>
                      <br>*/
                     <br>public List getProgramPhases(int connectorUsageId, ApplicationContext context) throws Exception
                     <br>{
                     <br>     List args = new ArrayList();
                     <br>     args.add(new Integer(connectorUsageId));
                            <br>
                     <br>     return (List) SQLDataAccess.executePreparedQuery(
                     <br>          selectProgramPhasesByConnectorUsageByIdSQL,
                     <br>          args,
                     <br>          new SQLBuildPhasePersister().new ProgramPhaseListResultSetHandler(),
                     <br>          getConnection(),
                     <br>          context);
                     <br>}
                • 5. Re: New Announcement in this forum
                  275888
                      
                  
                             /**     
                               * Get the ProgramPhases which are assigned to this ConnectorUsage.
                               * @param the concerned connectorUsageId int value
                               * @param context The current ApplicationContext.
                               * @return List list of ProgramPhase objects.
                              */
                              public List getProgramPhases(int connectorUsageId, ApplicationContext context) throws Exception
                              {
                            List args = new ArrayList();
                            args.add(new Integer(connectorUsageId));
                              
                            return (List) SQLDataAccess.executePreparedQuery(
                                 selectProgramPhasesByConnectorUsageByIdSQL,
                                 args,
                                 new SQLBuildPhasePersister().new ProgramPhaseListResultSetHandler(),
                                 getConnection(),
                                 context);
                           }
                  • 6. Re: New Announcement in this forum
                    275888
                    Oh, it seems easier than what have beed discussed above. The last one just used
                     all the codes 
                    , it turns out nicely on the page. Hopefully it will stay as this format.

                    JFeng
                    • 7. Re: New Announcement in this forum
                      221488
                      This forum uses hard brackets instead of less than and more than signs to make it possible to use html tags. Any html tags like <pre> will be preserved rather han interpreted. The same tag "pre" within hard brackets "[]" will be interpreted as <pre> would ina normal setting.
                      • 8. Re: New Announcement in this forum
                        275888
                        Yes, I felt it after my trials. But this forum should put the sample on the right hand side to the editing Message box since there is enough space on the right hand.

                        Thanks,

                        JFeng
                        • 9. Re: New Announcement in this forum
                          EddieR
                          How long time did it take you to figure that out?
                          I've used that method a few times before. It didn't take long but I think it was actually based on something Monsieur Degrelle posted a while back (as are so many things!).
                          • 10. Re: New Announcement in this forum
                            user346369
                            Good thread! And good announcement, Jan.

                            Here are a few comments:

                            What is an "empty b tag"?

                            Here's how I do it:  When I post a message that includes ampersand characters such as the &amp91; for the [, and then go back and edit the message, the board software screws up the ampersands.   In order to preserve them, [u]every time I edit the message, I must add "amp;" after the ampersand, so it looks like this: &amp;amp;  If I don't, the [code&#93; turns into an active tag.  The best way to get it right is to copy my message into a simple editor, and make corrections there, then paste it back into this board's edit window.    …so you can see why the "empty b tag" sounds good.

                            As for history of where we learned the methods:   Francois learned of it <a href=http://forums.oracle.com/forums/message.jspa?messageID=960521#960521 target=_new>here.</a>  And I learned about it from Andrew P Clarke  (exactly 4 years ago) <a href=http://forums.oracle.com/forums/message.jspa?messageID=546435#546435 target=_new>here.</a>

                            And incidentally, that code formatting feature failed <a href=http://forums.oracle.com/forums/message.jspa?messageID=1387245#1387245 target=_new>for a time last year.</a>

                            Jan, I think you could clean up that announcement.  You show the second code as /code\.  But there should be no trailing backslash.  And now that you know how to edit and maintain those square brackets, you could show it as &#91;code&#93;...&#91;/code&#93;

                            Thanks! [nobr]
                            • 11. Re: New Announcement in this forum
                              EddieR
                              What is an "empty b tag"?
                              The code I posted to get the output above was
                              [pre][[b][[b]b]code[b][[b]b]]    /**
                                   * Dump a form to the output stream
                                   */
                                  public void dumpForm(String filename) throws Exception {
                                      FormModule fmb = FormModule.open(filename);
                                      System.out.println("Dumping module " + fmb.getName());[[b][[b]b]/code[b][[b]b]][[b]pre]
                              The b tags prevent the code tags being parsed in the normal manner.


                              As for history of where we learned the methods
                              Surely we all just read the FAQ?! The code thing isn't mentioned there (i, b, u and pre are) but it's common to many other forums so it's guessable (if you're 1337 enough ;-) ). The URL tag is also missing and is a bit harder to guess, and I believe image tags are possible but I've never needed them.

                              Could the FAQ be updated?