Download Alfresco content from Java using Spring

Posted in IT StuffTagged , ,

To download content stored on Alfresco repository using Java, this is one possible way: String url = "http://localhost:18080/alfresco/d/a/workspace/SpacesStore/" + attach.getNode_ref() + "/" + attach.getAttach_filename() + "?ticket=" + ticket; return new ModelAndView("redirect:" + url);String url = "http://localhost:18080/alfresco/d/a/workspace/SpacesStore/" + attach.getNode_ref() + "/" + attach.getAttach_filename() + "?ticket=" + ticket; return new ModelAndView("redirect:" + url); Where getNode_ref() is a….

Use of LIKE clause in sql prepared statement

Posted in IT StuffTagged , ,

Suppose you have a where condition with like clause: AND ( UPPER(C.ndg) LIKE UPPER(’%test%’) OR UPPER(C.ndg_name) LIKE UPPER(’%test%’) )and ( UPPER(C.ndg) like UPPER(‘%test%’) or UPPER(C.ndg_name) like UPPER(‘%test%’) ) on Java you should write something like that: AND ( UPPER(C.ndg) LIKE UPPER(’%?%’) OR UPPER(C.ndg_name) LIKE UPPER(’%?%’) )and ( UPPER(C.ndg) like UPPER(‘%?%’) or UPPER(C.ndg_name) like UPPER(‘%?%’) )….

ClickOnce fails: Value does not fall within the expected range.

Posted in IT StuffTagged ,

I finally found out the “Value does not fall within the expected range” problem with a ClickOnce install application. This was the error log: ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of resulted in exception. Following failure messages were detected:….

Query Alfresco Web script using REST

Posted in IT StuffTagged , ,

With Spring 3 querying a REST-based service it’s easy. For first, you need to authenticate on Alfresco repository using an Alfresco Ticket instead of an explicit user name and password. A ticket represents a pre-authenticated user who has already performed the login process. To log in, the url is: http://localhost:8081/alfresco/service/api/login?u=admin&pw=adminhttp://localhost:8081/alfresco/service/api/login?u=admin&pw=admin Assuming the userid and password….

MacOS Tips and Tricks

Posted in IT StuffTagged

Rebuild the Spotlight index manually : sudo mdutil -E /sudo mdutil -E / Insert a blank space on Dock: defaults write persistent-apps -array-add ‘{"tile-type"="spacer-tile";}’ killall Dockdefaults write persistent-apps -array-add ‘{"tile-type"="spacer-tile";}’ killall Dock Show all files (also hidden): defaults write AppleShowAllFiles TRUE killall Finderdefaults write AppleShowAllFiles TRUE killall Finder

Run Postgres 9.1 on MacOS Lion as Daemon

Posted in IT StuffTagged ,

To start a new Postgres version as Daemon you need to follow these commands. For first, unload current version (if available): sudo launchctl unload /Library/LaunchDaemons/org.postgresql.dbms.plistsudo launchctl unload /Library/LaunchDaemons/org.postgresql.dbms.plist Edit theĀ org.postgresql.dbms.plist (if not available, create a new one): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" ""> <plist version="1.0"> <dict> <key>Label</key> <string>org.postgresql.postgres</string> <key>ProgramArguments</key> <array>….