Search in sources :

Example 6 with PropertySet

use of com.enonic.xp.data.PropertySet in project xp by enonic.

the class FindNodesByQueryCommandTest_arrays method nested_array_elements.

@Test
public void nested_array_elements() throws Exception {
    final PropertyTree data = new PropertyTree();
    final PropertySet cars = data.addSet("cars");
    final PropertySet car1 = cars.addSet("car");
    car1.setString("brand", "skoda");
    car1.setString("color", "artic grey");
    final PropertySet car2 = cars.addSet("car");
    car2.setString("brand", "volvo");
    car2.setString("color", "red");
    final Node node1 = createNode(CreateNodeParams.create().name("my-node-1").parent(NodePath.ROOT).data(data).indexConfigDocument(PatternIndexConfigDocument.create().analyzer(NodeConstants.DOCUMENT_INDEX_DEFAULT_ANALYZER).defaultConfig(IndexConfig.BY_TYPE).build()).build());
    printContentRepoIndex();
    compareQueryAndAssert("cars.car.brand", "skoda", node1.id());
    compareQueryAndAssert("cars.car.brand", "volvo", node1.id());
    compareQueryAndAssert("cars.car.color", "red", node1.id());
    compareQueryAndAssert("cars.car.color", "artic grey", node1.id());
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) Node(com.enonic.xp.node.Node) PropertySet(com.enonic.xp.data.PropertySet) Test(org.junit.jupiter.api.Test)

Example 7 with PropertySet

use of com.enonic.xp.data.PropertySet in project xp by enonic.

the class SecurityAuditLogSupportImpl method removeIdProvider.

@Override
public void removeIdProvider(final IdProviderKey idProviderKey) {
    if (isEnabledAuditLogs) {
        PropertyTree data = new PropertyTree();
        PropertySet paramsSet = data.addSet("params");
        paramsSet.setString("key", idProviderKey.toString());
        log("system.security.idProvider.delete", data, AuditLogUris.from(idProviderKey.toString()));
    }
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) PropertySet(com.enonic.xp.data.PropertySet)

Example 8 with PropertySet

use of com.enonic.xp.data.PropertySet in project xp by enonic.

the class SecurityAuditLogSupportImpl method updateGroup.

@Override
public void updateGroup(UpdateGroupParams params) {
    if (isEnabledAuditLogs) {
        PropertyTree data = new PropertyTree();
        PropertySet paramsSet = data.addSet("params");
        paramsSet.setString("key", params.getKey().toString());
        paramsSet.setString("displayName", params.getDisplayName());
        paramsSet.setString("description", params.getDescription());
        log("system.security.principal.update", data, AuditLogUris.from(params.getKey().toString()));
    }
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) PropertySet(com.enonic.xp.data.PropertySet)

Example 9 with PropertySet

use of com.enonic.xp.data.PropertySet in project xp by enonic.

the class SecurityAuditLogSupportImpl method removeRelationships.

@Override
public void removeRelationships(final PrincipalKey key) {
    if (isEnabledAuditLogs) {
        PropertyTree data = new PropertyTree();
        PropertySet paramsSet = data.addSet("params");
        paramsSet.setString("from", key.toString());
        log("system.security.principal.removeRelationships", data, AuditLogUris.from(key.toString()));
    }
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) PropertySet(com.enonic.xp.data.PropertySet)

Example 10 with PropertySet

use of com.enonic.xp.data.PropertySet in project xp by enonic.

the class SecurityAuditLogSupportImpl method createRole.

@Override
public void createRole(final CreateRoleParams params) {
    if (isEnabledAuditLogs) {
        PropertyTree data = new PropertyTree();
        PropertySet paramsSet = data.addSet("params");
        paramsSet.setString("key", params.getKey().toString());
        paramsSet.setString("displayName", params.getDisplayName());
        paramsSet.setString("description", params.getDescription());
        log("system.security.principal.create", data, AuditLogUris.from(params.getKey().toString()));
    }
}
Also used : PropertyTree(com.enonic.xp.data.PropertyTree) PropertySet(com.enonic.xp.data.PropertySet)

Aggregations

PropertySet (com.enonic.xp.data.PropertySet)225 PropertyTree (com.enonic.xp.data.PropertyTree)150 Test (org.junit.jupiter.api.Test)69 Content (com.enonic.xp.content.Content)30 Node (com.enonic.xp.node.Node)20 CreateContentParams (com.enonic.xp.content.CreateContentParams)12 ContentId (com.enonic.xp.content.ContentId)11 Property (com.enonic.xp.data.Property)11 LogAuditLogParams (com.enonic.xp.audit.LogAuditLogParams)10 PrincipalKey (com.enonic.xp.security.PrincipalKey)9 ContentQuery (com.enonic.xp.content.ContentQuery)7 DescriptorKey (com.enonic.xp.page.DescriptorKey)7 ExtraDatas (com.enonic.xp.content.ExtraDatas)6 Form (com.enonic.xp.form.Form)6 PatternIndexConfigDocument (com.enonic.xp.index.PatternIndexConfigDocument)6 CreateAttachment (com.enonic.xp.attachment.CreateAttachment)5 ContentPropertyNames (com.enonic.xp.content.ContentPropertyNames)5 ExtraData (com.enonic.xp.content.ExtraData)5 PropertyPath (com.enonic.xp.data.PropertyPath)5 Page (com.enonic.xp.page.Page)5