Lawrence  Lesch

Lawrence Lesch

1676317440

Webview_deno: Deno Bindings for Webview

Webview_deno

deno bindings for webview

Webview is a tiny cross-platform library to make web-based GUIs for desktop applications.


⚠️ This project is still in development. Expect breaking changes.


Example Image

Example

import { Webview } from "https://deno.land/x/webview/mod.ts";

const html = `
  <html>
  <body>
    <h1>Hello from deno v${Deno.version.deno}</h1>
  </body>
  </html>
`;

const webview = new Webview();

webview.navigate(`data:text/html,${encodeURIComponent(html)}`);
webview.run();

You can run this example directly from the web:

deno run -Ar --unstable https://deno.land/x/webview/examples/local.ts

or in your development environment:

deno run -Ar --unstable examples/local.ts

you can find other examples in the examples/ directory.

Documentation

You can find the official documentation here.

Development

Prerequisites

Linux

  • webkit2gtk (to install using apt: sudo apt-get install libwebkit2gtk-4.0-dev)

Building

Make sure to init the webview submodule with:

$ git submodule update --init --recursive

Building on Windows requires admin privileges.

$ deno task build

Running

To run webview_deno without automatically downloading the binaries from releases you will need to use the environment variable PLUGIN_URL and set it to the path where the built binaries are located. This is usually file://./target/release.

$ deno task build
$ PLUGIN_URL=./build/
$ deno run --unstable -A examples/local.ts

or

$ deno task run examples/local.ts

or if you have the webview library already built and didn't make any changes to it, you can skip the building step with:

$ deno task run:fast examples/local.ts

Environment variables

  • PLUGIN_URL - Set a custom library URL. Defaults to the latest release assets on Github. Setting this also disables cache for plug.

Dependencies

Other

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno task fmt, linted with deno task lint and commit messages are done following Conventional Commits spec.

Download Details:

Author: Webview
Source Code: https://github.com/webview/webview_deno 
License: MIT license

#typescript #gui #webview #hacktoberfest #deno 

What is GEEK

Buddha Community

Webview_deno: Deno Bindings for Webview
Lawrence  Lesch

Lawrence Lesch

1676317440

Webview_deno: Deno Bindings for Webview

Webview_deno

deno bindings for webview

Webview is a tiny cross-platform library to make web-based GUIs for desktop applications.


⚠️ This project is still in development. Expect breaking changes.


Example Image

Example

import { Webview } from "https://deno.land/x/webview/mod.ts";

const html = `
  <html>
  <body>
    <h1>Hello from deno v${Deno.version.deno}</h1>
  </body>
  </html>
`;

const webview = new Webview();

webview.navigate(`data:text/html,${encodeURIComponent(html)}`);
webview.run();

You can run this example directly from the web:

deno run -Ar --unstable https://deno.land/x/webview/examples/local.ts

or in your development environment:

deno run -Ar --unstable examples/local.ts

you can find other examples in the examples/ directory.

Documentation

You can find the official documentation here.

Development

Prerequisites

Linux

  • webkit2gtk (to install using apt: sudo apt-get install libwebkit2gtk-4.0-dev)

Building

Make sure to init the webview submodule with:

$ git submodule update --init --recursive

Building on Windows requires admin privileges.

$ deno task build

Running

To run webview_deno without automatically downloading the binaries from releases you will need to use the environment variable PLUGIN_URL and set it to the path where the built binaries are located. This is usually file://./target/release.

$ deno task build
$ PLUGIN_URL=./build/
$ deno run --unstable -A examples/local.ts

or

$ deno task run examples/local.ts

or if you have the webview library already built and didn't make any changes to it, you can skip the building step with:

$ deno task run:fast examples/local.ts

Environment variables

  • PLUGIN_URL - Set a custom library URL. Defaults to the latest release assets on Github. Setting this also disables cache for plug.

Dependencies

