RSS pubsubhubbub implementation - ruby

According to pubsubhubbub I need add
<link rel="hub" href="http://pubsubhubbub.appspot.com"/>
to my channel tag, but my channel already contains a link tag to my own site, and adding another link means I can't pass verification because of there being two link tags in the same channel.
Unfortunately I couldn't open new issue in pubsubhubbub
Is there any way to deal with two link in the same channel?
Thanks!

Of course you can add several the <link> tags in your <channel>, but the link tags need to be in the Atom namespace, not in the RSS namespace, and yes, they can both be used in the same feed, as long as you prefix tags in the atom namespace with atom and later define what it means by using xmlns:atom="http://www.w3.org/2005/Atom".
For example, you can have this :
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="hub" href="http://superfeedr.com"/>
Also remember that the namespace definitions are "herited" from the parent elements. SO you can just add in the <channel> element and you can just write:
<atom:link rel="hub" href="http://superfeedr.com"/>
UPDATE The answer above applies to PubSubHubbub 0.3 which was specific to both RSS/Atom feeds. The latest version of the spec brings support for any mime type, which means that discovery has to be performed at the HTTP level using 2 Link headers.

If you are not defining your feed as an atom feed you can do this:
<link>http://www.your-site.com/</link>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com"/>
the xmls:atom attribute has to be there to use the atom namespace. I don't think you would need to use more than once though. With the atom namespace you can use more than one link.

Related

What NOREPLACE means at netflix's nebula plugin?

I was using netflix's nebula. Looking here, I saw this line:
fileType [org.freecompany.redline.payload.Directive] - Default for types, e.g. CONFIG, DOC, NOREPLACE, LICENSE
I didn't find any doc about the actual meaning of this enum, but I've found the original code.
Now I want an actual description of this enum. I thought NOREPLACE is releated to being not allowed to replace the file. But I want to be sure and don't rely on assumptions.
I have only seen noreplace as an additional attribute on a config file, e.g. %config(noreplace). It means that if the user has edited the file, the installer should put its new version as filename.rpmnew; by default %config files are replaced with the user one put as filename.rpmold .

include template from another extension ezpublish

In my current extension template i need to include template from another extension.
If i write
{include uri="design:article/full.tpl"}
it will search in my current extension. How can i direct it to other extension? According to doc there is a name parameter. What should be value of name?
https://doc.ez.no/eZ-Publish/Technical-manual/3.8/Reference/Template-functions/Miscellaneous/include
The design part of the design:article/full.tpl is already supposed to do what you want. It will search a article/full.tpl template, starting from a templates folder within your design folder extension/myextension/design.
eZ Publish will use the following rules to find the good template :
First : determinate which designs are used for the siteaccess. See the [DesignSettings] block in your site.ini files
[DesignSettings]
SiteDesign=a_design_specific_or_not_to_your_siteaccess
AdditionalSiteDesignList[]=another_generic_design
AdditionalSiteDesignList[]=standard
AdditionalSiteDesignList[]=base
Then : determinate which extensions are offering a design. See the [ExtensionSettings] block in each extension's design.ini file (exemple of the extension/ezflow/settings/design.ini.append.php) :
[ExtensionSettings]
DesignExtensions[]=ezflow
Finally, eZ Publish looks for the template. The SiteDesign design will be tried first, and then all the AdditionalSiteDesignList designs from top to bottom. Once the template is found, the lookup stops, and this information is cached (even if your TemplaceCache / TemplateCompile / ... is disabled). Remember the cache part, every time you add a new template, meant to be overriding another one, you need to clear the cache.
So if we have only 2 extensions offering a design, say ezflow and mysite, eZ Publish will try the following paths :
extension/mysite/design/a_design_specific_or_not_to_your_siteaccess/templates/full/article.tpl
extension/mysite/design/another_generic_design/templates/full/article.tpl
extension/mysite/design/standard/templates/full/article.tpl
extension/mysite/design/base/templates/full/article.tpl
extension/ezflow/design/a_design_specific_or_not_to_your_siteaccess/templates/full/article.tpl
extension/ezflow/design/another_generic_design/templates/full/article.tpl
extension/ezflow/design/standard/templates/full/article.tpl
extension/ezflow/design/base/templates/full/article.tpl
design/a_design_specific_or_not_to_your_siteaccess/templates/full/article.tpl
design/another_generic_design/templates/full/article.tpl
design/standard/templates/full/article.tpl
design/base/templates/full/article.tpl
Note that I made the hypothesis that the mysite extension has a higher priority than ezflow. See in settings/override/site.ini.append.php :
[ExtensionSettings]
ActiveExtensions[]
ActiveExtensions[]=mysite
....
ActiveExtensions[]=ezflow
....
This is for the system templates. The process is a little different when it comes to content templates (the ones which are used by attribute_view_gui and node_view_gui functions), see https://doc.ez.no/eZ-Publish/Technical-manual/4.x/Templates/The-template-override-system

