Fetching raw rows
setFetchesRawRows( true ); must be set before setRawRowKeyPaths
In case of personal memory failures...
A WOImage with data bound to NSData( read from DB ) was not showing up on print.
Binding the "key" to a unique identifier for every image did the trick.
Hugi pointed this out to me, he had run into it some years ago, seems the NSData is only kept for a short period of time in the cache and setting the key will extend it's lifetime there.
Find text in files:
grep -c -r pattern file
-c fyrir count, telur hverstu oft kemur fyrir
-r fyrir recursive, fer ofan í undirmöppur
e.x. grep -c -r logi *
search all files/folders for "logi"
...havn't tried the "find" ;)
du -hcd 1
list all directories, down 1 level( d 1 )
in human readable form (h) and total count( c )
ls - lt : returns (l)ist ordered by (t)ime
head : return top 10
=>ls -lt | head
ls -1 return single column name only
export PATH=$PATH:/opt/subversion/bin
Go to folder to work with
to commit: svn commit -m "Message description"
When working with JavaScript I often need a unique ID for the current component I'm woking with:
ERXStringUtilities.replaceStringByStringInString( ".", "_", context().elementID().toString() );
I wanted to enable the user to go back to the previous page without using a WOActionResults to set the name of the component calling the nextPage. WOContext has a method called page that did this for me with ease ;)
String previousPage = context().page().name();
Need to create a wocomponent instance in java, you'll need : Application.application().createContextForRequest( new WORequest( "GET", "", "HTTP/ 1.0", null, null, null) ) to create the request
Created a WOFileUpload and connected the inputStream attribute to an input stream but nothing worked, kept getting a NP untill I connected FilePath to a String variable, then the WOFileUpload worked like charm( annoying charm that took too much of my time to figure out ).
// Use SimpleDateFormat to format the display of date Strings
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
return sdf.format(new Date());
// Read each line of the file infile.txt
BufferedReader rdr = new BufferedReader( new InputStreamReader(new FileInputStream("infile.txt"), "ISO-8859-1"));
String line = rdr.readLine();
I need to access a localalized strings file for the right language and I don't like the Localizer method.
I wanted to access it through Application and in the WOD files by simply adding "application.@ls.MY_STRING_TO_GET_FROM_LOCALIZED_STRING".
Added the following to Application.java:
public Object valueForKeyPath( String keypath ) {
// Catch all keypaths starting with ls and do whatever you want with it
if( keypath.startsWith( "@ls" ) )
return localizedStringForKey( keypath.substring( 4, keypath.length() ) );
return super.valueForKeyPath( keypath );
}
public String localizedStringForKey( String key ) {
return WOApplication.application().resourceManager().stringForKey( key, "localizedStrings", "!!LOCALIZED_STRING_NOT_FOUND!!", "app", languages() );
}