public FastDateFormat getDateFormat() { return FastDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, getLocale()); } }
public List<ConnInstanceTO> getAllConnectors() { List<ConnInstanceTO> connectors = Collections.<ConnInstanceTO>emptyList(); try { connectors = getService(ConnectorService.class).list(SyncopeConsoleSession.get().getLocale().toString()); } catch (Exception e) { LOG.error("While reading connectors", e); } return connectors; }
public List<ConnBundleTO> getAllBundles() { List<ConnBundleTO> bundles = Collections.<ConnBundleTO>emptyList(); try { bundles = getService(ConnectorService.class).getBundles(SyncopeConsoleSession.get().getLocale().toString()); } catch (SyncopeClientException e) { LOG.error("While getting connector bundles", e); } return bundles; }
public List<String> getObjectClasses(final String connectorKey) { List<String> result = new ArrayList<>(); ConnectorService service = getService(ConnectorService.class); ConnInstanceTO connInstance = service.read(connectorKey, SyncopeConsoleSession.get().getLocale().getLanguage()); if (connInstance != null) { result.addAll(service.buildObjectClassInfo(connInstance, true).stream(). map(input -> input.getType()).collect(Collectors.toList())); } return result; }
/** * Load an already existent connector by its name. * * @param key the id * @return ConnInstanceTO */ public ConnInstanceTO read(final String key) { ConnInstanceTO connectorTO = null; try { connectorTO = getService(ConnectorService.class). read(key, SyncopeConsoleSession.get().getLocale().toString()); } catch (SyncopeClientException e) { LOG.error("While reading a connector", e); } return connectorTO; }
public AjaxDateFieldPanel(final String id, final String name, final IModel<Date> model, final String datePattern) { super(id, name, model, datePattern); field = new AjaxDatePicker("field", model, SyncopeConsoleSession.get().getLocale(), datePattern); add(field.setLabel(new Model<>(name)).setOutputMarkupId(true)); }
public ConnInstanceTO delete(final String key) { ConnInstanceTO connectorTO = getService(ConnectorService.class). read(key, SyncopeConsoleSession.get().getLocale().toString()); getService(ConnectorService.class).delete(key); return connectorTO; }
public AjaxDateTimeFieldPanel( final String id, final String name, final IModel<Date> model, final String dateTimePattern) { super(id, name, model, dateTimePattern); // dateTimePattern should be spit into separate date and time pattern strings in order to be passed to the // AjaxDateTimePicker constructor, but there is no safe way to do that - ignoring field = new AjaxDateTimePicker("field", model, SyncopeConsoleSession.get().getLocale()); add(field.setLabel(new Model<>(name)).setOutputMarkupId(true)); }
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); response.render(JavaScriptHeaderItem.forReference( new KendoCultureResourceReference(SyncopeConsoleSession.get().getLocale()))); } }
@Override protected void populateItem(final ListItem<Attr> item) { Attr attrTO = item.getModelObject(); IModel<String> model; List<String> values = attrTO.getValues(); if (values == null || values.isEmpty()) { model = new ResourceModel("derived.emptyvalue.message", StringUtils.EMPTY); } else { model = new Model<>(values.get(0)); } AjaxTextFieldPanel panel = new AjaxTextFieldPanel( "panel", schemas.get(attrTO.getSchema()).getLabel(SyncopeConsoleSession.get().getLocale()), model, false); panel.setEnabled(false); panel.setRequired(true); panel.setOutputMarkupId(true); item.add(panel); } });
@Override @SuppressWarnings("unchecked") protected void populateItem(final ListItem<Attr> item) { Attr attrTO = item.getModelObject(); VirSchemaTO virSchemaTO = schemas.get(attrTO.getSchema()); AbstractFieldPanel<?> panel = new AjaxTextFieldPanel( "panel", virSchemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), false); if (mode == AjaxWizard.Mode.TEMPLATE) { AjaxTextFieldPanel.class.cast(panel).enableJexlHelp().setEnabled(!virSchemaTO.isReadonly()); } else { panel = new MultiFieldPanel.Builder<>( new PropertyModel<List<String>>(attrTO, "values")).build( "panel", virSchemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), AjaxTextFieldPanel.class.cast(panel)); panel.setEnabled(!virSchemaTO.isReadonly()); } item.add(panel); if (!attrTO.getValues().isEmpty() && VirAttrs.this.modelObject instanceof UserWrapper && UserWrapper.class.cast(VirAttrs.this.modelObject).getPreviousUserTO() != null) { panel.showExternAction(new LabelInfo("externalAction", StringUtils.EMPTY)); } } });
panel = new AjaxCheckBoxPanel( "panel", schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), true); panel = new AjaxDateTimeFieldPanel( "panel", schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), datePattern); panel = new AjaxDateFieldPanel( "panel", schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), datePattern); schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), new Model<>(), true); ((AjaxDropDownChoicePanel<String>) panel).setChoices(SchemaUtils.getEnumeratedValues(schemaTO)); panel = new AjaxSpinnerFieldPanel.Builder<Long>().enableOnChange().build( "panel", schemaTO.getLabel(SyncopeConsoleSession.get().getLocale()), Long.class, new Model<>()); panel = new AjaxSpinnerFieldPanel.Builder<Double>().enableOnChange().step(0.1).build( "panel",