Can I use geofence to mark all roads within the shape coords as avoids or favors? - here-maps-rest

Fleet telematics API tool https://tcs.ext.here.com/examples/v3/fleet_telematics_api has examples "Prefer certain links and route through them" and "Avoid certain links and route by avoiding them".
The question is does HERE maps provide an API to mark geofence as avoid or favor similarly how it provides the ability to mark route links as avoids or favors?
UPD: Additionally is there a way of matching router links within the geofence so that we can get them and mark as avoids/favors?

The geofence/shape can be used only to restrict the area. See Overlay Override Area chapter in Fleet telematics Custom Routes docs.
So you can't do areas "preferred". Only route links — roads can be marked both either "favored" or "avoided".

Related

Drupal how to add a search filter to admin content page

I've never used Drupal before (development or managing content). I was asked to extend the admin content page to have a filter and simply don't know enough to get moving quickly.
Can anyone tell me if adding a search by text filter in the admin content area requires code or is there a CMS feature like adding a node for this task.
If code is required, is there something like a hook for this area? Not sure where to start. I will be investigating on my own but pointers to get me oriented to Drupal would help.
By default Drupal provides search mechanism ready to use. But there are also additional module which can improve search experience. You don't need any coding to use that search. You already have search form block ready to use.
Go to Structure -> Blocks and find block called "Search form". Now all you have to do is to put that block in some region and it will appear on front-end. Of course if it's not already styled by your theme it may be needed to put some extra CSS to make it look nice. There are also some template files which you can override and put some your HTML if you need.
There's also template file for search results page (which of course will work out of box also).
You may also need to create new block region if you want to place your form at some specific place, not covered by any existing region defined by your theme (easy thing to do!).
See https://drupal.stackexchange.com/q/30633/101329, the "Admin Views" module lets you configure the search form as you like.

How to organize content in Orchard?

One of my colleague left on vacation and left me with an Orchard project to work on.
I never worked with Orchard, so please excuse my ignorance and my possibly stupid questions.
I come to you for general advice on how to implement and structure the content of my site, as my research didn't give me the answers I'm looking for.
Here are the requirements:
The site must be divided into sections (section A, section A-1, section A-2, section B, etc...)
The navigation of the site must be based on the sections, each navigation item must also contain an image
Each section has a separate page with roughly 4 types of content that must be displayed:
Title of the page
Articles associated with this section, which represent the main content
FAQ content associated with the section which should be displayed in a specific zone
Miscellaneous content associated with the section which should also be displayed in a specific zone
I'm struggling at nearly every aspect of the requirements...
We started building a taxonomy, with as many terms as we have sections, allowing us to build the hierarchy we want, which is perfect. But this had 2 downsides:
The built-in taxonomy-based navigation is static, so the only thing displayed is the term, and we couldn't find a way to change it so the user would be able to add an image to the taxonomy term.
The generated pages based on the taxonomy display every content item based on the current term, that is, the articles, but also the FAQ content and the miscellaneous content, all in the Content zone.
Is there any way to work around these issues by using the built-in taxonomy? Or will I have to build content types from scratch in order to achieve what I'm trying?
The solution my colleague came up with was to add a layer for each section, and add in this layer 3 widgets, one for each specific content (title, FAQ, misc) in different zones. But I don't think this will me maintainable, as we currently have 4 main sections, each with 4-5 subsections, so that's rougly 60 layers, which will be a nightmare for the client to maintain.
Any advice will be greatly appreciated, I'm kind of lost.
Thanks in advance,
Mickaël
Taxonomies was a good start, but now you need to study projections. You'll be able to set-up filters about what you display.
For adding an image to your terms, one way to do it is to add a media library picker field to the type that was created for your taxonomy.

Plone: creating and using document tags?

