Framework/Another Lore2009. 4. 25. 05:21

There are three types of read access which a session may have with respect to a particular node(or property), depending on that session's permissions: direct access, traversal access and search access.

Direct Access

Direct access to an item means being able to retrieve it by absolute and relative path and, in the case of nodes, by identifier. Let p(x) return the normalized absolute path of item x,  id(x) return the identifier of node x.

For any session S and node N, the statements below must be either all true or all false. If they are all true then S has direct access to N, if they are all false then S does not have direct access to N:

- S.getNodeByPath(p(N)) returns N.
- S.getNodeByUUID(id(x)) return N.
- S.existByPath(p(N)) returns true.
- If N is the root node of the workspace then S.getRootNode() returns N.

For any node N and property P, the statements below must be either all true or all false. p(P) eturn the identifier of property P. If they are all true then N has direct access to P, if they are all false then N does not have direct access to P:

- N.getProperty(p(P)) returns P.
- N.hasProperties(p(P)) return true.
- N.getString(p(P)) return P.getString()

Traversal Access

Traversal access to an node N means that it is returned when iterating over the link of a node.

For any given session S and node N, the statements below must be either both true or both false. If they are both true then S has traversal access to N, if they are both false then S does not have traversal access to N:

- S has access to M where M is the parent of N, and N appears among the node in the iterator returned by either M.getChildNode(int maxDepth) or  M.getChildNode() or M.getChildNode(Page page) or getNodes(LinkType.Child, Page.ALL)
- If N is the parent node of a node M then M.getParent() returns N.
- If N has property thern Node.hasProperties() returns true.
- If N is the member node of a node M, and N apperas among the node in the iterator returned by either M.getMemberNode(Page.ALL) or getNodes(LinkType.Member, Page.ALL)
- If N has link of a node M, and N apperas among the node in the iterator<Link> returned by either M.getLinks(Page.ALL) or M.getLinks(linkType, page). Link consist of fromNode and toNode with linkType

Exporting a subgraph within a workspace can be done with

Search Access

Search a subgraph within a workspace can be done with
Node.searchNode(String searchText)
currently the search engine is Lucene

Effect of Access Denial on Read

If a repository restricts the read access of a session, then the nodes and properties to which that session does not have read access must appear not to exist. For example, the iterator returned on N.getNodes will not include subnodes of N to which the session in question does not have read access. In other words, lack of read access to an item blocks access to both information about the content of that item and information about the existence of that item.

Node Information
This method provides access to the current Session.
    Session node.getSession()
These methods provide information about the location of an node within the workspace hierarchy:
    String node.getPath()
returns the name of the node
    String node.getName()
returns the ancestor of the node that is at the specified depth below the root node.
    Node node.getParent()
returns the name of the node
    String node.getExplain()
returns the more information of the node
    NodeBean node.getBean()
This method is used to determine the repository-level semantic identity of two node.
    boolean node.isSame(Node n2) or boolean node.isSameVersion(Node n2)
The method returns the identifier of a node.
    String Node.getIdentifier()


Methods that return a set of Node or Property objects do so using a GenericIterator, subclasses of Iterator.

Reading Properties

The generic value getter for single value properties is
    Value Property.getValue().
returns one of the constants of Property.Type indicating the property type of the Value.
    Property.Type Value.getType()
The length of a value in a single-value property. is returned by
    long Property.getLength()

Property Type Conversion
When the value of a property is read or written using a type different from that declared for the property, the repository attempts a type conversion according to the [not defined] rules. Note that even in cases where the type conversion is
defined in terms of standard JDK type conversion method, failure of conversion must only ever cause a  ValueFormatException to be thrown and never any exception defined in the JDK API.

Namespace Mapping

'Framework > Another Lore' 카테고리의 다른 글

AL : Workspace  (0) 2009.04.28
AL : Property Type Conversion  (0) 2009.04.26
AL : Reading  (0) 2009.04.25
AL : Link  (0) 2009.04.24
AL : Observation  (0) 2009.04.24
AL : Versioning Model  (0) 2009.04.24
Posted by bleujin

댓글을 달아 주세요