@Override public void fixNames(final BasicSystemProperties props, final BwPrincipal principal) { if (getHref() != null) { return; } String extra = getWordVal(); final String name; final int pos = extra.lastIndexOf("/"); if (pos < 0) { name = extra; extra = ""; } else { name = extra.substring(pos + 1); extra = extra.substring(0, pos); } setName(name); setColPath(props, principal, "categories", extra); setHref(Util.buildPath(false, getColPath(), getName())); }
public void toJson(final JsonGenerator jgen) throws CalFacadeException { try { jgen.writeStartObject(); outJsonField("name", getName(), jgen); outJsonField("href", getHref(), jgen); outJsonField("colPath", getColPath(), jgen); outJsonField("uid", getUid(), jgen); outJsonBwString("word", getWord(), jgen); outJsonBwString("description", getDescription(), jgen); jgen.writeEndObject(); // category } catch (final Throwable t) { throw new CalFacadeException(t); } }