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 public void onClick(Optional<AjaxRequestTarget> targetOptional) { boolean isActiveTransaction = getDatabase().getTransaction().isActive(); if(isActiveTransaction) getDatabase().commit(); // Schema changes should be done outside of transaction try { super.onClick(targetOptional); getDatabase().getMetadata().reload(); } finally { if(isActiveTransaction) getDatabase().begin(); } }
@Override public RequiredOrientResource[] getRequiredResources() { T object = getModelObject(); if(object!=null) { OrientPermission permission = (object instanceof IPrototype<?>)?OrientPermission.CREATE:OrientPermission.UPDATE; return new RequiredOrientResource[] { OSecurityHelper.requireResource(ORule.ResourceGeneric.SCHEMA, null, permission)[0], OSecurityHelper.requireResource(ORule.ResourceGeneric.CLUSTER, "internal", permission)[0] }; } else { return new RequiredOrientResource[0]; } } }
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); }
@Override protected void onInitialize() { super.onInitialize(); structureTable.addCommand(new EditSchemaCommand<OProperty>(structureTable, getModeModel())); structureTable.addCommand(new SaveSchemaCommand<OProperty>(structureTable, getModeModel(), getModel())); }
@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)); }
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));
@Override protected void onInitialize() { super.onInitialize(); structureTable.addCommand(new EditSchemaCommand<OIndex<?>>(structureTable, getModeModel())); structureTable.addCommand(new SaveSchemaCommand<OIndex<?>>(structureTable, getModeModel(), getModel())); structureTable.addCommand(new RebuildOIndexCommand(structureTable)); }
public ODatabaseConfigurationWidget(String id, IModel<Void> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); Form<ODatabase<?>> form = new Form<ODatabase<?>>("form"); structureTable = new OrienteerStructureTable<ODatabase<?>, String>("attributes", CurrentDatabaseModel.<ODatabase<?>>getInstance(), ODatabaseMetaPanel.ODATABASE_ATTRS) { @Override protected Component getValueComponent(String id, final IModel<String> rowModel) { return new ODatabaseMetaPanel<Object>(id, getModeModel(), getModel(), rowModel); } }; structureTable.addCommand(new EditSchemaCommand<ODatabase<?>>(structureTable, getModeModel())); structureTable.addCommand(new SaveSchemaCommand<ODatabase<?>>(structureTable, getModeModel())); form.add(structureTable); add(form); }
public OClusterConfigurationWidget(String id, IModel<OCluster> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); Form<OCluster> form = new Form<OCluster>("form"); structureTable = new OrienteerStructureTable<OCluster, String>("attributes", getModel(), OClusterMetaPanel.OCLUSTER_ATTRS) { @Override protected Component getValueComponent(String id, final IModel<String> rowModel) { return new OClusterMetaPanel<Object>(id, getModeModel(), this.getModel(), rowModel); } }; structureTable.addCommand(new EditSchemaCommand<OCluster>(structureTable, getModeModel())); structureTable.addCommand(new SaveSchemaCommand<OCluster>(structureTable, getModeModel())); form.add(structureTable); add(form); }
structureTable.addCommand(new SaveSchemaCommand<OClass>(structureTable, getModeModel()));
public OClassConfigurationWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); Form<OClass> form = new TransactionlessForm<OClass>("form"); structureTable = new OrienteerStructureTable<OClass, String>("attributes", getModel(), OClassMetaPanel.OCLASS_ATTRS) { @Override protected Component getValueComponent(String id, final IModel<String> rowModel) { return new OClassMetaPanel<Object>(id, getModeModel(), OClassConfigurationWidget.this.getModel(), rowModel); } }; structureTable.addCommand(new EditSchemaCommand<OClass>(structureTable, getModeModel())); structureTable.addCommand(new SaveSchemaCommand<OClass>(structureTable, getModeModel(), getModel())); form.add(structureTable); add(form); addCommand(new BookmarkablePageLinkCommand<OClass>(newCommandId(), "class.browse", BrowseOClassPage.class) { @Override public PageParameters getPageParameters() { return BrowseOClassPage.preparePageParameters(OClassConfigurationWidget.this.getModelObject(), DisplayMode.VIEW); } @Override protected void onConfigure() { super.onConfigure(); setVisible(OSchemaUtils.isNotNullOrPrototype(OClassConfigurationWidget.this.getModelObject())); } }); }
@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)); }
structureTable.addCommand(new SaveSchemaCommand<T>(structureTable, getModeModel())); structureTable.addCommand(new AjaxCommand<T>(new StringResourceModel("command.showhide.system.${}", new PropertyModel<Boolean>(this, "hideSystem")), structureTable) {