Results 1 to 8 of 8

Thread: cWPWebColumnImage won't work with images per line

  1. #1
    Join Date
    Jul 2009
    Location
    Wiesbaden, Germany
    Posts
    245

    Default cWPWebColumnImage won't work with images per line

    Defining images for a cWPWebColumnImage doesn't seem to work, when defining the images on a record by record basis.
    They work fine if we call the WebApp itself, but they won't show up if the WebApp is embeddet into WordPress.

    A good example for that is http://www.dataflex4wordpress.com/in...border-mobile/
    The poor sales persons are all faceless monsters (click on "Sales Person Query")

  2. #2
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: cWPWebColumnImage won't work with images per line

    Hi

    Which DF version are you using?

    Mike

  3. #3
    Join Date
    Jul 2009
    Location
    Wiesbaden, Germany
    Posts
    245

    Default Re: cWPWebColumnImage won't work with images per line

    We are using DF19

  4. #4
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: cWPWebColumnImage won't work with images per line

    Understood - there are issues with DF19 and DF4WP. We will be preparing a new version of the plugin shortly to resolve these.

    Re "faceless monsters" - I too saw those at first, but a hard page reload turned them into to beautiful people I was hoping for... some browser caching issue I expect. (Or maybe they really are all faceless monsters and we caught them by surprise before they had time to assume their reassuringly human disguises! )

    Regarding your application/WordPress site, what the plugin does ATM is to take the psImageURL property (which it expects to be a relative path from the app's AppHTML directory) and turns that into a fully qualified URL (actually that's slightly not true - it skips the "protocol" part of the URL, relying on the browser to supply whatever protocol is in use for the page). For that to work it expects that you will be using the WPWebResourceManager (I think you must be, otherwise there would be an uncaught error), but also to be using images that are web-accessible. The v19.0 sample now uses a different approach, utilising the DownloadURL mechanism of the WebResourceManager, which is more secure and does not rely on the images being web-accessible. Which technique are you using in your OnDefineImages procedure in the app? Can you post that bit of code?

    Mike

  5. #5
    Join Date
    Jul 2009
    Location
    Wiesbaden, Germany
    Posts
    245

    Default Re: cWPWebColumnImage won't work with images per line

    Hi Mike,

    we are using the WebResourceManager route:
    Code:
    Procedure OnDefineImages
        String sFileName sFolder sUrl
        
        Forward Send OnDefineImages
        
        Move (Trim (ASURLAUB.BILD)) to sFileName
        If (sFileName <> "") Begin
            Get  ABCFolder of oWebApp to sFolder
            If (Right(sFolder,1) <> "\") Move (sFolder + "\") to sFolder
            Move (sFolder + "XYZ") to sFolder
            
            Move (sFolder - "\" - sFileName) to sFileName
            Get DownloadURL of ghoWebResourceManager sFileName to sUrl
            Send AddImage sUrl
        End
    End_Procedure
    I guessed that we would need some kind of other resource manager, but I can't find any mention of a WPWebResourceManager (or any ResourceManager) in the library. Just downloaded it again, hoping that we are just using an old version, but in the new downloaded one there is also no WPWebResourceManager to be found.
    I guess, that might be the problem?

  6. #6
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: cWPWebColumnImage won't work with images per line

    Hi

    Sorry - I think I was getting confused with some work I'd already done on a 19.0 version of the plugin, which has a WPWebResourceManager in it (possibly just me experimenting). It adds functionality to get a fully qualified path for things, which is required if you are embedding the app and then using the DownloadURL mechanism.

    I need to work on this for a DF 19 version.

    For now, try something like this (new code in blue):

    Code:
    String  sHome sHost sPort sPath
    Integer iPos 
    
    Get DownloadURL of ghoWebResourceManager sFilename            to sUrl
    Move (ServerVariable(ghoWebServiceDispatcher, "PATH_INFO"))   to sHome
    Move (ServerVariable(ghoWebServiceDispatcher, "SERVER_NAME")) to sHost
    Move (ServerVariable(ghoWebServiceDispatcher, "SERVER_PORT")) to sPort
    Move (Pos("WebServiceDispatcher.wso", sHome))                 to iPos
    Move (Left(sHome, (iPos - 1)))                                to sHome
    Move ("//" + sHost + ":" + sPort + sHome + sUrl)              to sPath
    Send AddImage sPath
    That might work "as is", or you might have to sprinkle some "/" separators in there - set a breakpoint in the debugger on the Send AddImage line and see what sPath looks like if it doesn't immediately work.

    Note: this should also work outside of WordPress, so you should be able to test stand-alone first.

    Mike

  7. #7
    Join Date
    Jul 2009
    Location
    Wiesbaden, Germany
    Posts
    245

    Default Re: cWPWebColumnImage won't work with images per line

    Hi Mike,

    worked like a charm. Thanks for the easy fix

  8. #8
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: cWPWebColumnImage won't work with images per line

    Hth!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •