Any ideas on a nice BSP view pretty printer?

Hi there,
I am wondering whether somebody already tried to extend the SAP standard pretty printer by an own functionality which fits better for pages with mixed content, containing not only BSP-elements but also HTML-tags.
The standard pretty printer considers everything as plain text which is not a BSP-element and leaves it unaltered. Only BSP-elements are arranged according to their tree structure.
This produces ugly results for pages with mixed content.
1.) Requirement
A Pretty Printer for HTML-based BSP views should cover the following:
(a) HTML-Tags and BSP-elements together form the chain. As in following example:
<z:table table_id="testTab" binding="//test/gt_test" rows="5">
  <z:tableBody position="top">
    <colgroup>
      <col width="4%">
      <col width="96%">
    </colgroup>
  </z:tableBody>
  <z:column name="type" header="<%=zcl_bsp_util=>dtel_text_s('EDI_TTYP')%>"
            listPos="10"/>
  <z:column name="text" listPos="20"></z:column>
</z:table>
(b) Certain HTML formatting tags like I, B, etc. should not be added to the stack but be treated inline.
(c) HTML-attribute names should be converted to lower case, the attribute values should be quoted.
(d) Like for BSP-elements, there should be a threshold after which the attributes should appear in separate lines. Instead of a certain maximum "number of attributes", this could also be a maximum number of characters per line.
(e) Scripting Tags (<% ... %>) should start at a new line, if the content contains new-lines.
(f) Evaluation Scripting (<%= ... %>) should be inline, if they are contained within text nodes (and not within HTML oder BSP element nodes).
(g) The Pretty Printer should be parametrizable (with parameters like indent-depth,... ).
2.) Exits?
Of course, one could always use an external HTML editor and write an add-on for that editor which produces the desired result. Or one could take the view content into the clipboard, paste it into a plain text editor like UltraEdit or TextPad which allows external commands, apply an external, self-written pretty printer to it and then paste the result back into the View. But it would be easier to use the "Pretty Printer" button directly to get the result. Therefore the question arises at which point the standard Pretty Printer Functionality could be modified or extended.
I didn't find an exit. But the pretty-print itself is doubly-decoupled in the standard which minimizes the number of points where an extension has to be made:
2.a) First decoupling point: The Fcode handler method pretty_printer_ext( ) in cl_o2_page is calling
dynamically a method in cl_o2_co2_processor:
* call pretty printer
  create object pp type ('CL_O2_CO2_PROCESSOR').
  appl_str = me->pagekey-applname.
  page_str = me->pagekey-pagekey.
  try.
      CALL METHOD pp->('PRETTY_PRINT')
        EXPORTING
          indent              = 2
          ATTRIBUTE_NORMALIZE = 'X'
          ATTRIBUTE_THRESHOLD = 2
          BSP_UNFORMATTED     = source
          appl                = appl_str
          page                = page_str
        IMPORTING
          test_ok             = test_ok
          BSP_FORMATTED       = pp_source.
    catch cx_o2_co2_exception into o2ex.
2.b) Second decoupling point:
The method pretty_print() of class cl_o2_co2_processor (fancy names, by the way. It seems that many former chemistry students had joined the BSP team ),
there is a second delegation, to a local class, as follows:
  data pretty type ref to LCL_BSP_PRETTY_PRINT.
  pretty = LCL_BSP_PRETTY_PRINT=>getInstance( processor = me ).
The real logic for doing the Pretty Print, finally, is performed in this local class.
3.) Implementation.
Since, up to my knowledge, there is no HTML parser in the ABAP world,
the implementation could be based on existing HTML Parsers, like the Perl module Parser::HTML, or the Java package http://htmlparser.sourceforge.net/ . The pretty printer could then be called as external OS command.
Are there any ideas out there? Or is there somebody who already worked in this direction?
Regards,
Rüdiger