Other

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno task fmt, linted with deno task lint and commit messages are done following Conventional Commits spec.

Download Details:

Author: Webview
Source Code: https://github.com/webview/webview_deno 
License: MIT license

#typescript #gui #webview #hacktoberfest #deno 

Apache Cayenne | Mirror Of Apache Cayenne Written in Java

Apache Cayenne

Apache Cayenne is an open source persistence framework licensed under the Apache License, providing object-relational mapping (ORM) and remoting services.

Quick Start

Create XML mapping

Modeler GUI application

You can use Cayenne Modeler to manually create Cayenne project without DB. Binary distributions can be downloaded from https://cayenne.apache.org/download/

Modeler

See tutorial https://cayenne.apache.org/docs/4.2/getting-started-guide/

Maven plugin

Additionally, you can use Cayenne Maven (or Gradle) plugin to create model based on existing DB structure. Here is example of Cayenne Maven plugin setup that will do it:

<plugin>
    <groupId>org.apache.cayenne.plugins</groupId>
    <artifactId>cayenne-maven-plugin</artifactId>
    <version>4.2.RC1</version>

    <dependencies>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.29</version>
        </dependency>
    </dependencies>

    <configuration>
        <map>${project.basedir}/src/main/resources/demo.map.xml</map>
        <cayenneProject>${project.basedir}/src/main/resources/cayenne-demo.xml</cayenneProject>
        <dataSource>
            <url>jdbc:mysql://localhost:3306/cayenne_demo</url>
            <driver>com.mysql.cj.jdbc.Driver</driver>
            <username>user</username>
            <password>password</password>
        </dataSource>
        <dbImport>
            <defaultPackage>org.apache.cayenne.demo.model</defaultPackage>
        </dbImport>
    </configuration>
</plugin>

Run it:

mvn cayenne:cdbimport
mvn cayenne:cgen

See tutorial https://cayenne.apache.org/docs/4.2/getting-started-db-first/

Gradle plugin

And here is example of Cayenne Gradle plugin setup:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath group: 'org.apache.cayenne.plugins', name: 'cayenne-gradle-plugin', version: '4.2.RC1'
        classpath 'mysql:mysql-connector-java:8.0.29'
    }
}

apply plugin: 'org.apache.cayenne'
cayenne.defaultDataMap 'demo.map.xml'

cdbimport {   
    cayenneProject 'cayenne-demo.xml'

    dataSource {
        driver 'com.mysql.cj.jdbc.Driver'
        url 'jdbc:mysql://127.0.0.1:3306/cayenne_demo'
        username 'user'
        password 'password'
    }

    dbImport {
        defaultPackage = 'org.apache.cayenne.demo.model'
    }
}

cgen.dependsOn cdbimport
compileJava.dependsOn cgen

Run it:

gradlew build

Include Cayenne into project

Maven

<dependencies>
    <dependency>
        <groupId>org.apache.cayenne</groupId>
        <artifactId>cayenne-server</artifactId>
        <version>4.2.RC1</version>
    </dependency>
</dependencies>

Gradle

compile group: 'org.apache.cayenne', name: 'cayenne-server', version: '4.2.RC1'
 
// or, if Gradle plugin is used
compile cayenne.dependency('server')

Create Cayenne Runtime

ServerRuntime cayenneRuntime = ServerRuntime.builder()
    .addConfig("cayenne-demo.xml")
    .dataSource(DataSourceBuilder
             .url("jdbc:mysql://localhost:3306/cayenne_demo")
             .driver("com.mysql.cj.jdbc.Driver")
             .userName("username")
             .password("password")
             .build())
    .build();

Create New Objects

ObjectContext context = cayenneRuntime.newContext();

Artist picasso = context.newObject(Artist.class);
picasso.setName("Pablo Picasso");
picasso.setDateOfBirth(LocalDate.of(1881, 10, 25));

Gallery metropolitan = context.newObject(Gallery.class);
metropolitan.setName("Metropolitan Museum of Art");

