@Override public WikittyTreeNode getParent(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public Wikitty getRestored(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public WikittyToken getToken(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public WikittyUser getOwner(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public Set<WikittyAuthorisation> getParent(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public WikittyUser getUser(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public WikittyUser getUser(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public Set<Wikitty> getAttachment(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public Set<Wikitty> getMembers(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public Set<Wikitty> getAdmin(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public Set<Wikitty> getWriter(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
@Override public Set<Wikitty> getReader(boolean exceptionIfNotLoaded) { if (exceptionIfNotLoaded) { throw new WikittyException("Preload is not implemented in DTO"); } else { return null; } }
/** * Retourne le stack courant des conditions, si le stack est null cela * veut dire que le maker ne permet plus de modification * @return */ protected Deque<Condition> getOpenStack() { if (openStack == null) { throw new WikittyException( "You can't create condition if you have used setCondition method" + " or close last condition"); } return openStack; }
/** * given a fully qualified field name, return the name of the field * TODO poussin 20101208 redondant code with {@link WikittyExtension#extractFieldName(java.lang.String)} */ public static String getFieldNameFromFQFieldName(String fqFieldName) { try { String[] fqFieldElements = fqFieldName.split(FQ_FIELD_NAME_SEPARATOR_REGEX); return fqFieldElements[1]; } catch(ArrayIndexOutOfBoundsException eee) { throw new WikittyException("Field is not fully qualified field:" + fqFieldName, eee); } }
@Override public boolean isDeleted(WikittyTransaction transaction, String id) { boolean result = false; Wikitty w = wikitties.get(id); if (w == null) { throw new WikittyException(String.format("No wikitty with id '%s'", id)); } else { result = w.isDeleted(); } return result; }
private String value2solr(String value) { String result; if (value != null) { result = Restriction2Solr.escapeValue(value); } else { throw new WikittyException("Parse error, value must be not empty"); } if (result.contains(" ")) { result = "\"" + result + "\""; } return result; }
@Override public WikittyExtension restore(WikittyTransaction transaction, String name, String version) throws WikittyException { String id = WikittyExtension.computeId(name, version); WikittyExtension result = extensions.get(id); if (result == null) { throw new WikittyException(String.format("No extension with id '%s'", id)); } return result; }
private String value2solr(String value) { String result; if (value != null) { result = Restriction2Solr.escapeValue(value); } else { throw new WikittyException("Parse error, value must be not empty"); } if (result.contains(" ")) { result = "\"" + result + "\""; } return result; }
public void syncImportFromUri(FORMAT format, String uri) { try { URL url = new URL(uri); Reader reader = new InputStreamReader(url.openStream()); ImportTask task = new ImportTask(client, format, reader); task.run(); } catch (Exception eee) { throw new WikittyException(String.format( "Can't import in format %s uri %s", format, uri), eee); } }
@Override public Condition addCondition(Condition c) { if (c instanceof ConditionValue) { getValues().add((ConditionValue)c); } else { throw new WikittyException(String.format( "Only ConditionValue can be add to %s, but you try to add: %s", this.getClass().getSimpleName(), ClassUtils.getShortCanonicalName(c, "null"))); } return this; }