Seaside - How do I install Scriptaculous on a clean Seaside install (via Configuration Browser) on Pharo? - pharo

I used the method described here to install Seaside3 on Pharo. All is well, but Scriptaculous doesn't come preinstalled. How do I get it?
Seaside3 :
1: Go to the configuration manager
2: Select the Seaside 3 configuration. Click on Install.
3: Wait while it loads. Takes a couple of minutes on an i7 and a decent network link.
4: Open a Workspace and start a ZincServerAdaptor on the port you like (here 8080):
ZnZincServerAdaptor startOn: 8080. (then CMD+d for Do It)
7: Access Seaside from your browser.
8: Install Scriptaculous, but how?

Johan B's input:
http://forum.world.st/Seaside-How-do-I-install-Scriptaculous-on-a-clean-Seaside-install-via-Configuration-Browser-on-Pharo-td4802930.html
Pharo’s Configuration browser loads the default group of the Metacello configuration, which unfortunately was set to ‘Core’ for Seaside 3.1.
So, you will need to load additional groups programmatically:
(ConfigurationOfSeaside3 project version: #stable) load: #('Scriptaculous' 'JSON')
If you want to get the list of possible groups to load, inspect:
(ConfigurationOfSeaside3 project version: #stable) groups
Install from scratch with:
(ConfigurationOfSeaside3 project version: #stable) load: #('default' 'Scriptaculous' 'JSON')
This is something we fixed for Seaside 3.2, where the default will load everything to help newcomers.
We prefer not to change the existing 3.1 configuration versions to not break existing uses, but it’s fixed in the upcoming version.
Btw, Scriptaculous is really outdated. You will prefer to use jQuery and jQuery-UI (or any other JS framework…)
My findings on the subject:
Well, finally figured it out.
The packages needed for Scriptaculous to work are listed in the book here:
http://book.seaside.st/book/web-20/scriptaculous/frameworks/installation
Then you need to find a repository to get them from, after a little poking around here:
http://www.smalltalkhub.com/mc/Seaside/
I chose the Seaside31 repository, which is what I apparently managed to install a few hours ago.
http://www.smalltalkhub.com/mc/Seaside/Seaside31/main
Then I had to Do-It a couple of times on (maybe there is a faster way to do this):
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Javascript-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Prototype-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Scriptaculous-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Scriptaculous-Components';
load.
For those looking to install jQuery into Seaside can use these:
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'Javascript-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'JQuery-Core';
load.
Gofer new
url:'http://www.smalltalkhub.com/mc/Seaside/Seaside31/main';
package: 'JQuery-UI'; "notice that there is no -Core on this one, I don't know why"
load.

If one wants to load a full fledged configuration in Pharo 4.0 (after having loaded Seaside from the configuration browser):
| config groups |
config := (ConfigurationOfSeaside3 project version: #release3).
"Inspect this in case you want to see what's available"
groups := config groups.
"Load the usual suspects"
config load: #('OneClick' 'Javascript' 'Javascript Tests' 'JQuery' 'JQuery Tests' 'JQueryUI' 'JQueryUI Tests' 'JQueryUI Examples' 'REST' 'REST Tests' 'JSON' 'JSON Tests').
An additional interesting configuration to load is Bootstrap.
Check the configuration browser.

Related

Is there a html reporter to use with jest-cucumber which shows all the Gherkin annotations on report

I have started using jest-cucumber (https://github.com/bencompton/jest-cucumber) for automating my ReactJS app.
I have tried these reporters with the framework: https://github.com/jest-community/awesome-jest#reporters but I'm not able to see Gherkin steps on the report.
All reports show the test case level details.
I tried to use cucumber-html-reporter https://www.npmjs.com/package/cucumber-html-reporter but unable to use it with jest-cucumber.
Can you suggest any good library which can report the Gherkin annotations step by step which will look like https://www.npmjs.com/package/cucumber-html-reporter
Steps to be followed:
1) Install jest-cucumber with version v2.0.12 that supports reporting. During this writeup this version was not available as stable version of npm. You need to specifically give the version number when installing this.
2) Add below paramter in jest config to specify the report storage location. The jest-cucumber outputs a json file.
reporters: [
"default",
[
"./node_modules/jest-cucumber/dist/src/reporter", //This is the default path
{
formatter: "json",
path: "./tests/integration-test-results/test-report.json" //specific path
}
]
]
3) Create a index.js file for cucumber-html-report conf and mention the location of above created json file and output when the html file need to be placed. For more info, refer: https://www.npmjs.com/package/cucumber-html-reporter
4) Create package.json command as shown below for ease of use so that once the BDD test completes, the report is automatically generated and displayed.
"test-bdd": "jest --config=jest-cucumber.config.js && node ./cucumber-report-config.js"
5) Run: npm run test-bdd
I got it working with cucumber-html-reporter and jest-cucumber version 2.0.12. Please check the issue #27 of jest-cucumber: https://github.com/bencompton/jest-cucumber/issues/27.

