use of com.enonic.xp.data.PropertySet in project xp by enonic.
the class MediaUploaderTypeTest method testCreateProperty.
@Test
public void testCreateProperty() {
final InputTypeConfig config = InputTypeConfig.create().build();
final Value value = this.type.createValue(ValueFactory.newPropertySet(new PropertySet()), config);
assertNotNull(value);
assertSame(ValueTypes.PROPERTY_SET, value.getType());
}
use of com.enonic.xp.data.PropertySet in project xp by enonic.
the class DslOrderExprTest method equalsContract.
@Test
public void equalsContract() {
final PropertySet expression1 = new PropertySet();
expression1.addString("field", "myField");
final PropertySet expression2 = new PropertySet();
expression2.addString("field", "anotherField");
EqualsVerifier.forClass(DslOrderExpr.class).withPrefabValues(PropertySet.class, expression1, expression2).usingGetClass().verify();
}
use of com.enonic.xp.data.PropertySet in project xp by enonic.
the class AuditLogSerializer method toCreateNodeParams.
public static CreateNodeParams.Builder toCreateNodeParams(final LogAuditLogParams auditLogParams) {
List<String> objectUris = auditLogParams.getObjectUris().stream().map(AuditLogUri::toString).collect(Collectors.toList());
final PropertyTree tree = new PropertyTree();
final PropertySet data = tree.getRoot();
data.addString(AuditLogPropertyNames.TYPE, auditLogParams.getType());
data.addInstant(AuditLogPropertyNames.TIME, auditLogParams.getTime());
data.addString(AuditLogPropertyNames.SOURCE, auditLogParams.getSource());
data.addString(AuditLogPropertyNames.USER, auditLogParams.getUser().toString());
data.addStrings(AuditLogPropertyNames.OBJECTURIS, objectUris);
data.addSet(AuditLogPropertyNames.DATA, auditLogParams.getData().getRoot().copy(data.getTree()));
return CreateNodeParams.create().nodeType(AuditLogConstants.NODE_TYPE).inheritPermissions(true).data(tree);
}
use of com.enonic.xp.data.PropertySet in project xp by enonic.
the class ContentAuditLogSupportImpl method doMove.
private void doMove(final MoveContentParams params, final MoveContentsResult result, final Context rootContext) {
final PropertyTree data = new PropertyTree();
final PropertySet paramsSet = data.addSet("params");
final PropertySet resultSet = data.addSet("result");
paramsSet.addString("contentId", nullToNull(params.getContentId()));
paramsSet.addString("parentContentPath", nullToNull(params.getParentContentPath()));
if (params.getCreator() != null) {
paramsSet.addString("creator", params.getCreator().getId());
}
addContents(resultSet, result.getMovedContents(), "movedContents");
log("system.content.move", data, params.getContentId(), rootContext);
}
use of com.enonic.xp.data.PropertySet in project xp by enonic.
the class ContentAuditLogSupportImpl method doUpdate.
private void doUpdate(final UpdateContentParams params, final Content content, final Context rootContext) {
final PropertyTree data = new PropertyTree();
final PropertySet paramsSet = data.addSet("params");
final PropertySet resultSet = data.addSet("result");
final PrincipalKey modifier = rootContext.getAuthInfo().getUser() != null ? rootContext.getAuthInfo().getUser().getKey() : PrincipalKey.ofAnonymous();
paramsSet.addString("contentId", nullToNull(params.getContentId()));
paramsSet.addString("modifier", nullToNull(modifier));
paramsSet.addBoolean("clearAttachments", params.isClearAttachments());
paramsSet.addBoolean("requireValid", params.isRequireValid());
addContent(resultSet, content);
log("system.content.update", data, content.getId(), rootContext);
}
Aggregations