wicket-orientdb

Wicket library for OrientDB

License

License

Categories

Categories

Wicket User Interface Web Frameworks
GroupId

GroupId

ru.ydn.wicket.wicket-orientdb
ArtifactId

ArtifactId

wicket-orientdb
Last Version

Last Version

1.5
Release Date

Release Date

Type

Type

jar
Description

Description

wicket-orientdb
Wicket library for OrientDB

Download wicket-orientdb

How to add to project

<!-- https://jarcasting.com/artifacts/ru.ydn.wicket.wicket-orientdb/wicket-orientdb/ -->
<dependency>
    <groupId>ru.ydn.wicket.wicket-orientdb</groupId>
    <artifactId>wicket-orientdb</artifactId>
    <version>1.5</version>
</dependency>
// https://jarcasting.com/artifacts/ru.ydn.wicket.wicket-orientdb/wicket-orientdb/
implementation 'ru.ydn.wicket.wicket-orientdb:wicket-orientdb:1.5'
// https://jarcasting.com/artifacts/ru.ydn.wicket.wicket-orientdb/wicket-orientdb/
implementation ("ru.ydn.wicket.wicket-orientdb:wicket-orientdb:1.5")
'ru.ydn.wicket.wicket-orientdb:wicket-orientdb:jar:1.5'
<dependency org="ru.ydn.wicket.wicket-orientdb" name="wicket-orientdb" rev="1.5">
  <artifact name="wicket-orientdb" type="jar" />
</dependency>
@Grapes(
@Grab(group='ru.ydn.wicket.wicket-orientdb', module='wicket-orientdb', version='1.5')
)
libraryDependencies += "ru.ydn.wicket.wicket-orientdb" % "wicket-orientdb" % "1.5"
[ru.ydn.wicket.wicket-orientdb/wicket-orientdb "1.5"]

Dependencies

compile (6)

Group / Artifact Type Version
org.apache.wicket : wicket-core jar 8.10.0
org.apache.wicket : wicket-extensions jar 8.10.0
org.apache.wicket : wicket-auth-roles jar 8.10.0
com.orientechnologies : orientdb-core jar 2.2.37
com.orientechnologies : orientdb-server jar 2.2.37
com.google.guava : guava jar 24.1.1-jre

provided (1)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.0.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.13.1

Project Modules

There are no modules declared in this project.

Build Status Coverage Status

wicket-orientdb

Everything you need to work with Apache Wicket and OrientDB. Library contains several functional part which can be used separatly or all together.

Looking for examples? Orienteer - Business Application Platform

Initial setup of application

You should inherit WebApplication class from OrientDbWebApplication to use OrientDB and its authentication with in your application.

public class WicketApplication extends OrientDbWebApplication

Specify connection properties

		getOrientDbSettings().setDBUrl("local:localhost/"+DB_NAME);
		getOrientDbSettings().setAdminUserName("admin");
		getOrientDbSettings().setAdminUserPassword("admin");

Embedded OrientDB Server

If you need to run OrientDB in embedded mode please use EmbeddOrientDbApplicationListener

public class WicketApplication extends OrientDbWebApplication
{
@Override
	public void init()
	{
		super.init();
		getApplicationListeners().add(new EmbeddOrientDbApplicationListener(WicketApplication.class.getResource("db.config.xml"))
		{

			@Override
			public void onAfterServerStartupAndActivation() throws Exception {
				OServerAdmin serverAdmin = new OServerAdmin("localhost/"+DB_NAME).connect("root", "WicketOrientDB");
				if(!serverAdmin.existsDatabase())
			    serverAdmin.createDatabase(DB_NAME, "graph", "local");
			    
			}
			
		});
		getOrientDbSettings().setDBUrl("local:localhost/"+DB_NAME);
		getOrientDbSettings().setAdminUserName("admin");
		getOrientDbSettings().setAdminUserPassword("admin");
	}
}

PropertyModel

To gain access to Orient DB document from your application please use ODocumentPropertyModel instead of common PropertyModel. Important! Following issue have been created to introduce support of custom properties models into wicket: https://issues.apache.org/jira/browse/WICKET-5623 If you interested in using PropertyModel as usual in wicket, please, take a look to following pull request: https://github.com/apache/wicket/pull/74

Security

It's easy to integrate with OrientDB security stuff: You can either specify static required orientDB resources

@RequiredOrientResource(value=ORule.ResourceGeneric.CLASS, specific="ORole", permissions={OrientPermission.READ, OrientPermission.UPDATE})
public class MyPage extends WebPage {
...
@RequiredOrientResources({
	@RequiredOrientResource(value = OSecurityHelper.SCHEMA, permissions=OrientPermission.READ),
	@RequiredOrientResource(value = OSecurityHelper.CLASS, permissions=OrientPermission.READ),
})
public class MyPanel extends Panel {
...

or provide them dynamically: just implement ISecuredComponent

public class SaveSchemaCommand<T> extends SavePrototypeCommand<T> implements ISecuredComponent {
...
	@Override
	public RequiredOrientResource[] getRequiredResources() {
		T object = objectModel.getObject();
		OrientPermission permission = (object instanceof IPrototype<?>)?OrientPermission.CREATE:OrientPermission.UPDATE;
		return OSecurityHelper.requireResource(OSecurityHelper.SCHEMA, null, permission);
	}

OrientDB objects prototypes

Sometimes it's useful to work with object without actual creation of that object. Examples: OClass, OProperty, OIndex - all this objects require pre-creation in DB. Prototyping microframeworks allows creation of 'Prototype' of some objects, modify it and only after that 'realize' it in real environment.

Usage:

OClass oClass = OClassPrototyper.newPrototype();
oClass.setName("MyClass");
oClass.setSuperClass(superClass);
OClass realOClass = ((IPrototype<OClass>)oClass).realizePrototype();
ru.ydn.wicket.wicket-orientdb

Orienteer

Open Source Business Application Platform

Versions

Version
1.5
1.4
1.3
1.2
1.1
1.0