Tuesday, September 20, 2011

Page-layout rel = «next | prev»

Along with the attribute rel = «canonical» to specify a 'search robot' to duplicate content, it is now possible to use the HTML reference value rel = "next" and rel = "prev" to indicate the position of the current page with neighbors in the navigation box. F.x. you have article splitted on 10 pages and you use next/prev buttons in order to move from one page to another. If you want to be sure that most of 'score' from 'google spider' will go to main page red="next"/"prev" is the very good options.

Here is more details about our example


Now about rel="next" and rel="prev"
www.example.com/article?id=123page=1
<link rel="next" href="http://www.example.com/article?id=123&page=2" />
www.example.com/article?id=123page=2
<link rel="next" href="http://www.example.com/article?id=123&page=3" />
<link rel="prev" href="http://www.example.com/article?id=123&page=1" />
www.example.com/article?id=123page=3
<link rel="next" href="http://www.example.com/article?id=123&page=4" />
<link rel="prev" href="http://www.example.com/article?id=123&page=2" />www.example.com/article?id=123page=10
<link rel="prev" href="http://www.example.com/article?id=123&page=9" />


Few notes:

  • First page should have only rel=«next». 
  • All pages between 1-st and last usually should have both only rel=«next» and rel="prev".
  • Last page should have olny rel=«prev». 
  • Allowed to use the value rel=«previous» as an alternative to rel=”prev”. Not sure if it has sence :) 
  • In case if you fail with that Google will continue to index your content with own heuristic logic.

Tuesday, August 02, 2011

Domino resolve URL with and without trailing as same URL, wrong?

We are faced with a problem (for us) with Domino. The problem is that Domino processes those 2 URL as similar same URL:

http://host/0/unid
http://host/0/unid/

the difference in 'trailing' (for those who thinks in same way as Domino :]). Well, it would be not a problem at all if you do internal staff, even very useful, problems start when we talk about SEO.

It actually affects our websites, as f.x. google 'eats' 2 URL (I mentioned above) as 2 different URL so their 'value' will be split on 2 part + 2 URL with same content also very bad as it is duplicate.

We should be able to either make 301's from the NOT CORRECT to the CORRECT URLs, or respond with a 404 (not found). Both options would be good.

Does anybody know ways how to do it?

[update from 28 October 2011] we've found solution with DSAPI filter, here you can read Solution to the trailing slash problem in Lotus Domino

Saturday, July 23, 2011

How to prevent text selection

There are few ways

1. Apply 'preventDefault' for events 'onselectstart' and 'onmousedown'

var element = document.getElementById('content');
element.onselectstart = function () { return false; }
element.onmousedown = function () { return false; }

2. Add attribute 'unselectable'

$(document.body).attr('unselectable', 'on')

3. Add style 'user-select: none'

.g-unselectable {
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

4. Use disabled textarea
<textarea disabled="disabled" style="border:none;color:#000;background:#fff; font-family:Arial;">
    how to prevent text selection?
textarea>

source (ru): javascript tips #2 

Monday, June 27, 2011

IBM Domino Java: No trusted certificate found. Fail?

I've faced with quite major problem when use IBM Java (the one from Domino 8.5.2 FP2). Our Domino grabs data from some webservices via 'https' (webservice does not have authentication, its free to everybody). Using simple Java Agent in Domino we grabbed data and was very happy :), here is few lines what we do
 URL url = new URL("https://here url");  
 URLConnection connection = url.openConnection();  
 HttpsURLConnection httpConn = (HttpsURLConnection) connection;  
 httpConn.setRequestMethod("POST");  
 httpConn.setDoOutput(true);  
 httpConn.setDoInput(true);  
 byte[] bytes = msg.getBytes("UTF-8");  
 httpConn.setRequestProperty("Content-length", String.valueOf(bytes.length));  
 OutputStream out = httpConn.getOutputStream(); // and on this line we now have an error: "no trusted certificate found"  
It worked fine for years but their (webservice provide) certificate has expired and they generate new one using same official CA. After they did it, Domino refuse to use new certificate and we can't grab data anymore from Domino.

We did some tests and noticed that non Domino JVM works just fine (we did tests in Eclipse with Oracles JVM) with exactly same code and it worked fine.

Of course we tried much more thing i.e.: we tried to add new certificate to cacerts storage in Domino and it did not work, we also tried to replace cacerts on Domino and use the one from Oracle JVM and lot of more things without any luck. Also when we tried to add new cert to cacerts in Domino it started to report about another issue: certificate chaining error.

Maybe Domino or Domino's JVM has problem/issue or we need to do something we just do not know. Would be nice to get more details about it because we are stacked now, does anybody know why we get this problem and if it is really problem in IBM Java?
There is also post on IBM with exactly same problem with not trusted certificates.
Would be nice if somebody share his suggestions/opinions.

Related topics:
IBM Domino Java: No trusted certificate found. Fail?
Domino and No trusted certificate found
Disabling certificate validation in Java