usbip not working with OpenWRT

I am using MT7688 module with openWRT OS, version 15.05. I did install usbip into the device with:
#opkg install http://downloads.lede-project.org/releases/17.01.1/targets/ramips/mt7688/packages/kmod-usbip-client_4.4.61-1_mipsel_24kc.ipk
#opkg install http://downloads.lede-project.org/releases/17.01.1/targets/ramips/mt7688/packages/kmod-usbip-server_4.4.61-1_mipsel_24kc.ipk
#opkg install http://downloads.lede-project.org/releases/17.01.1/targets/ramips/mt7688/packages/kmod-usbip_4.4.61-1_mipsel_24kc.ipk
Failure scenario:
root#mylinkit:/# usbip
-ash: usbip: not found
So, looks like something broken at user space. Do any one know the solution for it?
Below are the logs which shows kernel module is installed:
root#mylinkit:/# lsmod|grep usbip
usbip_core 4768 2 vhci_hcd
usbip_host 11256 0
root#mylinkit:/# find -name *usbip*
./etc/modules.d/usbip-server
./etc/modules.d/usbip
./etc/modules.d/usbip-client
./lib/modules/3.18.23/usbip-core.ko
./lib/modules/3.18.23/usbip-host.ko
./overlay/upper/etc/modules.d/usbip-server
./overlay/upper/etc/modules.d/usbip
./overlay/upper/etc/modules.d/usbip-client
./overlay/upper/lib/modules/3.18.23/usbip-core.ko
./overlay/upper/lib/modules/3.18.23/usbip-host.ko
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.postinst-pkg
./overlay/upper/usr/lib/opkg/info/kmod-usbip.control
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.prerm
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.postinst
./overlay/upper/usr/lib/opkg/info/kmod-usbip.list
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.prerm
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.list
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.postinst
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.control
./overlay/upper/usr/lib/opkg/info/kmod-usbip.postinst
./overlay/upper/usr/lib/opkg/info/kmod-usbip.prerm
./overlay/upper/usr/lib/opkg/info/kmod-usbip-server.control
./overlay/upper/usr/lib/opkg/info/kmod-usbip.postinst-pkg
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.postinst-pkg
./overlay/upper/usr/lib/opkg/info/kmod-usbip-client.list
./sys/bus/usb/drivers/usbip-host
./sys/devices/platform/vhci_hcd/usbip_debug
./sys/module/usbip_core
./sys/module/usbip_core/parameters/usbip_debug_flag
./sys/module/usbip_core/holders/usbip_host
./sys/module/usbcore/holders/usbip_host
./sys/module/usbip_host
./sys/module/usbip_host/drivers/usb:usbip-host
./usr/lib/opkg/info/kmod-usbip-server.postinst-pkg
./usr/lib/opkg/info/kmod-usbip.control
./usr/lib/opkg/info/kmod-usbip-server.prerm
./usr/lib/opkg/info/kmod-usbip-client.postinst
./usr/lib/opkg/info/kmod-usbip.list
./usr/lib/opkg/info/kmod-usbip-client.prerm
./usr/lib/opkg/info/kmod-usbip-server.list
./usr/lib/opkg/info/kmod-usbip-server.postinst
./usr/lib/opkg/info/kmod-usbip-client.control
./usr/lib/opkg/info/kmod-usbip.postinst
./usr/lib/opkg/info/kmod-usbip.prerm
./usr/lib/opkg/info/kmod-usbip-server.control
./usr/lib/opkg/info/kmod-usbip.postinst-pkg
./usr/lib/opkg/info/kmod-usbip-client.postinst-pkg
./usr/lib/opkg/info/kmod-usbip-client.list
I spend much time to figure out the solution. And in the end, doubt was correct. The installer ipk from release branch, as mentioned in query post, does not have user space binaries.
Solution: To get rid of it, I took complete source from official openwrt
- `git clone https://github.com/openwrt/openwrt`
- `make menuconfig`
- *Enabling from menuconfig*
- `networking->usbip` `networking->usbip-client` and `networking->usbip-server`
And after compiling I got two binaries in sbin
/usr/sbin/usbip
/usr/sbin/usbipd
Which was needed and I was looking for. It works perfectly now.

