@Override protected void onPrepareResults(OrienteerDataTable<ODocument, String> table, OClass oClass, IModel<DisplayMode> modeModel) { table.addCommand(new EditODocumentsCommand(table, modeModel, oClass)); table.addCommand(new SaveODocumentsCommand(table, modeModel)); } });
public OQueryModelResultsPanel(String id, OQueryModel<ODocument> queryModel) { super(id, queryModel); OClass oClass = queryModel.probeOClass(20); OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>(queryModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); List<? extends IColumn<ODocument, String>> columns = oClassIntrospector.getColumnsFor(oClass, true, modeModel); GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<ODocument>("tablePanel", columns, provider, 20); OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.addCommand(new EditODocumentsCommand(table, modeModel, oClass)); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new DeleteODocumentCommand(table, oClass)); table.addCommand(new ExportCommand<>(table, new ResourceModel("sql.results"))); add(tablePanel); }
table = tablePanel.getDataTable(); table.addCommand(new EditODocumentsCommand(table, getModeModel(), new OClassModel(OrienteerLocalizationModule.OCLASS_LOCALIZATION))); table.addCommand(new SaveOLocalizationsCommand(table, getModeModel())); table.setCaptionModel(new ResourceModel("class.localization"));
OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.addCommand(new CreateEdgeCommand(new ResourceModel("command.create"),table, getModel()).setBootstrapType(BootstrapType.PRIMARY)); table.addCommand(new EditODocumentsCommand(table, modeModel, commonParent)); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new DeleteEdgeCommand(table, getModel()));
table.addCommand(new EditODocumentsCommand(table, modeModel, linkedClass).add(securityBehaviour)); table.addCommand(new SaveODocumentsCommand(table, modeModel).add(securityBehaviour)); table.addCommand(new CopyODocumentCommand(table, linkedClass).add(securityBehaviour)); table.addCommand(new EditODocumentsCommand(table, modeModel, linkedClass).add(securityBehaviour)); table.addCommand(new SaveODocumentsCommand(table, modeModel).add(securityBehaviour));
@Override protected void onInitialize() { super.onInitialize(); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); String sql = "select expand(bothV()) from " + getModelObject().getIdentity(); OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>(sql); OClass commonParent = provider.probeOClass(20); GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<>("vertices", createColumns(commonParent, modeModel), provider, //setParameter does not work here 2 ); OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.addCommand(new EditODocumentsCommand(table, modeModel, commonParent)); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new ExportCommand<>(table, new StringResourceModel("export.filename.vertices", new ODocumentNameModel(getModel())))); add(tablePanel); add(DisableIfDocumentNotSavedBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
@SuppressWarnings("unchecked") public AbstractCalculatedDocumentsWidget(String id, IModel<T> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); final String sql = getSql(); GenericTablePanel<ODocument> tablePanel; if(!Strings.isEmpty(sql)) { OQueryDataProvider<ODocument> provider = newDataProvider(sql); OClass expectedClass = getExpectedClass(provider); if(expectedClass!=null) { oClassIntrospector.defineDefaultSorting(provider, expectedClass); List<? extends IColumn<ODocument, String>> columns = oClassIntrospector.getColumnsFor(expectedClass, true, modeModel); tablePanel = new GenericTablePanel<>("tablePanel", columns, provider, 20); OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.addCommand(new EditODocumentsCommand(table, modeModel, expectedClass)); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new DeleteODocumentCommand(table, expectedClass)); table.addCommand(new ExportCommand<>(table, getTitleModel())); } else { tablePanel = new GenericTablePanel<>("tablePanel", new ResourceModel("error.class.not.defined")); } } else { tablePanel = new GenericTablePanel<>("tablePanel", new ResourceModel("error.query.not.defined")); } add(tablePanel); }
public GraphNeighborsWidget(String id, IModel<ODocument> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); OQueryDataProvider<ODocument> provider = new OQueryDataProvider<ODocument>("select expand(both().asSet()) from "+getModelObject().getIdentity()); OClass commonParent = provider.probeOClass(20); if(commonParent==null) commonParent = getSchema().getClass("V"); List<IColumn<ODocument, String>> columns = oClassIntrospector.getColumnsFor(commonParent, true, modeModel); GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<ODocument>("neighbors", columns, provider, 20); OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.addCommand(new CreateVertexCommand(table, getModel())); table.addCommand(new CreateEdgeCommand(table, getModel())); table.addCommand(new UnlinkVertexCommand(table, getModel())); table.addCommand(new DeleteVertexCommand(table, getModel())); table.addCommand(new EditODocumentsCommand(table, modeModel, commonParent)); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new ExportCommand<>(table, new StringResourceModel("export.filename.neighbors", new ODocumentNameModel(model)))); add(tablePanel); add(DisableIfDocumentNotSavedBehavior.INSTANCE,UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
public ListAllODocumentsWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); String className = getModelObject().getName(); String sql = "select from " + className; OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>(sql); oClassIntrospector.defineDefaultSorting(provider, getModelObject()); GenericTablePanel<ODocument> tablePanel = new GenericTablePanel<>("tablePanel", oClassIntrospector.getColumnsFor(getModelObject(), true, modeModel), provider, 20); final OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); table.getCommandsToolbar().setDefaultModel(getModel()); table.addCommand(new CreateODocumentCommand(table, getModel())); table.addCommand(new EditODocumentsCommand(table, modeModel, getModel())); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new CopyODocumentCommand(table, getModel())); table.addCommand(new DeleteODocumentCommand(table, getModel())); table.addCommand(new ExportCommand<>(table, new PropertyModel<String>(model, "name"))); add(tablePanel); add(UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); addCommand(new BookmarkablePageLinkCommand<OClass>(newCommandId(), "command.gotoClass", OClassPage.class) { @Override public PageParameters getPageParameters() { return OClassPage.preparePageParameters(ListAllODocumentsWidget.this.getModelObject(), DisplayMode.VIEW); } }); }