Painting girl = context.newObject(Painting.class);
girl.setName("Girl Reading at a Table");

Painting stein = context.newObject(Painting.class);
stein.setName("Gertrude Stein");

picasso.addToPaintings(girl);
picasso.addToPaintings(stein);

girl.setGallery(metropolitan);
stein.setGallery(metropolitan);

context.commitChanges();

Queries

Select Objects

List<Painting> paintings = ObjectSelect.query(Painting.class)
        .where(Painting.ARTIST.dot(Artist.DATE_OF_BIRTH).year().lt(1900))
        .prefetch(Painting.ARTIST.joint())
        .select(context);

Aggregate functions

// this is artificial property signaling that we want to get full object
Property<Artist> artistProperty = Property.createSelf(Artist.class);

List<Object[]> artistAndPaintingCount = ObjectSelect.columnQuery(Artist.class, artistProperty, Artist.PAINTING_ARRAY.count())
    .where(Artist.ARTIST_NAME.like("a%"))
    .having(Artist.PAINTING_ARRAY.count().lt(5L))
    .orderBy(Artist.PAINTING_ARRAY.count().desc(), Artist.ARTIST_NAME.asc())
    .select(context);

for(Object[] next : artistAndPaintingCount) {
    Artist artist = (Artist)next[0];
    long paintingsCount = (Long)next[1];
    System.out.println(artist.getArtistName() + " has " + paintingsCount + " painting(s)");
}

Raw SQL queries

// Selecting objects
List<Painting> paintings = SQLSelect
    .query(Painting.class, "SELECT * FROM PAINTING WHERE PAINTING_TITLE LIKE #bind($title)")
    .params("title", "painting%")
    .upperColumnNames()
    .localCache()
    .limit(100)
    .select(context);

// Selecting scalar values
List<String> paintingNames = SQLSelect
    .scalarQuery(String.class, "SELECT PAINTING_TITLE FROM PAINTING WHERE ESTIMATED_PRICE > #bind($price)")
    .params("price", 100000)
    .select(context);

// Insert values
int inserted = SQLExec
    .query("INSERT INTO ARTIST (ARTIST_ID, ARTIST_NAME) VALUES (#bind($id), #bind($name))")
    .paramsArray(55, "Picasso")
    .update(context);

Documentation

Getting Started

https://cayenne.apache.org/docs/4.2/getting-started-guide/

Getting Started Db-First

https://cayenne.apache.org/docs/4.2/getting-started-db-first/

Full documentation

https://cayenne.apache.org/docs/4.2/cayenne-guide/

JavaDoc

https://cayenne.apache.org/docs/4.2/api/

About

With a wealth of unique and powerful features, Cayenne can address a wide range of persistence needs. Cayenne seamlessly binds one or more database schemas directly to Java objects, managing atomic commit and rollbacks, SQL generation, joins, sequences, and more.

Cayenne is designed to be easy to use, without sacrificing flexibility or design. To that end, Cayenne supports database reverse engineering and generation, as well as a Velocity-based class generation engine. All of these functions can be controlled directly through the CayenneModeler, a fully functional GUI tool. No cryptic XML or annotation based configuration is required! An entire database schema can be mapped directly to Java objects within minutes, all from the comfort of the GUI-based CayenneModeler.

Cayenne supports numerous other features, including caching, a complete object query syntax, relationship pre-fetching, on-demand object and relationship faulting, object inheritance, database auto-detection, and generic persisted objects. Most importantly, Cayenne can scale up or down to virtually any project size. With a mature, 100% open source framework, an energetic user community, and a track record of solid performance in high-volume environments, Cayenne is an exceptional choice for persistence services.

Collaboration

Download Details:
Author: apache
Source Code: https://github.com/apache/cayenne
License:

#java

Darren  Watsica

Darren Watsica

1597913858

Should You Learn Deno Js ? The Deno Js Intro By DESI PROGRAMMER