For an academic plone site I am creating, it is desirable to support document tags (see below).
There are multiple users for this site, and each user has a (long) list of publications that they alone can add / edit.
In its simplest form, a publication entry consists of a hyperlink or even just plain text. For instance:
A. Baynes, J. Watson and S. Holmes, "The role of observation and deduction in forensics", Applied Crime Solving, 221, 210-243 (1901). doi: 10.1032/acsolv2714
(The above is a fictitious article, but it has all the elements one expects in most citations.)
For those unfamiliar with DOI links, these are fixed text strings that can be resolved to the page for the article in question using dx.doi.org. Further, copyright / license terms often prohibit the authors from providing a full PDF / HTML for their articles on their websites. The articles often lie behind a paywall (usually accessible from most Universities / major research labs). So, running full text searches on the article itself is NOT an option.
Returning to the problem definition, I am assuming that the users will add their publications as links, but I want to give them the ability to specify a comma separated list of words / phrases (or tags) that more closely identify what the article is about.
For the above article, an appropriate list of tags would be:
forensics, haemoglobin, degradation of evidence
After each user appends such tags to the article, I want to create a backend that will allow visitors to the site to simply be able to enter these tags in a search field and find all publications that pertain to, say, haemoglobin.
That search should pull all publications that list haemoglobin as a tag, for all users of the site.
I intentionally used haemoglobin as a tag to illustrate that relevant tags need not be (and usually aren't) part of the text specified in the title of the article.
Further, the Plone "Collections" feature is not an adequate solution to this problem. Collections are typically generated by the admin. That means that a) admin intervention for something like this is essential and b) tags are best defined by users, not the admin.
When adding any content type (File, Folder, Page, Link, Collection, ...) in Plone, you can apply any number of tags to the content. This is done in the "Categorization" tab when editing/creating the content.
Visitors/Users can search the site based on tags like normal searches (using the search box or accessing the /##search URL).
Moreover you can use "tag cloud" portlets to visualise the tags' frequencies. Check the followings to get an idea:
1. A tag cloud portlet that rotates tags in 3D using a Flash movie
2. TagCloud
Don't forget to check Plone documentation, and specially Plone user manual to get yourself acquainted with the way Plone works.
#user2751530
I would like to know whether you are still working on this specific project - I am currently developing a similar one using plone v4, documentviewer v3 and an as of yet nonexistant frontend. I would like to discuss different approaches to the tagging-by-user problem, you can contact me through skype (dawitt19) or twitter (pref.) through #japhigu.

How To Intercept All WordPress Queries and Restrict to Category?

In WordPress plugin coding, if I have two categories (cars and gardening) and I want to always exclude gardening from all queries, what is the intercept (hook or other trick) I need to do to do this? I need to always exclude gardening whether it be via search, tag cloud widget, comment widget, calendar widget, and any other portion of the website.
The reason I ask is that my client needs to have a single theme react differently by domain name coming in. If the user types gardening.com and it's mapped to this blog, then he wants to restrict to show only gardening.com content. If the user types cars.com and it's mapped to this same blog, then he wants to restrict to show only cars.com content.
Said again, my question lies in the area of wanting to hit one central place of WordPress with a plugin hook to always ensure the queries are restricted to a given category. That way, even if a new plugin is added that's not a default coming with WordPress, it will also be restricted by category too.
I have already figured out how to slip this code in the header.php of a theme to make the links act properly depending on whichever URL someone types in:
$sURL = 'http://' . $_SERVER['SERVER_NAME'];
update_option('siteurl',$sURL);
update_option('home',$sURL);
unset($sURL);
I found I had to create a home.php that was a copy of index.php, but tack on a query_posts('category_name=' . $_SERVER['SERVER_NAME']) call before the have_posts() call. On index.php, I left it alone and didn't add the query_posts(). Then, I had to make an archive.php that was a copy of Kubrick's archive.php, and then edit that so that I change query_posts() differently depending on what was chosen to do, such as add "&tag=", "&year=", etc. As well, a search.php had to be added (borrowing from Kubrick) that did a restriction too by category. This was a big help:
http://codex.wordpress.org/Template_Tags/query_posts
The only thing I haven't figured out yet is how to restrict widgets in the dynamic sidebar to a category. I'm making that into a separate request in StackOverflow.

Do you commonly use Link Relations ("rel" attributes)?

I'm eager to move towards a more standards-based, accessible and semanticly-correct web development approach. At the office, I don't expect there to be huge changes straight away, but I'm trying to start laying down some of the basic foundations for progress further down the track.
Part of this process is the introduction of the rel attribute in links and other such content. This extends further than the familiar old
<link href="mystyles.css" type="text/css" rel="stylesheet" />
which many developers would probably throw in without even thinking about it. I'm curious to know if anyone uses rel regularly in other ways. For example, setting your main navigation's link back to the home page with rel="start".
If you have implemented Link Relations in your own project, what prompted you to adopt them and what benefits were you trying to realise?
If you have looked at Link Relations but decided against their use, what was the basis for your decision?
I frequently use the rel (and rev) attributes with a wide range of values on both <link/> and <a/> elements.
I've outlined some of the more common (and more useful) relationship types below. A more complete list of rel values is maintained on the microformats wiki.
HTML 4
There are several standard link types defined by the HTML 4 specification.
alternate - Used when providing a link to an alternative version of an HTML document, for example in a different language or another format. This is most commonly used when linking to an syndicated (RSS or Atom) version of a web site.
next and previous - Used to indicate the next and previous documents in a series of documents. If rel="next" is used on a <link/> element then some browsers will pre-fetch the contents of the linked document (see the MDC link prefetching FAQ).
XFN
XFN (XHTML Friends Network) is a microformat used to describe the relationships between the people that are represented by web pages. It also allows a page to indicate other pages that represent the same person (e.g. my blog, my Twitter profile and my Stack Overflow profile all represent me). It does all of this by defining a set of rel values:
me - Used to indicate that the linking page and the linked page represent the same user. This is widely adopted by many social sites (including Stack Overflow) when linking from a user profile to the user's own web site.
contact, aquantance and friend - indicates that you know the person you are linking and how well you know them.
met - indicates that you have met the person you are linking to.
co-worker and colleague - indicate that you either work with or work in the same field as the person you are linking to.
co-resident and neighbor - indicate that you live with or near the person you are linking to.
child, parent, sibling, spouse and kin - indicate that you are linking to a member of your family.
muse, crush, date and sweetheart - indicate a romantic relationship with the person you are linking to.
These relationships can be parsed and used to determine information about a user, such as who their friends are or what other online profiles they possess. For more information on current, and potential future, applications of this the following pages might be of interest:
Ben Ward's article on Portable Social Networks.
The list of XFN implementations on the microformats wiki.
Other
There are various other link types defined by various specifications:
nofollow - Used to indicate that search engines should not follow a link when crawling a web page. See the rel-nofollow specification.
canonical - Used to indicate that another URL is the canonical version of the current page and should therefore be favoured by search engines. This is also used with the rev attribute to indicate an alternative, usually shorter, URL for the current page (i.e. rev="canonical" indicates that the current URL is the canonical version of the linked URL). More information and tools can be found in Simon Willison's blog entry on rev=canonical.
tag - Used to indicate that the linked page is a tag (i.e. keyword) describing the linking page. See the rel-tag specification.
license - Used to indicate the license under which the content of the linking page is released. See the rel-license specification.
I use the rel="nofollow" for user contributed links in blog comments. Google wont follow the link and it wont get a higher page rank because of the link.
One thing I've used them for is as a way to designate external links that should be opened in a new window. This functionality isn't possible with strict XHTML, because the target attribute is no longer allowed on <a> tags. But with some javascript and the rel attribute you can do a pretty decent job of it, as outlined in this article: New-Window Links in a Standards-Compliant World.
As Chad said, I use rel="external" to designate links I'd like to open in a new window (leveraging some jQuery to make it possible).
I also use rel="nofollow" when I'd like to make the bots that follow rules (like Google bot) not index my link.
It's useful on public websites to automatically add the nofollow, otherwise it could become enticing for spammers to make a link farm out of your blog comments, for example.

Resources