adminJcrTemplate.execute( new JcrCallback() {
@Override
public Object doInJcr( Session session ) throws IOException, RepositoryException {
new PentahoJcrConstants( session );
String absPath = ServerRepositoryPaths.getPentahoRootFolderPath();
RepositoryFile rootFolder =
JcrRepositoryFileUtils
.getFileByAbsolutePath( session, absPath, pathConversionHelper, null, false, null );
if ( rootFolder != null ) {
Map<String, Serializable> metadataMap =
JcrRepositoryFileUtils.getFileMetadata( session, rootFolder.getId() );
if ( metadataMap == null ) {
metadataMap = new HashMap<String, Serializable>();
}
metadataMap.put( metadataProperty, Boolean.TRUE );
JcrRepositoryFileUtils.setFileMetadata( session, rootFolder.getId(), metadataMap );
} else {
throw new IllegalStateException( "Repository has not been initialized properly" );
}
session.save();
return null;