@Override protected void onPrepareResults(OrienteerDataTable<ODocument, String> table, OClass oClass, IModel<DisplayMode> modeModel) { table.addCommand(createSelectCommand(table)); if (isMultiValue) { table.addCommand(createSelectAndSearchCommand(table, this)); } }
private void addCommands(OrienteerDataTable<OClass, String> table) { table.addCommand(createAddClassesCommand(table)); table.addCommand(createCancelCommand(table)); }
@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)); } });
@Override protected void addTableCommands(OrienteerDataTable<OClass, String> table, IModel<DisplayMode> modeModel) { table.addCommand(new CreateOClassCommand(table)); table.addCommand(new EditSchemaCommand<>(table, modeModel)); table.addCommand(new SaveSchemaCommand<>(table, modeModel)); table.addCommand(new DeleteOClassCommand(table)); table.addCommand(new ReloadOMetadataCommand(table)); table.addCommand(new TriggerCommand<>("command.showhide.allclasses", table, showAllClassesModel)); table.addCommand(new ExportOSchemaCommand(table)); table.addCommand(new ImportOSchemaCommand(table)); table.addCommand(new ViewUMLCommand(table)); }
private void addTableCommands(OrienteerDataTable<OCluster, String> table, IModel<DisplayMode> modeModel) { table.addCommand(new EditSchemaCommand<OCluster>(table, modeModel)); table.addCommand(new SaveSchemaCommand<OCluster>(table, modeModel)); }
@Override protected void addTableCommands(OrienteerDataTable<OClass, String> table, IModel<DisplayMode> modeModel) { table.addCommand(new CreateOClassCommand(table, getModel())); table.addCommand(new EditSchemaCommand<OClass>(table, modeModel)); table.addCommand(new SaveSchemaCommand<OClass>(table, modeModel)); table.addCommand(new DeleteOClassCommand(table)); }
public OClassIndexesWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); iTable.addCommand(new ShowHideParentsCommand<OIndex<?>>(getModel(), iTable, showParentIndexesModel)); }
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); }
protected AbstractIndexesWidget(String id, IModel<T> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> indexesDisplayMode = getModeModel(); List<IColumn<OIndex<?>, String>> iColumns = new ArrayList<IColumn<OIndex<?>,String>>(); iColumns.add(new CheckBoxColumn<OIndex<?>, String, String>(OIndexNameConverter.INSTANCE)); iColumns.add(new OIndexDefinitionColumn(OIndexPrototyper.NAME, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.TYPE, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.DEF_FIELDS, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.DEF_COLLATE, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.DEF_NULLS_IGNORED, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.SIZE, indexesDisplayMode)); iColumns.add(new OIndexMetaColumn(OIndexPrototyper.KEY_SIZE, indexesDisplayMode)); OIndexesDataProvider iProvider = getIndexDataProvider(); iProvider.setSort("name", SortOrder.ASCENDING); GenericTablePanel<OIndex<?>> tablePanel = new GenericTablePanel<OIndex<?>>("tablePanel", iColumns, iProvider ,20); iTable = tablePanel.getDataTable(); iTable.addCommand(new EditSchemaCommand<OIndex<?>>(iTable, indexesDisplayMode)); iTable.addCommand(new SaveSchemaCommand<OIndex<?>>(iTable, indexesDisplayMode)); iTable.addCommand(new DeleteOIndexCommand(iTable)); iTable.setCaptionModel(new ResourceModel("class.indexes")); add(tablePanel); add(DisableIfPrototypeBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
GenericTablePanel<OProperty> tablePanel = new GenericTablePanel<OProperty>("tablePanel", pColumns, pProvider ,20); OrienteerDataTable<OProperty, String> pTable = tablePanel.getDataTable(); pTable.addCommand(new CreateOPropertyCommand(pTable, getModel())); pTable.addCommand(new EditSchemaCommand<OProperty>(pTable, propertiesDisplayMode)); pTable.addCommand(new SaveSchemaCommand<OProperty>(pTable, propertiesDisplayMode)); pTable.addCommand(new ShowHideParentsCommand<OProperty>(getModel(), pTable, showParentPropertiesModel)); pTable.addCommand(new DeleteOPropertyCommand(pTable)); pTable.addCommand(new CreateOIndexFromOPropertiesCommand(pTable, getModel())); pTable.setCaptionModel(new ResourceModel("class.properties")); add(tablePanel);
if(!isStructureReadonly) table.addCommand(new CreateODocumentCommand(table, documentModel, propertyModel).add(securityBehaviour)); 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 DeleteODocumentCommand(table, linkedClass).add(securityBehaviour)); table.addCommand(new SelectODocumentCommand(table, documentModel, propertyModel).add(securityBehaviour)); table.addCommand(new ReleaseODocumentCommand(table, documentModel, propertyModel).add(securityBehaviour)); table.addCommand(new EditODocumentsCommand(table, modeModel, linkedClass).add(securityBehaviour)); table.addCommand(new SaveODocumentsCommand(table, modeModel).add(securityBehaviour)); table.addCommand(new ExportCommand<>(table, new LoadableDetachableModel<String>() { @Override protected String load() {
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 OrienteerCloudOModulesConfigurationsPanel(String id, final OArtifactsModalWindowPage windowPage, ISortableDataProvider<OArtifact, String> provider) { super(id); setOutputMarkupPlaceholderTag(true); Form orienteerModulesForm = new Form("orienteerCloudOModulesConfigsForm"); Label feedback = new Label("feedback"); feedback.setVisible(false); feedback.setOutputMarkupPlaceholderTag(true); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); List<IColumn<OArtifact, String>> columns = getColumns(modeModel); OrienteerDataTable<OArtifact, String> table = new OrienteerDataTable<>("availableModules", columns, provider, 10); table.addCommand(new AjaxCommand<OArtifact>(new ResourceModel(BACK_BUT), table) { @Override public void onClick(Optional<AjaxRequestTarget> targetOptional) { windowPage.showOrienteerModulesPanel(false); targetOptional.ifPresent(target->target.add(windowPage)); } @Override protected void onInstantiation() { super.onInstantiation(); setIcon(FAIconType.angle_left); setBootstrapType(BootstrapType.PRIMARY); setAutoNotify(false); } }); table.addCommand(new InstallOModuleCommand(table, windowPage, false, feedback)); table.addCommand(new InstallOModuleCommand(table, windowPage,true, feedback)); orienteerModulesForm.add(table); orienteerModulesForm.add(feedback); add(orienteerModulesForm); }
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); } }); }
new GenericTablePanel<ODocument>("edges", columns, vertexEdgesDataProvider, 20); 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 ExportCommand<>(table, new StringResourceModel("export.filename.edges", new ODocumentNameModel(model))));
@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); }
@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); }
public OClassSecurityWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); List<IColumn<ORole, String>> sColumns = new ArrayList<IColumn<ORole,String>>(); OClass oRoleClass = OrientDbWebSession.get().getDatabase().getMetadata().getSchema().getClass("ORole"); sColumns.add(new AbstractColumn<ORole, String>(new OClassNamingModel(oRoleClass), "name") { @Override public void populateItem(Item<ICellPopulator<ORole>> cellItem, String componentId, IModel<ORole> rowModel) { cellItem.add(new LinkViewPanel(componentId, new PropertyModel<ODocument>(rowModel, "document"))); } }); sColumns.add(new SecurityRightsColumn(OrientPermission.EXECUTE)); sColumns.add(new SecurityRightsColumn(OrientPermission.CREATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.READ)); sColumns.add(new SecurityRightsColumn(OrientPermission.UPDATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.DELETE)); OQueryDataProvider<ORole> sProvider = new OQueryDataProvider<ORole>("select from ORole", ORole.class); sProvider.setSort("name", SortOrder.ASCENDING); GenericTablePanel<ORole> tablePanel = new GenericTablePanel<ORole>("tablePanel", sColumns, sProvider ,20); OSecurityHelper.secureComponent(tablePanel, OSecurityHelper.requireOClass("ORole", Component.ENABLE, OrientPermission.UPDATE)); OrienteerDataTable<ORole, String> sTable = tablePanel.getDataTable(); Command<ORole> saveCommand = new AbstractSaveCommand<ORole>(sTable, null); sTable.addCommand(saveCommand); sTable.setCaptionModel(new ResourceModel("class.security")); add(tablePanel); add(DisableIfPrototypeBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
public OClusterSecurityWidget(String id, IModel<OCluster> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); List<IColumn<ORole, String>> sColumns = new ArrayList<IColumn<ORole,String>>(); OClass oRoleClass = OrientDbWebSession.get().getDatabase().getMetadata().getSchema().getClass("ORole"); sColumns.add(new AbstractColumn<ORole, String>(new OClassNamingModel(oRoleClass), "name") { @Override public void populateItem(Item<ICellPopulator<ORole>> cellItem, String componentId, IModel<ORole> rowModel) { cellItem.add(new LinkViewPanel(componentId, new PropertyModel<ODocument>(rowModel, "document"))); } }); sColumns.add(new SecurityRightsColumn(OrientPermission.CREATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.READ)); sColumns.add(new SecurityRightsColumn(OrientPermission.UPDATE)); sColumns.add(new SecurityRightsColumn(OrientPermission.DELETE)); OQueryDataProvider<ORole> sProvider = new OQueryDataProvider<ORole>("select from ORole", ORole.class); sProvider.setSort("name", SortOrder.ASCENDING); GenericTablePanel<ORole> tablePanel = new GenericTablePanel<ORole>("tablePanel", sColumns, sProvider ,20); OSecurityHelper.secureComponent(tablePanel, OSecurityHelper.requireOClass("ORole", Component.ENABLE, OrientPermission.UPDATE)); OrienteerDataTable<ORole, String> sTable = tablePanel.getDataTable(); Command<ORole> saveCommand = new AbstractSaveCommand<ORole>(sTable, null); sTable.addCommand(saveCommand); sTable.setCaptionModel(new ResourceModel("cluster.security")); add(tablePanel); add(DisableIfPrototypeBehavior.INSTANCE, UpdateOnActionPerformedEventBehavior.INSTANCE_ALL_CONTINUE); }
table.getHeadersToolbar().setVisibilityAllowed(false); table.getNoRecordsToolbar().setVisibilityAllowed(false); table.addCommand(new SelectODocumentCommand(table, documentModel, new OPropertyModel(property)) .setBootstrapSize(BootstrapSize.EXTRA_SMALL) .setIcon((String)null));