Ez publish 4.7: embed twit in xml block

I want to embed a tweet into xml block using ezoe. Is there any way to embed custom html code into it?
Tweet embed code looks like this:
<blockquote class="twitter-tweet" lang="en"><p>Bla bla </p>— Air France (#airfrance) April 9, 2014</blockquote><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
You need to activate the html class for the literal tag.
settings/content.ini
[literal]
AvailableClasses[]
# The class 'html' is disabled by default because it gives editors the
# possibility to insert html and javascript code in XML blocks.
# Don't enable the 'html' class unless you really trust all users who has
# privileges to edit objects containing XML blocks.
#AvailableClasses[]=html
CustomAttributes[]
=> reproduce the following in your admin & front siteaccesses
settings/siteaccess/youradminsiteaccess/content.ini.append.php
and settings/siteaccess/yourfrontsiteaccess/content.ini.append.php
[literal]
AvailableClasses[]=html
Once done, you'll be able to choose the html class.
That said, enabling this feature suggests that contributors are aware of and concerned by possible security issues such as XSS. This should never be enabled for anonymous users (when you let them create comment objects with rich text fields for instance).

jstl/jsp print name of file beutiful

I have my tag ${file.name} in a jsp file to display a name of file to download
name containt a full file name,include file extension. for example
testfile.png
a-file.zip
testfile-test505454654.png
a-filenum5468.docx
other_file_with_a_name_very_very_very_larrrrrrrrrrrrrrrrrrrrrge.pdf
Files with very long names, crash my layout.
I think the way to format the file name to shorten it but include the extention. Maybe
testfile.png
a-file.zip
testfile-test505454....png *
a-filenum5468.docx
other_file_with_a_na....pdf *
How I can do?
in href no problem because it is done by id ${file.id}
If file is a POJO, you may add a getter-method to the POJO (something like String getShortName(){}) that returns a short version of the file name. And then use the method in your EL expression: ${file.shortName}.
I would write and register a custom tag that would take care of shortening the output to a maximum length
<custom:short value="${file.name}" var="shortFileName" />
The tag would take care of shortening based on defaults or values you specify in the element and putting it the result in a request attribute you can use anywhere after that declaration.
Since the requirements can be used many times so You should go with CUSTOM Tag solution like #Sotirios Delimanolis suggested.
JSTL function ( Like c:fn ) is another solution. Using jstl function get better performance than Custom tag ( simple / classic model )
Link: http://www.noppanit.com/how-to-create-a-custom-function-for-jstl/

How to comment a GPX file?

How I can make a comment in a GPX files?
I checked on Google and here with no luck. Thank you !
Assuming GPX = GPS eXchange Format it's just XML so a standard XML comment is all you'd need:
<!-- XML Comment -->
Waypoint, Routes and Tracks in Gpx have a formal tag <cmt /> and <desc /> The other main types have something called <extensions /> that allow you to add whatever content you want. The only requirement is that what you put in there is linked to a different schema so you can't use the default namespace for your tags.
You can put something like <myns:cmt>Comment here</myns:cmt> in there assuming you define the myns namespace in the top.
You can read more about this in the Gpx specs here
Garmin uses extensions extensively. To get an idea how they do it you can get their schema here

Resources