@Override public String getNodeName() { Configuration configuration = AppBeans.get(Configuration.NAME); GlobalConfig globalConfig = configuration.getConfig(GlobalConfig.class); return globalConfig.getWebHostName() + ":" + globalConfig.getWebPort(); } }
protected MetaClass resolveTargetMetaClass(MetaClass metaClass) { if (metaClass == null) { return null; } Metadata metadata = AppBeans.get(Metadata.NAME); MetaClass targetMetaClass = metadata.getExtendedEntities().getOriginalMetaClass(metaClass); if (targetMetaClass == null) { targetMetaClass = metaClass; } return targetMetaClass; }
@Override public <E extends Entity> E save(E entity) { CommitContext cc = new CommitContext(entity); cc.setJoinTransaction(true); return dataManager.commit(cc).get(entity); }
@Override public List<UserSubstitution> getSubstitutedUsers(UUID userId) { LoadContext<UserSubstitution> ctx = new LoadContext<>(UserSubstitution.class); LoadContext.Query query = ctx.setQueryString("select us from sec$UserSubstitution us " + "where us.user.id = :userId and (us.endDate is null or us.endDate >= :currentDate) " + "and (us.startDate is null or us.startDate <= :currentDate) " + "and (us.substitutedUser.active = true or us.substitutedUser.active is null) order by us.substitutedUser.name"); query.setParameter("userId", userId); query.setParameter("currentDate", timeSource.currentTimestamp()); ctx.setView("app"); return dataManager.loadList(ctx); } }
public ListPrintFormAction(String id, ListComponent listComponent) { super(id); this.listComponent = listComponent; Messages messages = AppBeans.get(Messages.NAME); this.caption = messages.getMessage(ListPrintFormAction.class, "actions.Report"); this.icon = "icons/reports-print.png"; }
protected String getDefaultRequiredMessage(String name) { Messages messages = AppBeans.get(Messages.NAME); return messages.formatMessage(messages.getMainMessagePack(), "validation.required.defaultMsg", name); } }
protected Locale getCurrentLocale() { Locale locale; if (userSessionSource.checkCurrentUserSession()) { locale = userSessionSource.getLocale(); } else { locale = messages.getTools().getDefaultLocale(); } return locale; } }
public String getDefaultErrorMessage() { MetaClass metaClass = metadata.getClass(beanClass); return messages.formatMainMessage("validation.defaultMsg", messages.getTools().getPropertyCaption(metaClass, beanProperty)); }
protected void reloadProcInstance() { View view = new View(ProcInstance.class) .addProperty("procDefinition", new View(ProcDefinition.class).addProperty("actProcessInstanceId")); procInstance = dataManager.reload(procInstance, view); }
@Override public <E extends Entity> List<E> loadList(LoadContext<E> context) { context.setJoinTransaction(true); return dataManager.loadList(context); }
/** * Loads a list of entities. */ public List<E> list() { LoadContext<E> loadContext = createLoadContext(); return dataManager.loadList(loadContext); }
@Override public void remove(Entity entity) { CommitContext cc = new CommitContext(); cc.addInstanceToRemove(entity); cc.setJoinTransaction(true); dataManager.commit(cc); }
@Override public EntitySet save(Entity... entities) { CommitContext cc = new CommitContext(entities); cc.setJoinTransaction(true); return dataManager.commit(cc); }
/** */ @SupportedByClient @Logging(Logging.Type.BRIEF) public class EntityImportException extends RuntimeException { public EntityImportException(String message) { super(message); } public EntityImportException(String message, Throwable cause) { super(message, cause); } }
/** * Return an instance of the specified bean. * @param name the name of the bean to retrieve * @return bean instance * @see org.springframework.beans.factory.BeanFactory#getBean(java.lang.String) */ @SuppressWarnings("unchecked") public static <T> T get(String name) { return (T) getBeanLocator().get(name); }
@Override public EntitySet commit(CommitContext context) { context.setAuthorizationRequired(true); return dataManager.commit(context); } }
@Override public long getCount(LoadContext<? extends Entity> context) { context.setAuthorizationRequired(true); return dataManager.getCount(context); }
protected ValueLoadContext createLoadContext() { ValueLoadContext loadContext = super.createLoadContext(); loadContext.addProperty(PROP_NAME); return loadContext; }
/** * Exception that is thrown if the passed credentials class is unsupported. */ @Logging(Logging.Type.BRIEF) @SupportedByClient public class UnsupportedCredentialsException extends LoginException { public UnsupportedCredentialsException(String message) { super(message); } }
@Override public Set<Entity> commit(CommitContext context) { context.setAuthorizationRequired(true); return dataManager.commit(context); }