MCPcopy Index your code
hub / github.com/OrienteerBAP/wicket-orientdb

github.com/OrienteerBAP/wicket-orientdb @v1.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5 ↗ · + Follow
1,083 symbols 3,568 edges 166 files 290 documented · 27% updated 2y agov1.5 · 2020-11-18★ 3311 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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();

Extension points exported contracts — how you extend this code

IResourceCheckingStrategy (Interface)
Interface for checking access rights for a resource [3 implementers]
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/IResourceCheckingStrategy.java
IOrientDbSettings (Interface)
OrientDB setting to be used in Wicket-OrientDB application [2 implementers]
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/IOrientDbSettings.java
IHookPosition (Interface)
support returning hook position in queue of executing [2 implementers]
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/components/IHookPosition.java
ISecuredComponent (Interface)
Interface for marking components dynamically secured [2 implementers]
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/ISecuredComponent.java
IQueryManager (Interface)
Interface for different implementation of query managers [2 implementers]
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/query/IQueryManager.java

Core symbols most depended-on inside this repo

field
called by 198
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java
getObject
called by 106
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/model/NvlModel.java
size
called by 105
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/model/OQueryModel.java
get
called by 88
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/OrientDbWebSession.java
getName
called by 88
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/query/filter/IFilterCriteria.java
of
called by 85
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/converter/SerializableConverter.java
equals
called by 66
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/model/OIndexModel.java
getName
called by 54
wicket-orientdb/src/test/java/ru/ydn/wicket/wicketorientdb/proto/IMyBean.java

Shape

Method 922
Class 147
Interface 12
Enum 2

Languages

Java100%

Modules by API surface

wicket-orientdb/src/test/java/ru/ydn/wicket/wicketorientdb/orientdb/TestInAppOrientDBCompatibility.java34 symbols
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java31 symbols
wicket-orientdb/src/test/java/ru/ydn/wicket/wicketorientdb/junit/WicketOrientDbTester.java30 symbols
wicket-orientdb/src/test/java/ru/ydn/wicket/wicketorientdb/filter/TestFilters.java30 symbols
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/OrientDbWebApplication.java27 symbols
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/model/OQueryModel.java25 symbols
wicket-orientdb/src/test/java/ru/ydn/wicket/wicketorientdb/TestModels.java23 symbols
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/query/filter/FilterCriteriaManager.java22 symbols
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/query/filter/IFilterCriteriaManager.java21 symbols
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/proto/AbstractPrototyper.java20 symbols
wicket-orientdb/src/test/java/ru/ydn/wicket/wicketorientdb/filter/WicketOrientDbFilterTesterScope.java19 symbols
wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/security/OSecurityHelper.java19 symbols

For agents

$ claude mcp add wicket-orientdb \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact