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); }
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); }
pTable.addCommand(new DeleteOPropertyCommand(pTable)); pTable.addCommand(new CreateOIndexFromOPropertiesCommand(pTable, getModel())); pTable.setCaptionModel(new ResourceModel("class.properties")); add(tablePanel); add(DisableIfPrototypeBehavior.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); }
table.setCaptionModel(new ResourceModel("class.localization"));
OrienteerDataTable<ODocument, String> table = tablePanel.getDataTable(); final OPropertyNamingModel propertyNamingModel = new OPropertyNamingModel(propertyModel); table.setCaptionModel(propertyNamingModel); SecurityBehavior securityBehaviour = new SecurityBehavior(documentModel, OrientPermission.UPDATE); if(!isStructureReadonly)