2013年10月3日 星期四

Dojo 1.8 & Domino 8.5.3

Quick-n-Dirty: Dojo 1.8 & Domino 8.5.3


If you want to use Dojo 1.8 with Domino 8.5.3, you can do the following:
1. Grab the Dojo JAR file from a ND9 installation:
\osgi\shared\eclipse\plugins\com.ibm.xsp.dojo_9.0.0.jar
2. Create a folder “dojo-1.8.0” in your notes data directory
\domino\js\dojo-1.8.0
3. Unpack the JAR file
4. Copy the content of the subfolder \resources\dojo-version of the unpacked JAR file in this folder:

5. Restart HTTP task.
6. Enjoy!

    
    

    


轉自blog@hasselba.ch

2013年8月12日 星期一

Xpage 程式更新 viewPanel 備忘

getComponent('viewPanel9').getData().refresh();

2013年8月1日 星期四

JavaScript search() 方法

String.search

 example

var stringValue = "This is my test string to search";
var result = stringValue.search(/is|test|string/);
//if () {....} 
//true return 6 false return -1
var str = "This is a sample text";
var re = /nothing|text|string/g
if (str.search(re) != -1) {
    midstring = " contains ";
} else {
    midstring = " does not contain ";
}

2013年7月28日 星期日

Learning XPages : The basics of OneUI

Welcome to part 2 in a series of blog entries
on how to create a simple phonebook application in Lotus Domino 8.5 using
XPages. In this part we are going to look at the basics of OneUI and understand
how to use it to provide the standard layout for your application.

By using a combination of DIVs and CSS
it is very easy to create a layout for your web based application. Your
CSS file will contain styles that match up with the divs in the html page
and this is what creates the layout. When we examine the OneUI core.css
file we find a section for structure that looks like this :





/*** S T R U C T U R E ***/
#lotusFrame, .lotusFrame{margin:0 auto;padding:0;min-width:990px;}
#lotusTitleBar, #lotusPlaceBar, .lotusTitleBar, .lotusPlaceBar{margin:0
20px}
#lotusMain, #lotusFooter, .lotusMain, .lotusFooter{border-style:solid;clear:both;margin:0
20px 10px 20px;overflow:hidden}
#lotusMain, .lotusMain{padding:0 0 5px 0;min-height:400px;border-width:0
1px 1px 1px;-moz-border-radius:0 0 4px 4px;-webkit-border-bottom-left-radius:4px;-webkit-border-bottom-right-radius:4px;
background-repeat:no-repeat}
#lotusColLeft, .lotusColLeft{width:180px;padding:20px 10px 10px 10px;}
#lotusColRight, .lotusColRight{width:180px;padding:15px 10px;font-size:.9em}
#lotusColRight h2, .lotusColRight h2{}
#lotusColLeft .lotusFirst, #lotusColRight .lotusFirst, .lotusColLeft .lotusFirst,
.lotusColRight .lotusFirst{margin-top:0;}
#lotusContent, .lotusContent{padding:16px 20px 20px 20px;overflow:hidden;margin-right:auto;margin-left:auto;}
.lotusContentColOne{width:45%;}
.lotusContentColTwo{width:45%;}
This defines parts of the basic layout
however it does not include the OneUI color scheme or graphics. These are
stored in a separate css file called defaulttheme.css.  If you match
these two css files up with some simple html that looks like this :








Banner Contents Here


Titlebar Here


PlaceBar Here




Left Sidebar Here


Main Content Here



Footer Contents Here

You’ll end up with an instant webpage
with a nice look and feel that looks like this :

A picture named M2

( footer and banner contents not shown
)

The core.css and defaulttheme.css and
a couple of other css files are all stored on the domino server in the
datadirectorydominojavaxpsthemeoneui directory. We could reference
the files directly in the XPage application but as you will see in part
3 of this series we are going to use a theme document to include the files


  轉自:Dec's Dom Blog

2013年7月2日 星期二

XPages: Simple function to clear scoped variables

All scope objects (applicationScope, sessionScope, etc.) are maps, so it's quite easy to clear them. This might come in handy during development, if you want to clear the applicationScope.

I've tested it on both applicationScope and sessionScope, and it doesn't seem to do any harm. After the maps are cleared, the server automatically loads the "internal" values used by the system.

function clearMap( map:Map ){
 // Get iterator for the keys
 var iterator = map.keySet().iterator();
 
 // Remove all items
 while( iterator.hasNext() ){
  map.remove( iterator.next() );
 }
}

Usage:
clearMap( applicationScope )

 轉載自DontPanic - a blog about Lotus Notes / Domino

2013年3月12日 星期二

how can I remove brackets from this array?

方法一:

import java.util.*;

public class RandomArray {
    public static void main( String[] args ) {

        Random random = new Random();

        int[][] array = new int[19][19];

        for( int i = 0 ; i < array.length ; i++ ) {
           for ( int j = 0 ; j < array[i].length ; j++ ) {
              array[i][j] = random.nextInt(3-0);
           }
        }

        for( int[] a : array ) {
            System.out.println( Arrays.toString( a ).replace("[", "").replace("]", ""));            
        }


    }
   
}
方法二:

System.out.println(Arrays.toString(a).replaceAll("^\\[|\\]$"));

資料來源:
http://www.dreamincode.net/forums/topic/288259-how-can-i-remove-brackets-from-this-array/