I have been looking around the site a bit, but I didn't find any replies on how to do it the way I want.
What I want is an URL like this:
www.example.com/Projects/"querystring1 - text only"/"querystring2 - 4 digits only"/
to show the page with this URL:
www.example.com/Projects.aspx?Region=querystring1&Zip=querystring2
What I have been trying is the following:
<rewrite url="~/Leje-og-udlejning-arbejdskraft/(.+)/(.+)" to="~/Workers.aspx?Region=$1&zip=$2"/>
But it just takes both of them as one querysting and put them in the Region-querystring.
I'd need to see the rest of your rewrite rules to be sure, but if you have multiple rewrites (i.e. to handle situations where users only specify one of the two query strings) neglecting to add processing="stop" at the end will cause one rule to override the other.
For example, I use the following setup in my web.config file:
<rewriter>
<rewrite url="~/(.+)/(.+)" to="~/Default.aspx?ref=$1&page=$2" processing="stop"/>
<rewrite url="~/(.+)" to="~/Default.aspx?ref=$1" processing="stop"/>
</rewriter>
This will first check to see if 2 query variables are present. If they are, it rewrites them appropriately and stops processing other rules. This is the biggie. Without processing="stop" at the end, I end up passing both as the ref query string. This might be the conflict you're running in to.
Related
I have several processes with almost same flow like "Get some parameters, extract data from database according to them and upload them to target". The parameters vary slightly across processes as well as targets but only a bit. Most of the process is the same. I would like to extract those differences to parameter-context and dynamically load them. My idea is to have parameters defined following way and then using them.
So core of question is:
How to dynamically choose which parameter group load and use?
Having several parameter contexts with same-named/different-valued parameters and dynamically switching them would be probably the best, but it is not possible as far as I know.
Also duplicating flows is out-of-the-table. Any error correction would be spread out over several places and maintenance would be a nightmare.
Moreover, I know I can do it like "In GenetrateFlowFile for process A set value1=#{A_value1} and in GenetrateFlowFile for process B set value1=#{B_value1}. But this is tedious, error-prone and scales kinda bad. Not speaking of situation when I can have dozens of parameters and several processes. Also it is a kind of hardcoding, not configuring...
I was hoping for something like defining group=A and then using it like value1=#{ ${ group:append('_value1') } } but this does not work - it is evaluated as parameter literally named ${ group:append('_value1') }.
TL;DR: Use evaluateELString().
The actual solution is to set in GenetrateFlowFile processor group=A and in next UpdateAttribute processor set the following:
value1=${ group:prepend('hash{ '):append('_value1 }'):replace('hash', '#'):evaluateELString() }
The magic being done here is "Take value of group slap around it #{ and _value1 } to make it valid NiFi Expression Language statement and then evaluate it." (Notice - the word hash and function replace is there since I didnĀ“t manage to escape the # char right before {.)
If you would like to have your value1 at the beginning of the statement then you can use following code. The result is same, it is easier to use (often-changed value value1 is at the beginning of the statement) and is less readable "what is really going on?"-wise.
value1=${ literal('value1'):prepend('_'):prepend(${ group }):prepend('hash{ '):append(' }'):replace('hash', '#'):evaluateELString() }
I have this Analysis that I wish to invoke from URL (which I can).
This analysis in particular is mounted on a dashboard and 6 of the 17 columns can be filtered from a prompt mounted on the same dashboard.
I only need the analysis and still be able to filter the results. I read about parameters that can be given to the URL, but I can't seem to make the filters work. I am using the &P0=n parameter and the consequent &P1=xx parameter.
Without the &P I am able to see the table, when I add parameters I get this error UH6MBRBC:E6MUPJPH.
Thanks for your time, have a nice day.
Got it to work by myself afterall (always best).
Basically instead of &p0 and such I used &coln and &valn (where n is the column number):
&coln - is the name of the field
&valn - is the value for which you filter
More information and better explanation can be found here.
I am facing a strange issue with a specific search.
I would expect the below two queries to return the same result set since space between keywords interpreted as AND anyway:
1) inurl:taskcracker Angela restart crash
2) inurl:taskcracker Angela AND restart crash
First one returns 42 results where the highlighted keywords on the search result page includes 'start' in addition to 'restart'. Whereas the second query returns only 2 results with 'restart' only (no 'start') which what I was expecting from the first search as well.
Please note that it does not matter whether I put an AND in front of other keywords on the 2nd query. It only makes a difference when I put or don't put an AND in front of 'restart'
I initially thought that maybe restart is in the synonyms list under Search > Query Settings > Synonym Data > English in the GSA admin panel but it is not there.
So the issue is when I don't put an explicit AND in front of 'restart' GSA expands it to include 'start' as well.
Any ideas whether this comes from a configuration somewhere on the admin panel or likely to be a bug?
This is probably because query expansion doesn't work when you put AND before "restart".
Can you try adding &entqr=0 to the URL being sent to the GSA? It controls the the query expansion policy. You can also try &entqrm=0 too if first one doesn't work.
I have a view set up to accept 2 arguments. The url is like this: playlists/video5/%/%/rss.xml
It works fine if I supply the url with 2 arguments like playlists/video5/front/coach/rss.xml.
I have 2 arguments of "Taxonomy: Term"
But I need it to run even if 1 or no arguments are supplied. It looks like you can do this with PHP Code under: Provide default argument options -> Default argument type: -> PHP Code.
I'm using this for the first one:
$arg[0] == 'all';
return 'all';
I'm using this for the second one:
$arg[1] == 'all';
return 'all';
It's working fine in the preview if I enter 1, 2 or no arguments, but in the browser it giving me a "Page not found" error if I use less than 2 arguments in the url.
It woks with these urls:
/playlists/video5/gridiron/all/rss.xml
/playlists/video5/gridiron/football/rss.xml
It does not work with this:
playlists/video5/gridiron/rss.xml
I want it to return all values when no arguments are given, or if only one arg is given, just use the one, etc...
thanks
I would rearrange your URL to look like this: playlists/video5/rss/%/% so that way your arguments always come last. Then in your argument settings set:
Action to take if argument is not present: Display all values
This way when you go to playlists/video5/rss you will get every value. When you go to /playlists/video5/rss/term1 you will get all values that have term1 in them. Then the trick for the second argument is to include the wildcard for first argument like this: /playlists/video5/rss/all/term2. I believe that will include just the values that have the second term.
Alternatively, if these are both taxonomy terms, you may want to consolidate these into a single argument and check the box that says: Allow multiple terms per argument. According to the documentation right below the checkbox, it looks like this should allow you something like playlists/video5/rss/term1+term2 and display all values that have the first or second term.
Views will only collapse the %, not the slashes surrounding it. So while you're trying to use playlists/video5/rss.xml, Views is expecting playlists/video5///rss.xml.
To get what you're looking for, you need to duplicate the View display you're using twice.
For the first duplicate, use playlists/video5/%/rss.xml as the path. In your arguments for this view display, make sure the first argument validates for either gridiron or football.
For the second duplicate, use playlists/video5/rss.xml. There will be no arguments for this view display. If you just want all of the records to show up, you shouldn't have to do anything more. But if you want to supply a default argument other than all the records, you'd override the view display and create a filter instead of an argument.
Another (less ideal) option is to treat gridiron/football as one argument and validate it that way.
I am trying to find a mod rewrite solution to my problem.
I have almost 6 parameters that i am passing to my url and i want to rewrite.
Let me demonstrate an example of 3 parameters (x,y,z)
The url is list.php?x=1&y=2&z=3 so a rule will be
RewriteRule ^list/x/([^/\.]+)/y/([^/\.]+)/z/([^/\.]+)/?$ list.php?x=$1&y=$2&z=$3
So far fine.
The really tricky part (at least for me) is that the parameters x,y,z have no predicted order so the url might be
list.php?z=2&x=4&y=9
OR
list.php?y=2&z=4&x=9
PLUS
the parameters can came not all together
EX
list.php?z=4
OR
list.php?x=7&z=7
OR whatever combination of 3 arguments
So for 3 arguments i have to write all possible combinations (RewriteRule)
So my htaccess is actually 7 pages with 6 parameters and if want to add one more must write the new rules and correct all others
Is there any other way to accomplish it.
FOR EXAMPLE
if mod rewrite each parameter separate but when more than one parameter come from URL to combine the rules for each parameter.
EXAMPLE
RewriteRule parameter x rewrite to x/$1
RewriteRule parameter y rewrite to y/$2
So when both parameters come became x/$1/y/$2
OR some smart way that i dont have to write 7 pages of rules and be easier to modify
I hope its clear
Something like this should work
RewriteRule ^list/(?=(?:x/(\d+))?)(?=(?:y/(\d+))?) /list.php?x=$1&y=$2
Although it will produce empty parameters but that might be OK.