In a ScalaJs sbt build, is there any advantage to use webjars instead of npm or bower with 'Provided'?

When I first discovered webJars a few months ago I was super-skeptical that it would be be a viable way means of handling client-side dependencies given the enormous complexity of some of these builds/buildsystems, and given the frequency that js files are published. The second concern was of course not well-founded but I feel vindicated on the first after spending almost 36 hours now trying in vain to get about 10 scss/css/less-type webJars and 8 JS webJars to live under one jsDependencies roof.
What I found as that by the time you reach JS dependency 3, 4, or 5,you start getting into a ridiculous timekill loop:
1. "Oh nos! fastOptJS failed because there was some random file that was also named the same as a dependency in the webjar!"
[trace] Stack trace suppressed: run last client/compile:resolvedJSDependencies for the full output.
[error] (client/compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Ambiguous reference to a JS library: bootstrap.min.js
[error] Possible paths found on the classpath:
[error] - META-INF/resources/webjars/bootstrap/3.3.6/js/bootstrap.min.js
[error] - META-INF/resources/webjars/bootstrap3-dialog/1.34.4/examples/assets/bootstrap/js/bootstrap.min.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
[error] - Ambiguous reference to a JS library: bootstrap.js
[error] Possible paths found on the classpath:
[error] - META-INF/resources/webjars/bootstrap3-dialog/1.34.4/examples/assets/bootstrap/js/bootstrap.js
[error] - META-INF/resources/webjars/bootstrap/3.3.6/js/bootstrap.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
2. I know what to do! I'll add a version to the defined js!
lazy val webjarbs = "org.webjars" % "bootstrap" % version.bootstrap / s"${version.bootstrap}/bootstrap.js" minified s"${version.bootstrap}/bootstrap.min.js" dependsOn "jquery.js" commonJSName "bootstrap"
3. "Oh no! fastOptJS failed!"
[trace] Stack trace suppressed: run last client/compile:resolvedJSDependencies for the full output.
[error] (client/compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Missing JS library: 3.3.6/bootstrap.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
[error] - Missing JS library: 3.3.6/bootstrap.min.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
gg boys.
This goes over and over and around and around, and then I have to start doing
lazy val bs_sidebar = ( "org.webjars" % "bootstrap-sidebar" % version.bs_sidebar intransitive()) / "js/sidebar.js" dependsOn(s"bootstrap.js", s"bootstrap.min.js")
and now I'm not really even using the webjar, but it has a jsdependency named X and I cannot change that...
Question
Hmmm? What if I just did what I used to do but build the dependencies without the app into some gigantic file, or set of files, and then feed that into the build? I have a proof of concept from online and I got it work (I think it was https://github.com/wav/material-ui-scalajs-react/blob/master/src/main/scala/wav/web/muiwrapper/package.scala ) which almost worked, and gave me the idea.
I know npm works a lot better than sbt, and I can still get it into my package... what's the downside, and am I missing something about sbt?
I agree with you. Once an application starts having non-trivial dependencies on JavaScript libraries, jsDependencies does not scale. This is mostly because WebJars are missing critical features (just as transitive dependencies), but also because jsDependencies was not a mechanism designed to scale.
As time passed, users have asked for more and more features of jsDependencies, because they want to use it as their true app-scale (whatever that means) dependency mechanism. As a result, we've been patching more and more features/hacks on top of jsDependencies. The result is not the prettiest thing in the world, and it definitely has shortcomings.
I would actually encourage using npm to resolve your dependencies, especially if you are familiar with it and know how to integrate it into your workflow.
The principal advantage to using web jars, in my opinion, is not having to use npm. Plus, they go through the usual maven resolution / download process, so while it isn't perfect, it's only one pipeline of breakage instead of two.
Regardless, they can be painful. I've got about 30 dependencies in my scala.js app, and they are mostly managed with web jars. I have found that, in general, I get better results using npm webjars vs. bower webjars, and it is folly to attempt to rely on web jar transitive dependencies.
My jsDependencies tend to look like this:
("org.webjars" % "morrisjs" % "0.5.1" intransitive ())
/ "morris.js"
minified "morris.min.js"
dependsOn "2.1.2/raphael.js",
("org.webjars" % "raphaeljs" % "2.1.2-1" intransitive ())
/ "2.1.2/raphael.js"
minified "2.1.2/raphael-min.js"
The first thing to note is the version number mangled onto basically everything that ever gets depended on. If it gets used much, I extract the version out into a variable. The second thing is the intransitive() annotation. While I can sometimes get away without it, I find that being explicit keeps things working and my hair in place.
I tend to stick to front-end friendly packages like react and angular. Some of the new react libraries have dozens of transitive dependencies and attempting to use them would be painful. I avoid those =p

Loading Seaside 30 in Pharo 3 results in a MetacelloProjectSpecLoadError about ConfigurationOfOmniBrowser?

No version found for #stable of ConfigurationOfOmniBrowser?
Just downloaded Pharo 3 from here: http://files.pharo.org/platform/Pharo3.0-portable.zip
Opened an workspace and did this:
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfSeaside30';
load.
(Smalltalk at: #ConfigurationOfSeaside30) load.
I get this error:
Well... in Pharo, correct configuration is Seaside3... and it is not in MetacelloRepository since starting in Pharo3 we switched to a "per version" repo.
So, this code should do the work:
Gofer new
smalltalkhubUser: 'Pharo' project: 'MetaRepoForPharo30';
configurationOf: 'Seaside3';
loadStable.

Does Firefox disable plugins that failed to initialize?

I am trying to test a Mozilla plugin (developed using FireBreath) in the form of an .so shared object file. The plugin was developed on Ubuntu, where it works fine.
I am now trying it under OpenSUSE - so I first symlinked the .so file in ~/.mozilla/plugins:
> ln -s /path/to/npXXX.so ~/.mozilla/plugins/
... and then ran Firefox (7) from command line:
> /path/to/firefox -P myprofile
...
LoadPlugin: failed to initialize shared library libXext.so [libXext.so: cannot open shared object file: No such file or directory]
LoadPlugin: failed to initialize shared library /path/to/npXXX.so [/path/to/npXXX.so: undefined symbol: gtk_widget_get_mapped]
# and the LoadPlugin messages do NOT show a second time - probably because plugin is disabled (via about:addons).
And so I thought to try different stuff to look into this - but first, I restarted Firefox, and realized that on the second run I do not get the "LoadPlugin: failed to initialize" messages anymore! Then I tried removing the plugins symlink, and restarting FF; and adding it again, and restarting FF - still no error messages!
So, this tells me that probably Firefox somehow disabled/blacklisted the plugin (but which one: libXext, npXXX or both?) , but searching (grepping) for (np)XXX in '/path/to/myprofile/blocklist.xml' returns nothing (the plugin should use a email-like id, not those number GUIDs, so I'd expect that string to show in blocklist.xml if it's there).
Does anyone know: is the default behavior of Firefox to disable/blocklist plugins, that fail to load at first? If so, is there a way to force Firefox to load them again (and spit out error messages)? If you'd also have links to where this behavior is documented, it will be much appreciated :)
Many thanks in advance for any answers,
Cheers!
Note: after I stopped seeing the error messages, I did the following:
I am trying "about:plugins": "No enabled plugins found";
then trying "about:addons", and clicking under Plugins: "You don't have any add-ons of this type installed";
This plugin is not embedded in an extension, so nothing new should be added in "about:addons" under "Extensions" - and as expected, nothing new shows there. Under Ubuntu (where all works), just by symlinking the plugin to ~/.mozilla/plugins, the above two locations/screens start showing the plugin info.
This one of the things that puzzle me - if it just showed the plugin as "disabled", maybe I would have had a chance to re-enable it again (to get a new batch of error messages) - however, "about:plugins" and "about:addons" simply show nothing - so there's nothing I can use to enable from there. Which tells me Firefox has used a different method to disable the plugin(s) - but I cannot tell what it is...
Firefox has a cache for XPCOM modules ("fastload cache"), if a module fails to load Firefox won't try again. The cache is reset automatically if an extension is installed or if the application is updated. Starting with Firefox 4 you can also use -purgecaches command line flag to discard the cache.

Resources