Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

a5w_include and Pathing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    a5w_include and Pathing

    Greetings,

    I use a5w_include a lot and I am trying to get a handle on its pathing requirements.

    I have a web project with the directory structure:
    Code:
    \
       index.a5w
       logout.a5w
       LoginDialog.a5wcmp
    script
       logintest.a5w
    menu
       E
          main.a5w 
       F
          main.a5w
    images
       bilingual_logo.jpg
       E
          logo.jpg
       F
          logo.jpg
    headersfooters
       header_bilingual.a5w
       header_E_notable.a5w
       header_F_notable.a5w
    dialogs
       LoginDialog.a5wcmp
    You will notice that the dialog 'LoginDialog' is repeated at the root project level and in the 'dialogs' directory. I would like to place the dialog in the 'dialogs' folder but when I drop it into an 'a5w' page, Alpha 5 says that it cannot find the dialog so I gave up and copied the 'LoginDialog' to the root project level.

    The purpose of this message, however, is to try and find out what type of pathing works consistently with 'a5w_include'. I have tried both relative and absolute in order to get the file included and I found it is touch-and-go. As an example. Here is a part of the header page 'header_E_notable.a5w':
    Code:
    <%A5
    ' re-assert English as the language just in case it was
    ' dynamically changed
    session.__protected__language = "E"
    '
    ' make sure user is logged in
    a5w_include("../script/logintest.a5w")
    %>
    <body bgcolor="#ffffff" text="#000000">
    
    <table cellSpacing="0" cellPadding="0" width="100%">
    <tr height="120">
    <td noWrap align="left">
    <table height="140" cellSpacing="0" cellPadding="0" width="100%">
    <tr vAlign="top" height="110">
    <td width="210">
    <P><IMG SRC="/images/E/logo.jpg" alt="logo" style="border-width:0px;height:75px;width:167px;"/>
    Notice the 'a5w_include' of 'logintest' which causes a 500 server error with the error message stating that it cannot find the 'logintest.a5w' file. In this particular call, I have tried both relative pathing and absolute and they both result in a 500 server error(not found).

    The only way I got the above to work is to take the include of 'logintest' out of the header and put it at the top of the menu page and specify the path as relative.

    I am kind of forming the impression that folders in the web project are not completly supported based on my attempts to implement a project structure and the consequences of this.

    Your thoughts and comments are, as always, greatly appreciated.

    Rick

    #2
    Re: a5w_include and Pathing

    The path will be relative to ServerSetting.IncludePath, however absolute paths work as well.

    The thing that jumps out at me about your code is that you are using forward slashes (/), as if specifying a URL. You need to use back slashes (\) because you are specifying a path on the local Windows file system.

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

    Comment


      #3
      Re: a5w_include and Pathing

      Lenny,

      Thanks for the comments and the suggestion.

      I guess I have been working in HTML so long, I automatically use *nix pathing convention since all of HTML is this way.

      Are you are saying that from within Xbasic, the Windows path separater must always be used?

      I'll change my a5w_include's to use the backslash and relative pathing (I prefer it).

      I'll also report back my findings.

      Rick

      Comment


        #4
        Re: a5w_include and Pathing

        Originally posted by rsmereka View Post

        Are you are saying that from within Xbasic, the Windows path separater must always be used?

        It must be used when accessing the Windows filesystem. If you are working with a URL such as in a repsonse.redirect(), you use the forward slash as you have been doing.

        Lenny Forziati
        Vice President, Internet Products and Technical Services
        Alpha Software Corporation

        Comment


          #5
          Re: a5w_include and Pathing

          Lenny,

          Thanks again for the help and suggestion.

          I re-structured my web project keeping in mind what you suggested. Here is a short directory listing of my projects' 'webroot':
          Code:
          Directory of C:\A5Webroot
          
          10/20/2006  09:08    <DIR>          .
          10/20/2006  09:08    <DIR>          ..
          10/20/2006  09:08               532 a5_application.a5i
          10/16/2006  11:54    <DIR>          CSS
          10/20/2006  09:08    <DIR>          dealers
          10/20/2006  09:08               687 eos.a5w
          10/20/2006  09:08    <DIR>          headersfooters
          10/20/2006  09:08    <DIR>          images
          10/20/2006  09:08             1,768 index.a5w
          08/22/2006  15:06    <DIR>          JavaScript
          09/28/2006  15:38    <DIR>          LivePreview
          10/20/2006  09:08            11,810 LoginDialog.a5wcmp
          10/20/2006  09:08               508 logout.a5w
          10/20/2006  09:08    <DIR>          Menu
          10/20/2006  09:08    <DIR>          script
          10/20/2006  09:24    <DIR>          session_folders
          
           Directory of C:\A5Webroot\dealers
          
          10/20/2006  09:08    <DIR>          .
          10/20/2006  09:08    <DIR>          ..
          10/20/2006  09:08               355 dealers9E.a5w
          10/20/2006  09:08               321 dealers9F.a5w
                         2 File(s)            676 bytes
          
           Directory of C:\A5Webroot\headersfooters
          
          10/20/2006  09:08    <DIR>          .
          10/20/2006  09:08    <DIR>          ..
          10/20/2006  09:08             1,242 header_bilingual.a5w
          10/20/2006  09:08             2,076 header_E_notable.a5w
          10/20/2006  09:08             1,980 header_F_notable.a5w
                         3 File(s)          5,298 bytes
          
           Directory of C:\A5Webroot\images
          
          10/20/2006  09:08    <DIR>          .
          10/20/2006  09:08    <DIR>          ..
          10/08/2006  19:12             3,723 Bilingual_logo.jpg
          10/08/2006  22:25             2,373 connectPri.jpg
          10/08/2006  22:26             3,091 logoE.jpg
          10/12/2006  17:34             3,267 logoF.jpg
                         4 File(s)         12,454 bytes
          
           Directory of C:\A5Webroot\Menu
          
          10/20/2006  09:08    <DIR>          .
          10/20/2006  09:08    <DIR>          ..
          10/20/2006  09:08               372 main9E.a5w
          10/20/2006  09:08               383 main9F.a5w
                         2 File(s)            755 bytes
          
           Directory of C:\A5Webroot\script
          
          10/20/2006  09:08    <DIR>          .
          10/20/2006  09:08    <DIR>          ..
          10/20/2006  09:08               272 logintest.a5w
          10/20/2006  09:08               190 securitytest9.a5w
                         2 File(s)            462 bytes
          An here is my main menu page (after login):
          Code:
          <html>
          <head>
          <meta name="generator" content="Alpha Five HTML Editor">
          <title>Main Menu</title>
          </head>
          <body>
          <%A5
          session.__protected__page = "main"
          a5w_include("\script\securitytest9.a5w")
          a5w_include("\headersfooters\header_E_notable.a5w")
          %>
          <p align=center><font size=4>
          <a href="/dealers/dealers9E.a5w">Dealers</a></font></p>
          </body></html>
          Since the re-structure, I am getting a 500 server error:
          Code:
          500 Internal Server Error
          Script Error
          Error:Script: /menu/main9E.a5w line:9
          A5WINCLUDE "\script\securitytest9.a5w"
          a5w_include unable to open file '\script\securitytest9.a5w'
          Not found
          
          Alpha Five/7.0 Build/4130-3033 at EUROPA Port 80
          As you can see from the directory list, the file 'securitytest9.a5w' is present and readable and the page 'main9E.a5w' is using the backslash in the 'a5w_include' statement.

          Any idea as to what is going on?
          Any/all comments greatly appreciated.
          Rick

          Comment


            #6
            Re: a5w_include and Pathing

            Remember that a5w_inlcude is dealing with a filesystem, not a URL. The leading slash in a5w_include("\script\securitytest9.a5w") refers to the root. If this were a URL it would refer to your webroot, but because it is a filesystem path it refers to the root of the current drive.

            You've shown that your webroot is c:\A5Webroot, so "\script\securitytest9.a5w" tells the server to look for c:\script\securitytest9.a5w

            If you want to refer to the web root to include a file from there, you would use
            Code:
            a5w_include(ServerSetting.Document_Root + "\script\securitytest9.a5w")

            Lenny Forziati
            Vice President, Internet Products and Technical Services
            Alpha Software Corporation

            Comment


              #7
              Re: a5w_include and Pathing

              Lenny,

              Works well once I implemented it. Thanks for the tip.

              I have some additional questions. I looked for documentation on 'ServerSetting.Document_Root' and could not find anything. Is this an alias? Is it always defined? What happens when I publish to a stand-alone WAS server? Will 'ServerSetting.Document_Root' still point to the proper place?

              Rick

              Comment

              Working...
              X