This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val _rawResponseStream: InputStream = post.getResponseBodyAsStream() | |
val processedResponse: List[String] = getProcessedResponse | |
private var _outputList: List[String] = List() | |
private def getProcessedResponse: List[String] = { | |
var _readStream: BufferedReader = new BufferedReader( | |
new InputStreamReader(_rawResponseStream) | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.liftweb.paypal | |
import net.liftweb.util.Helpers | |
import Helpers._ | |
import net.liftweb.util._ | |
import _root_.org.apache.commons.httpclient._ | |
import _root_.org.apache.commons.httpclient.methods._ | |
import _root_.java.io._ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NameError (uninitialized constant MyModule::Job::GetStatus): | |
/vendor/rails/activesupport/lib/active_support/dependencies.rb:442:in `load_missing_constant' | |
/vendor/rails/activesupport/lib/active_support/dependencies.rb:77:in `const_missing' | |
/lib/mymodule/job/base.rb:14:in `status' | |
/app/controllers/visitors_controller.rb:73:in `get_job_status' | |
/vendor/rails/actionpack/lib/action_controller/base.rb:1253:in `send' | |
/vendor/rails/actionpack/lib/action_controller/base.rb:1253:in `perform_action_without_filters' | |
/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters' | |
/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark' | |
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the resource bundle for the current locale | |
*/ | |
def resourceBundles: List[ResourceBundle] = { | |
_resBundle.value match { | |
case Nil => _resBundle.set(LiftRules.resourceNames.flatMap(name => tryo( | |
List(ResourceBundle.getBundle(name, locale)) | |
) openOr Nil)) | |
_resBundle.value | |
case bundles => bundles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resourceBundles: List[ResourceBundle] = { | |
_resBundle.value match { | |
case Nil => { | |
_resBundle.set(LiftRules.resourceNames.flatMap(name => tryo( | |
List(ResourceBundle.getBundle(name, locale)) | |
).openOr( | |
LiftRules.resourceBundleFactories.toList.find(_.isDefinedAt(locale)).toList.map(_.apply(locale)) | |
))) | |
_resBundle.value | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LiftRules.resourceBundleFactories.prepend { | |
case locale if locale.getISO3Language == "eng" => new MyResources | |
case locale if locale.getISO3Language == "swe" => new MyResources_sv | |
case locale => | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def buildSetStringValue(accessor : Method, columnName : String): (T, String) => Unit = (inst, v) => doField(inst, accessor, {case f: MappedText[T] => | |
val toSet = v match { | |
case null => null | |
case other => other | |
} | |
f.data() = toSet | |
f.orgData() = toSet | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set the locale calculator | |
LiftRules.localeCalculator = Localizer.localeCalculator _ | |
// bundle factor | |
LiftRules.resourceBundleFactories.prepend { | |
case (basename, locale) if localeAvalible_?(locale) => CacheResourceBundle(locale) | |
case _ => CacheResourceBundle(new java.util.Locale("en","GB")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind("reg", xhtml, | |
"passwordField" -> text("", Pilot.password(_)) % ("size" -> "8") % ("id" -> "passwordField") | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val myReWriter: LiftRules.RewritePF = NamedPF("DemoBind") { | |
case RewriteRequest(ParsePath("user" :: id :: Nil, "", true, false), GetRequest, _) => { | |
RewriteResponse(ParsePath("path" :: "to" :: "template" :: Nil, "", true, false), Map("id" -> id)) | |
} | |
} | |
LiftRules.rewrite.append(myReWriter) |
OlderNewer