issrg.acm.extensions
Class PMIXMLPolicyEditor

java.lang.Object
  extended by issrg.acm.AttributeEditor
      extended by issrg.acm.extensions.PMIXMLPolicyEditor
All Implemented Interfaces:
PrivilegeEditor, Utility

public class PMIXMLPolicyEditor
extends AttributeEditor

This class is intended to provide some GUI for inputting XML Policy attribute value. At the moment it simply displays a text area, where the user is expected to paste his Policy.

Version:
1.0
Author:
A Otenko

Field Summary
static java.lang.String CRLF
          This is what will be added after each line when saving the Policy onto a disk.
static java.lang.String PMI_XML_POLICY_OID
          This is the OID of the pMIXMLPolicy attribute.
static java.lang.String VALIDATE_FLAG
          This is a name of configuration file variable to set when the user wants the XML to be validated automatically before it can be stored in an AC.
static java.lang.String XML_EXTENSION
          This is what the extension of the sought files would be.
 
Constructor Summary
PMIXMLPolicyEditor()
           
 
Method Summary
 java.util.Vector buildValues(java.awt.Frame parentComponent, java.util.Map environment, java.util.Vector values, Registry registry)
          This is the method to build Attribute Values out of the given Vector of issrg.ac.AttributeValue.
 java.lang.String getName()
           
 java.lang.String getOID()
          This method should return the OID of the constructed entity, in the dotted form.
 AttributeValue parseAttribute(AttributeValue av)
          This is the method to parse an issrg.ac.AttributeValue into the real object, representing it.
protected  java.lang.String showInputDialog(java.awt.Frame parentComponent, java.lang.String title, java.lang.String oldvalue)
          Shows an input dialog with the edit memo and several buttons for loading and verification of the policy.
 
Methods inherited from class issrg.acm.AttributeEditor
registerMe, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PMI_XML_POLICY_OID

public static final java.lang.String PMI_XML_POLICY_OID
This is the OID of the pMIXMLPolicy attribute. Its value is "1.2.826.0.1.3344810.1.1.13".

See Also:
Constant Field Values

CRLF

public static final java.lang.String CRLF
This is what will be added after each line when saving the Policy onto a disk. Note, that at the moment it is 0x0a0d, which is DOS format (Unix format would be 0x0a only).

See Also:
Constant Field Values

VALIDATE_FLAG

public static final java.lang.String VALIDATE_FLAG
This is a name of configuration file variable to set when the user wants the XML to be validated automatically before it can be stored in an AC. Its name is "PMIXMLPolicyEditor.Validate". It must just be present in the [variables] section.

See Also:
Constant Field Values

XML_EXTENSION

public static final java.lang.String XML_EXTENSION
This is what the extension of the sought files would be. At the moment it is ".xml".

See Also:
Constant Field Values
Constructor Detail

PMIXMLPolicyEditor

public PMIXMLPolicyEditor()
Method Detail

getName

public java.lang.String getName()

getOID

public java.lang.String getOID()
Description copied from interface: PrivilegeEditor
This method should return the OID of the constructed entity, in the dotted form.


buildValues

public java.util.Vector buildValues(java.awt.Frame parentComponent,
                                    java.util.Map environment,
                                    java.util.Vector values,
                                    Registry registry)
                             throws ACCreationException
Description copied from class: AttributeEditor
This is the method to build Attribute Values out of the given Vector of issrg.ac.AttributeValue. This method can provide GUI for user to edit the values or add new ones. The implementations of AttributeEditor must define this function in such a way so as to handle only values of attribute types known to it. Should any troubles with parsing arise, it must throw an ACCreationException. This method must be capable of handling empty sets of values and null pointers to sets; the latter meaning that it must create a new attribute value set. The implementations are not obliged to handle multivalued attributes, if they mandate it to be single-valued. Their behaviour in such occasions is up to the implementor.

Specified by:
buildValues in class AttributeEditor
Parameters:
parentComponent - the java.awt.Component, to which the GUI must be modal
environment - the configuration environment, containing variables only
values - the vector of attribute values; contains a single value, if it is a signle-valued attribute; can be empty or null
registry - the Register object where to find any other editors or utilities
Returns:
the Vector of new values; edited, added and removed
Throws:
ACCreationException

parseAttribute

public AttributeValue parseAttribute(AttributeValue av)
                              throws iaik.asn1.CodingException
Description copied from class: AttributeEditor
This is the method to parse an issrg.ac.AttributeValue into the real object, representing it.

Specified by:
parseAttribute in class AttributeEditor
Parameters:
av - the value to parse
Returns:
the parsed Attribute Value; now it can be safely type-casted, or acquired what Java type it is
Throws:
iaik.asn1.CodingException

showInputDialog

protected java.lang.String showInputDialog(java.awt.Frame parentComponent,
                                           java.lang.String title,
                                           java.lang.String oldvalue)
Shows an input dialog with the edit memo and several buttons for loading and verification of the policy.