Tuesday, March 22, 2011
have you already download new FireFox?
Saturday, March 19, 2011
I've moved my applications to google code.
- backup.
- we can use SVN now as on some projects I work with another people, so now we can get benefits from that as well.
- I just feel that it is much much more correctly :)
If you wish to create project your own project on google code, just fill google code form. After that using SVN do checkout and
input as URL repository https://*******.googlecode.com/svn/trunk/
[Username] is your email
[password] is available on google code setting page.
So go on and do your first commit to google code
Friday, March 04, 2011
SVN plug-in problems
IBM did forum on xPage, nice
Tuesday, February 15, 2011
Introducing LotusLive Symphony
Friday, February 11, 2011
xPage view with categories + readers fields + don't show empty categories
IBM LO58079: XPAGE VIEW CONTROL WITH EXPANDLEVEL, VIEW WITH 'DON'T SHOW EMPTY CATEGORIES', DOCUMENTS WITH A READERS FIELDS
Actually this paper describes my situation and there is really smart solution there!
Local fix
Remove any one of these three factors:
- The readers fields from the documents.
- The "Don't show empty categories" property from the view.
- The 'expandLevel' property from the view control.
Is it joke? Would it not be better to remove whole application at all? nice that they do not say to use another sofrware for web development, but who know... probably next 'Loal fix'... :-)
Monday, January 31, 2011
Wednesday, January 19, 2011
trying to get full control over xPage auto generated html
Here are couple steps for those who want to get some more control over xPage. I will show example with new application that has only one xPage.
so let's start. we created new application and created new xPage, let's call it 'index'. Open it in browser. what do you see? My Domino generates already lot of staff.
3. created form and put there ~6 fields for some reasons. I do not know why.
4. html, head, title, body tags and !DOCTYPE
1-st step: disable default dojo in xPage.
You can disable the loading of the default Dojo, for example in order to use a more recent version of Dojo. In the Package Explorer in Domino Designer open your database and find the WebContent/WEB-INF/xp.properties file.
Tuesday, January 18, 2011
Google Maps API - MarkerClusterer
Here is an article about it - markerClusterer solution to the Too Many Markers problem
For those who works with Google Maps API this article is mandatory to read.
short dojo + ajax example how to get data from db
- getting view as JSON. database.nsf/viewname?readviewentries& OutputFormat=JSON (fast and modern)
var jsondata;
Sunday, January 16, 2011
nice command lotus\notes\nsd.exe -kill
Thursday, January 06, 2011
Improving SEO for blogspot bloggers. Lesson #1.
looks on different pages as well. If you want to update it go to Design of your blog and open it as HTML, find area with title and replace it on such one
<b:if cond='data:blog.pageType == "item"'>
<title><data:blog.pageName/> | <data:blog.title/></title>
<b:else/>
<title><data:blog.pageTitle/> | Your additional keywords</title>
</b:if>
Actually you are free to put there whatever you want. Mostly all says that ideal length for title tag is 69-70 chars. So remember that and try to make it near to that.
2. By default blogspot does not include meta tags such as description and keywords, so we have to add that manually (at least my blog did not have these tags). Good length for this tags are: meta description ~156, meta keywords is about 180 chars. Here is snapshot of what you need to add to your template.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<meta content='bla bla bla' name='description'/>
<meta content='lotus, motus, fotus, focus, etc' name='keywords'/>
if you read logic carefully you will see that it says: add meta tags only for main page, that's because otherwise we will get these tags on all pages and that's very bad, google does not like same meta description on pages. that's duplicate and you will decrease PR. Later I will add some information how we can have unique meta tags on pages.
3. sitemap. I believe it is not necessary as we are already you google so it does this automatically, but anywhere, better to do :), I hope you have already enabled RSS on your blog. So just open Google Web Master add you site there and find menu Sitemap and try to add next /atom.xml?redirect=false&start-index=1&max-results=300you can update max-results as u wish. If everything went fine you should see Status 'OK' and number of of URL should be same as you have in you atom.xml.
4. that's is not linked to blogspot problem, but just remember that:
- Images should have title and alt.
- Tag <strong> is better that <b>, but as I see it requires go fix it into HTML of your entry.
Summary
These tips are legal and easy to implement, but remember, unique and interesting content is the key.
Monday, January 03, 2011
Native JSON
var object_person = JSON.parse(jsonString);
// object_person is object now with 2 properties
var personString = JSON.stringify(person);
// personString now keeps the string '{"name":"Erast Fandorin", "speciality":"detective"}'
this native JSON is now supported mostof browsers, so just use it :)
Wednesday, December 29, 2010
Useful option when you are doing Java in LDD
To avoid that - set this option you see on screen below (I believe at some point IBM will set as default)
Thursday, December 23, 2010
CSS staff you have to know
1. div>h1 { color: red;}
- means all h1 that are child to div will get that CSS, but not sub child.
examples:
<h1>this is red</h1>
</div>
<div>
<p>
<h1>this is not red</h1>
</p>
</div>
2. p+h1 {color:red}
- means make red h1 in case if it is going just after p on the same level
examples:
<div>
<p></p>
<h1>this is red text</h1>
</div>
<div>
<p></p>
<h2></h2>
<h1>this is not red text</h1>
</div>
3. p~h1 {color:red} (similar to +)
- means make red h1 in case if it is on the same level with p
</div>
<div>
<p></p>
<h2></h2>
<h1>this is also red text</h1>
</div>
4. p:first-child {color:red}
- means make red p in case if it is first child
examples:
<body>
<p>This is red text</p>
<p>This is not read</p>
</body>
Saturday, December 18, 2010
I've installed FP1 (for 8.5.2) without any problems.
Monday, December 13, 2010
I've just passed exam #190-951. IBM Lotus Notes Domino 8.5 Application Development Update
Monday, December 06, 2010
Expand and Collapse views in xPages
Collapse all
var viewPanel = getComponent(compositeData.viewPanelName);
var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();
var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();
container.collapseAll();
Expand all
var viewPanel = getComponent(compositeData.viewPanelName);
var model:com.ibm.xsp.model.domino.DominoViewDataModel = viewPanel.getDataModel();
var container:com.ibm.xsp.model.domino.DominoViewDataContainer = model.getDominoViewDataContainer();
container.expandAll();
That's much better then save values in sessionScope/RequestScope and use property expandLevel in viewPanel.
Tuesday, November 16, 2010
JS staff: Use Object instead of Switch.
Let me show couple examples
1. Example with switch
function FoodType(food) {
var getfoodtype;
switch(food) {
case 'apple': getfoodtype = 'fruit'; break;
case 'cucumbers': getfoodtype = 'vegetable'; break;
case 'watermelon': getfoodtype = 'strawberry'; break;
default: getfoodtype = 'not recognized';
}
return getfoodtype;
}
var getfoodtype, case, and break, we can avoid them.
2. Example with Object
FoodType {
apple: fruit,
cucumbers: vegetable,
watermelon: strawberry,
GetFoodType: function(type) {
return(this[type] || 'not recognized');
}
}
Ofc there could be cases where Object approach does not work and we have to use switch, but it is alternative, so keep in mind this.
Friday, November 12, 2010
Dynamical counter in Lotus Notes client
Let me show my example, I've a form, there I have couple fields I need to show length of it (because there is some validation of length for this field).
There are actually 2 fields: 1 for input and another one is just below the Title of field (computed type).
What we need to do - use some simple JavaScript lines..
step 1.
go to JS Header even in form/subform and put there couple lines of JS (select Run: Client and JavaScript)
var f = document.forms[0];
var stopDynamicalCounter = 0;
function updateCharCounter(delay) {
if(stopDynamicalCounter == 0) return;
f.AlternateTitle_length.value = f.AlternateTitle.value.length;
setTimeout( 'updateCharCounter( ' + delay + ' )', delay);
}
step 2.
select input-field, and go to onFocus event, select Run: Client and JavaScript and put there 2 lines
stopDynamicalCounter = 1;
updateCharCounter(100)
step 3.
select input-field, and go to onBlur event, select Run: Client and JavaScript and put there 1 line
stopDynamicalCounter = 0;
That's all.
Computewithform does not work properly at 8.5.2
Computewithform just stopped to work (but when you use debugger and look into document before computewithform it works fine).
Here is my solution to avoid this problem
Set doc=view.GetDocumentByKey(key, True)
Dim bug as String
bug=doc.UniversalID '(or any item) '// that is actually the main line, funny?
Call doc.ComputeWithForm(False, False)
Tuesday, November 09, 2010
Very nice SOAP client (java)
I've implement also LS2J approach
here is my example. There are some enhancements need to do, but anywhere this also works fine.
Java library
import java.io.*;
import java.net.*;
public class ECWebservice {
String cResponse;
String wsurl;
String msg;
String contentType;
public ECWebservice(String init_url) throws IOException {
wsurl = init_url;
msg = "";
contentType = "text/xml; charset=utf-8";
cResponse = "";
}
public String GetResponce() {
return cResponse;
}
public void SetContentType(String init_contenttype) {
contentType = init_contenttype;
}
public boolean Send(String init_msg) {
boolean result = true;
try {
msg = init_msg;
// Create the connection where we're going to send the file.
URL url = new URL(wsurl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
String SOAPAction = msg;
byte[] b = SOAPAction.getBytes();
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty( "Content-Length", String.valueOf(SOAPAction.length()));
httpConn.setRequestProperty("Content-Type", contentType);
httpConn.setRequestProperty("SOAPAction", SOAPAction);
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
// Everything's set up; send the XML that was read in to b.
OutputStream out = httpConn.getOutputStream();
out.write(b);
out.close();
// Read the response and write it to standard out.
InputStreamReader isr = new InputStreamReader(httpConn.getInputStream(), "utf-8");
BufferedReader in = new BufferedReader(isr);
String inputLine;
while ((inputLine = in.readLine()) != null) {
cResponse += inputLine;
}
in.close();
} catch(Exception e) {
e.printStackTrace();
cResponse = "Main: Exception occured - check Java Debug Console";
result = false;
}
return result;
}
}
LS2J library
Option Public
Option Declare
Use "webservice.core"
UseLSX "*javacon"
Class ECWebservice
responce As string
connection As string
contentType As string
Sub New(connection_url As string)
connection = connection_url
contentType = "text/xml; charset=utf-8"
End Sub
Public Property Get GetResponce As string
GetResponce = responce
End Property
public Property Set SetConnection
connection = SetConnection
End Property
Public Property Set SetContentType
contentType = SetContentType
End Property
Function SendXMLRequest(xmldata) As Boolean
On Error Goto errorproc
'** everything we'll need to access our Java classes
Dim jSession As New JavaSession
Dim jClass As JavaClass
Dim jObject As JavaObject
'** get the IGWebservice class and instantiate an instance of it
Set jClass = jSession.GetClass("ECWebservice")
'** version of CreateObject and init with path to WSDL)
Set jObject = jClass.CreateObject("(Ljava/lang/String;)V", connection)
jObject.SetContentType(contentType)
'** send message and get result: true/false, if true then we got result
If jObject.send(xmldata) Then
me.responce = jObject.GetResponce()
End If
SendXMLRequest = True
endofsub:
Exit Function
errorproc:
MsgBox "Error #" & Err & " on line " & Erl & " in function " & Lsi_info(2) & " : " & Error, 48, "Runtime error"
Resume endofsub
End Function
End Class
Thursday, November 04, 2010
Lotus Notes got SVN: Can't believe we get that :)
Thursday, October 28, 2010
xPage: Could not load 'imb.xsp.widget.layout.TypeAhead'
Monday, October 11, 2010
xPage: date picker does not work in IE8
Workaround
http://www-10.lotus.com/ldd/nd85forum.nsf/0/579744cf7198e21785257731006c9cea?OpenDocument
Thursday, September 16, 2010
Change encoding attribute after XLST
I've done some transformation my DXL using XSLT. The funny thing was that after transformation using
// Transform
var str = docxml.transformNode(xsl);
I always got 'encoding' as UTF-16, that's not correct, so after some time I found nice solution
here is code I used: http://dotnet.itags.org/dotnet-tech/66097/
var doc = new ActiveXObject("Microsoft.XMLDOM");
doc.load("test.xml");
// Print initial encoding
var pi = doc.firstChild;
var eattr = pi.attributes.getNamedItem("encoding");
var encoding = eattr.value;
// Convert to string and reload (this loses the encoding)
var xml = doc.xml;
doc.loadXML(xml);
// Reset the encoding to "ISO-8859-1"
pi = doc.firstChild;
var eattr = pi.attributes.getNamedItem("encoding");
if (eattr == null) {
eattr = doc.createAttribute("encoding");
pi.attributes.setNamedItem(eattr);
}
eattr.value = "ISO-8859-1";
// And save document with new encoding.
doc.save("test2.xml");
It works fine for me (and not, output option in XSL did not help)
Wednesday, September 15, 2010
Date.prototype.addDays
// add days
Date.prototype.addDays = function(days) {
var secsDay = 86400000; // there are 86400000 secs in 1 day
var time = this.getTime(); // number of milliseconds since midnight of January 1, 1970.
var newdate = new Date(time + (days * secsDay));
this.setDate(newdate.getDate());
}
If anybody has better solution, you are welcome!



