/** * @return the date the function node (this version) was last modified * @throws RulesRepositoryException */ public Calendar getLastModified() throws RulesRepositoryException { try { Node n = getVersionContentNode(); if (n.hasProperty(LAST_MODIFIED_PROPERTY_NAME)) { Property lastModifiedProperty = getVersionContentNode().getProperty( LAST_MODIFIED_PROPERTY_NAME ); return lastModifiedProperty.getDate(); } else { return null; } } catch ( Exception e ) { log.error( "Caught Exception", e ); throw new RulesRepositoryException( e ); } }
/** * @return the date the function node (this version) was last modified * @throws RulesRepositoryException */ public Calendar getLastModified() throws RulesRepositoryException { try { Node n = getVersionContentNode(); if (n.hasProperty(LAST_MODIFIED_PROPERTY_NAME)) { Property lastModifiedProperty = getVersionContentNode().getProperty( LAST_MODIFIED_PROPERTY_NAME ); return lastModifiedProperty.getDate(); } else { return null; } } catch ( Exception e ) { log.error( "Caught Exception", e ); throw new RulesRepositoryException( e ); } }
public String getStringProperty(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); return data.getValue().getString(); } else { return ""; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
public String getStringProperty(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); return data.getValue().getString(); } else { return ""; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
public String[] getStringPropertyArray(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); Value[] values = data.getValues(); List<String> list = new ArrayList<String>(); for (Value value : values) { list.add(value.getString()); } return list.toArray(new String[0]); } else { return new String[0]; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } } protected long getLongProperty(String property) {
public String[] getStringPropertyArray(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); Value[] values = data.getValues(); List<String> list = new ArrayList<String>(); for (Value value : values) { list.add(value.getString()); } return list.toArray(new String[0]); } else { return new String[0]; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } } protected long getLongProperty(String property) {
/** * Gets the Title of the versionable node. See the Dublin Core documentation for more * explanation: http://dublincore.org/documents/dces/ * * @return the title of the node this object encapsulates * @throws RulesRepositoryException */ public String getTitle() throws RulesRepositoryException { try { Node theNode = getVersionContentNode(); Property data = theNode.getProperty( TITLE_PROPERTY_NAME ); return data.getValue().getString(); } catch ( Exception e ) { log.error( "Caught Exception", e ); throw new RulesRepositoryException( e ); } }
/** * Test if the VersionableItem is archived */ public boolean isArchived() { try { Node ruleNode = getVersionContentNode(); return ruleNode.getProperty( CONTENT_PROPERTY_ARCHIVE_FLAG ).getBoolean(); /* return this.node.getProperty(CONTENT_PROPERTY_ARCHIVE_FLAG) .getBoolean();*/ } catch ( PathNotFoundException e ) { // doesn't have this property return false; } catch (RepositoryException e) { log.error("Unable to check this asset"); throw new RulesRepositoryException(e); } }
/** * Test if the VersionableItem is archived */ public boolean isArchived() { try { Node ruleNode = getVersionContentNode(); return ruleNode.getProperty( CONTENT_PROPERTY_ARCHIVE_FLAG ).getBoolean(); /* return this.node.getProperty(CONTENT_PROPERTY_ARCHIVE_FLAG) .getBoolean();*/ } catch ( PathNotFoundException e ) { // doesn't have this property return false; } catch (RepositoryException e) { log.error("Unable to check this asset"); throw new RulesRepositoryException(e); } }
/** * Gets the Title of the versionable node. See the Dublin Core documentation for more * explanation: http://dublincore.org/documents/dces/ * * @return the title of the node this object encapsulates * @throws RulesRepositoryException */ public String getTitle() throws RulesRepositoryException { try { Node theNode = getVersionContentNode(); Property data = theNode.getProperty( TITLE_PROPERTY_NAME ); return data.getValue().getString(); } catch ( Exception e ) { log.error( "Caught Exception", e ); throw new RulesRepositoryException( e ); } }
protected Boolean getBooleanProperty(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); return data.getValue().getBoolean(); } else { return false; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
/** * @return A unique identifier for this items content node. * This UUID is constant even with new versions, it represents the asset, and * ALL its historical versions. */ public String getUUID() { try { return this.getVersionContentNode().getIdentifier(); } catch ( RepositoryException e ) { throw new RulesRepositoryException(e); } }
/** * @return A unique identifier for this items content node. * This UUID is constant even with new versions, it represents the asset, and * ALL its historical versions. */ public String getUUID() { try { return this.getVersionContentNode().getIdentifier(); } catch ( RepositoryException e ) { throw new RulesRepositoryException(e); } }
/** * This returns the format of an item. * This is analogous to a file extension * if the resource was a file (it may contain more information * then a pure file extension could, however). * * See the Dublin Core documentation for more * explanation: http://dublincore.org/documents/dces/ * * @return the format of this object's node * @throws RulesRepositoryException */ public String getFormat() throws RulesRepositoryException { try { Node theNode = getVersionContentNode(); Property data = theNode.getProperty(FORMAT_PROPERTY_NAME); return data.getValue().getString(); } catch (Exception e) { log.error("Caught Exception", e); throw new RulesRepositoryException(e); } }
protected long getLongProperty(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); return data.getValue().getLong(); } else { return 0; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
protected long getLongProperty(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); return data.getValue().getLong(); } else { return 0; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
/** * This returns the format of an item. * This is analogous to a file extension * if the resource was a file (it may contain more information * then a pure file extension could, however). * * See the Dublin Core documentation for more * explanation: http://dublincore.org/documents/dces/ * * @return the format of this object's node * @throws RulesRepositoryException */ public String getFormat() throws RulesRepositoryException { try { Node theNode = getVersionContentNode(); Property data = theNode.getProperty(FORMAT_PROPERTY_NAME); return data.getValue().getString(); } catch (Exception e) { log.error("Caught Exception", e); throw new RulesRepositoryException(e); } }
protected Boolean getBooleanProperty(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); return data.getValue().getBoolean(); } else { return false; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
/** * Gets StateItem object corresponding to the state property of this object's node * * @return a StateItem object corresponding to the state property of this object's node, or null * if the state property is not set * @throws RulesRepositoryException */ public StateItem getState() throws RulesRepositoryException { try { Node content = getVersionContentNode(); Property stateProperty = content.getProperty( STATE_PROPERTY_NAME ); Node stateNode = this.rulesRepository.getSession().getNodeByIdentifier( stateProperty.getString() ); return new StateItem( this.rulesRepository, stateNode ); } catch ( PathNotFoundException e ) { //not set return null; } catch ( Exception e ) { log.error( "Caught exception", e ); throw new RulesRepositoryException( e ); } }
/** * Gets StateItem object corresponding to the state property of this object's node * * @return a StateItem object corresponding to the state property of this object's node, or null * if the state property is not set * @throws RulesRepositoryException */ public StateItem getState() throws RulesRepositoryException { try { Node content = getVersionContentNode(); Property stateProperty = content.getProperty( STATE_PROPERTY_NAME ); Node stateNode = this.rulesRepository.getSession().getNodeByIdentifier( stateProperty.getString() ); return new StateItem( this.rulesRepository, stateNode ); } catch ( PathNotFoundException e ) { //not set return null; } catch ( Exception e ) { log.error( "Caught exception", e ); throw new RulesRepositoryException( e ); } }