Default route is matched instead specific route - zend-framework

<routes>
<www type="Zend_Controller_Router_Route_Hostname">
<route>www.domain.com</route>
<chains>
<index type="Zend_Controller_Router_Route">
<route></route>
<defaults module="default" controller="index" action="index" />
</index>
<community>
<route>community</route>
<defaults module="community" />
<chains>
<index type="Zend_Controller_Router_Route">
<route>:action/*</route>
<defaults controller="index" action="index" />
</index>
<member type="Zend_Controller_Router_Route_Regex">
<route>member/profile-(\d+)-(.+)</route>
<reverse>member/profile-%d-%s</reverse>
<map>
<id>1</id>
<nom>2</nom>
</map>
<defaults action="viewmember" />
</member>
</chains>
</community>
</chains>
</www>
As you can see, I use a route with :action/* in to cover the homepages and the basics actions on index controller.
domain.com/community/random_action => works good.
domain.com/community/ doesn't work. The whole homepage is displayed.
I checked, and the default route is matched.
I tried assemble() on route "www-community-index" and it gives well www.domain.com/community
I don't see from where comes the problem :(

The first thing you should check is if you deleted the default route.
The second one is....remember that the routes are checked in reverse order. This means that the most specific should be the first and the default the last one.

Related

how to hide advance search by defalt in SmartField Value help in UI5?

I'm trying to hide Advance search in value help by default.
When this dialog opens, by default the category and category description Advance search options appears, I want this to be hidden.
Please help on how to approach this issue.
This is what I have
This is what I want: (Advance search to be hidden, not removed altogether)
It seems, you have used the Explored-Example from here
There you can also download the coding. Maybe you need to adjust the paths to the mockdata to get it up and running.
What happens if you try: sap:filterable="false" in your metadata.xml ?
Please see also the corresponding docu.
There it says:
“We notice that we have set sap:filterable="false" for the CURR property.
We do this, since we would otherwise also have a currency code search field in the dialog that we wish to avoid (default of sap:filterable is true).”
Now your adjusted metadata.xml from the SmartField example above could look like:
<EntityType Name="VL_SH_H_CATEGORY" sap:content-version="1">
<Key>
<PropertyRef Name="CATC" />
</Key>
<Property Name="CATC" Type="Edm.String" Nullable="false" MaxLength="4" sap:display-format="UpperCase" sap:label="Category" sap:text="LTXT" sap:filterable="false" />
<Property Name="LTXT" Type="Edm.String" Nullable="false" sap:label="Category Description" sap:filterable="false"/>
</EntityType>
…
Is this what you are looking for ?

Confluence Macro Browser autocompletion for attachments

I am trying to show all attachments (from the current page) in an auto-completed drop-down list. This is the part in the atlassian-plugin.xml which defines the parameters:
<xhtml-macro name="plugin-name" class="com.example.macro.name" key="macroname-xhtml" icon="/download/resources/${project.groupId}.${project.artifactId}/icons/macroname.png">
<category name="formatting"/>
<parameters>
<parameter name="content_input" type="confluence-content" />
<parameter name="space_input" type="spacekey" />
<parameter name="attachment_input" type="attachment" />
</parameters>
</xhtml-macro>
The confluence-content and spacekey types work just fine. It shows a textfield which autocompletes Pages and Spaces.
However, the attachment type shows a empty drop-down list (select box) which cannot auto-complete.
The official Confluence documentation says it should work like I do:
https://developer.atlassian.com/display/CONFDEV/Including+Information+in+your+Macro+for+the+Macro+Browser
I must be missing something here, but I don't know what. Anyone might know what the problem is?
If you want a drop-down list with all the attachments then you may also try the following:
<xhtml-macro name="plugin-name" class="com.example.macro.name" key="macroname-xhtml" icon="/download/resources/${project.groupId}.${project.artifactId}/icons/macroname.png">
<category name="confluence-content" />
<parameters>
<parameter name="page" type="confluence-content" required="false"
multiple="false" />
<parameter name="name" type="attachment" required="false" />
</parameters>
</xhtml-macro>
Don't change the names of the parameters
If you want to add a filter, then you need the following:
<web-resource key="macro-browser-smart-fields" name="Macro Browser Smart Fields">
<resource type="download" name="confluence-core-macro-fields.js" location="js/confluence-core-macro-fields.js" />
<dependency>confluence.editor.actions:editor-macro-browser</dependency>
<context>macro-browser</context>
</web-resource>
confluence-core-macro-fields.js
(function($) {
AJS.MacroBrowser.activateSmartFieldsAttachmentsOnPage("plugin-name", [ "png", "jpg", "gif" ]);
})(AJS.$);
I found that setting the type as attachment (following official documentation) is bugged. I have found a work-around to display attachments in a auto-complete box.
<parameter name="xsd" type="confluence-content" required="true">
<option key="type" value="attachment"/>
<option key="showKeyInPlaceholder" value="false" />
<option key="showValueInPlaceholder" value="true" />
</parameter>

Is it possible to assign default values to NAnt properties?

I'd like to use the property value as a part of an argument passed to a certain EXE via <exec/> task. There's a condition which influences the property initialization, that is, if condition is true, it should contain value, otherwise be just empty (but still defined).
This is what I ended up so far:
<property name="prop1" value="" />
<property name="prop1" value="some-value-based-on-condition" if="condition-goes-here" />
And later on:
<exec program="my.exe">
<arg value="C:\Root\Folder\${prop1}" />
...
</exec>
If the property is not set, I'd like to pass just C:\Root\Folder\ as an argument value.
Initializing the property in this way seems too much for such a simple operation. Is there a way to do it simpler using what's in NAnt at the moment? I would imagine something like:
<property name="prop1" value="somevalue-based-on-condition" if="condition" default="" />
The example below should meet your needs. It will create a property named 'SolutionConfiguration' and assign it the value 'Release' if and only if the same parameter isn't already defined (ie. it was defined via the command line).
<property name="SolutionConfiguration" value="Release" unless="${property::exists('SolutionConfiguration')}" />
For your scenario, try
<property name="RootFolder" value="c:\Root\Folder" unless="${property::exists('RootFolder')}" />
<exec program="my.exe">
<arg value="${RootFolder}\${prop1}" />
...
</exec>
Use overwrite="False"
<property name="RootFolder" value="c:\Root\Folder" overwrite="false" />

Wikipedia API: how to retrieve multiple titles AND resolve redirects in 1 call?

It appears from the MediaWiki API:Query page that you can only resolve a redirect one at a time.
The document even says "The example below isn't really useful because it doesn't use any query modules, but shows how the redirects parameter works."
But how can you get the redirect information -- using a query module that does return multiple results?
If you have any result that returns pages, then you can just append redirects to the query and it resolves the redirects. If you don't have results that returns pages, you can usually convert it to that by using a generator.
For example, the query
http://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Redirects_from_gender&redirects
returns something like (shortened)
<api>
<query>
<categorymembers>
<cm pageid="648" ns="0" title="Actress" />
<cm pageid="19887132" ns="0" title="Administratrix" />
</categorymembers>
</query>
</api>
If you convert that into a generator
http://en.wikipedia.org/w/api.php?action=query&generator=categorymembers&gcmtitle=Category:Redirects_from_gender
you get
<api>
<query>
<pages>
<page pageid="648" ns="0" title="Actress" />
<page pageid="19887132" ns="0" title="Administratrix" />
</pages>
</query>
</api>
And if you now add redirects
http://en.wikipedia.org/w/api.php?action=query&generator=categorymembers&gcmtitle=Category:Redirects_from_gender&redirects
you get
<api>
<query>
<redirects>
<r from="Actress" to="Actor" />
<r from="Administratrix" to="Administrator (law)" />
</redirects>
<pages>
<page pageid="21504235" ns="0" title="Actor" />
<page pageid="6676496" ns="0" title="Administrator (law)" />
</pages>
</query>
</api>
You can also use prop=redirects with any generator, e.g. generator=allpages. This is a new feature since MW-1.23, fixing bug T59057.
When using generator=allpages with max limits (gaplimit=max and rdlimit=max) and apihighlimits right is available, all redirects on ArchWiki are resolved in a single query ;)
https://wiki.archlinux.org/api.php?action=query&generator=allpages&gapfilterredir=nonredirects&gaplimit=max&prop=redirects&rdprop=pageid|title|fragment&rdlimit=max

Redirect to default action in Struts 2

I have an action with an empty string for name defined in the root namespace, and I want to redirect to that action from another action if a certain result is found, but it doesn't seem to work.
Here's the default action
<action name="" class="com.example.actions.HomeAction">
<result name="success" type="freemarker">freemarker/home.ftl</result>
</action>
And I'm defining the redirect in the global-results for the package:
<global-results>
<result name="sendToRouting" type="redirectAction">
<param name="actionName"></param>
<param name="namespace">/</param>
</result>
</global-results>
I've tried taking out the actionName parameter, but that doesn't work. If I put a name in for the HomeAction and reference it by name in the global-results it works, so I'm assuming the problem is lack of action name for the redirect.
Any thoughts?
I think that what you want to do is use <default-action-ref />:
<package name="home" namespace="/" extends="struts-default">
<default-action-ref name="home" />
<action name="home" class="com.example.actions.HomeAction">
<result name="success" type="freemarker">freemarker/home.ftl</result>
</action>
</package>
Sorry...misread the question:
Try changing type="redirectAction" to type="redirect", I'm fairly sure that redirectAction is now redirect.
Were you getting a NullPointerException because the actionName parameter is blank? I hacked around this by providing a string which evaluates to an empty string:
<param name="actionName">${}</param>
Still looking for a more "correct" solution though...