For those who are interested. I found out that the Dave Ragget's classic "HTML Tidy" (see <a href="http://tidy.sourceforge.net/">http://tidy.sourceforge.net/</a> )  is available in ABAP! There is a class CL_HTMLTIDY (at least here in my SAP_BASIS 700 system) which wraps calls of HTML Tidy by kernel modules.
The class is undocumented, but there are 2 OSS notes of this year for it, so it might well be that it is alive.
HTML Tidy can surely not directly be used for Pretty Printing BSP views, but for designing test cases or for doing things like HTML parsing, it might be a helpful tool.

Similar Messages

  • I have a MacBook Air (10.8.2) connected to Canon MP530 printer.  I'm unable to scan documents as MP Navigator is not supported.   Any ideas on how to scan using this printer.

    I have a MacBook Air (10.8.2) connected to a Canon MP530 printer.    I am unable to scan documents as it appears my Mac does not support MP Navigator.   Any ideas?     I have made an inquiry to Canon but have not received any answers yet.

    Why do you say your MBA won't support it? MP Navigator for OS X 8 and the MP530 is available here. 

  • For some reason all of my forwards, and my printing come out significantly smaller than the original. Any idea how to get this back to printing the size of my screen and forwarding the size of the original mail I've received? Thanks.

    Hi. I am not technically proficient. I have somehow hit something that is making my email forwards and text to the printer way smaller than what is appearing on my screen. I have looked into everything I can think of in settings and outlook express. If you have any ideas, I would greatly appreciate them. I assume that one click and I'll be back to "normal", but can't figure out which darned click that would be.  Thanks.

    Have you checked Outlook's font preferences?  You can change to size under General Preferences>Fonts.  You can also change font sizes by using ⌘shift+

  • When i upgraded my ipad and reinstalled ibooks, the print on my books is so tiny  i can barely read the books.  Any idea how to get back my larger print?

    When i upgraded my ipad and reinstalled Ibooks, the print on my books is now so tiny i can barely read them.   Any idea how to get my larger print back?

    Media is not included in a backup. You should be able to resync them your copy of them on your computer's iTunes. If you haven't got your a copy of them then if they are still in the store, then you can re-download apps via the Purchased tab in the App Store, ibooks via the Purchased tab in the ibookstore in the iBooks app, and (depending upon what country that you are in) potentially music, films and tv shows via the Purchased tab in the iTunes store app.
    For podcasts you can download the Podcasts app

  • New 17" MBP, any ideas on a nice easy-to-use bag that will protect the MPB

    Does anybody know if the new magic mouse and the wireless keyboard work and work well with the latest editions of MBPs?
    I guess I will ask while I am here. I need a nice bag to protect the MBP since there will e days I can use the 13' and days I will have to haul the 17" MPB for architecture/city planning grad school.
    I would like to get a sweet sounding mini speaker system for the MBP, anybody have some top-of-the line speakers that are easy to put away and take out that give a superb sound on the latest MP 17".
    What is the official term I should use for the latest edition of the MPB 17" SL, separate dedicated graphics card? I think I need this for the Program I am in, but I am not sure if I need them to be dedicated.
    thank you tons.

    I did not have any luck with the Mighty Mouse. It was a pain to me and I was hoping the new one worked better. I did think of your question about the magic mouse but why a wireless keyboard? They have 2, one I would not gt and one I dream of being able to it back and just do some work in a comfortable position on the couch with my gf rubbing my feet. I think having a wireless keyboard would b ideal with a 17" MBP. the touch pad would be ideal at times too. I am not saying "always" just like last night I was sitting forward in this chair and my back hurt so bad. I thought; "if I had that one wireless keyboard, I could sit back, look at the big 17" display." But if I am sitting back I would need the mouse. that mouse seems like it rocks. You control it by your hand gestures and fingers, what more could you want?
    what did you like abut the Mighty Mouse? Did your even work, right? What notebook do you have? Now if I had that I would not be able to have the wireless keyboard, you are right there. You need a surface for that dinky thing. I gave it to my nephew and he uses it as a car and he has so much fun with it.
    I do hope they come out with a wireless keyboard with the glass touch pad. Yes you are right, I do look forward to using that since I am still using Tiger.
    do you have the bag you suggested? Did you look at the ones Rod suggested? Two complete opposite ens of the spectrum.

  • Any ideas for making work an 2004 photo printer in Mavericks.

    The generic postscript driver does not have the 4x6'' paper the printer support. (It is a Sony DPP-FP30... and Sony does not have Mac drivers)

    Per the specs, that printer never supported OS X.  You'll want to either run Windows XP to access it — as a guest in a virtual machine or via Boot Camp, or via some other Windows XP system — or using a hack-around via a camera, or you'll end up replacing the printer.
    You'll spend more than US$200 to US$400 to get that printer to work; that's the price of an entry-level replacement dye sublimation printer on Amazon.    Assuming the printer supports some sort of protocol and has some mildly capable on-board rendering — it supposedly prints from cameras, which don't include rendering — then you'd need to find or write the CUPS driver support for the printer.   You'll need to find the specs for the interface, which may not be easy.  That's a somewhat manageable project, but you'll still almost certainly blow through more time and effort and cash than that printer is worth.  If you can't find the specs for the printer interface — a situation which is unfortunately common — reverse-engineering the interface and writing the software will definitely cost more than a replacement printer.
    Based on this and this — the latter page has one potential work-around to continue usage, using a camera as a file transfer device, though with the migration of OS X to Intel, the binary formats might now be little-endian again — this support didn't exist when the printer was new, and I seriously doubt it's been added.

  • Pretty-print xml

    Anybody has any idea how can I do a pretty-print of an xml which is stored in the oracle database as CLOB.
    I tried LSSerializer, but could not get it work. I am using jdeveloper10.1.2
    Thanks
    MM

    Have you tried this:
    StringWriter sw = new StringWriter();
    org.apache.xml.serialize.OutputFormat outFormat = new org.apache.xml.
    serialize.OutputFormat();
    outFormat.setIndenting(true);
    outFormat.setIndent(4);
    org.apache.xml.serialize.XMLSerializer xmlser = new org.apache.xml.serialize.XMLSerializer(sw, outFormat);
    try {
    xmlser.serialize(your_document); //replace your_document with reference to document you want to serialize
    catch (Exception ex1) {
    }

  • HT4623 I used to be able to print from my iPad, but it has stopped, however I can still print from my iPod, any ideas?

    I used to be able to print from my iPad, but it has stopped, however I can still print from my iPod, any ideas?

    Re-booting Pad, router and printer seems to have solved the problem!

  • Since I downloaded Snow Leopard on my iMac, my HP all-in-one C7280 scanner will not work. It says "scanner not found, scanner could not be initialized".  Any ideas?

    Since I downloaded Snow Leopard on my iMac, my HP all-in-one C7280 scanner will not work. It says "scanner not found, scanner could not be initialized".  Any ideas?

    Hi,
    I suggest uninstalling the printer drivers from your HP printer. The go to System Preferences> Printer &amp; Fax and in the printer list box go ahead and reset the printing system. Do that by right clicking over the printer list box ad the option should appear. After that close system preferences and reinstall your printer drivers from the HP CD. After installation check if your printer works as expected, if it does, stop here and ignore the rest of the message.
    If you don't have the install CDs for the printer or the previous step does not work; connect your printer to your Mac via USB and then again go to system preferences. Open the Print &amp; Fax menu and in the printer list box you should see a "+" sign. Click on it, and a new window should appear with a list of printers that are available to you. If that's the case, go ahead click your printer name and wait for the computer to look in the Apple servers for the drivers. When searching is finished click the "install" button. This process will open software update and install the neccesary drivers.
    After that, you should be able to scan documents with the Preview App.
    For more information on the printing system in OS X Snow Leopard visit:
    http://support.apple.com/kb/HT3771
    Hope this helps!

  • Any ideas for resolving IE "Page Cannot be Displayed" issues being encountered in Viewer using 11.1.1.7 in SSL mode, works fine w/Firefox & Chrome, or IE using nonSSL.

    Wanted to reach out to the community to see if anyone else is experiencing this issue.  We have tried to work an SR on it, but just have not been getting anywhere w/support.
    We recently upgraded from 11.1.1.6 to 11.1.1.7.
    When using a SSL connection (https://...8094), our Discoverer Viewer IE users are encountering "Page cannot be found" errors when running reports and when trying to export.  The problems are not encountered for users utilizing Firefox or Chrome, just IE.
    A couple notes:
    We've found that by dialing down the number of rows to display, that will most often allow the report to work, e.g. if the report is set to display 25 rows, the report will fail and we'll just get the IE "Page cannot be found".  If we change the display rows to 5, then the exact same report with the exact same parameters will work.  Although it would be nice to be able to display more than just 5 rows of data :-) .
    When the report runs successfully, we've also found that users get a lot of failures when exporting to .XLS.  Often they can be successful exporting to .csv instead of .xls, but some reports still fail to export .csv.
    We didn't have any of these issues prior to upgrading from 11.1.1.6 to 11.1.1.7, and again the issues only impact IE users when connecting in SSL mode.  If we test the exact same reports/parameters using a non-SSL connection (same web-server, just using http://....:8090 instead of https://.....:8094), everything works great.  Something just doesn't seem to be compatible between IE, SSL and the Web Server for the page calls over some certain size.
    Just wanted to reach out to see if any Disco Web Server gurus out there might have any ideas of things for us to try.
    Thanks a ton!
    Larry

    So, I did this:
    edited  $INSTANCE_HOME/config/OHS/ohs1/ssl.conf file.
    Commented/removed the following section (Took a backup of the file before modifying it)
    BrowserMatch ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    opmnctl stopall
    opmnctl startall
    The Viewer problem seems to be gone.  Oracle is adding a note to MOS for this issue, possibly with this solution.
    Tom

  • Problem with creating "updatable" view. Any ideas?

    Hello to nice people!
    I'm trying to create plain, simple updatable view such as:
    CREATE OR REPLACE VIEW v_admin_maint
    (from_addrs,mail_invoice_addrs,auth_off,location_cd) AS SELECT
    A.from_addrs, A.mail_invoice_addrs, A.auth_off,
    A.location_cd FROM admin_maint A, sysusers B WHERE A.location_cd
    = B.location_cd and B.user_id = USER;
    TABLE admin_maint
    from_addrs,
    mail_invoice_addrs,
    auth_off,
    location_cd (PRIMARY KEY)
    TABLE sysusers
    USER_ID (PRIMARY KEY)
    FIRST_NAME
    LAST_NAME
    LOCATION_CD
    View works great as view-only, but I got an error on update
    statement "ORA-01779: cannot modify a column which maps to a non
    key-preserved table".
    UPDATE v_admin_maint SET from_addrs = 'test' where location_cd
    = 'HOME';
    TABLE admin_maint does have PK and this column included into
    VIEW.
    Any ideas? Please advice.

    You need to create a unique index on the location_cd column of
    the sysusers table, then re-create your view:
    SQL> ALTER TABLE sysusers
      2  ADD CONSTRAINT sysusers_location_cd_uk
      3  UNIQUE (location_cd)
      4  /
    Table altered.
    SQL> CREATE OR REPLACE VIEW v_admin_maint
      2    (from_addrs,
      3     mail_invoice_addrs,
      4     auth_off,
      5     location_cd)
      6  AS
      7  SELECT A.from_addrs,
      8         A.mail_invoice_addrs,
      9         A.auth_off,
    10         A.location_cd
    11  FROM   admin_maint A,
    12         sysusers B
    13  WHERE  A.location_cd = B.location_cd
    14  and    B.user_id = USER
    15  /
    View created.
    SQL> SELECT      column_name,
      2              updatable
      3  FROM        user_updatable_columns
      4  WHERE       table_name = 'V_ADMIN_MAINT'
      5  /
    COLUMN_NAME                    UPD
    FROM_ADDRS                     YES
    MAIL_INVOICE_ADDRS             YES
    AUTH_OFF                       YES
    LOCATION_CD                    YES
    SQL> UPDATE v_admin_maint
      2  SET    from_addrs = 'test'
      3  where  location_cd = 'HOME'
      4  /
    1 row updated.

  • My iPod touch is stuck in landscape view.  Even when held vertically if I open facebook or safari is rotates to landscape.  Have tried turning on and off, same results. Any ideas to fix?

    My iPod touch is stuck in landscape view.  Even when held vertically if I open facebook or safari is rotates to landscape.  Have tried turning on and off, same results. Any ideas to fix?

    Try switching it back from landscape to vertical. Or, go to settings and see if you have any special setting turned on that enable only landscape view. Also, try hooking it up to your computer and charging it to see what happens.

  • Can not view slidshows or creat a book on Snapfish.  SF IT folks say it's a security issue on my end.  Any ideas?

    Can not view slidshows or creat a book on Snapfish.  SF IT folks say it's a security issue on my end.  Any ideas?

    You will need to contact Snapfish to find out their system requirements and which plugin you need
    - http://support.snapfish.com/app/answers/detail/a_id/669/brand/3

  • When trying to update apps i keep getting billing method incorrect(this is on iphone 4s) i hsve tried this store,apple id,view id,payment info but does not offer me the none option,i can npt update my phone any ideas anybody please?

    when trying to update apps i keep getting billing method incorrect(this is on iphone 4s) i hsve tried this store,apple id,view id,payment info but does not offer me the none option,i can npt update my phone any ideas anybody please?

    If you dont have none option then you must own itunes some money. So you have to enter the payment like a itunes giftcard. you can contact itunes by email by going to expresslane.apple.com

  • I'm trying to connect my 30" Cinema Display to my new Mac Pro along with a new Apple 23'" monitor.  The new Apple monitor is fine.  On the cinema monitor everything is blown up pretty large.  Any ideas on how to solve this?

    I'm trying to connect my 30" Cinema Display to my new Mac Pro along with a new Apple 23'" monitor.  The new Apple monitor is fine.  On the cinema monitor everything is blown up pretty large.  Any ideas on how to solve this?

    The 30" display needs a DUAL-LINK adapter.
    <http://store.apple.com/us/product/MB571Z/A/mini-displayport-to-dual-link-dvi-ada pter>

Maybe you are looking for

  • Command line generation errors in log. How do I fix this?

    Version: RH 9 (latest version) OS: Windows 7, 64-bit Output: CHM I have a batch file that uses RH's command line generation functionality to generate our CHMs regularly. The command line works for my other projects. But I have one project that has th

  • During charge LED indicator does not switch correctly to amber (orange)

    Symptom: Battery charging and everything works fine, but during charge the color does not change to amber or better to say the change is nearly not detectable anymore. The green light only changes being a bit more yellowish. The charging can only be

  • Update to iOS 5 Signal Problems?

    hi, i was wondering if anyone experienced some signal problems after ios 5 update? I did and when i was using the beta, it gave me full bars and never dropped calls but after i updated to the final version, my calls started to drop and text messages

  • No boot after new build, stats inside

    MB: MSI 870S-G46 AMD board AM3 ready Video: GeForce(PNY) GTX 550Ti 1024MB GDDR5 PCI express Processor: AMD Phenom 2 Black Edition x4 965, 3.4GHZ True Quad-Core 8.0MB Cache, Socket AM3 w/Heat Sink Fan Ram: G.Skill DDR3-1333 4G sticks. 4 sticks PC3-106

  • Assigned products missing in Opportunities

    Hi, very often we have the problem, that products which were assigned within an opportunity on a WGS-Client are missing in the transaction afterwards on WTS-Clients. In the CRM Online the assignment is still present. On the WTS-Clients we only have t