Hey youtube, This is Prince and welcome back to another exciting video and in this video we are going to explore a bit of Deno JS !

Comparison : 1:39
Installation : 3:39

#deno #deno js

Oda  Shields

Oda Shields

1625635048

Android WebView Tutorial With Kotlin In Android Studio

Subscribe for more: https://www.youtube.com/channel/UChCgMnyGKOgEGDvubbjjr6A

Thanks for watching, leave a like, leave a comment…
Don’t forget to subscribe to the channels and click on the bell to activate notifications!

Github ----- https://github.com/IsaiasCuvula
Website ----- https://www.bersyte.com/
Twitter ----- https://twitter.com/ICuvula
Instagram ----- https://www.instagram.com/isaias_cuvula/
My App ---- https://play.google.com/store/apps/details?id=com.bersyte.berlist

#Bersyte #WebView #AndroidDev

#webview #kotlin #android studio #webview

Idris Brhane

Idris Brhane

1595629620

Deno bindings for webview, a tiny library for creating web-based desktop GUIs

webview_deno

deno bindings for webview using the webview_rust. Webview is a tiny cross-platform library to render web-based GUIs for desktop applications.

⚠️ This project is still in an early stage of development. Expect breaking changes.

Example Image

Example

import { WebView } from "https://deno.land/x/webview/mod.ts";

const html = `
  <html>
  <body>
    <h1>Hello from deno</h1>
  </body>
  </html>
`;

await new WebView({
  title: "Local webview_deno example",
  url: `data:text/html,${encodeURIComponent(html)}`,
  height: 600,
  resizable: true,
  debug: true,
  frameless: false,
}).run();

you can run this example directly from the web:

$ deno run -A -r --unstable https://deno.land/x/webview/examples/local.ts

or in your development environment:

$ deno run -A -r --unstable app.ts

you can find other examples in the [example/](https://github.com/webview/webview_deno/blob/master/examples) directory.

Documentation

You can find the official documentation here.

Development

Prerequisites

For building webview_deno the same prerequisites as for building deno is required.

Linux dependencies

  • webkit2gtk (to install using apt: sudo apt-get install libwebkit2gtk-4.0-dev)

Building

Building webview_deno can take a nontrivial amount of time depending on your operating system. After the first build most files will be cached so building time will be reduced. Building on Windows requires admin privileges.

For a default build you can use the provided script:

deno run -A scripts/build.ts

which internally runs:

optionally you can use mshtml:

deno run -A scripts/build.ts mshtml

Running

To run webview_deno without automatically downloading the binaries from releases you will need to use the environment variable WEBVIEW_DENO_PLUGIN and set it to the path where the built binaries are located. This is usually file://./target/release. The process of running and using local binaries can be easier to using the dev script:

deno -A scripts/dev.ts [example.ts]

Environment variables

  • WEBVIEW_DENO_PLUGIN - The URL of the plugin
  • Due to MSHTML (ie) no longer being enabled by default, the only way to enable it is to set the WEBVIEW_DENO_PLUGIN variable to the path of a binary build built with the --no-default-features flag or using deno -A scripts/build.ts mshtml
  • WEBVIEW_DENO_PLUGIN_BASE - The URL of the plugin except the last part. Ignored if WEBVIEW_DENO_PLUGIN is set.
  • When developing locally WEBVIEW_DENO_PLUGIN_BASE should be set to the directory containing the plugin binary, usually file://./target/release. Otherwise, don’t set this.
  • WEBVIEW_DENO_DEBUG - Disable cache and enable logs for plug. Used for debugging.

Dependencies

Deno

Rust

Other

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with denon fmt (which internally runs deno fmt and cargo fmt) and commit messages are done following Conventional Commits spec.

Download Details:

Author: webview

Live Demo: https://deno.land/x/webview

GitHub: https://github.com/webview/webview_deno

#deno #javascript #nodejs #node-js