NameTrans pfx2dir with 'from' as wildcard?

Hi,
Is it possible to use a wildcard in the 'from' parameter of a pfx2dir NameTrans directive? This is with Web Server 6.1.
I've tried all sorts of ways but nothing seems to work.
What I'm trying to do is convert several permutations of a URI, e.g.:
Instead of several directives such as
... from="/uri" dir="/path/to/uri"
... from="/URI" dir="/path/to/uri"
<etc>just use a single one with a wildcard:
...from="/[uU][rR][iI]" dir="/path/to/uri"At the moment we have hundreds of these directives in obj.conf, and we could get rid of most of them if pfx2dir will accept a wildcarded 'from' parameter

No, it's not possible. The pfx2dir SAF's from parameter specifies a prefix, not a wildcard pattern.
You could probably get the functionality you're looking for using the <Client> tag in combination with the redirect SAF. However, if you have hunderds of such directives, you're probably better off with a custom NSAPI plugin.
The following custom SAF, map-shortcut, seems to do what you want:
#include <string.h>
#include "nsapi.h"
NSAPI_PUBLIC int map_shortcut(pblock *pb, Session *sn, Request *rq)
    pb_param *pp;
    char *from;
    char *dir;
    int fromlen;
    char *suffix;
    /* pp is the partial path (URI) */
    pp = pblock_find("ppath", rq->vars);
    /* from and dir are this SAF's parameters */
    from = pblock_findval("from", pb);
    dir = pblock_findval("dir", pb);
    if ((!from) || (!dir)) {
        log_error(LOG_MISCONFIG, "map-shortcut", sn, rq,
                  "missing parameter (need from and dir)");
        return REQ_ABORTED;
    /* Check for a from prefix match (N.B. case insensitive) */
    fromlen = strlen(from);
    if (strncasecmp(from, pp->value, fromlen))
        return REQ_NOACTION; /* no match */
    /* The from prefix matched; now check that the suffix begins with a '/' */
    suffix = pp->value + fromlen;
    if (*suffix && *suffix != '/')
        return REQ_NOACTION; /* no match */
    /* We matched the from prefix, so everything will be relative to dir */
    pblock_nvinsert("ntrans-base", dir, rq->vars);
    /* Rewrite the partial path so that it begins with dir */
    FREE(pp->value);
    pp->value = (char *)MALLOC(strlen(dir) + strlen(suffix) + 1);
    strcpy(pp->value, dir);
    strcat(pp->value, suffix);
    return REQ_PROCEED;
}

