if (user == null)
throw new TranslatableJsonException("emport.error.missingUser", username);
userId = user.getId();
}
JsonArray components = jsonObject.getJsonArray("viewComponents");
if (components != null) {
viewComponents.clear();
for (JsonValue jv : components)
addViewComponent(reader.read(ViewComponent.class, jv));
}
String text = jsonObject.getString("anonymousAccess");
if (text != null) {
anonymousAccess = ShareUser.ACCESS_CODES.getId(text);
if (anonymousAccess == -1)
throw new TranslatableJsonException("emport.error.invalid", "anonymousAccess", text,
ShareUser.ACCESS_CODES.getCodeList());
}
JsonArray jsonSharers = jsonObject.getJsonArray("sharingUsers");
if (jsonSharers != null) {
viewUsers.clear();
for (JsonValue jv : jsonSharers) {
ShareUser shareUser = reader.read(ShareUser.class, jv);