Similar Messages

  • How to add item to a List with a bounded wildcard

    Hi,
    Is there a way to add a subtype instance to a List with a bounded wildcard? For example, say I have an
    abstract class called Car. Then I have 2 concrete subclasses--Ford and Toyota. Now say I have another
    class that contains a prepopulated list and is wildcard bounded like this: List<? extends Car> carList. I
    want to add a method where I pass in a Car subtype as a parameter and then add it into this list, e.g:
    public void addCar(Car car) {
    carList.add(car);
    Trying this, I keep getting "cannot find symbol" compilation errors. When I went back to read the Generics
    tutorial by Bracha, he mentions that explicitly adding a subtype, e.g. carList.add(new Ford()), can not be
    done. But here I'm adding the "upper bound" of the wildcard, i.e. the Car type. Therefore there should be no
    discrepancy between supertype and subtype an thus the carList.add(car) should be ok, IMO.
    Am I misunderstanding something with this logic? Also, if carList.add(car) can not be done, then how can
    I go about doing something similar which will allow me to add subtypes to a "generic" list?
    Thanks in advanced!
    -los

    I get a compilation error expecting an Object instead of a Car. Of course you did. List<? super Car> is a list into which you can put cars -- and possibly other stuff. List<? extends Car> is a list out of which you can get cars (possibly of different makes).
    Do you need a list that you can put cars in and get cars out? That's List<Car>
    This isn't a linguistic problem you are having; this is a design problem. If you have a function that takes an argument which is a list that you can put any kind of car into and be sure of getting a car out of, it isn't reasonable to pass in a List<Ford> (because the function might put in a Chevy) or a List<Object> (but there might be motorcycles already in there). By the requirements you have, you need a List<Car> and nothing else.
    Yes, you could use a cast, but all you are doing is circumventing the type system by saying "I know this List<Object> only has Cars in it."

  • BSOD in XP with from-the-CD driv

    Even in Safe Mode, I get this..
    STOP: 0x000000A5 (etc etc) [I didn't write them down].
    Microsoft KB articles and the error itself claim it to be an ACPI issue, whatever that is.. but it didn't start happening until I installed this X-Fi Platinum Champion [with the 3.5" 'dri've' addon and the remote]. Help plox?
    I'm going to post full specs so I can verify if its just an underpowered PSU or an issue needing a reinstall on.
    MachSpeed Viper MSNV-939 / nForce4 AMD chipset
    AMD Athlon64 X2 3800+
    .5GB RAM operating at DDR333
    WinXP Professional SP2
    XFX GeForce 8600GT 256MB OC'd out of the box
    2xIDE HDD
    xSATA2 HDD
    xIDE DVD+/-R/RW-DL
    Gigabyte Wireless LAN card
    SoundBlaster X-Fi Platinum
    3x80mm intake fans, blue LEDs
    x20mm exhaust fan, no LEDs
    Ultra X-Connect 600W PSU w/ 28A on the +2V rail
    I'd prefer it being something as simple as stepping up my power supply, which is something I had in mind for the upcoming future anyways..

    Nevermind.. [url="http://www.pcper.com/comments.php?nid=480">I found the problem[/url].
    You'd think something like that wouldn't be so obscure on Creative's website.. or are they trying to hide it (yes, still in a foul mood - having to buy a new soundcard just to get proper 5. support in VIsta, coming from a PERFECTLY GOOD SoundBlaster Li've 5. PCI [no, I don't really care too much about EAX - it got the job done that I needed]..)?

  • SQL query with From table being entered in twice

    I have a query that is doing an exist clause with the inner select statement querying the T_PROJECTS table using two different alias "t3 & t2".
    SELECT t0.ID, t0.EFFECTIVEDATE, t0.CUSTOMERID, t0.PROJECTID, .... FROM T_FINANCIALDATAS t0 WHERE ((t0.PROJECTID = 2271) AND (EXISTS (SELECT t1.TMPUSERID FROM T_PROJECTS t3, T_PROJECTS t2 , T_PROJECTSUSERS t1 WHERE (((( t2.CUSTOMERID = 1) AND (t1.USERID = 2276)) AND (t1.PROJECTID = t3.ID )) AND ( t2.ID = t1.PROJECTID))) AND (t0.CUSTOMERID = 1)))
    They need to be combined so I'm using only one table alias. They way the query get's built is a little complicated. The Exist clause get's built as a ReportQuery and then that get's passed into another method which eventually is added to a top level Expression as such:
    ReportQuery existsQuery = new ReportQuery(existsClass, existsExpressionHolder.getExpression());
    expHolder.addAnd(expHolder.getExpressionBuilder().exists(existsQuery));
    Question: what causes the double table alias from showing up? From what I read it seems like it's caused when you use two different ExpressionBuilders?

    Could you include the code that builds the Expression.
    Perhaps try to reproduce the issue in a simple isolated example. Generally every ExpressionBuilder used in a query represents a table/alias.
    What version of TopLink are you using?
    The duplicate alias seems repetitive, but doesn't seem like it will have any effect on the query result, other than its efficiency.
    James : http://www.eclipselink.org

  • Will EC support setting default file type and Open With from file menu?

    The default file types I can live without, but at least allow for Open With on right click from Windows Explorer.
    I currently have EC set in the Open With programs list, but EC does not comply for any files I opt to open it with (.css, .php, .html etc).
    EC open but not the file I choose.
    Also, even though the above use case is not ideal when if I do attempt an Open With when EC is already open, a new application session starts instead of attempting to open in the currently active app frame. It would be ideal to allow for single app frame, multiple files when Open With is employed.
    Darrell

    Hey Darrell,
    Thanks for the feedback. How Edge Code treats files is definitely something we know isn't ideal and it's something we're looking at fixing soon. There's currently a story on the Brackets backlog that adresses the Open With issue - https://trello.com/c/GhF1Bgf9
    And it based on howit ranks in that priority it looks like we could potentially take that into Edge Code over the next couple of months.
    This is definitely a feature that we think is important before we consider ourselves 1.0 so it's high priority.
    =Ryan
    [email protected]

  • Sync. problem with from iPad2 to iTunes???

    I've a problem with sync from iPad2 to itunes. I got the latest version of iTunes 10.5.2 and my iPad 2 is the version of ios 5.1. However, when I activate the sync. iTunes cannot process the sync. and it's locked. Is there anyone has the same problem?

    have the same problem with my iphone... :@

  • Stored procedure with database link with "from table(...)"

    Hi guys,
    I've been told I can't create views on a database by the design team and so have to use this stored procedure to obtain the values.
    select HAN_ID, HAN_DS, GLOBAL_IN, LOCAL_IN
    from table(cast(ODADMIN.ODP00002_QUERY.Execute001@DBLINK(11312,'EN') as
    ODADMIN.ODP00002_001_Array@DBLINK)) WHERE LOCAL_IN = 'Y';I've been told that it works when you remove the database links (so on the actual database) when you remove the cast part. I've tried it with my link and with/without the cast part but it doesn't work. With the example above I get the error: ORA-00907: missing right parenthesis.
    When I remove the CAST-AS and the additional parenthesis it brings i get the error: ORA-00904: "ODADMIN"."ODP00002_QUERY"."EXECUTE001": invalid identifier
    When I do table( *"* ODADMIN.ODP00002_QUERY.Execute001@MWW_DEV(11312,'EN') *"* )... -- wrapping the call in speech marks I get: ORA-00972: identifier is too long
    Anyone see what's wrong? Thanks for any help.
    Mike

    Hi Ben,
    Asking now. By a view I mean one local to the database; I could create one on APEX but then I use the database link twice instead of just 1.
    His reasoning Ben:
    Firstly, Maintenance. We will have to maintain additional views (at additional code). Secondly, if the view has a JOIN, then you can't update through it (without complexities). If we have to get the View to pass the data to a Procedure (that's a pain). Also, standards..
    All update occur via either a Procedure, or a Base view, across over 1000 tables
    That's the standard, and doing things differently is costly long term
    People will not know how it works, it will have to be explained, maintained..etc.
    If the Application has the Business Rules, then updates via Base Views, that's a more standard way of developing. Also, if you update via this view, you'll update multiple rows in one call, which is in-effficient if only ONE row needs to change. Therefore, single row updates from the Application is more efficient
    The procedure is as follows:
    --SET SERVEROUTPUT ON
    DECLARE
    nPBusLoc       NUMBER(5):=11312;
    sPHanId        VARCHAR2(3):='SB1';
    sPLngId        VARCHAR2(2):='EN';
    sPDesc         VARCHAR2(30);
    sPAllowAlloc   VARCHAR2(1);
    sPShowEnq      VARCHAR2(1);
    sPAllowDel     VARCHAR2(1);
    sPShowScan     VARCHAR2(1);
    sPGlobalLocal  VARCHAR2(1);
    sPReturnCd     VARCHAR2(2);
    sPReturnTx     VARCHAR2(100);                  
    BEGIN
    ODADMIN.ODP00001.getHandlingCodes
                           (nPBusLoc    --  IN   NUMBER
                          ,sPHanId      -- IN   VARCHAR2
                          ,sPLngId      -- IN   VARCHAR2
                          ,sPDesc       -- OUT  VARCHAR2
                          ,sPAllowAlloc -- OUT  VARCHAR2
                          ,sPShowEnq    -- OUT  VARCHAR2
                          ,sPAllowDel   -- OUT  VARCHAR2
                          ,sPShowScan   -- OUT  VARCHAR2
                          ,sPGlobalLocal-- OUT  VARCHAR2
                          ,sPReturnCd   -- OUT  VARCHAR2
                          ,sPReturnTx   -- OUT  VARCHAR2                                    
    DBMS_OUTPUT.PUT_LINE('nPBusLoc                 = '||nPBusLoc              );
    DBMS_OUTPUT.PUT_LINE('sPHanId                  = '||sPHanId               );
    DBMS_OUTPUT.PUT_LINE('sPLngId                  = '||sPLngId               );
    DBMS_OUTPUT.PUT_LINE('sPDesc                   = '||sPDesc                );
    DBMS_OUTPUT.PUT_LINE('sPAllowAlloc             = '||sPAllowAlloc          );
    DBMS_OUTPUT.PUT_LINE('sPShowEnq                = '||sPShowEnq             );
    DBMS_OUTPUT.PUT_LINE('sPAllowDel               = '||sPAllowDel            );
    DBMS_OUTPUT.PUT_LINE('sPShowScan               = '||sPShowScan            );
    DBMS_OUTPUT.PUT_LINE('sPGlobalLocal            = '||sPGlobalLocal         );
    DBMS_OUTPUT.PUT_LINE('sPReturnCd               = '||sPReturnCd            );
    DBMS_OUTPUT.PUT_LINE('sPReturnTx               = '||sPReturnTx            );
    END;
    /Mike
    Edited by: Dird on 27-Aug-2009 01:50

  • How to have logical expression with value '*' not wildcard '*'

    Hi ,
        I have requirement where i have to filter records based on a field with value  EQ '' but strangely it is taking wildcard '' in the production system. In the Dev system it is taken as exact value '' but behaves as a wild card in prod system. Please advice a sure shot change which will work in both the environment as i am on a strict deadline for this. Will a usage of CONSTANT work ? Constant : val   type c value "".
    Regards
    Tashi

    Hi,
    Check the bellow code which will help you in using wild card in searcg help.
    DATA: ls_selopt         TYPE ddshselopt,                                  
            ls_t006a          LIKE t006a.                                        
    TYPES:lv_range          TYPE char45.
    CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
          EXPORTING
            parameter         = lc_old_mat
          IMPORTING
            value             = lv_dummy
          TABLES
            shlp_tab          = shlp_tab
            record_tab        = record_tab
            selopt_tab        = lt_sel_opt
          CHANGING
            shlp              = shlp
            callcontrol       = callcontrol
          EXCEPTIONS
            parameter_unknown = 1
            OTHERS            = 2.
        IF sy-subrc <> 0.
          EXIT.
        ELSEIF NOT lv_dummy IS INITIAL.
          lv_old_filled = 'X'.
        real backend system ?
          MOVE 'I'          TO ls_old_mat_ranges-sign.
          MOVE 'EQ'         TO ls_old_mat_ranges-option.
          MOVE lv_dummy(10) TO ls_old_mat_ranges-low.
          APPEND ls_old_mat_ranges TO lt_old_mat_ranges.
        ELSEIF NOT lt_sel_opt[] IS INITIAL.
          lv_old_filled = 'X'.
          LOOP AT lt_sel_opt INTO ls_sel_opt.
          no select in case of 'all systems'
            IF ls_sel_opt-low EQ '*'.
              DELETE lt_sel_opt.
            ELSE.
            wildcards
              MOVE-CORRESPONDING ls_sel_opt TO ls_old_mat_ranges.
              APPEND ls_old_mat_ranges TO lt_old_mat_ranges.
            ENDIF.
          ENDLOOP.
        ENDIF.
    Regards,
    Goutam Kolluru.

  • Trying to update UI with from another thread

    Hi,
    I start a JavaFX application from another class, and then I want to modify UI components from it. I have been trying to use Platform.runLater to do it.
    But the GUI hangs initially (doesnt display anything) for the first 5 seconds (sleep time) and then modifies and shows it.
    I want to display the GUI at first, and then after 5 seconds the GUI should update with the message, but with the below code it just hangs first and displays everything after 5seconds.
    Here sampleGUI is a a javafx app with text fields in it.
    +public class StartGame extends Application {+
    +@Override+
    +public void start(Stage stage) throws Exception {+
    final sampleGUI gui = new sampeGUI();
    gui.start(stage);
    +Platform.runLater(new Runnable() {+
    +@Override+
    +public void run() {+
    +try {+
    System.out.println("Sleeping now...");
    Thread.sleep(5000);
    System.out.println("Sleep over!");
    gui.updateText("New message");
    +} catch (InterruptedException ex) {+
    System.out.println("exception" ex);+
    +}+
    +}+
    +});+
    +}+
    +}+

    Platform.runLater(new Runnable() {
      @Override
      public void run() {
    });causes the Runnable's run method to be executed on the FX Application Thread. Since you put Thread.sleep(5000) inside your Runnable's run method, the sleep happens on the FX Application Thread.
    The call to runLater(...) can be invoked from any thread, including the FX Application Thread.
    So if you are not in the FX Application thread, you want to do:
    // any long-running task, for example
    System.out.println("Sleeping now");
    Thread.sleep(5000);
    System.out.println("Sleep over");
    Platform.runLater(new Runnable() {
      @Override
      public void run() {
        // update UI:
        gui.updateText("New Message");
    });If you are on the FX Application thread, which is the case in your Application.start(...) method, you need to create a new thread to execute your long-running code. You can do this "by hand", creating a Thread and a Runnable for it to execute, but it's probably better to use the JavaFX concurrency API, which has lots of useful hooks for updating the UI on the FX Application Thread.
    In this case, the code would look like this:
    public class StartGame extends Application {
      @Override
      public void start(Stage stage) throws Exception {
        final SampleGUI gui = new SampleGUI();
        gui.start();
        final Task<String> waitingTask = new Task<String>() {
          @Override
          public String call() throws Exception {
            System.out.println("Sleeping");
            Thread.sleep(5000);
            System.out.println("Sleep over!");
            return "New Message" ;
        waitingTask.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
          @Override
          public void handle(WorkerStateEvent event) {
            gui.updateMessage(waitingTask.getValue());
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.submit(waitingTask);
    }There are (probably dozens of) other ways to use a Task to do this. See the [url http://docs.oracle.com/javafx/2/api/javafx/concurrent/Task.html]API docs for Task for more.

  • How to make  jar with from java code for the filenames containing spaces

    I tried to make jar file using Runtime.exec method . The filenames have spaces in it .So i gave the filenames in double quotes.It works fine with windows and also from the command prompt.But when i run the same code in unix box , it creates a jar file with no content.Pls give some solution. I used the jdk1.2.2

    Pls give some solution. Pls post your code

  • Random Crashing with from SLI gtx980

    I have had random issues with My two 980 randomly crashing with 3 ROG swift monitors . Either i get a black screen across 1-3 screens then a nvidea driver error that it has crashed and recovered or a same black screens then i reboot.
    I've tried complete driver uninstall then reinstall but no dice.

    Quote from: purge98 on 12-December-14, 09:53:35
    What GPU temperature are you getting? I successfully run my GTX980 at 1500Mhz and 75c with no problems.
    I'm getting around 50-70c.
    So I've streesed test second card with no problem except they benchmarked two different amounts. First card benchmarked 1800 and second at 1200. Also notice sometimes one fan randomly stops turning. Keep testing it see if any crash but does look like the probvlem is once use them in sli.

  • Im using new with from itunes   or only previous music and video will be deleted

    Im using new itunes im trying to make sync with music and video from itunes to iphone what is going to be? all my photos music contacts apps... all will be deleted or only previous music and video will be deleted

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • How to erase an album with from my iPhone with photos from my Mac that I happened to erase from the Mac already. When typing edit the three bars appearing in grey and do not respond. Txs.

    How to erase an album in my iPhone with photos from my Mac that I happened to erase from the Mac already. When typing edit the three bars appear
    in grey and do not respond. Txs.

    Not sure if it will help but if you had registered it with Apple you could try unregistering it.  To do this:
    Go to: https://supportprofile.apple.com/MySupportProfile.do
    Log in if not already logged in.
    Click on ">" to the right of the device you want to unregister
    Click "unregister"

  • Elements 9 Opening with from Windows Photo Gallery

    I have just installed Elements 9 which was an upgrade from my previous Elements 7, which was the successr to 6 which was pre-installed on my laptop.
    I have retained Elements 7 as the new install process indicated that it would stay on the system but in effect lie dormant. However my problem now is that when using the 'Open With' command in Windows Photo Gallery it still defaults to PSE7 and not automatically go to 9 which I want. I have tried finding a way to set PSE9 as my default but can't seem to work that. If I delete the PSE7 version on my laptop will that affect my use of 9 as it was an upgrade.
    Can any one help perhaps please.
    Many thanks
    Rob

    No need to delete PSE7.
    In the Open With dialog click Browse.
    Then navigate to the PSE9 folder and select the PSE9 editor.exe file.
    That should do it.

  • Why does adobe not let you manage the computers your accounts are set up with from the online service?

    ?? They expect you to deauthorize from that computer, but if you sell that computer you don't have access to it anymore. HELLO?? Anyone at Adobe try thinking that far ahead or is it done on purpose to screw the customers? I have to active creative cloud memberships but only one computer using it with 4 computers signed up with only 1 actively using it because I don't have access to the other ones to deactivate the computers creative cloud is active on. Adobe recommends reinstalling creative cloud and deactivating, but here's a newsflash, if you don't own those computers anymore YOU CANT DO IT. It is not that hard to activate and deactivate computers "FROM THE CLOUD" especially on a service called "CREATIVE CLOUD" because Microsoft and apple do it with Office 365 and any Mac product. I take it my only solution is to cancel my credit card??

    Before complaining that something can't be done, a simple question of HOW to do something would be better... there IS a way to deactivate a computer you don't have access to physically
    Remove license on a computer http://forums.adobe.com/thread/1442423?tstart=0 may help
    -http://helpx.adobe.com/x-productkb/policy-pricing/error-maxium-acitvation-exceeded.html

Maybe you are looking for

  • ORA-39126 during an export of a partition via dbms_datapump

    Hi , i did export using datapump in command line everything went fine but while exporting via dbms_datapump i got this: ORA-39126 during an export of a partition via dbms_datapump ORA-00920 'SELECT FROM DUAL WHERE :1' P20060401 ORA-06512: at "SYS.DBM

  • Where can I find the Version column in Designer Repository ?

    I'm using Oracle Designer 10.1.2.6, and need to know where to find the current version # for a module. this is what I'm looking for: I thought I might find it in sdd_mod, which has Short_Name, but alas, it wasn't there. FYI, I recently got good help

  • Javascript help needed (confirmation for cancel button )

    Hi guys! I am not good at javascript but am going to improve shortly :-). Now i need very quick fix. I'm using <html:cancel> button in Struts 1.1 and I'm using without thinking the following code: <html:cancel onclick="bCancel=true;" > <bean:message

  • How do I create a delay or time-lag for my data in LABVIEW

    In my data acquisition system I am using acquired data to create an digital output. I want to delay this output or create a sort of time lag for it. Is there any easy way to incorporate this?

  • Converting PDF to RAW for display in the portal

    Hi all, We have an application that took a pdf and converted it into a raw datastring to pass to the portal for display purposes. We have migrated this function to a unicode system and are now struggling to get this to work. Code in non-unicode syste